@well-played.gg/react-sdk 1.15.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),LL=require("react-dom");function VL(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var sg=function(t,e){return sg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},sg(t,e)};function $r(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sg(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var C=function(){return C=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},C.apply(this,arguments)};function xn(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function hs(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function ps(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function St(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Kp="Invariant Violation",WE=Object.setPrototypeOf,jL=WE===void 0?function(t,e){return t.__proto__=e,t}:WE,YO=function(t){$r(e,t);function e(n){n===void 0&&(n=Kp);var r=t.call(this,typeof n=="number"?Kp+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Kp,jL(r,e.prototype),r}return e}(Error);function oo(t,e){if(!t)throw new YO(e)}var Cf=["debug","log","warn","error","silent"],og=Cf.indexOf("log");function Wu(t){return function(){if(Cf.indexOf(t)>=og){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wu("debug"),t.log=Wu("log"),t.warn=Wu("warn"),t.error=Wu("error")})(oo||(oo={}));function Ey(t){var e=Cf[og];return og=Math.max(0,Cf.indexOf(t)),e}var wy="3.11.10";function Sr(t){try{return t()}catch{}}const ag=Sr(function(){return globalThis})||Sr(function(){return window})||Sr(function(){return self})||Sr(function(){return global})||Sr(function(){return Sr.constructor("return this")()});var zE=new Map;function Df(t){var e=zE.get(t)||1;return zE.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ty(t,e){e===void 0&&(e=0);var n=Df("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function zu(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Sy(i),e||(e=Oy(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var ie=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||oo(e,Sy(n,r)||Oy(n,r))},{debug:zu(oo.debug),log:zu(oo.log),warn:zu(oo.warn),error:zu(oo.error)});function Dn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new YO(Sy(t,e)||Oy(t,e))}var QE=Symbol.for("ApolloErrorMessageHandler_"+wy);function XO(t){if(typeof t=="string")return t;try{return Ty(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Sy(t,e){if(e===void 0&&(e=[]),!!t)return ag[QE]&&ag[QE](t,e.map(XO))}function Oy(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:wy,message:t,args:e.map(XO)})))}var BL=globalThis.__DEV__!==!1;const UL="16.9.0",qL=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function Be(t,e){if(!!!t)throw new Error(e)}function cr(t){return typeof(t==null?void 0:t.then)=="function"}function ur(t){return typeof t=="object"&&t!==null}function Mt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const WL=/\r\n|[\n\r]/g;function Rf(t,e){let n=0,r=1;for(const i of t.body.matchAll(WL)){if(typeof i.index=="number"||Mt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function ZO(t){return ky(t.source,Rf(t.source,t.start))}function ky(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,l=e.column+a,u=`${t.name}:${o}:${l}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ae=require("react"),LL=require("react-dom");function VL(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var sg=function(t,e){return sg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},sg(t,e)};function $r(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sg(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var C=function(){return C=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},C.apply(this,arguments)};function xn(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function hs(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})}function ps(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function St(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Kp="Invariant Violation",WE=Object.setPrototypeOf,jL=WE===void 0?function(t,e){return t.__proto__=e,t}:WE,YO=function(t){$r(e,t);function e(n){n===void 0&&(n=Kp);var r=t.call(this,typeof n=="number"?Kp+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=Kp,jL(r,e.prototype),r}return e}(Error);function oo(t,e){if(!t)throw new YO(e)}var Cf=["debug","log","warn","error","silent"],og=Cf.indexOf("log");function Wu(t){return function(){if(Cf.indexOf(t)>=og){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wu("debug"),t.log=Wu("log"),t.warn=Wu("warn"),t.error=Wu("error")})(oo||(oo={}));function Ey(t){var e=Cf[og];return og=Math.max(0,Cf.indexOf(t)),e}var wy="3.11.10";function Sr(t){try{return t()}catch{}}const ag=Sr(function(){return globalThis})||Sr(function(){return window})||Sr(function(){return self})||Sr(function(){return global})||Sr(function(){return Sr.constructor("return this")()});var zE=new Map;function Df(t){var e=zE.get(t)||1;return zE.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ty(t,e){e===void 0&&(e=0);var n=Df("stringifyForDisplay");return JSON.stringify(t,function(r,i){return i===void 0?n:i},e).split(JSON.stringify(n)).join("<undefined>")}function zu(t){return function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(typeof e=="number"){var i=e;e=Sy(i),e||(e=Oy(i,n),n=[])}t.apply(void 0,[e].concat(n))}}var ie=Object.assign(function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];e||oo(e,Sy(n,r)||Oy(n,r))},{debug:zu(oo.debug),log:zu(oo.log),warn:zu(oo.warn),error:zu(oo.error)});function Dn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new YO(Sy(t,e)||Oy(t,e))}var QE=Symbol.for("ApolloErrorMessageHandler_"+wy);function XO(t){if(typeof t=="string")return t;try{return Ty(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Sy(t,e){if(e===void 0&&(e=[]),!!t)return ag[QE]&&ag[QE](t,e.map(XO))}function Oy(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:wy,message:t,args:e.map(XO)})))}var BL=globalThis.__DEV__!==!1;const UL="16.9.0",qL=Object.freeze({major:16,minor:9,patch:0,preReleaseTag:null});function Be(t,e){if(!!!t)throw new Error(e)}function cr(t){return typeof(t==null?void 0:t.then)=="function"}function ur(t){return typeof t=="object"&&t!==null}function Mt(t,e){if(!!!t)throw new Error(e??"Unexpected invariant triggered.")}const WL=/\r\n|[\n\r]/g;function Rf(t,e){let n=0,r=1;for(const i of t.body.matchAll(WL)){if(typeof i.index=="number"||Mt(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function ZO(t){return ky(t.source,Rf(t.source,t.start))}function ky(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,s=t.locationOffset.line-1,o=e.line+s,a=e.line===1?n:0,l=e.column+a,u=`${t.name}:${o}:${l}
2
2
  `,d=r.split(/\r\n|[\n\r]/g),h=d[i];if(h.length>120){const p=Math.floor(l/80),g=l%80,y=[];for(let b=0;b<h.length;b+=80)y.push(h.slice(b,b+80));return u+GE([[`${o} |`,y[0]],...y.slice(1,p+1).map(b=>["|",b]),["|","^".padStart(g)],["|",y[p+1]]])}return u+GE([[`${o-1} |`,d[i-1]],[`${o} |`,h],["|","^".padStart(l)],[`${o+1} |`,d[i+1]]])}function GE(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
3
3
  `)}function zL(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}let j=class ek extends Error{constructor(e,...n){var r,i,s;const{nodes:o,source:a,positions:l,path:u,originalError:d,extensions:h}=zL(n);super(e),this.name="GraphQLError",this.path=u??void 0,this.originalError=d??void 0,this.nodes=HE(Array.isArray(o)?o:o?[o]:void 0);const p=HE((r=this.nodes)===null||r===void 0?void 0:r.map(y=>y.loc).filter(y=>y!=null));this.source=a??(p==null||(i=p[0])===null||i===void 0?void 0:i.source),this.positions=l??(p==null?void 0:p.map(y=>y.start)),this.locations=l&&a?l.map(y=>Rf(a,y)):p==null?void 0:p.map(y=>Rf(y.source,y.start));const g=ur(d==null?void 0:d.extensions)?d==null?void 0:d.extensions:void 0;this.extensions=(s=h??g)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),d!=null&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,ek):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
4
4
 
@@ -182,7 +182,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
182
182
  `),O=_U(_.slice(0,w)),N=O["content-type"],N&&N.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(I=_.slice(w),I){if(P=NN(t,I),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(EN(P)){if(M={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];M=C({},P.payload)}"errors"in P&&(M=C(C({},M),{extensions:C(C({},"extensions"in M?M.extensions:null),(Q={},Q[Fv]=P.errors,Q))})),e(M)}else e(P);else if(Object.keys(P).length===1&&"hasNext"in P&&!P.hasNext)return[2]}b=a.indexOf(o)}return[3,1];case 3:return[2]}})})}function _U(t){var e={};return t.split(`
183
183
  `).forEach(function(n){var r=n.indexOf(":");if(r>-1){var i=n.slice(0,r).trim().toLowerCase(),s=n.slice(r+1).trim();e[i]=s}}),e}function NN(t,e){if(t.status>=300){var n=function(){try{return JSON.parse(e)}catch{return e}};zd(t,n(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var r=i;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function EU(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function $v(t){return function(e){return e.text().then(function(n){return NN(e,n)}).then(function(n){return!Array.isArray(n)&&!Mw.call(n,"data")&&!Mw.call(n,"errors")&&zd(e,n,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(r){return r.operationName}):t.operationName,"'.")),n})}}var uc=function(t,e){var n;try{n=JSON.stringify(t)}catch(i){var r=Dn(40,e,i.message);throw r.parseError=i,r}return n},wU={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},TU={accept:"*/*","content-type":"application/json"},SU={method:"POST"},Lv={http:wU,headers:TU,options:SU},Gd=function(t,e){return e(t)};function AN(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return n.unshift(e),Hd.apply(void 0,St([t,Gd],n,!1))}function Hd(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={},s={};n.forEach(function(h){i=C(C(C({},i),h.options),{headers:C(C({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),s=C(C({},s),h.http)}),i.headers&&(i.headers=OU(i.headers,s.preserveHeaderCase));var o=t.operationName,a=t.extensions,l=t.variables,u=t.query,d={operationName:o,variables:l};return s.includeExtensions&&(d.extensions=a),s.includeQuery&&(d.query=e(u,Qa)),{options:i,body:d}}function OU(t,e){if(!e){var n={};return Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]=t[s]}),n}var r={};Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(r).forEach(function(s){i[r[s].originalName]=r[s].value}),i}var Vv=function(t){if(!t&&typeof fetch>"u")throw Dn(38)},IN=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}},jv=function(t,e){var n=t.getContext(),r=n.uri;return r||(typeof e=="function"?e(t):e||"/graphql")};function Bv(t,e){var n=[],r=function(h,p){n.push("".concat(h,"=").concat(encodeURIComponent(p)))};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){var i=void 0;try{i=uc(e.variables,"Variables map")}catch(h){return{parseError:h}}r("variables",i)}if(e.extensions){var s=void 0;try{s=uc(e.extensions,"Extensions map")}catch(h){return{parseError:h}}r("extensions",s)}var o="",a=t,l=t.indexOf("#");l!==-1&&(o=t.substr(l),a=t.substr(0,l));var u=a.indexOf("?")===-1?"?":"&",d=a+u+n.join("&")+o;return{newURI:d}}var Pw=Sr(function(){return fetch}),Uv=function(t){t===void 0&&(t={});var e=t.uri,n=e===void 0?"/graphql":e,r=t.fetch,i=t.print,s=i===void 0?Gd:i,o=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,u=t.includeUnusedVariables,d=u===void 0?!1:u,h=xn(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&Vv(r||Pw);var p={http:{includeExtensions:o,preserveHeaderCase:a},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new Fn(function(g){var y=jv(g,n),b=g.getContext(),_={};if(b.clientAwareness){var w=b.clientAwareness,O=w.name,N=w.version;O&&(_["apollographql-client-name"]=O),N&&(_["apollographql-client-version"]=N)}var I=C(C({},_),b.headers),P={http:b.http,options:b.fetchOptions,credentials:b.credentials,headers:I};if(Ds(["client"],g.query)){var M=Sv(g.query);if(!M)return Ql(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));g.query=M}var B=Hd(g,s,Lv,p,P),Q=B.options,x=B.body;x.variables&&!d&&(x.variables=oU(x.variables,g.query));var U;!Q.signal&&typeof AbortController<"u"&&(U=new AbortController,Q.signal=U.signal);var be=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="mutation"},Oe=function(ge){return ge.kind==="OperationDefinition"&&ge.operation==="subscription"},ke=Oe(Vo(g.query)),Le=Ds(["defer"],g.query);if(l&&!g.query.definitions.some(be)&&(Q.method="GET"),Le||ke){Q.headers=Q.headers||{};var te="multipart/mixed;";ke&&Le&&globalThis.__DEV__!==!1&&ie.warn(39),ke?te+="boundary=graphql;subscriptionSpec=1.0,application/json":Le&&(te+="deferSpec=20220824,application/json"),Q.headers.accept=te}if(Q.method==="GET"){var Ae=Bv(y,x),fe=Ae.newURI,Ee=Ae.parseError;if(Ee)return Ql(Ee);y=fe}else try{Q.body=uc(x,"Payload")}catch(ge){return Ql(ge)}return new Xe(function(ge){var ct=r||Sr(function(){return fetch})||Pw,ve=ge.next.bind(ge);return ct(y,Q).then(function(L){var Z;g.setContext({response:L});var Y=(Z=L.headers)===null||Z===void 0?void 0:Z.get("content-type");return Y!==null&&/^multipart\/mixed/i.test(Y)?bU(L,ve):$v(g)(L).then(ve)}).then(function(){U=void 0,ge.complete()}).catch(function(L){U=void 0,EU(L,ge)}),function(){U&&U.abort()}})})},Kd=function(t){$r(e,t);function e(n){n===void 0&&(n={});var r=t.call(this,Uv(n).request)||this;return r.options=n,r}return e}(Fn);const{toString:Fw,hasOwnProperty:kU}=Object.prototype,$w=Function.prototype.toString,Ng=new Map;function We(t,e){try{return Ag(t,e)}finally{Ng.clear()}}function Ag(t,e){if(t===e)return!0;const n=Fw.call(t),r=Fw.call(e);if(n!==r)return!1;switch(n){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Vw(t,e))return!0;const i=Lw(t),s=Lw(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!kU.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!Ag(t[l],e[l]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(Vw(t,e))return!0;const i=t.entries(),s=n==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!Ag(l,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=$w.call(t);return i!==$w.call(e)?!1:!IU(i,AU)}}return!1}function Lw(t){return Object.keys(t).filter(NU,t)}function NU(t){return this[t]!==void 0}const AU="{ [native code] }";function IU(t,e){const n=t.length-e.length;return n>=0&&t.indexOf(e,n)===n}function Vw(t,e){let n=Ng.get(t);if(n){if(n.has(e))return!0}else Ng.set(t,n=new Set);return n.add(e),!1}const xU=Object.freeze(Object.defineProperty({__proto__:null,default:We,equal:We},Symbol.toStringTag,{value:"Module"}));function xN(t,e,n,r){var i=e.data,s=xn(e,["data"]),o=n.data,a=xn(n,["data"]);return We(s,a)&&_f(Vo(t).selectionSet,i,o,{fragmentMap:$c(jc(t)),variables:r})}function _f(t,e,n,r){if(e===n)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!za(s,r.variables))||jw(s))return!0;if(Wi(s)){var o=qi(s),a=e&&e[o],l=n&&n[o],u=s.selectionSet;if(!u)return We(a,l);var d=Array.isArray(a),h=Array.isArray(l);if(d!==h)return!1;if(d&&h){var p=a.length;if(l.length!==p)return!1;for(var g=0;g<p;++g)if(!_f(u,a[g],l[g],r))return!1;return!0}return _f(u,a,l,r)}else{var y=Lc(s,r.fragmentMap);if(y)return jw(y)?!0:_f(y.selectionSet,e,n,r)}})}function jw(t){return!!t.directives&&t.directives.some(CU)}function CU(t){return t.name.value==="nonreactive"}var Jd=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=ac(z1,{max:Yr["cache.fragmentQueryDocuments"]||1e3,cache:Uf})}return t.prototype.batch=function(e){var n=this,r=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(n)},r),i},t.prototype.recordOptimisticTransaction=function(e,n){this.performTransaction(e,n)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{rootId:e.id||"ROOT_QUERY",optimistic:n}))},t.prototype.watchFragment=function(e){var n=this,r=e.fragment,i=e.fragmentName,s=e.from,o=e.optimistic,a=o===void 0?!0:o,l=xn(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(r,i),d=C(C({},l),{returnPartialData:!0,id:typeof s>"u"||typeof s=="string"?s:this.identify(s),query:u,optimistic:a}),h;return new Xe(function(p){return n.watch(C(C({},d),{immediate:!0,callback:function(g){if(!(h&&xN(u,{data:h==null?void 0:h.result},{data:g.result}))){var y={data:g.result,complete:!!g.complete};g.missing&&(y.missing=Ga(g.missing.map(function(b){return b.missing}))),h=g,p.next(y)}}}))})},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!!e.optimistic),this.read(C(C({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:n}))},t.prototype.writeQuery=function(e){var n=e.id,r=e.data,i=xn(e,["id","data"]);return this.write(Object.assign(i,{dataId:n||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(e){var n=e.id,r=e.data,i=e.fragment,s=e.fragmentName,o=xn(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,s),dataId:n,result:r}))},t.prototype.updateQuery=function(e,n){return this.batch({update:function(r){var i=r.readQuery(e),s=n(i);return s==null?i:(r.writeQuery(C(C({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,n){return this.batch({update:function(r){var i=r.readFragment(e),s=n(i);return s==null?i:(r.writeFragment(C(C({},e),{data:s})),s)}})},t}();globalThis.__DEV__!==!1&&(Jd.prototype.getMemoryInternals=KB);var Gf;Gf||(Gf={});var Yd=function(t){$r(e,t);function e(n,r,i,s){var o,a=t.call(this,n)||this;if(a.message=n,a.path=r,a.query=i,a.variables=s,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(o={},o[a.path[l]]=a.missing,o)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ht=Object.prototype.hasOwnProperty;function Ol(t){return t==null}function Xd(t,e){var n=t.__typename,r=t.id,i=t._id;if(typeof n=="string"&&(e&&(e.keyObject=Ol(r)?Ol(i)?void 0:{_id:i}:{id:r}),Ol(r)&&!Ol(i)&&(r=i),!Ol(r)))return"".concat(n,":").concat(typeof r=="number"||typeof r=="string"?r:JSON.stringify(r))}var CN={dataIdFromObject:Xd,addTypename:!0,resultCaching:!0,canonizeResults:!1};function DU(t){return Ms(CN,t)}function DN(t){var e=t.canonizeResults;return e===void 0?CN.canonizeResults:e}function RU(t,e){return nt(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var RN=/^[_a-z][_0-9a-z]*/i;function Ps(t){var e=t.match(RN);return e?e[0]:t}function Ig(t,e,n){return bt(e)?Tt(e)?e.every(function(r){return Ig(t,r,n)}):t.selections.every(function(r){if(Wi(r)&&za(r,n)){var i=qi(r);return Ht.call(e,i)&&(!r.selectionSet||Ig(r.selectionSet,e[i],n))}return!0}):!1}function pa(t){return bt(t)&&!nt(t)&&!Tt(t)}function MU(){return new zi}function MN(t,e){var n=$c(jc(t));return{fragmentMap:n,lookupFragment:function(r){var i=n[r];return!i&&e&&(i=e.lookup(r)),i||null}}}var Ef=Object.create(null),sm=function(){return Ef},Bw=Object.create(null),fc=function(){function t(e,n){var r=this;this.policies=e,this.group=n,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return Pa(nt(i)?r.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return nt(i)?r.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return Fi(i);if(nt(i))return i;var o=r.policies.identify(i)[0];if(o){var a=Fi(o);return s&&r.merge(o,i),a}}}return t.prototype.toObject=function(){return C({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,n){if(this.group.depend(e,n),Ht.call(this.data,e)){var r=this.data[e];if(r&&Ht.call(r,n))return r[n]}if(n==="__typename"&&Ht.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof us)return this.parent.get(e,n)},t.prototype.lookup=function(e,n){if(n&&this.group.depend(e,"__exists"),Ht.call(this.data,e))return this.data[e];if(this instanceof us)return this.parent.lookup(e,n);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,n){var r=this,i;nt(e)&&(e=e.__ref),nt(n)&&(n=n.__ref);var s=typeof e=="string"?this.lookup(i=e):e,o=typeof n=="string"?this.lookup(i=n):n;if(o){ie(typeof i=="string",1);var a=new zi(FU).merge(s,o);if(this.data[i]=a,a!==s&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);s||(l.__exists=1),Object.keys(o).forEach(function(u){if(!s||s[u]!==a[u]){l[u]=1;var d=Ps(u);d!==u&&!r.policies.hasKeyArgs(a.__typename,d)&&(l[d]=1),a[u]===void 0&&!(r instanceof us)&&delete a[u]}}),l.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return r.group.dirty(i,u)})}}},t.prototype.modify=function(e,n){var r=this,i=this.lookup(e);if(i){var s=Object.create(null),o=!1,a=!0,l={DELETE:Ef,INVALIDATE:Bw,isReference:nt,toReference:this.toReference,canRead:this.canRead,readField:function(u,d){return r.policies.readField(typeof u=="string"?{fieldName:u,from:d||Fi(e)}:u,{store:r})}};if(Object.keys(i).forEach(function(u){var d=Ps(u),h=i[u];if(h!==void 0){var p=typeof n=="function"?n:n[u]||n[d];if(p){var g=p===sm?Ef:p(Pa(h),C(C({},l),{fieldName:d,storeFieldName:u,storage:r.getStorage(e,u)}));if(g===Bw)r.group.dirty(e,u);else if(g===Ef&&(g=void 0),g!==h&&(s[u]=g,o=!0,h=g,globalThis.__DEV__!==!1)){var y=function(P){if(r.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&ie.warn(2,P),!0};if(nt(g))y(g);else if(Array.isArray(g))for(var b=!1,_=void 0,w=0,O=g;w<O.length;w++){var N=O[w];if(nt(N)){if(b=!0,y(N))break}else if(typeof N=="object"&&N){var I=r.policies.identify(N)[0];I&&(_=N)}if(b&&_!==void 0){globalThis.__DEV__!==!1&&ie.warn(3,_);break}}}}h!==void 0&&(a=!1)}}),o)return this.merge(e,s),a&&(this instanceof us?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,n,r){var i,s=this.lookup(e);if(s){var o=this.getFieldValue(s,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(e,a?(i={},i[a]=sm,i):sm)}return!1},t.prototype.evict=function(e,n){var r=!1;return e.id&&(Ht.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof us&&this!==n&&(r=this.parent.evict(e,n)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,n=this.toObject(),r=[];return this.getRootIdSet().forEach(function(i){Ht.call(e.policies.rootTypenamesById,i)||r.push(i)}),r.length&&(n.__META={extraRootIds:r.sort()}),n},t.prototype.replace=function(e){var n=this;if(Object.keys(this.data).forEach(function(s){e&&Ht.call(e,s)||n.delete(s)}),e){var r=e.__META,i=xn(e,["__META"]);Object.keys(i).forEach(function(s){n.merge(s,i[s])}),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var n=--this.rootIds[e];return n||delete this.rootIds[e],n}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof us?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,n=this.getRootIdSet(),r=this.toObject();n.forEach(function(o){Ht.call(r,o)&&(Object.keys(e.findChildRefIds(o)).forEach(n.add,n),delete r[o])});var i=Object.keys(r);if(i.length){for(var s=this;s instanceof us;)s=s.parent;i.forEach(function(o){return s.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ht.call(this.refs,e)){var n=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return n;var i=new Set([r]);i.forEach(function(s){nt(s)&&(n[s.__ref]=!0),bt(s)&&Object.keys(s).forEach(function(o){var a=s[o];bt(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),PN=function(){function t(e,n){n===void 0&&(n=null),this.caching=e,this.parent=n,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?fN():null,this.keyMaker=new Fo(Bs)},t.prototype.depend=function(e,n){if(this.d){this.d(om(e,n));var r=Ps(n);r!==n&&this.d(om(e,r)),this.parent&&this.parent.depend(e,n)}},t.prototype.dirty=function(e,n){this.d&&this.d.dirty(om(e,n),n==="__exists"?"forget":"setDirty")},t}();function om(t,e){return e+"#"+t}function Uw(t,e){Gl(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(n){$r(r,n);function r(i){var s=i.policies,o=i.resultCaching,a=o===void 0?!0:o,l=i.seed,u=n.call(this,s,new PN(a))||this;return u.stump=new PU(u),u.storageTrie=new Fo(Bs),l&&u.replace(l),u}return r.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},r.prototype.removeLayer=function(){return this},r.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},r}(t);t.Root=e})(fc||(fc={}));var us=function(t){$r(e,t);function e(n,r,i,s){var o=t.call(this,r.policies,s)||this;return o.id=n,o.parent=r,o.replay=i,o.group=s,i(o),o}return e.prototype.addLayer=function(n,r){return new e(n,this,r,this.group)},e.prototype.removeLayer=function(n){var r=this,i=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var o=r.data[s],a=i.lookup(s);a?o?o!==a&&Object.keys(o).forEach(function(l){We(o[l],a[l])||r.group.dirty(s,l)}):(r.group.dirty(s,"__exists"),Object.keys(a).forEach(function(l){r.group.dirty(s,l)})):r.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return C(C({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(n){var r=this.parent.findChildRefIds(n);return Ht.call(this.data,n)?C(C({},r),t.prototype.findChildRefIds.call(this,n)):r},e.prototype.getStorage=function(){for(var n=this.parent;n.parent;)n=n.parent;return n.getStorage.apply(n,arguments)},e}(fc),PU=function(t){$r(e,t);function e(n){return t.call(this,"EntityStore.Stump",n,function(){},new PN(n.group.caching,n.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(n,r){return this.parent.merge(n,r)},e}(us);function FU(t,e,n){var r=t[n],i=e[n];return We(r,i)?r:i}function Gl(t){return!!(t instanceof fc&&t.group.caching)}function $U(t){return bt(t)?Tt(t)?t.slice(0):C({__proto__:Object.getPrototypeOf(t)},t):t}var qw=function(){function t(){this.known=new(hv?WeakSet:Set),this.pool=new Fo(Bs),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return bt(e)&&this.known.has(e)},t.prototype.pass=function(e){if(bt(e)){var n=$U(e);return this.passes.set(n,e),n}return e},t.prototype.admit=function(e){var n=this;if(bt(e)){var r=this.passes.get(e);if(r)return r;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),o=this.pool.lookupArray(s);return o.array||(this.known.add(o.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],u=this.sortedKeys(e);l.push(u.json);var d=l.length;u.sorted.forEach(function(g){l.push(n.admit(e[g]))});var o=this.pool.lookupArray(l);if(!o.object){var h=o.object=Object.create(a);this.known.add(h),u.sorted.forEach(function(g,y){h[g]=l[d+y]}),globalThis.__DEV__!==!1&&Object.freeze(h)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var n=Object.keys(e),r=this.pool.lookupArray(n);if(!r.keys){n.sort();var i=JSON.stringify(n);(r.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,r.keys={sorted:n,json:i})}return r.keys},t}();function Ww(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var LU=function(){function t(e){var n=this;this.knownResults=new(Bs?WeakMap:Map),this.config=Ms(e,{addTypename:e.addTypename!==!1,canonizeResults:DN(e)}),this.canon=e.canon||new qw,this.executeSelectionSet=ac(function(r){var i,s=r.context.canonizeResults,o=Ww(r);o[3]=!s;var a=(i=n.executeSelectionSet).peek.apply(i,o);return a?s?C(C({},a),{result:n.canon.admit(a.result)}):a:(Uw(r.context.store,r.enclosingRef.__ref),n.execSelectionSetImpl(r))},{max:this.config.resultCacheMaxSize||Yr["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Ww,makeCacheKey:function(r,i,s,o){if(Gl(s.store))return s.store.makeCacheKey(r,nt(i)?i.__ref:i,s.varString,o)}}),this.executeSubSelectedArray=ac(function(r){return Uw(r.context.store,r.enclosingRef.__ref),n.execSubSelectedArrayImpl(r)},{max:this.config.resultCacheMaxSize||Yr["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(r){var i=r.field,s=r.array,o=r.context;if(Gl(o.store))return o.store.makeCacheKey(i,s,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new qw},t.prototype.diffQueryAgainstStore=function(e){var n=e.store,r=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,o=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,u=e.canonizeResults,d=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;o=C(C({},jd(yv(r))),o);var p=Fi(s),g=this.executeSelectionSet({selectionSet:Vo(r).selectionSet,objectOrReference:p,enclosingRef:p,context:C({store:n,query:r,policies:h,variables:o,varString:Ar(o),canonizeResults:d},MN(r,this.config.fragments))}),y;if(g.missing&&(y=[new Yd(VU(g.missing),g.missing,r,o)],!l))throw y[0];return{result:g.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,n,r,i){if(Gl(i.store)&&this.knownResults.get(e)===r){var s=this.executeSelectionSet.peek(r,n,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var n=this,r=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,o=e.context;if(nt(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a=o.variables,l=o.policies,u=o.store,d=u.getFieldValue(i,"__typename"),h=[],p,g=new zi;this.config.addTypename&&typeof d=="string"&&!l.rootIdsByTypename[d]&&h.push({__typename:d});function y(N,I){var P;return N.missing&&(p=g.merge(p,(P={},P[I]=N.missing,P))),N.result}var b=new Set(r.selections);b.forEach(function(N){var I,P;if(za(N,a))if(Wi(N)){var M=l.readField({fieldName:N.name.value,field:N,variables:o.variables,from:i},o),B=qi(N);M===void 0?Wd.added(N)||(p=g.merge(p,(I={},I[B]="Can't find field '".concat(N.name.value,"' on ").concat(nt(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),I))):Tt(M)?M.length>0&&(M=y(n.executeSubSelectedArray({field:N,array:M,enclosingRef:s,context:o}),B)):N.selectionSet?M!=null&&(M=y(n.executeSelectionSet({selectionSet:N.selectionSet,objectOrReference:M,enclosingRef:nt(M)?M:s,context:o}),B)):o.canonizeResults&&(M=n.canon.pass(M)),M!==void 0&&h.push((P={},P[B]=M,P))}else{var Q=Lc(N,o.lookupFragment);if(!Q&&N.kind===k.FRAGMENT_SPREAD)throw Dn(9,N.name.value);Q&&l.fragmentMatches(Q,d)&&Q.selectionSet.selections.forEach(b.add,b)}});var _=Ga(h),w={result:_,missing:p},O=o.canonizeResults?this.canon.admit(w):Pa(w);return O.result&&this.knownResults.set(O.result,r),O},t.prototype.execSubSelectedArrayImpl=function(e){var n=this,r=e.field,i=e.array,s=e.enclosingRef,o=e.context,a,l=new zi;function u(d,h){var p;return d.missing&&(a=l.merge(a,(p={},p[h]=d.missing,p))),d.result}return r.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(d,h){return d===null?null:Tt(d)?u(n.executeSubSelectedArray({field:r,array:d,enclosingRef:s,context:o}),h):r.selectionSet?u(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:d,enclosingRef:nt(d)?d:s,context:o}),h):(globalThis.__DEV__!==!1&&jU(o.store,r,d),d)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function VU(t){try{JSON.stringify(t,function(e,n){if(typeof n=="string")throw n;return n})}catch(e){return e}}function jU(t,e,n){if(!e.selectionSet){var r=new Set([n]);r.forEach(function(i){bt(i)&&(ie(!nt(i),10,RU(t,i),e.name.value),Object.values(i).forEach(r.add,r))})}}var qv=new bv,zw=new WeakMap;function Hl(t){var e=zw.get(t);return e||zw.set(t,e={vars:new Set,dep:fN()}),e}function Qw(t){Hl(t).vars.forEach(function(e){return e.forgetCache(t)})}function BU(t){Hl(t).vars.forEach(function(e){return e.attachCache(t)})}function Wv(t){var e=new Set,n=new Set,r=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(l){Hl(l).dep.dirty(r),UU(l)});var o=Array.from(n);n.clear(),o.forEach(function(l){return l(t)})}}else{var a=qv.getValue();a&&(i(a),Hl(a).dep(r))}return t};r.onNextChange=function(s){return n.add(s),function(){n.delete(s)}};var i=r.attachCache=function(s){return e.add(s),Hl(s).vars.add(r),r};return r.forgetCache=function(s){return e.delete(s)},r}function UU(t){t.broadcastWatches&&t.broadcastWatches()}var Gw=Object.create(null);function zv(t){var e=JSON.stringify(t);return Gw[e]||(Gw[e]=Object.create(null))}function Hw(t){var e=zv(t);return e.keyFieldsFn||(e.keyFieldsFn=function(n,r){var i=function(o,a){return r.readField(a,o)},s=r.keyObject=Qv(t,function(o){var a=_a(r.storeObject,o,i);return a===void 0&&n!==r.storeObject&&Ht.call(n,o[0])&&(a=_a(n,o,$N)),ie(a!==void 0,4,o.join("."),n),a});return"".concat(r.typename,":").concat(JSON.stringify(s))})}function Kw(t){var e=zv(t);return e.keyArgsFn||(e.keyArgsFn=function(n,r){var i=r.field,s=r.variables,o=r.fieldName,a=Qv(t,function(u){var d=u[0],h=d.charAt(0);if(h==="@"){if(i&&Hn(i.directives)){var p=d.slice(1),g=i.directives.find(function(w){return w.name.value===p}),y=g&&Vc(g,s);return y&&_a(y,u.slice(1))}return}if(h==="$"){var b=d.slice(1);if(s&&Ht.call(s,b)){var _=u.slice(0);return _[0]=b,_a(s,_)}return}if(n)return _a(n,u)}),l=JSON.stringify(a);return(n||l!=="{}")&&(o+=":"+l),o})}function Qv(t,e){var n=new zi;return FN(t).reduce(function(r,i){var s,o=e(i);if(o!==void 0){for(var a=i.length-1;a>=0;--a)o=(s={},s[i[a]]=o,s);r=n.merge(r,o)}return r},Object.create(null))}function FN(t){var e=zv(t);if(!e.paths){var n=e.paths=[],r=[];t.forEach(function(i,s){Tt(i)?(FN(i).forEach(function(o){return n.push(r.concat(o))}),r.length=0):(r.push(i),Tt(t[s+1])||(n.push(r.slice(0)),r.length=0))})}return e.paths}function $N(t,e){return t[e]}function _a(t,e,n){return n=n||$N,LN(e.reduce(function r(i,s){return Tt(i)?i.map(function(o){return r(o,s)}):i&&n(i,s)},t))}function LN(t){return bt(t)?Tt(t)?t.map(LN):Qv(Object.keys(t).sort(),function(e){return _a(t,e)}):t}function xg(t){return t.args!==void 0?t.args:t.field?Vc(t.field,t.variables):null}var qU=function(){},Jw=function(t,e){return e.fieldName},Yw=function(t,e,n){var r=n.mergeObjects;return r(t,e)},Xw=function(t,e){return e},WU=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=C({dataIdFromObject:Xd},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,n){var r,i=this,s=n&&(n.typename||((r=n.storeObject)===null||r===void 0?void 0:r.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=n&&n.storeObject||e,a=C(C({},n),{typename:s,storeObject:o,readField:n&&n.readField||function(){var p=Gv(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,u=s&&this.getTypePolicy(s),d=u&&u.keyFn||this.config.dataIdFromObject;d;){var h=d(C(C({},e),o),a);if(Tt(h))d=Hw(h);else{l=h;break}}return l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var n=this;Object.keys(e).forEach(function(r){var i=e[r],s=i.queryType,o=i.mutationType,a=i.subscriptionType,l=xn(i,["queryType","mutationType","subscriptionType"]);s&&n.setRootTypename("Query",r),o&&n.setRootTypename("Mutation",r),a&&n.setRootTypename("Subscription",r),Ht.call(n.toBeAdded,r)?n.toBeAdded[r].push(l):n.toBeAdded[r]=[l]})},t.prototype.updateTypePolicy=function(e,n){var r=this,i=this.getTypePolicy(e),s=n.keyFields,o=n.fields;function a(l,u){l.merge=typeof u=="function"?u:u===!0?Yw:u===!1?Xw:l.merge}a(i,n.merge),i.keyFn=s===!1?qU:Tt(s)?Hw(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(function(l){var u=r.getFieldPolicy(e,l,!0),d=o[l];if(typeof d=="function")u.read=d;else{var h=d.keyArgs,p=d.read,g=d.merge;u.keyFn=h===!1?Jw:Tt(h)?Kw(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),a(u,g)}u.read&&u.merge&&(u.keyFn=u.keyFn||Jw)})},t.prototype.setRootTypename=function(e,n){n===void 0&&(n=e);var r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(ie(!i||i===e,5,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)},t.prototype.addPossibleTypes=function(e){var n=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(r){n.getSupertypeSet(r,!0),e[r].forEach(function(i){n.getSupertypeSet(i,!0).add(r);var s=i.match(RN);(!s||s[0]!==i)&&n.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var n=this;if(!Ht.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(o,a){if(o.test(e)){var l=n.supertypeMap.get(a);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(o){var a=n.getTypePolicy(o),l=a.fields,u=xn(a,["fields"]);Object.assign(r,u),Object.assign(r.fields,l)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(o){n.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,n,r){if(e){var i=this.getTypePolicy(e).fields;return i[n]||r&&(i[n]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,n){var r=this.supertypeMap.get(e);return!r&&n&&this.supertypeMap.set(e,r=new Set),r},t.prototype.fragmentMatches=function(e,n,r,i){var s=this;if(!e.typeCondition)return!0;if(!n)return!1;var o=e.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(n,!0),l=[a],u=function(y){var b=s.getSupertypeSet(y,!1);b&&b.size&&l.indexOf(b)<0&&l.push(b)},d=!!(r&&this.fuzzySubtypes.size),h=!1,p=0;p<l.length;++p){var g=l[p];if(g.has(o))return a.has(o)||(h&&globalThis.__DEV__!==!1&&ie.warn(6,n,o),a.add(o)),!0;g.forEach(u),d&&p===l.length-1&&Ig(e.selectionSet,r,i)&&(d=!1,h=!0,this.fuzzySubtypes.forEach(function(y,b){var _=n.match(y);_&&_[0]===n&&u(b)}))}return!1},t.prototype.hasKeyArgs=function(e,n){var r=this.getFieldPolicy(e,n,!1);return!!(r&&r.keyFn)},t.prototype.getStoreFieldName=function(e){var n=e.typename,r=e.fieldName,i=this.getFieldPolicy(n,r,!1),s,o=i&&i.keyFn;if(o&&n)for(var a={typename:n,fieldName:r,field:e.field||null,variables:e.variables},l=xg(e);o;){var u=o(l,a);if(Tt(u))o=Kw(u);else{s=u||r;break}}return s===void 0&&(s=e.field?X1(e.field,e.variables):gv(r,xg(e))),s===!1?r:r===Ps(s)?s:r+":"+s},t.prototype.readField=function(e,n){var r=e.from;if(r){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=n.store.getFieldValue(r,"__typename");s&&(e.typename=s)}var o=this.getStoreFieldName(e),a=Ps(o),l=n.store.getFieldValue(r,o),u=this.getFieldPolicy(e.typename,a,!1),d=u&&u.read;if(d){var h=Zw(this,r,e,n,n.store.getStorage(nt(r)?r.__ref:r,o));return qv.withValue(this.cache,d,[l,h])}return l}}},t.prototype.getReadFunction=function(e,n){var r=this.getFieldPolicy(e,n,!1);return r&&r.read},t.prototype.getMergeFunction=function(e,n,r){var i=this.getFieldPolicy(e,n,!1),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,n,r,i,s){var o=r.field,a=r.typename,l=r.merge;return l===Yw?VN(i.store)(e,n):l===Xw?n:(i.overwrite&&(e=void 0),l(e,n,Zw(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:i.variables},i,s||Object.create(null))))},t}();function Zw(t,e,n,r,i){var s=t.getStoreFieldName(n),o=Ps(s),a=n.variables||r.variables,l=r.store,u=l.toReference,d=l.canRead;return{args:xg(n),field:n.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:nt,toReference:u,storage:i,cache:t.cache,canRead:d,readField:function(){return t.readField(Gv(arguments,e,a),r)},mergeObjects:VN(r.store)}}function Gv(t,e,n){var r=t[0],i=t[1],s=t.length,o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o=C({},r),Ht.call(o,"from")||(o.from=e)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&ie.warn(7,Ty(Array.from(t))),o.variables===void 0&&(o.variables=n),o}function VN(t){return function(n,r){if(Tt(n)||Tt(r))throw Dn(8);if(bt(n)&&bt(r)){var i=t.getFieldValue(n,"__typename"),s=t.getFieldValue(r,"__typename"),o=i&&s&&i!==s;if(o)return r;if(nt(n)&&pa(r))return t.merge(n.__ref,r),n;if(pa(n)&&nt(r))return t.merge(n,r.__ref),r;if(pa(n)&&pa(r))return C(C({},n),r)}return r}}function am(t,e,n){var r="".concat(e).concat(n),i=t.flavors.get(r);return i||t.flavors.set(r,i=t.clientOnly===e&&t.deferred===n?t:C(C({},t),{clientOnly:e,deferred:n})),i}var zU=function(){function t(e,n,r){this.cache=e,this.reader=n,this.fragments=r}return t.prototype.writeToStore=function(e,n){var r=this,i=n.query,s=n.result,o=n.dataId,a=n.variables,l=n.overwrite,u=Lo(i),d=MU();a=C(C({},jd(u)),a);var h=C(C({store:e,written:Object.create(null),merge:function(g,y){return d.merge(g,y)},variables:a,varString:Ar(a)},MN(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:s||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!nt(p))throw Dn(11,s);return h.incomingById.forEach(function(g,y){var b=g.storeObject,_=g.mergeTree,w=g.fieldNodeSet,O=Fi(y);if(_&&_.map.size){var N=r.applyMerges(_,O,b,h);if(nt(N))return;b=N}if(globalThis.__DEV__!==!1&&!h.overwrite){var I=Object.create(null);w.forEach(function(B){B.selectionSet&&(I[B.name.value]=!0)});var P=function(B){return I[Ps(B)]===!0},M=function(B){var Q=_&&_.map.get(B);return!!(Q&&Q.info&&Q.info.merge)};Object.keys(b).forEach(function(B){P(B)&&!M(B)&&QU(O,b,B,h.store)})}e.merge(y,b)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var n=this,r=e.dataId,i=e.result,s=e.selectionSet,o=e.context,a=e.mergeTree,l=this.cache.policies,u=Object.create(null),d=r&&l.rootTypenamesById[r]||qf(i,s,o.fragmentMap)||r&&o.store.get(r,"__typename");typeof d=="string"&&(u.__typename=d);var h=function(){var N=Gv(arguments,u,o.variables);if(nt(N.from)){var I=o.incomingById.get(N.from.__ref);if(I){var P=l.readField(C(C({},N),{from:I.storeObject}),o);if(P!==void 0)return P}}return l.readField(N,o)},p=new Set;this.flattenFields(s,i,o,d).forEach(function(N,I){var P,M=qi(I),B=i[M];if(p.add(I),B!==void 0){var Q=l.getStoreFieldName({typename:d,fieldName:I.name.value,field:I,variables:N.variables}),x=eT(a,Q),U=n.processFieldValue(B,I,I.selectionSet?am(N,!1,!1):N,x),be=void 0;I.selectionSet&&(nt(U)||pa(U))&&(be=h("__typename",U));var Oe=l.getMergeFunction(d,I.name.value,be);Oe?x.info={field:I,typename:d,merge:Oe}:tT(a,Q),u=N.merge(u,(P={},P[Q]=U,P))}else globalThis.__DEV__!==!1&&!N.clientOnly&&!N.deferred&&!Wd.added(I)&&!l.getReadFunction(d,I.name.value)&&globalThis.__DEV__!==!1&&ie.error(12,qi(I),i)});try{var g=l.identify(i,{typename:d,selectionSet:s,fragmentMap:o.fragmentMap,storeObject:u,readField:h}),y=g[0],b=g[1];r=r||y,b&&(u=o.merge(u,b))}catch(N){if(!r)throw N}if(typeof r=="string"){var _=Fi(r),w=o.written[r]||(o.written[r]=[]);if(w.indexOf(s)>=0||(w.push(s),this.reader&&this.reader.isFresh(i,_,s,o)))return _;var O=o.incomingById.get(r);return O?(O.storeObject=o.merge(O.storeObject,u),O.mergeTree=Cg(O.mergeTree,a),p.forEach(function(N){return O.fieldNodeSet.add(N)})):o.incomingById.set(r,{storeObject:u,mergeTree:Hf(a)?void 0:a,fieldNodeSet:p}),_}return u},t.prototype.processFieldValue=function(e,n,r,i){var s=this;return!n.selectionSet||e===null?globalThis.__DEV__!==!1?Cv(e):e:Tt(e)?e.map(function(o,a){var l=s.processFieldValue(o,n,r,eT(i,a));return tT(i,a),l}):this.processSelectionSet({result:e,selectionSet:n.selectionSet,context:r,mergeTree:i})},t.prototype.flattenFields=function(e,n,r,i){i===void 0&&(i=qf(n,e,r.fragmentMap));var s=new Map,o=this.cache.policies,a=new Fo(!1);return function l(u,d){var h=a.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(p){if(za(p,r.variables)){var g=d.clientOnly,y=d.deferred;if(!(g&&y)&&Hn(p.directives)&&p.directives.forEach(function(w){var O=w.name.value;if(O==="client"&&(g=!0),O==="defer"){var N=Vc(w,r.variables);(!N||N.if!==!1)&&(y=!0)}}),Wi(p)){var b=s.get(p);b&&(g=g&&b.clientOnly,y=y&&b.deferred),s.set(p,am(r,g,y))}else{var _=Lc(p,r.lookupFragment);if(!_&&p.kind===k.FRAGMENT_SPREAD)throw Dn(13,p.name.value);_&&o.fragmentMatches(_,i,n,r.variables)&&l(_.selectionSet,am(r,g,y))}}}))}(e,r),s},t.prototype.applyMerges=function(e,n,r,i,s){var o,a=this;if(e.map.size&&!nt(r)){var l=!Tt(r)&&(nt(n)||pa(n))?n:void 0,u=r;l&&!s&&(s=[nt(l)?l.__ref:l]);var d,h=function(p,g){return Tt(p)?typeof g=="number"?p[g]:void 0:i.store.getFieldValue(p,String(g))};e.map.forEach(function(p,g){var y=h(l,g),b=h(u,g);if(b!==void 0){s&&s.push(g);var _=a.applyMerges(p,y,b,i,s);_!==b&&(d=d||new Map,d.set(g,_)),s&&ie(s.pop()===g)}}),d&&(r=Tt(u)?u.slice(0):C({},u),d.forEach(function(p,g){r[g]=p}))}return e.info?this.cache.policies.runMergeFunction(n,r,e.info,i,s&&(o=i.store).getStorage.apply(o,s)):r},t}(),jN=[];function eT(t,e){var n=t.map;return n.has(e)||n.set(e,jN.pop()||{map:new Map}),n.get(e)}function Cg(t,e){if(t===e||!e||Hf(e))return t;if(!t||Hf(t))return e;var n=t.info&&e.info?C(C({},t.info),e.info):t.info||e.info,r=t.map.size&&e.map.size,i=r?new Map:t.map.size?t.map:e.map,s={info:n,map:i};if(r){var o=new Set(e.map.keys());t.map.forEach(function(a,l){s.map.set(l,Cg(a,e.map.get(l))),o.delete(l)}),o.forEach(function(a){s.map.set(a,Cg(e.map.get(a),t.map.get(a)))})}return s}function Hf(t){return!t||!(t.info||t.map.size)}function tT(t,e){var n=t.map,r=n.get(e);r&&Hf(r)&&(jN.push(r),n.delete(e))}var nT=new Set;function QU(t,e,n,r){var i=function(h){var p=r.getFieldValue(h,n);return typeof p=="object"&&p},s=i(t);if(s){var o=i(e);if(o&&!nt(s)&&!We(s,o)&&!Object.keys(s).every(function(h){return r.getFieldValue(o,h)!==void 0})){var a=r.getFieldValue(t,"__typename")||r.getFieldValue(e,"__typename"),l=Ps(n),u="".concat(a,".").concat(l);if(!nT.has(u)){nT.add(u);var d=[];!Tt(s)&&!Tt(o)&&[s,o].forEach(function(h){var p=r.getFieldValue(h,"__typename");typeof p=="string"&&!d.includes(p)&&d.push(p)}),globalThis.__DEV__!==!1&&ie.warn(14,l,a,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",u,C({},s),C({},o))}}}}var Hv=function(t){$r(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.watches=new Set,r.addTypenameTransform=new Bc(Wd),r.assumeImmutableResults=!0,r.makeVar=Wv,r.txCount=0,r.config=DU(n),r.addTypename=!!r.config.addTypename,r.policies=new WU({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return e.prototype.init=function(){var n=this.data=new fc.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()},e.prototype.resetResultCache=function(n){var r=this,i=this.storeReader,s=this.config.fragments;this.storeWriter=new zU(this,this.storeReader=new LU({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:DN(this.config),canon:n?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=ac(function(o,a){return r.broadcastWatch(o,a)},{max:this.config.resultCacheMaxSize||Yr["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var a=o.optimistic?r.optimisticData:r.data;if(Gl(a)){var l=o.optimistic,u=o.id,d=o.variables;return a.makeCacheKey(o.query,o.callback,Ar({optimistic:l,id:u,variables:d}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(n){return this.init(),n&&this.data.replace(n),this},e.prototype.extract=function(n){return n===void 0&&(n=!1),(n?this.optimisticData:this.data).extract()},e.prototype.read=function(n){var r=n.returnPartialData,i=r===void 0?!1:r;try{return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof Yd)return null;throw s}},e.prototype.write=function(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(n){if(Ht.call(n,"id")&&!n.id)return!1;var r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(n){return this.storeReader.diffQueryAgainstStore(C(C({},n),{store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(n){var r=this;return this.watches.size||BU(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),function(){r.watches.delete(n)&&!r.watches.size&&Qw(r),r.maybeBroadcastWatch.forget(n)}},e.prototype.gc=function(n){var r;Ar.reset(),Qa.reset(),this.addTypenameTransform.resetCache(),(r=this.config.fragments)===null||r===void 0||r.resetCaches();var i=this.optimisticData.gc();return n&&!this.txCount&&(n.resetResultCache?this.resetResultCache(n.resetResultIdentities):n.resetResultIdentities&&this.storeReader.resetCanon()),i},e.prototype.retain=function(n,r){return(r?this.optimisticData:this.data).retain(n)},e.prototype.release=function(n,r){return(r?this.optimisticData:this.data).release(n)},e.prototype.identify=function(n){if(nt(n))return n.__ref;try{return this.policies.identify(n)[0]}catch(r){globalThis.__DEV__!==!1&&ie.warn(r)}},e.prototype.evict=function(n){if(!n.id){if(Ht.call(n,"id"))return!1;n=C(C({},n),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(n){var r=this;return this.init(),Ar.reset(),n&&n.discardWatches?(this.watches.forEach(function(i){return r.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Qw(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(n){var r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())},e.prototype.batch=function(n){var r=this,i=n.update,s=n.optimistic,o=s===void 0?!0:s,a=n.removeOptimistic,l=n.onWatchUpdated,u,d=function(p){var g=r,y=g.data,b=g.optimisticData;++r.txCount,p&&(r.data=r.optimisticData=p);try{return u=i(r)}finally{--r.txCount,r.data=y,r.optimisticData=b}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p){return h.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,d):o===!1?d(this.data):d(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&h.size?(this.broadcastWatches(C(C({},n),{onWatchUpdated:function(p,g){var y=l.call(this,p,g);return y!==!1&&h.delete(p),y}})),h.size&&h.forEach(function(p){return r.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(n),u},e.prototype.performTransaction=function(n,r){return this.batch({update:n,optimistic:r||r!==null})},e.prototype.transformDocument=function(n){return this.addTypenameToDocument(this.addFragmentsToDocument(n))},e.prototype.broadcastWatches=function(n){var r=this;this.txCount||this.watches.forEach(function(i){return r.maybeBroadcastWatch(i,n)})},e.prototype.addFragmentsToDocument=function(n){var r=this.config.fragments;return r?r.transform(n):n},e.prototype.addTypenameToDocument=function(n){return this.addTypename?this.addTypenameTransform.transformDocument(n):n},e.prototype.broadcastWatch=function(n,r){var i=n.lastDiff,s=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,s,i)===!1)||(!i||!We(i.result,s.result))&&n.callback(n.lastDiff=s,i)},e}(Jd);globalThis.__DEV__!==!1&&(Hv.prototype.getMemoryInternals=HB);var Ge;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(Ge||(Ge={}));function dc(t){return t?t<7:!1}function BN(t){return t===7||t===8}var rT=Object.assign,GU=Object.hasOwnProperty,hc=function(t){$r(e,t);function e(n){var r=n.queryManager,i=n.queryInfo,s=n.options,o=t.call(this,function(_){try{var w=_._subscription._observer;w&&!w.error&&(w.error=HU)}catch{}var O=!o.observers.size;o.observers.add(_);var N=o.last;return N&&N.error?_.error&&_.error(N.error):N&&N.result&&_.next&&_.next(N.result),O&&o.reobserve().catch(function(){}),function(){o.observers.delete(_)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=r,o.waitForOwnResult=lm(s.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var a=r.defaultOptions.watchQuery,l=a===void 0?{}:a,u=l.fetchPolicy,d=u===void 0?"cache-first":u,h=s.fetchPolicy,p=h===void 0?d:h,g=s.initialFetchPolicy,y=g===void 0?p==="standby"?d:p:g;o.options=C(C({},s),{initialFetchPolicy:y,fetchPolicy:p}),o.queryId=i.queryId||r.generateQueryId();var b=Lo(o.query);return o.queryName=b&&b.name&&b.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var n=this;return new Promise(function(r,i){var s={next:function(a){r(a),n.observers.delete(s),n.observers.size||n.queryManager.removeQuery(n.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=n.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentResult=function(n){n===void 0&&(n=!0);var r=this.getLastResult(!0),i=this.queryInfo.networkStatus||r&&r.networkStatus||Ge.ready,s=C(C({},r),{loading:dc(i),networkStatus:i}),o=this.options.fetchPolicy,a=o===void 0?"cache-first":o;if(!(lm(a)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(s.data=l.result),We(s.data,{})&&(s.data=void 0),l.complete?(delete s.partial,l.complete&&s.networkStatus===Ge.loading&&(a==="cache-first"||a==="cache-only")&&(s.networkStatus=Ge.ready,s.loading=!1)):s.partial=!0,globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&qN(l.missing)}return n&&this.updateLastResult(s),s},e.prototype.isDifferentFromLastResult=function(n,r){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!xN(this.query,this.last.result,n,this.variables):!We(this.last.result,n);return i||r&&!We(this.last.variables,r)},e.prototype.getLast=function(n,r){var i=this.last;if(i&&i[n]&&(!r||We(i.variables,this.variables)))return i[n]},e.prototype.getLastResult=function(n){return this.getLast("result",n)},e.prototype.getLastError=function(n){return this.getLast("error",n)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(n){var r,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="cache-and-network"?i.fetchPolicy=s:s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&n&&GU.call(n,"variables")){var o=yv(this.query),a=o.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&ie.warn(20,n,((r=o.name)===null||r===void 0?void 0:r.value)||o)}return n&&!We(this.options.variables,n)&&(i.variables=this.options.variables=C(C({},this.options.variables),n)),this.queryInfo.resetLastWrite(),this.reobserve(i,Ge.refetch)},e.prototype.fetchMore=function(n){var r=this,i=C(C({},n.query?n:C(C(C(C({},this.options),{query:this.options.query}),n),{variables:C(C({},this.options.variables),n.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=n.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,a=o.networkStatus;o.networkStatus=Ge.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=n==null?void 0:n.updateQuery,d=this.options.fetchPolicy!=="no-cache";return d||ie(u,21),this.queryManager.fetchQuery(s,i,Ge.fetchMore).then(function(h){if(r.queryManager.removeQuery(s),o.networkStatus===Ge.fetchMore&&(o.networkStatus=a),d)r.queryManager.cache.batch({update:function(y){var b=n.updateQuery;b?y.updateQuery({query:r.query,variables:r.variables,returnPartialData:!0,optimistic:!1},function(_){return b(_,{fetchMoreResult:h.data,variables:i.variables})}):y.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(y){l.add(y.query)}});else{var p=r.getLast("result"),g=u(p.data,{fetchMoreResult:h.data,variables:i.variables});r.reportResult(C(C({},p),{data:g}),r.variables)}return h}).finally(function(){d&&!l.has(r.query)&&UN(r)})},e.prototype.subscribeToMore=function(n){var r=this,i=this.queryManager.startGraphQLSubscription({query:n.document,variables:n.variables,context:n.context}).subscribe({next:function(s){var o=n.updateQuery;o&&r.updateQuery(function(a,l){var u=l.variables;return o(a,{subscriptionData:s,variables:u})})},error:function(s){if(n.onError){n.onError(s);return}globalThis.__DEV__!==!1&&ie.error(22,s)}});return this.subscriptions.add(i),function(){r.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(n){return this.reobserve(n)},e.prototype.silentSetOptions=function(n){var r=Ms(this.options,n||{});rT(this.options,r)},e.prototype.setVariables=function(n){return We(this.variables,n)?this.observers.size?this.result():Promise.resolve():(this.options.variables=n,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:n},Ge.setVariables):Promise.resolve())},e.prototype.updateQuery=function(n){var r=this.queryManager,i=r.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,s=n(i,{variables:this.variables});s&&(r.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),r.broadcastQueries())},e.prototype.startPolling=function(n){this.options.pollInterval=n,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(n,r){if(r.nextFetchPolicy){var i=r.fetchPolicy,s=i===void 0?"cache-first":i,o=r.initialFetchPolicy,a=o===void 0?s:o;s==="standby"||(typeof r.nextFetchPolicy=="function"?r.fetchPolicy=r.nextFetchPolicy(s,{reason:n,options:r,observable:this,initialFetchPolicy:a}):n==="variables-changed"?r.fetchPolicy=a:r.fetchPolicy=r.nextFetchPolicy)}return r.fetchPolicy},e.prototype.fetch=function(n,r,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,n,r,i)},e.prototype.updatePolling=function(){var n=this;if(!this.queryManager.ssrMode){var r=this,i=r.pollingInfo,s=r.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){ie(s,23);var o=i||(this.pollingInfo={});o.interval=s;var a=function(){var u,d;n.pollingInfo&&(!dc(n.queryInfo.networkStatus)&&!(!((d=(u=n.options).skipPollAttempt)===null||d===void 0)&&d.call(u))?n.reobserve({fetchPolicy:n.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Ge.poll).then(l,l):l())},l=function(){var u=n.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(a,u.interval))};l()}}},e.prototype.updateLastResult=function(n,r){r===void 0&&(r=this.variables);var i=this.getLastError();return i&&this.last&&!We(r,this.last.variables)&&(i=void 0),this.last=C({result:this.queryManager.assumeImmutableResults?n:Cv(n),variables:r},i?{error:i}:null)},e.prototype.reobserveAsConcast=function(n,r){var i=this;this.isTornDown=!1;var s=r===Ge.refetch||r===Ge.fetchMore||r===Ge.poll,o=this.options.variables,a=this.options.fetchPolicy,l=Ms(this.options,n||{}),u=s?l:rT(this.options,l),d=this.transformDocument(u.query);this.lastQuery=d,s||(this.updatePolling(),n&&n.variables&&!We(n.variables,o)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===a||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),r===void 0&&(r=Ge.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=lm(u.fetchPolicy));var h=function(){i.concast===y&&(i.waitForOwnResult=!1)},p=u.variables&&C({},u.variables),g=this.fetch(u,r,d),y=g.concast,b=g.fromLink,_={next:function(w){We(i.variables,p)&&(h(),i.reportResult(w,p))},error:function(w){We(i.variables,p)&&(Qd(w)||(w=new vn({networkError:w})),h(),i.reportError(w,p))}};return!s&&(b||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=y,this.observer=_),y.addObserver(_),y},e.prototype.reobserve=function(n,r){return this.reobserveAsConcast(n,r).promise},e.prototype.resubscribeAfterError=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=this.last;this.resetLastResults();var s=this.subscribe.apply(this,n);return this.last=i,s},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(n,r){var i=this.getLastError(),s=this.isDifferentFromLastResult(n,r);(i||!n.partial||this.options.returnPartialData)&&this.updateLastResult(n,r),(i||s)&&ba(this.observers,"next",n)},e.prototype.reportError=function(n,r){var i=C(C({},this.getLastResult()),{error:n,errors:n.graphQLErrors,networkStatus:Ge.error,loading:!1});this.updateLastResult(i,r),ba(this.observers,"error",this.last.error=n)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(n){return n.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(n){return this.queryManager.transform(n)},e}(Xe);Dv(hc);function UN(t){var e=t.options,n=e.fetchPolicy,r=e.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,s){return this.nextFetchPolicy=r,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,s):n}}):t.reobserve()}function HU(t){globalThis.__DEV__!==!1&&ie.error(24,t.message,t.stack)}function qN(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&ie.debug(25,t)}function lm(t){return t==="network-only"||t==="no-cache"||t==="standby"}var ma=new(Bs?WeakMap:Map);function cm(t,e){var n=t[e];typeof n=="function"&&(t[e]=function(){return ma.set(t,(ma.get(t)+1)%1e15),n.apply(this,arguments)})}function iT(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var um=function(){function t(e,n){n===void 0&&(n=e.generateQueryId()),this.queryId=n,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;ma.has(r)||(ma.set(r,0),cm(r,"evict"),cm(r,"modify"),cm(r,"reset"))}return t.prototype.init=function(e){var n=e.networkStatus||Ge.loading;return this.variables&&this.networkStatus!==Ge.loading&&!We(this.variables,e.variables)&&(n=Ge.setVariables),We(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:n}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){iT(this),this.dirty=!1},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this.getDiffOptions();if(this.lastDiff&&We(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var r=this.cache.diff(e);return this.updateLastDiff(r,e),r},t.prototype.updateLastDiff=function(e,n){this.lastDiff=e?{diff:e,options:n||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var n;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(n=this.observableQuery)===null||n===void 0?void 0:n.options.canonizeResults}},t.prototype.setDiff=function(e){var n=this,r,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&(!((r=this.observableQuery)===null||r===void 0)&&r.getLastError())||(this.updateLastDiff(e),!this.dirty&&!We(i&&i.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return n.notify()},0))))},t.prototype.setObservableQuery=function(e){var n=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var r=n.getDiff();r.fromOptimisticTransaction?e.observe():UN(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;iT(this),this.shouldNotify()&&this.listeners.forEach(function(n){return n(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(dc(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel;var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var n=this;e===void 0&&(e=this.variables);var r=this.observableQuery;if(!(r&&r.options.fetchPolicy==="no-cache")){var i=C(C({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return n.setDiff(s)}});(!this.lastWatch||!We(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,n){var r=this.lastWrite;return!(r&&r.dmCount===ma.get(this.cache)&&We(n,r.variables)&&We(e.data,r.result.data))},t.prototype.markResult=function(e,n,r,i){var s=this,o=new zi,a=Hn(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Hn(e.incremental)){var l=Rv(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,r.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):i!==0&&(Dg(e,r.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,r.variables))d.writeQuery({query:n,data:e.data,variables:r.variables,overwrite:i===1}),s.lastWrite={result:e,variables:r.variables,dmCount:ma.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var h=s.getDiffOptions(r.variables),p=d.diff(h);!s.stopped&&We(s.variables,r.variables)&&s.updateWatch(r.variables),s.updateLastDiff(p,h),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Ge.ready},t.prototype.markError=function(e){return this.networkStatus=Ge.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Dg(t,e){e===void 0&&(e="none");var n=e==="ignore"||e==="all",r=!zl(t);return!r&&n&&t.data&&(r=!0),r}var KU=Object.prototype.hasOwnProperty,sT=Object.create(null),JU=function(){function t(e){var n=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new Vd(Yr["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Fo(!1);var r=new Bc(function(s){return n.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults;var i=e.documentTransform;this.documentTransform=i?r.concat(i).concat(r):r,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(n,r){e.stopQueryNoBroadcast(r)}),this.cancelPendingFetches(Dn(26))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(n){return n(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return hs(this,arguments,void 0,function(n){var r,i,s,o,a,l,u,d=n.mutation,h=n.variables,p=n.optimisticResponse,g=n.updateQueries,y=n.refetchQueries,b=y===void 0?[]:y,_=n.awaitRefetchQueries,w=_===void 0?!1:_,O=n.update,N=n.onQueryUpdated,I=n.fetchPolicy,P=I===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":I,M=n.errorPolicy,B=M===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":M,Q=n.keepRootFields,x=n.context;return ps(this,function(U){switch(U.label){case 0:return ie(d,27),ie(P==="network-only"||P==="no-cache",28),r=this.generateMutationId(),d=this.cache.transformForLink(this.transform(d)),i=this.getDocumentInfo(d).hasClientExports,h=this.getVariables(d,h),i?[4,this.localState.addExportedVariables(d,h,x)]:[3,2];case 1:h=U.sent(),U.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[r]={mutation:d,variables:h,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:r,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,updateQueries:g,update:O,keepRootFields:Q}),this.broadcastQueries(),a=this,[2,new Promise(function(be,Oe){return bf(a.getObservableFromLink(d,C(C({},x),{optimisticResponse:o?p:void 0}),h,{},!1),function(ke){if(zl(ke)&&B==="none")throw new vn({graphQLErrors:Qf(ke)});s&&(s.loading=!1,s.error=null);var Le=C({},ke);return typeof b=="function"&&(b=b(Le)),B==="ignore"&&zl(Le)&&delete Le.errors,a.markMutationResult({mutationId:r,result:Le,document:d,variables:h,fetchPolicy:P,errorPolicy:B,context:x,update:O,updateQueries:g,awaitRefetchQueries:w,refetchQueries:b,removeOptimistic:o?r:void 0,onQueryUpdated:N,keepRootFields:Q})}).subscribe({next:function(ke){a.broadcastQueries(),(!("hasNext"in ke)||ke.hasNext===!1)&&be(ke)},error:function(ke){s&&(s.loading=!1,s.error=ke),o&&a.cache.removeOptimistic(r),a.broadcastQueries(),Oe(ke instanceof vn?ke:new vn({networkError:ke}))}})})]}})})},t.prototype.markMutationResult=function(e,n){var r=this;n===void 0&&(n=this.cache);var i=e.result,s=[],o=e.fetchPolicy==="no-cache";if(!o&&Dg(i,e.errorPolicy)){if(yo(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),yo(i)&&Hn(i.incremental)){var a=n.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=Rv(a.result,i)),typeof l<"u"&&(i.data=l,s.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,p){var g=h.observableQuery,y=g&&g.queryName;if(!(!y||!KU.call(u,y))){var b=u[y],_=r.queries.get(p),w=_.document,O=_.variables,N=n.diff({query:w,variables:O,returnPartialData:!0,optimistic:!1}),I=N.result,P=N.complete;if(P&&I){var M=b(I,{mutationResult:i,queryName:w&&Wf(w)||void 0,queryVariables:O});M&&s.push({result:M,dataId:"ROOT_QUERY",query:w,variables:O})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var d=[];if(this.refetchQueries({updateCache:function(h){o||s.forEach(function(b){return h.write(b)});var p=e.update,g=!_N(i)||yo(i)&&!i.hasNext;if(p){if(!o){var y=h.diff({id:"ROOT_MUTATION",query:r.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=C(C({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}g&&p(h,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&g&&h.modify({id:"ROOT_MUTATION",fields:function(b,_){var w=_.fieldName,O=_.DELETE;return w==="__typename"?b:O}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return d.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(d).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,n){var r=this,i=typeof e=="function"?e(n.variables,{IGNORE:sT}):e;return i===sT?!1:(this.cache.recordOptimisticTransaction(function(s){try{r.markMutationResult(C(C({},n),{result:{data:i}}),s)}catch(o){globalThis.__DEV__!==!1&&ie.error(o)}},n.mutationId),!0)},t.prototype.fetchQuery=function(e,n,r){return this.fetchConcastWithInfo(e,n,r).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(n,r){e[r]={variables:n.variables,networkStatus:n.networkStatus,networkError:n.networkError,graphQLErrors:n.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var n=this.queries.get(e);n&&(n.networkError=void 0,n.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var n=this.transformCache;if(!n.has(e)){var r={hasClientExports:V1(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:Ds(["nonreactive"],e),clientQuery:this.localState.clientQuery(e),serverQuery:qd([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],e),defaultVars:jd(Lo(e)),asQuery:C(C({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?C(C({},i),{operation:"query"}):i})})};n.set(e,r)}return n.get(e)},t.prototype.getVariables=function(e,n){return C(C({},this.getDocumentInfo(e).defaultVars),n)},t.prototype.watchQuery=function(e){var n=this.transform(e.query);e=C(C({},e),{variables:this.getVariables(n,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new um(this),i=new hc({queryManager:this,queryInfo:r,options:e});return i.lastQuery=n,this.queries.set(i.queryId,r),r.init({document:n,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,n){var r=this;return n===void 0&&(n=this.generateQueryId()),ie(e.query,29),ie(e.query.kind==="Document",30),ie(!e.returnPartialData,31),ie(!e.pollInterval,32),this.fetchQuery(n,C(C({},e),{query:this.transform(e.query)})).finally(function(){return r.stopQuery(n)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var n=this.queries.get(e);n&&n.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Dn(33)),this.queries.forEach(function(n){n.observableQuery?n.networkStatus=Ge.loading:n.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var n=this;e===void 0&&(e="active");var r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):Y1(o)?i.set(n.transform(o),!1):bt(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,a){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){r.set(a,l);return}var d=l.queryName,h=l.options.fetchPolicy;if(h==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&i.has(d)||u&&i.has(u))&&(r.set(a,l),d&&i.set(d,!0),u&&i.set(u,!0))}}),s.size&&s.forEach(function(o){var a=Df("legacyOneTimeQuery"),l=n.getQuery(a).init({document:o.query,variables:o.variables}),u=new hc({queryManager:n,queryInfo:l,options:C(C({},o),{fetchPolicy:"network-only"})});ie(u.queryId===a),l.setObservableQuery(u),r.set(a,u)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,a){o||globalThis.__DEV__!==!1&&ie.warn(typeof a=="string"?34:35,a)}),r},t.prototype.reFetchObservableQueries=function(e){var n=this;e===void 0&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&r.push(i.refetch()),n.getQuery(s).setDiff(null)}),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var n=this,r=e.query,i=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,a=e.variables,l=e.context,u=l===void 0?{}:l,d=e.extensions,h=d===void 0?{}:d;r=this.transform(r),a=this.getVariables(r,a);var p=function(y){return n.getObservableFromLink(r,u,y,h).map(function(b){i!=="no-cache"&&(Dg(b,o)&&n.cache.write({query:r,result:b.data,dataId:"ROOT_SUBSCRIPTION",variables:y}),n.broadcastQueries());var _=zl(b),w=yU(b);if(_||w){var O={};if(_&&(O.graphQLErrors=b.errors),w&&(O.protocolErrors=b.extensions[Fv]),o==="none"||w)throw new vn(O)}return o==="ignore"&&delete b.errors,b})};if(this.getDocumentInfo(r).hasClientExports){var g=this.localState.addExportedVariables(r,a,u).then(p);return new Xe(function(y){var b=null;return g.then(function(_){return b=_.subscribe(y)},y.error),function(){return b&&b.unsubscribe()}})}return p(a)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,n,r,i,s){var o=this,a;s===void 0&&(s=(a=n==null?void 0:n.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,u=this.getDocumentInfo(e),d=u.serverQuery,h=u.clientQuery;if(d){var p=this,g=p.inFlightLinkObservables,y=p.link,b={query:d,variables:r,operationName:Wf(d)||void 0,context:this.prepareContext(C(C({},n),{forceFetch:!s})),extensions:i};if(n=b.context,s){var _=Qa(d),w=Ar(r),O=g.lookup(_,w);if(l=O.observable,!l){var N=new ao([cc(y,b)]);l=O.observable=N,N.beforeNext(function(){g.remove(_,w)})}}else l=new ao([cc(y,b)])}else l=new ao([Xe.of({data:{}})]),n=this.prepareContext(n);return h&&(l=bf(l,function(I){return o.localState.runResolvers({document:h,remoteResult:I,context:n,variables:r})})),l},t.prototype.getResultsFromLink=function(e,n,r){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(r.query);return bf(this.getObservableFromLink(s,r.context,r.variables),function(o){var a=Qf(o),l=a.length>0,u=r.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new vn({graphQLErrors:a}));e.markResult(o,s,r,n),e.markReady()}var d={data:o.data,loading:!1,networkStatus:Ge.ready};return l&&u==="none"&&(d.data=void 0),l&&u!=="ignore"&&(d.errors=a,d.networkStatus=Ge.error),d},function(o){var a=Qd(o)?o:new vn({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,n,r,i){var s=this;r===void 0&&(r=Ge.loading),i===void 0&&(i=n.query);var o=this.getVariables(i,n.variables),a=this.getQuery(e),l=this.defaultOptions.watchQuery,u=n.fetchPolicy,d=u===void 0?l&&l.fetchPolicy||"cache-first":u,h=n.errorPolicy,p=h===void 0?l&&l.errorPolicy||"none":h,g=n.returnPartialData,y=g===void 0?!1:g,b=n.notifyOnNetworkStatusChange,_=b===void 0?!1:b,w=n.context,O=w===void 0?{}:w,N=Object.assign({},n,{query:i,variables:o,fetchPolicy:d,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:_,context:O}),I=function(x){N.variables=x;var U=s.fetchQueryByPolicy(a,N,r);return N.fetchPolicy!=="standby"&&U.sources.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",n),U},P=function(){return s.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(x){P(),setTimeout(function(){return M.cancel(x)})});var M,B;if(this.getDocumentInfo(N.query).hasClientExports)M=new ao(this.localState.addExportedVariables(N.query,N.variables,N.context).then(I).then(function(x){return x.sources})),B=!0;else{var Q=I(N.variables);B=Q.fromLink,M=new ao(Q.sources)}return M.promise.then(P,P),{concast:M,fromLink:B}},t.prototype.refetchQueries=function(e){var n=this,r=e.updateCache,i=e.include,s=e.optimistic,o=s===void 0?!1:s,a=e.removeOptimistic,l=a===void 0?o?Df("refetchQueries"):void 0:a,u=e.onQueryUpdated,d=new Map;i&&this.getObservableQueries(i).forEach(function(p,g){d.set(g,{oq:p,lastDiff:n.getQuery(g).getDiff()})});var h=new Map;return r&&this.cache.batch({update:r,optimistic:o&&l||!1,removeOptimistic:l,onWatchUpdated:function(p,g,y){var b=p.watcher instanceof um&&p.watcher.observableQuery;if(b){if(u){d.delete(b.queryId);var _=u(b,g,y);return _===!0&&(_=b.refetch()),_!==!1&&h.set(b,_),_}u!==null&&d.set(b.queryId,{oq:b,lastDiff:y,diff:g})}}}),d.size&&d.forEach(function(p,g){var y=p.oq,b=p.lastDiff,_=p.diff,w;if(u){if(!_){var O=y.queryInfo;O.reset(),_=O.getDiff()}w=u(y,_,b)}(!u||w===!0)&&(w=y.refetch()),w!==!1&&h.set(y,w),g.indexOf("legacyOneTimeQuery")>=0&&n.stopQueryNoBroadcast(g)}),l&&this.cache.removeOptimistic(l),h},t.prototype.fetchQueryByPolicy=function(e,n,r){var i=this,s=n.query,o=n.variables,a=n.fetchPolicy,l=n.refetchWritePolicy,u=n.errorPolicy,d=n.returnPartialData,h=n.context,p=n.notifyOnNetworkStatusChange,g=e.networkStatus;e.init({document:s,variables:o,networkStatus:r});var y=function(){return e.getDiff()},b=function(I,P){P===void 0&&(P=e.networkStatus||Ge.loading);var M=I.result;globalThis.__DEV__!==!1&&!d&&!We(M,{})&&qN(I.missing);var B=function(Q){return Xe.of(C({data:Q,loading:dc(P),networkStatus:P},I.complete?null:{partial:!0}))};return M&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:M},context:h,variables:o,onlyRunForcedResolvers:!0}).then(function(Q){return B(Q.data||void 0)}):u==="none"&&P===Ge.refetch&&Array.isArray(I.missing)?B(void 0):B(M)},_=a==="no-cache"?0:r===Ge.refetch&&l!=="merge"?1:2,w=function(){return i.getResultsFromLink(e,_,{query:s,variables:o,context:h,fetchPolicy:a,errorPolicy:u})},O=p&&typeof g=="number"&&g!==r&&dc(r);switch(a){default:case"cache-first":{var N=y();return N.complete?{fromLink:!1,sources:[b(N,e.markReady())]}:d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-and-network":{var N=y();return N.complete||d||O?{fromLink:!0,sources:[b(N),w()]}:{fromLink:!0,sources:[w()]}}case"cache-only":return{fromLink:!1,sources:[b(y(),e.markReady())]};case"network-only":return O?{fromLink:!0,sources:[b(y()),w()]}:{fromLink:!0,sources:[w()]};case"no-cache":return O?{fromLink:!0,sources:[b(e.getDiff()),w()]}:{fromLink:!0,sources:[w()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new um(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var n=this.localState.prepareContext(e);return C(C(C({},this.defaultContext),n),{clientAwareness:this.clientAwareness})},t}(),YU=function(){function t(e){var n=e.cache,r=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=n,r&&(this.client=r),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var n=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(r){n.resolvers=lc(n.resolvers,r)}):this.resolvers=lc(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return hs(this,arguments,void 0,function(n){var r=n.document,i=n.remoteResult,s=n.context,o=n.variables,a=n.onlyRunForcedResolvers,l=a===void 0?!1:a;return ps(this,function(u){return r?[2,this.resolveDocument(r,i.data,s,o,this.fragmentMatcher,l).then(function(d){return C(C({},i),{data:d.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Ds(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return Sv(e)},t.prototype.prepareContext=function(e){var n=this.cache;return C(C({},e),{cache:n,getCacheKey:function(r){return n.identify(r)}})},t.prototype.addExportedVariables=function(e){return hs(this,arguments,void 0,function(n,r,i){return r===void 0&&(r={}),i===void 0&&(i={}),ps(this,function(s){return n?[2,this.resolveDocument(n,this.buildRootValueFromCache(n,r)||{},this.prepareContext(i),r).then(function(o){return C(C({},r),o.exportedVariables)})]:[2,C({},r)]})})},t.prototype.shouldForceResolvers=function(e){var n=!1;return cn(e,{Directive:{enter:function(r){if(r.name.value==="client"&&r.arguments&&(n=r.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),n))return _s}}}),n},t.prototype.buildRootValueFromCache=function(e,n){return this.cache.diff({query:hN(e),variables:n,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,n){return hs(this,arguments,void 0,function(r,i,s,o,a,l){var u,d,h,p,g,y,b,_,w,O,N;return s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),ps(this,function(I){return u=Vo(r),d=jc(r),h=$c(d),p=this.collectSelectionsToResolve(u,h),g=u.operation,y=g?g.charAt(0).toUpperCase()+g.slice(1):"Query",b=this,_=b.cache,w=b.client,O={fragmentMap:h,context:C(C({},s),{cache:_,client:w}),variables:o,fragmentMatcher:a,defaultOperationType:y,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:l},N=!1,[2,this.resolveSelectionSet(u.selectionSet,N,i,O).then(function(P){return{result:P,exportedVariables:O.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,n,r,i){return hs(this,void 0,void 0,function(){var s,o,a,l,u,d=this;return ps(this,function(h){return s=i.fragmentMap,o=i.context,a=i.variables,l=[r],u=function(p){return hs(d,void 0,void 0,function(){var g,y;return ps(this,function(b){return!n&&!i.selectionsToResolve.has(p)?[2]:za(p,a)?Wi(p)?[2,this.resolveField(p,n,r,i).then(function(_){var w;typeof _<"u"&&l.push((w={},w[qi(p)]=_,w))})]:(Z1(p)?g=p:(g=s[p.name.value],ie(g,18,p.name.value)),g&&g.typeCondition&&(y=g.typeCondition.name.value,i.fragmentMatcher(r,y,o))?[2,this.resolveSelectionSet(g.selectionSet,n,r,i).then(function(_){l.push(_)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return Ga(l)})]})})},t.prototype.resolveField=function(e,n,r,i){return hs(this,void 0,void 0,function(){var s,o,a,l,u,d,h,p,g,y=this;return ps(this,function(b){return r?(s=i.variables,o=e.name.value,a=qi(e),l=o!==a,u=r[a]||r[o],d=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=r.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[h],p&&(g=p[l?o:a],g&&(d=Promise.resolve(qv.withValue(this.cache,g,[r,Vc(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,d.then(function(_){var w,O;if(_===void 0&&(_=u),e.directives&&e.directives.forEach(function(I){I.name.value==="export"&&I.arguments&&I.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=_)})}),!e.selectionSet||_==null)return _;var N=(O=(w=e.directives)===null||w===void 0?void 0:w.some(function(I){return I.name.value==="client"}))!==null&&O!==void 0?O:!1;if(Array.isArray(_))return y.resolveSubSelectedArray(e,n||N,_,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,n||N,_,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,n,r,i){var s=this;return Promise.all(r.map(function(o){if(o===null)return null;if(Array.isArray(o))return s.resolveSubSelectedArray(e,n,o,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,n,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,n){var r=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function s(o){if(!i.has(o)){var a=new Set;i.set(o,a),cn(o,{Directive:function(l,u,d,h,p){l.name.value==="client"&&p.forEach(function(g){r(g)&&dg(g)&&a.add(g)})},FragmentSpread:function(l,u,d,h,p){var g=n[l.name.value];ie(g,19,l.name.value);var y=s(g);y.size>0&&(p.forEach(function(b){r(b)&&dg(b)&&a.add(b)}),a.add(l),y.forEach(function(b){a.add(b)}))}})}return i.get(o)}return s(e)},t}(),oT=!1,Zd=function(){function t(e){var n=this,r;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Dn(15);var i=e.uri,s=e.credentials,o=e.headers,a=e.cache,l=e.documentTransform,u=e.ssrMode,d=u===void 0?!1:u,h=e.ssrForceFetchDelay,p=h===void 0?0:h,g=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,_=e.defaultOptions,w=e.defaultContext,O=e.assumeImmutableResults,N=O===void 0?a.assumeImmutableResults:O,I=e.resolvers,P=e.typeDefs,M=e.fragmentMatcher,B=e.name,Q=e.version,x=e.devtools,U=e.link;U||(U=i?new Kd({uri:i,credentials:s,headers:o}):Fn.empty()),this.link=U,this.cache=a,this.disableNetworkFetches=d||p>0,this.queryDeduplication=b,this.defaultOptions=_||Object.create(null),this.typeDefs=P,this.devtoolsConfig=C(C({},x),{enabled:(r=x==null?void 0:x.enabled)!==null&&r!==void 0?r:g}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),p&&setTimeout(function(){return n.disableNetworkFetches=!1},p),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=wy,this.localState=new YU({cache:a,client:this,resolvers:I,fragmentMatcher:M}),this.queryManager=new JU({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:l,queryDeduplication:b,ssrMode:d,clientAwareness:{name:B,version:Q},localState:this.localState,assumeImmutableResults:N,onBroadcast:this.devtoolsConfig.enabled?function(){n.devToolsHookCb&&n.devToolsHookCb({action:{},state:{queries:n.queryManager.getQueryStore(),mutations:n.queryManager.mutationStore||{}},dataWithOptimisticResults:n.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,n=Symbol.for("apollo.devtools");(e[n]=e[n]||[]).push(this),e.__APOLLO_CLIENT__=this,!oT&&globalThis.__DEV__!==!1&&(oT=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var r=window.navigator,i=r&&r.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&ie.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=fi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=fi(this.defaultOptions.query,e)),ie(e.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=C(C({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=fi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,n){return n===void 0&&(n=!1),this.cache.readQuery(e,n)},t.prototype.watchFragment=function(e){return this.cache.watchFragment(e)},t.prototype.readFragment=function(e,n){return n===void 0&&(n=!1),this.cache.readFragment(e,n)},t.prototype.writeQuery=function(e){var n=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.writeFragment=function(e){var n=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),n},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return cc(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(n){return n()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(n){return n()}))})},t.prototype.onResetStore=function(e){var n=this;return this.resetStoreCallbacks.push(e),function(){n.resetStoreCallbacks=n.resetStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.onClearStore=function(e){var n=this;return this.clearStoreCallbacks.push(e),function(){n.clearStoreCallbacks=n.clearStoreCallbacks.filter(function(r){return r!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var n=this.queryManager.refetchQueries(e),r=[],i=[];n.forEach(function(o,a){r.push(a),i.push(o)});var s=Promise.all(i);return s.queries=r,s.results=i,s.catch(function(o){globalThis.__DEV__!==!1&&ie.debug(17,o)}),s},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(Zd.prototype.getMemoryInternals=GB);var wf=new Map,Rg=new Map,WN=!0,Kf=!1;function zN(t){return t.replace(/[\s,]+/g," ").trim()}function XU(t){return zN(t.source.body.substring(t.start,t.end))}function ZU(t){var e=new Set,n=[];return t.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var i=r.name.value,s=XU(r.loc),o=Rg.get(i);o&&!o.has(s)?WN&&console.warn("Warning: fragment with name "+i+` already exists.
184
184
  graphql-tag enforces all fragment names across your application to be unique; read more about
185
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Rg.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function eq(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function tq(t){var e=zN(t);if(!wf.has(e)){var n=Nc(t,{experimentalFragmentVariables:Kf,allowLegacyFragmentVariables:Kf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");wf.set(e,eq(ZU(n)))}return wf.get(e)}function No(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),tq(r)}function Kv(){wf.clear(),Rg.clear()}function Jv(){WN=!1}function Yv(){Kf=!0}function Xv(){Kf=!1}var kl={gql:No,resetCaches:Kv,disableFragmentWarnings:Jv,enableExperimentalFragmentVariables:Yv,disableExperimentalFragmentVariables:Xv};(function(t){t.gql=kl.gql,t.resetCaches=kl.resetCaches,t.disableFragmentWarnings=kl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=kl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=kl.disableExperimentalFragmentVariables})(No||(No={}));No.default=No;Ey(globalThis.__DEV__!==!1?"log":"silent");const nq=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Jd,ApolloClient:Zd,ApolloError:vn,ApolloLink:Fn,get Cache(){return Gf},DocumentTransform:Bc,HttpLink:Kd,InMemoryCache:Hv,MissingFieldError:Yd,get NetworkStatus(){return Ge},Observable:Xe,ObservableQuery:hc,checkFetcher:Vv,concat:kN,createHttpLink:Uv,createSignalIfSupported:IN,defaultDataIdFromObject:Xd,defaultPrinter:Gd,disableExperimentalFragmentVariables:Xv,disableFragmentWarnings:Jv,empty:ON,enableExperimentalFragmentVariables:Yv,execute:cc,fallbackHttpConfig:Lv,from:Mv,fromError:Ql,fromPromise:SN,get gql(){return No},isApolloError:Qd,isNetworkRequestSettled:BN,isReference:nt,makeReference:Fi,makeVar:Wv,mergeOptions:fi,parseAndCheckHttpResponse:$v,resetCaches:Kv,rewriteURIForGET:Bv,selectHttpOptionsAndBody:AN,selectHttpOptionsAndBodyInternal:Hd,selectURI:jv,serializeFetchParameter:uc,setLogVerbosity:Ey,split:Pv,throwServerError:zd,toPromise:TN},Symbol.toStringTag,{value:"Module"}));var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rq(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ha(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var QN={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,le)})(QN);var X=QN.exports;const iq=rq(X),Zv=VL({__proto__:null,default:iq},[X]);var aT=Ld?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Ka(){ie("createContext"in Zv,46);var t=X.createContext[aT];return t||(Object.defineProperty(X.createContext,aT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var sq=Ka,oq=function(t){var e=Ka();return X.createElement(e.Consumer,null,function(n){return ie(n&&n.client,45),t.children(n.client)})},GN=function(t){var e=t.client,n=t.children,r=Ka(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return ie(s.client,47),X.createElement(r.Provider,{value:s},n)};function Jn(t){var e=X.useContext(Ka()),n=t||e.client;return ie(!!n,50),n}var lT=!1,aq="useSyncExternalStore",lq=Zv[aq],Uc=lq||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!lT&&r!==e()&&(lT=!0,globalThis.__DEV__!==!1&&ie.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return q1?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),fm(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return fm(s)&&o({inst:s}),t(function(){fm(s)&&o({inst:s})})},[t]),r};function fm(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var ar;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(ar||(ar={}));var uo;function Mg(t){var e;switch(t){case ar.Query:e="Query";break;case ar.Mutation:e="Mutation";break;case ar.Subscription:e="Subscription";break}return e}function eb(t){uo||(uo=new Vd(Yr.parser||1e3));var e=uo.get(t);if(e)return e;var n,r,i;ie(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}ie(!s.length||o.length||a.length||l.length,63),ie(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?ar.Query:ar.Mutation,!o.length&&!a.length&&(r=ar.Subscription);var p=o.length?o:a.length?a:l;ie(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return uo.set(t,y),y}eb.resetCache=function(){uo=void 0};globalThis.__DEV__!==!1&&mv("parser",function(){return uo?uo.size:0});function eh(t,e){var n=eb(t),r=Mg(e),i=Mg(n.type);ie(n.type===e,66,r,r,i)}function tb(t,e){var n=X.useRef();return(!n.current||!We(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var Jf=pv?X.useLayoutEffect:X.useEffect,dm;function cq(){}function uq(){return dm||(dm=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=cq,X.useContext(dm),!0}catch{return!1}finally{console.error=t}},[])}var fq="use",dq=Zv[fq],HN=dq||function(e){var n=xv(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},hq=Symbol.for("apollo.hook.wrappers");function jo(t,e,n){var r=n.queryManager,i=r&&r[hq],s=i&&i[t];return s?s(e):e}var pq=Object.prototype.hasOwnProperty;function cT(){}var Tf=Symbol();function th(t,e){return e===void 0&&(e=Object.create(null)),jo("useQuery",mq,Jn(e&&e.client))(t,e)}function mq(t,e){var n=KN(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function gq(t,e,n,r,i){function s(h){var p;eh(e,ar.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(nb(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[Tf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function KN(t,e){var n=Jn(e.client),r=X.useContext(Ka()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=JN(n,t,e,i),u=gq(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);bq(p,h,n,e,y);var b=X.useMemo(function(){return wq(h)},[h]);vq(h,r,o);var _=yq(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||cT,onError:e.onError||cT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function yq(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?XN:r.skip||i.fetchPolicy==="standby"?ZN:void 0,h=t.previousData,p=X.useMemo(function(){return d&&Yf(d,h,e,n)},[n,e,d,h]);return Uc(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&We(w.data,O.data)||Pg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!pq.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!We(w,O.error))&&Pg({data:O&&O.data,error:w,loading:!1,networkStatus:Ge.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||uT(t,e,u.current,o,n)},function(){return p||uT(t,e,u.current,o,n)})}function vq(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function bq(t,e,n,r,i){var s;e[Tf]&&!We(e[Tf],i)&&(e.reobserve(nb(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[Tf]=i}function JN(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=xn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||Fg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||Fg(s,t.defaultOptions)),l}}function nb(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(Ms(t&&t.options,r)),i.reduce(fi)}function Pg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Hn(t.errors)&&(t.error=new vn({graphQLErrors:t.errors})),e.current=Yf(Eq(t,n,i),e.previousData,n,r),s(),_q(t,a==null?void 0:a.networkStatus,o)}function _q(t,e,n){if(!t.loading){var r=YN(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Ge.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&ie.warn(i)})}}function uT(t,e,n,r,i){return t.current||Pg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function Fg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function YN(t){return Hn(t.errors)?new vn({graphQLErrors:t.errors}):t.error}function Yf(t,e,n,r){var i=t.data;t.partial;var s=xn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==XN&&t!==ZN,previousData:e});return o}function Eq(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Ge.refetch})):t}var XN=Pa({loading:!0,data:void 0,error:void 0,networkStatus:Ge.loading}),ZN=Pa({loading:!1,data:void 0,error:void 0,networkStatus:Ge.ready});function wq(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var Tq=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function rb(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=fi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=KN(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||Fg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var Le=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),Le.apply(this,arguments)}},U=0,be=Tq;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=fi(i.current,C({query:s.current},r.current)),U=Sq(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),M=X.useRef(P);Jf(function(){M.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return M.current.apply(M,Q)},[]);return[B,I]}function Sq(t,e,n,r,i,s){var o=i.query||r,a=JN(n,o,i,!1)(e),l=e.reobserveAsConcast(nb(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(Yf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(Yf(d,t.previousData,e,n))}})})}function Oq(t,e){var n=Jn(e==null?void 0:e.client);eh(t,ar.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});Jf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=fi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,M=P&&P.length>0?new vn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(M&&B&&B(M,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:M,client:y};o.current.isMounted&&!We(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return M||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};We(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function kq(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=Jn(e.client);eh(t,ar.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&ie.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&ie.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=tb(function(){return e.variables},[e.variables]),p=function(){return Nq(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);Jf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!We(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);Jf(function(){I.current=d});var P=Uc(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,Le;if(!Q){var te={loading:!1,data:Oe.data,error:YN(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(Le=(ke=w.current).onError)===null||Le===void 0||Le.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,Le;Oe=Oe instanceof vn?Oe:new vn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(Le=(ke=w.current).onError)===null||Le===void 0||Le.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),M=X.useCallback(function(){ie(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:M})},[P,M])}function Nq(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function Aq(t){return Uc(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function Iq(t){return jo("useFragment",xq,Jn(t.client))(t)}function xq(t){var e=Jn(t.client).cache,n=t.from,r=xn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=tb(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:Cq(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Uc(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){We(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function Cq(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=Ga(t.missing.map(function(n){return n.missing}))),e}var ib=Symbol(),sb=Symbol();function li(t){var e,n=(e={toPromise:function(){return ab(n).then(function(){return n})}},e[ib]=t,e[sb]=t.promise,e);return n}function ob(t){ie(!t||ib in t,61)}function ab(t){var e=Bo(t);return e.promise.status==="fulfilled"?e.promise:t[sb]}function Bo(t){return t[ib]}function pc(t,e){t[sb]=e}var Dq=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],eA=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return Dq.some(function(r){return r in e&&!We(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=vf(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=vf(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=yN(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!We(n.data,{})&&!We(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);We(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?vf(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return xv(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),Rq=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new Fo(Bs),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new eA(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),hm=Symbol.for("apollo.suspenseCache");function lb(t){var e;return t[hm]||(t[hm]=new Rq((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[hm]}var tA=Symbol.for("apollo.skipToken");function Mq(t,e){return e===void 0&&(e=Object.create(null)),jo("useSuspenseQuery",Pq,Jn(typeof e=="object"?e.client:void 0))(t,e)}function Pq(t,e){var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=St([t,Ar(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(M){g([d.key,M])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=$g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Ge.error:Ge.ready,error:I}},[d.result]),_=s==="standby"?b:HN(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:$g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function Fq(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;eh(e,ar.Query),$q(n),Lq(n,r)}function $q(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];ie(e.includes(t),58,t)}function Lq(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&ie.warn(59)}function $g(t){return Hn(t.errors)?new vn({graphQLErrors:t.errors}):t.error}function cb(t){var e=t.client,n=t.query,r=t.options;return tb(function(){var i;if(r===tA)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&Fq(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function Vq(t,e){return e===void 0&&(e=Object.create(null)),jo("useBackgroundQuery",jq,Jn(typeof e=="object"?e.client:void 0))(t,e)}function jq(t,e){var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=St([t,Ar(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(li(h)),g=p[0],y=p[1];if(Bo(g)!==h&&y(li(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);pc(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(li(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(li(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function Bq(t,e){e===void 0&&(e=Object.create(null));var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];ob(l);var d=l&&Bo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);pc(l,h)}var p=uq(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(li(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(li(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];ie(!p(),51);var I=O[0],P=St([t,Ar(I)],[].concat(o),!0),M=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(li(M))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return ie(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function Uq(t){var e=Bo(t);return jo("useQueryRefHandlers",qq,e?e.observable:Jn())(t)}function qq(t){ob(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=Bo(t);n!==t?(r(t),o(t)):pc(t,ab(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(li(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(li(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function Wq(t){var e=Bo(t);return jo("useReadQuery",zq,e?e.observable:Jn())(t)}function zq(t){ob(t);var e=X.useMemo(function(){return Bo(t)},[t]),n=X.useCallback(function(){return ab(t)},[t]);e.disposed&&(e.reinitialize(),pc(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Uc(X.useCallback(function(s){return e.listen(function(o){pc(t,o),s()})},[e,t]),n,n),i=HN(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:$g(i)}},[i])}function Qq(t){return jo("createQueryPreloader",Gq,t)(t)}var Gq=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new eA(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return li(o)}};const Hq=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Jd,ApolloClient:Zd,ApolloConsumer:oq,ApolloError:vn,ApolloLink:Fn,ApolloProvider:GN,get Cache(){return Gf},DocumentTransform:Bc,get DocumentType(){return ar},HttpLink:Kd,InMemoryCache:Hv,MissingFieldError:Yd,get NetworkStatus(){return Ge},Observable:Xe,ObservableQuery:hc,checkFetcher:Vv,concat:kN,createHttpLink:Uv,createQueryPreloader:Qq,createSignalIfSupported:IN,defaultDataIdFromObject:Xd,defaultPrinter:Gd,disableExperimentalFragmentVariables:Xv,disableFragmentWarnings:Jv,empty:ON,enableExperimentalFragmentVariables:Yv,execute:cc,fallbackHttpConfig:Lv,from:Mv,fromError:Ql,fromPromise:SN,getApolloContext:Ka,get gql(){return No},isApolloError:Qd,isNetworkRequestSettled:BN,isReference:nt,makeReference:Fi,makeVar:Wv,mergeOptions:fi,operationName:Mg,parseAndCheckHttpResponse:$v,parser:eb,resetApolloContext:sq,resetCaches:Kv,rewriteURIForGET:Bv,selectHttpOptionsAndBody:AN,selectHttpOptionsAndBodyInternal:Hd,selectURI:jv,serializeFetchParameter:uc,setLogVerbosity:Ey,skipToken:tA,split:Pv,throwServerError:zd,toPromise:TN,useApolloClient:Jn,useBackgroundQuery:Vq,useFragment:Iq,useLazyQuery:rb,useLoadableQuery:Bq,useMutation:Oq,useQuery:th,useQueryRefHandlers:Uq,useReactiveVar:Aq,useReadQuery:Wq,useSubscription:kq,useSuspenseQuery:Mq},Symbol.toStringTag,{value:"Module"})),Kq=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=th(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},ub=(t,e)=>{const[n,r]=le.useState(!(e!=null&&e.skip)),[i,s]=le.useState([]),[o]=rb(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return le.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Lg={exports:{}},Nl={};/**
185
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Rg.set(i,o=new Set),o.add(s),e.has(s)||(e.add(s),n.push(r))}else n.push(r)}),C(C({},t),{definitions:n})}function eq(t){var e=new Set(t.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(i){var s=r[i];s&&typeof s=="object"&&e.add(s)})});var n=t.loc;return n&&(delete n.startToken,delete n.endToken),t}function tq(t){var e=zN(t);if(!wf.has(e)){var n=Nc(t,{experimentalFragmentVariables:Kf,allowLegacyFragmentVariables:Kf});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");wf.set(e,eq(ZU(n)))}return wf.get(e)}function No(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];typeof t=="string"&&(t=[t]);var r=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?r+=i.loc.source.body:r+=i,r+=t[s+1]}),tq(r)}function Kv(){wf.clear(),Rg.clear()}function Jv(){WN=!1}function Yv(){Kf=!0}function Xv(){Kf=!1}var kl={gql:No,resetCaches:Kv,disableFragmentWarnings:Jv,enableExperimentalFragmentVariables:Yv,disableExperimentalFragmentVariables:Xv};(function(t){t.gql=kl.gql,t.resetCaches=kl.resetCaches,t.disableFragmentWarnings=kl.disableFragmentWarnings,t.enableExperimentalFragmentVariables=kl.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=kl.disableExperimentalFragmentVariables})(No||(No={}));No.default=No;Ey(globalThis.__DEV__!==!1?"log":"silent");const nq=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Jd,ApolloClient:Zd,ApolloError:vn,ApolloLink:Fn,get Cache(){return Gf},DocumentTransform:Bc,HttpLink:Kd,InMemoryCache:Hv,MissingFieldError:Yd,get NetworkStatus(){return Ge},Observable:Xe,ObservableQuery:hc,checkFetcher:Vv,concat:kN,createHttpLink:Uv,createSignalIfSupported:IN,defaultDataIdFromObject:Xd,defaultPrinter:Gd,disableExperimentalFragmentVariables:Xv,disableFragmentWarnings:Jv,empty:ON,enableExperimentalFragmentVariables:Yv,execute:cc,fallbackHttpConfig:Lv,from:Mv,fromError:Ql,fromPromise:SN,get gql(){return No},isApolloError:Qd,isNetworkRequestSettled:BN,isReference:nt,makeReference:Fi,makeVar:Wv,mergeOptions:fi,parseAndCheckHttpResponse:$v,resetCaches:Kv,rewriteURIForGET:Bv,selectHttpOptionsAndBody:AN,selectHttpOptionsAndBodyInternal:Hd,selectURI:jv,serializeFetchParameter:uc,setLogVerbosity:Ey,split:Pv,throwServerError:zd,toPromise:TN},Symbol.toStringTag,{value:"Module"}));var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rq(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ha(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var QN={exports:{}};(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,ae)})(QN);var X=QN.exports;const iq=rq(X),Zv=VL({__proto__:null,default:iq},[X]);var aT=Ld?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function Ka(){ie("createContext"in Zv,46);var t=X.createContext[aT];return t||(Object.defineProperty(X.createContext,aT,{value:t=X.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var sq=Ka,oq=function(t){var e=Ka();return X.createElement(e.Consumer,null,function(n){return ie(n&&n.client,45),t.children(n.client)})},GN=function(t){var e=t.client,n=t.children,r=Ka(),i=X.useContext(r),s=X.useMemo(function(){return C(C({},i),{client:e||i.client})},[i,e]);return ie(s.client,47),X.createElement(r.Provider,{value:s},n)};function Jn(t){var e=X.useContext(Ka()),n=t||e.client;return ie(!!n,50),n}var lT=!1,aq="useSyncExternalStore",lq=Zv[aq],Uc=lq||function(t,e,n){var r=e();globalThis.__DEV__!==!1&&!lT&&r!==e()&&(lT=!0,globalThis.__DEV__!==!1&&ie.error(60));var i=X.useState({inst:{value:r,getSnapshot:e}}),s=i[0].inst,o=i[1];return q1?X.useLayoutEffect(function(){Object.assign(s,{value:r,getSnapshot:e}),fm(s)&&o({inst:s})},[t,r,e]):Object.assign(s,{value:r,getSnapshot:e}),X.useEffect(function(){return fm(s)&&o({inst:s}),t(function(){fm(s)&&o({inst:s})})},[t]),r};function fm(t){var e=t.value,n=t.getSnapshot;try{return e!==n()}catch{return!0}}var ar;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(ar||(ar={}));var uo;function Mg(t){var e;switch(t){case ar.Query:e="Query";break;case ar.Mutation:e="Mutation";break;case ar.Subscription:e="Subscription";break}return e}function eb(t){uo||(uo=new Vd(Yr.parser||1e3));var e=uo.get(t);if(e)return e;var n,r,i;ie(!!t&&!!t.kind,62,t);for(var s=[],o=[],a=[],l=[],u=0,d=t.definitions;u<d.length;u++){var h=d[u];if(h.kind==="FragmentDefinition"){s.push(h);continue}if(h.kind==="OperationDefinition")switch(h.operation){case"query":o.push(h);break;case"mutation":a.push(h);break;case"subscription":l.push(h);break}}ie(!s.length||o.length||a.length||l.length,63),ie(o.length+a.length+l.length<=1,64,t,o.length,l.length,a.length),r=o.length?ar.Query:ar.Mutation,!o.length&&!a.length&&(r=ar.Subscription);var p=o.length?o:a.length?a:l;ie(p.length===1,65,t,p.length);var g=p[0];n=g.variableDefinitions||[],g.name&&g.name.kind==="Name"?i=g.name.value:i="data";var y={name:i,type:r,variables:n};return uo.set(t,y),y}eb.resetCache=function(){uo=void 0};globalThis.__DEV__!==!1&&mv("parser",function(){return uo?uo.size:0});function eh(t,e){var n=eb(t),r=Mg(e),i=Mg(n.type);ie(n.type===e,66,r,r,i)}function tb(t,e){var n=X.useRef();return(!n.current||!We(n.current.deps,e))&&(n.current={value:t(),deps:e}),n.current.value}var Jf=pv?X.useLayoutEffect:X.useEffect,dm;function cq(){}function uq(){return dm||(dm=X.createContext(null)),X.useCallback(function(){var t=console.error;try{return console.error=cq,X.useContext(dm),!0}catch{return!1}finally{console.error=t}},[])}var fq="use",dq=Zv[fq],HN=dq||function(e){var n=xv(e);switch(n.status){case"pending":throw n;case"rejected":throw n.reason;case"fulfilled":return n.value}},hq=Symbol.for("apollo.hook.wrappers");function jo(t,e,n){var r=n.queryManager,i=r&&r[hq],s=i&&i[t];return s?s(e):e}var pq=Object.prototype.hasOwnProperty;function cT(){}var Tf=Symbol();function th(t,e){return e===void 0&&(e=Object.create(null)),jo("useQuery",mq,Jn(e&&e.client))(t,e)}function mq(t,e){var n=KN(t,e),r=n.result,i=n.obsQueryFields;return X.useMemo(function(){return C(C({},r),i)},[r,i])}function gq(t,e,n,r,i){function s(h){var p;eh(e,ar.Query);var g={client:t,query:e,observable:r&&r.getSSRObservable(i())||t.watchQuery(nb(void 0,t,n,i())),resultData:{previousData:(p=h==null?void 0:h.resultData.current)===null||p===void 0?void 0:p.data}};return g}var o=X.useState(s),a=o[0],l=o[1];function u(h){var p,g;Object.assign(a.observable,(p={},p[Tf]=h,p));var y=a.resultData;l(C(C({},a),{query:h.query,resultData:Object.assign(y,{previousData:((g=y.current)===null||g===void 0?void 0:g.data)||y.previousData,current:void 0})}))}if(t!==a.client||e!==a.query){var d=s(a);return l(d),[d,u]}return[a,u]}function KN(t,e){var n=Jn(e.client),r=X.useContext(Ka()).renderPromises,i=!!r,s=n.disableNetworkFetches,o=e.ssr!==!1&&!e.skip,a=e.partialRefetch,l=JN(n,t,e,i),u=gq(n,t,e,r,l),d=u[0],h=d.observable,p=d.resultData,g=u[1],y=l(h);bq(p,h,n,e,y);var b=X.useMemo(function(){return wq(h)},[h]);vq(h,r,o);var _=yq(p,h,n,e,y,s,a,i,{onCompleted:e.onCompleted||cT,onError:e.onError||cT});return{result:_,obsQueryFields:b,observable:h,resultData:p,client:n,onQueryExecuted:g}}function yq(t,e,n,r,i,s,o,a,l){var u=X.useRef(l);X.useEffect(function(){u.current=l});var d=(a||s)&&r.ssr===!1&&!r.skip?XN:r.skip||i.fetchPolicy==="standby"?ZN:void 0,h=t.previousData,p=X.useMemo(function(){return d&&Yf(d,h,e,n)},[n,e,d,h]);return Uc(X.useCallback(function(g){if(a)return function(){};var y=function(){var w=t.current,O=e.getCurrentResult();w&&w.loading===O.loading&&w.networkStatus===O.networkStatus&&We(w.data,O.data)||Pg(O,t,e,n,o,g,u.current)},b=function(w){if(_.current.unsubscribe(),_.current=e.resubscribeAfterError(y,b),!pq.call(w,"graphQLErrors"))throw w;var O=t.current;(!O||O&&O.loading||!We(w,O.error))&&Pg({data:O&&O.data,error:w,loading:!1,networkStatus:Ge.error},t,e,n,o,g,u.current)},_={current:e.subscribe(y,b)};return function(){setTimeout(function(){return _.current.unsubscribe()})}},[s,a,e,t,o,n]),function(){return p||uT(t,e,u.current,o,n)},function(){return p||uT(t,e,u.current,o,n)})}function vq(t,e,n){e&&n&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function bq(t,e,n,r,i){var s;e[Tf]&&!We(e[Tf],i)&&(e.reobserve(nb(e,n,r,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[Tf]=i}function JN(t,e,n,r){n===void 0&&(n={});var i=n.skip;n.ssr,n.onCompleted,n.onError;var s=n.defaultOptions,o=xn(n,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(a){var l=Object.assign(o,{query:e});return r&&(l.fetchPolicy==="network-only"||l.fetchPolicy==="cache-and-network")&&(l.fetchPolicy="cache-first"),l.variables||(l.variables={}),i?(l.initialFetchPolicy=l.initialFetchPolicy||l.fetchPolicy||Fg(s,t.defaultOptions),l.fetchPolicy="standby"):l.fetchPolicy||(l.fetchPolicy=(a==null?void 0:a.options.initialFetchPolicy)||Fg(s,t.defaultOptions)),l}}function nb(t,e,n,r){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),n.defaultOptions&&i.push(n.defaultOptions),i.push(Ms(t&&t.options,r)),i.reduce(fi)}function Pg(t,e,n,r,i,s,o){var a=e.current;a&&a.data&&(e.previousData=a.data),!t.error&&Hn(t.errors)&&(t.error=new vn({graphQLErrors:t.errors})),e.current=Yf(Eq(t,n,i),e.previousData,n,r),s(),_q(t,a==null?void 0:a.networkStatus,o)}function _q(t,e,n){if(!t.loading){var r=YN(t);Promise.resolve().then(function(){r?n.onError(r):t.data&&e!==t.networkStatus&&t.networkStatus===Ge.ready&&n.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&ie.warn(i)})}}function uT(t,e,n,r,i){return t.current||Pg(e.getCurrentResult(),t,e,i,r,function(){},n),t.current}function Fg(t,e){var n;return(t==null?void 0:t.fetchPolicy)||((n=e==null?void 0:e.watchQuery)===null||n===void 0?void 0:n.fetchPolicy)||"cache-first"}function YN(t){return Hn(t.errors)?new vn({graphQLErrors:t.errors}):t.error}function Yf(t,e,n,r){var i=t.data;t.partial;var s=xn(t,["data","partial"]),o=C(C({data:i},s),{client:r,observable:n,variables:n.variables,called:t!==XN&&t!==ZN,previousData:e});return o}function Eq(t,e,n){return t.partial&&n&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),C(C({},t),{loading:!0,networkStatus:Ge.refetch})):t}var XN=Pa({loading:!0,data:void 0,error:void 0,networkStatus:Ge.loading}),ZN=Pa({loading:!1,data:void 0,error:void 0,networkStatus:Ge.ready});function wq(t){return{refetch:t.refetch.bind(t),reobserve:t.reobserve.bind(t),fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var Tq=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function rb(t,e){var n,r=X.useRef(),i=X.useRef(),s=X.useRef(),o=fi(e,r.current||{}),a=(n=o==null?void 0:o.query)!==null&&n!==void 0?n:t;i.current=e,s.current=a;var l=C(C({},o),{skip:!r.current}),u=KN(a,l),d=u.obsQueryFields,h=u.result,p=u.client,g=u.resultData,y=u.observable,b=u.onQueryExecuted,_=y.options.initialFetchPolicy||Fg(l.defaultOptions,p.defaultOptions),w=X.useReducer(function(Q){return Q+1},0)[1],O=X.useMemo(function(){for(var Q={},x=function(ke){var Le=d[ke];Q[ke]=function(){return r.current||(r.current=Object.create(null),w()),Le.apply(this,arguments)}},U=0,be=Tq;U<be.length;U++){var Oe=be[U];x(Oe)}return Q},[w,d]),N=!!r.current,I=X.useMemo(function(){return C(C(C({},h),O),{called:N})},[h,O,N]),P=X.useCallback(function(Q){r.current=Q?C(C({},Q),{fetchPolicy:Q.fetchPolicy||_}):{fetchPolicy:_};var x=fi(i.current,C({query:s.current},r.current)),U=Sq(g,y,p,a,C(C({},x),{skip:!1}),b).then(function(be){return Object.assign(be,O)});return U.catch(function(){}),U},[p,a,O,_,y,g,b]),M=X.useRef(P);Jf(function(){M.current=P});var B=X.useCallback(function(){for(var Q=[],x=0;x<arguments.length;x++)Q[x]=arguments[x];return M.current.apply(M,Q)},[]);return[B,I]}function Sq(t,e,n,r,i,s){var o=i.query||r,a=JN(n,o,i,!1)(e),l=e.reobserveAsConcast(nb(e,n,i,a));return s(a),new Promise(function(u){var d;l.subscribe({next:function(h){d=h},error:function(){u(Yf(e.getCurrentResult(),t.previousData,e,n))},complete:function(){u(Yf(d,t.previousData,e,n))}})})}function Oq(t,e){var n=Jn(e==null?void 0:e.client);eh(t,ar.Mutation);var r=X.useState({called:!1,loading:!1,client:n}),i=r[0],s=r[1],o=X.useRef({result:i,mutationId:0,isMounted:!0,client:n,mutation:t,options:e});Jf(function(){Object.assign(o.current,{client:n,options:e,mutation:t})});var a=X.useCallback(function(u){u===void 0&&(u={});var d=o.current,h=d.options,p=d.mutation,g=C(C({},h),{mutation:p}),y=u.client||o.current.client;!o.current.result.loading&&!g.ignoreResults&&o.current.isMounted&&s(o.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:y});var b=++o.current.mutationId,_=fi(g,u);return y.mutate(_).then(function(w){var O,N,I=w.data,P=w.errors,M=P&&P.length>0?new vn({graphQLErrors:P}):void 0,B=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(M&&B&&B(M,_),b===o.current.mutationId&&!_.ignoreResults){var Q={called:!0,loading:!1,data:I,error:M,client:y};o.current.isMounted&&!We(o.current.result,Q)&&s(o.current.result=Q)}var x=u.onCompleted||((N=o.current.options)===null||N===void 0?void 0:N.onCompleted);return M||x==null||x(w.data,_),w}).catch(function(w){var O;if(b===o.current.mutationId&&o.current.isMounted){var N={loading:!1,error:w,data:void 0,called:!0,client:y};We(o.current.result,N)||s(o.current.result=N)}var I=u.onError||((O=o.current.options)===null||O===void 0?void 0:O.onError);if(I)return I(w,_),{data:void 0,errors:w};throw w})},[]),l=X.useCallback(function(){if(o.current.isMounted){var u={called:!1,loading:!1,client:o.current.client};Object.assign(o.current,{mutationId:0,result:u}),s(u)}},[]);return X.useEffect(function(){var u=o.current;return u.isMounted=!0,function(){u.isMounted=!1}},[]),[a,C({reset:l},i)]}function kq(t,e){e===void 0&&(e=Object.create(null));var n=X.useRef(!1),r=Jn(e.client);eh(t,ar.Subscription),n.current||(n.current=!0,e.onSubscriptionData&&globalThis.__DEV__!==!1&&ie.warn(e.onData?53:54),e.onSubscriptionComplete&&globalThis.__DEV__!==!1&&ie.warn(e.onComplete?55:56));var i=e.skip,s=e.fetchPolicy,o=e.errorPolicy,a=e.shouldResubscribe,l=e.context,u=e.extensions,d=e.ignoreResults,h=tb(function(){return e.variables},[e.variables]),p=function(){return Nq(r,t,h,s,o,l,u)},g=X.useState(e.skip?null:p),y=g[0],b=g[1],_=X.useRef(p);Jf(function(){_.current=p}),i?y&&b(y=null):(!y||(r!==y.__.client||t!==y.__.query||s!==y.__.fetchPolicy||o!==y.__.errorPolicy||!We(h,y.__.variables))&&(typeof a=="function"?!!a(e):a)!==!1)&&b(y=p());var w=X.useRef(e);X.useEffect(function(){w.current=e});var O=!i&&!d,N=X.useMemo(function(){return{loading:O,error:void 0,data:void 0,variables:h}},[O,h]),I=X.useRef(d);Jf(function(){I.current=d});var P=Uc(X.useCallback(function(B){if(!y)return function(){};var Q=!1,x=y.__.variables,U=y.__.client,be=y.subscribe({next:function(Oe){var ke,Le;if(!Q){var te={loading:!1,data:Oe.data,error:YN(Oe),variables:x};y.__.setResult(te),I.current||B(),te.error?(Le=(ke=w.current).onError)===null||Le===void 0||Le.call(ke,te.error):w.current.onData?w.current.onData({client:U,data:te}):w.current.onSubscriptionData&&w.current.onSubscriptionData({client:U,subscriptionData:te})}},error:function(Oe){var ke,Le;Oe=Oe instanceof vn?Oe:new vn({protocolErrors:[Oe]}),Q||(y.__.setResult({loading:!1,data:void 0,error:Oe,variables:x}),I.current||B(),(Le=(ke=w.current).onError)===null||Le===void 0||Le.call(ke,Oe))},complete:function(){Q||(w.current.onComplete?w.current.onComplete():w.current.onSubscriptionComplete&&w.current.onSubscriptionComplete())}});return function(){Q=!0,setTimeout(function(){be.unsubscribe()})}},[y]),function(){return y&&!i&&!d?y.__.result:N},function(){return N}),M=X.useCallback(function(){ie(!w.current.skip,57),b(_.current())},[w,_]);return X.useMemo(function(){return C(C({},P),{restart:M})},[P,M])}function Nq(t,e,n,r,i,s,o){var a={query:e,variables:n,fetchPolicy:r,errorPolicy:i,context:s,extensions:o},l=C(C({},a),{client:t,result:{loading:!0,data:void 0,error:void 0,variables:n},setResult:function(d){l.result=d}}),u=null;return Object.assign(new Xe(function(d){u||(u=t.subscribe(a));var h=u.subscribe(d);return function(){return h.unsubscribe()}}),{__:l})}function Aq(t){return Uc(X.useCallback(function(e){return t.onNextChange(function n(){e(),t.onNextChange(n)})},[t]),t,t)}function Iq(t){return jo("useFragment",xq,Jn(t.client))(t)}function xq(t){var e=Jn(t.client).cache,n=t.from,r=xn(t,["from"]),i=X.useMemo(function(){return typeof n=="string"?n:e.identify(n)},[e,n]),s=tb(function(){return C(C({},r),{from:i})},[r,i]),o=X.useMemo(function(){var l=s.fragment,u=s.fragmentName,d=s.from,h=s.optimistic,p=h===void 0?!0:h;return{result:Cq(e.diff(C(C({},s),{returnPartialData:!0,id:d,query:e.getFragmentDoc(l,u),optimistic:p})))}},[s,e]),a=X.useCallback(function(){return o.result},[o]);return Uc(X.useCallback(function(l){var u=0,d=e.watchFragment(s).subscribe({next:function(h){We(h,o.result)||(o.result=h,clearTimeout(u),u=setTimeout(l))}});return function(){d.unsubscribe(),clearTimeout(u)}},[e,s,o]),a,a)}function Cq(t){var e={data:t.result,complete:!!t.complete};return t.missing&&(e.missing=Ga(t.missing.map(function(n){return n.missing}))),e}var ib=Symbol(),sb=Symbol();function li(t){var e,n=(e={toPromise:function(){return ab(n).then(function(){return n})}},e[ib]=t,e[sb]=t.promise,e);return n}function ob(t){ie(!t||ib in t,61)}function ab(t){var e=Bo(t);return e.promise.status==="fulfilled"?e.promise:t[sb]}function Bo(t){return t[ib]}function pc(t,e){t[sb]=e}var Dq=["canonizeResults","context","errorPolicy","fetchPolicy","refetchWritePolicy","returnPartialData"],eA=function(){function t(e,n){var r=this;this.key={},this.listeners=new Set,this.references=0,this.softReferences=0,this.handleNext=this.handleNext.bind(this),this.handleError=this.handleError.bind(this),this.dispose=this.dispose.bind(this),this.observable=e,n.onDispose&&(this.onDispose=n.onDispose),this.setResult(),this.subscribeToQuery();var i=function(){var s;r.references||(r.autoDisposeTimeoutId=setTimeout(r.dispose,(s=n.autoDisposeTimeoutMs)!==null&&s!==void 0?s:3e4))};this.promise.then(i,i)}return Object.defineProperty(t.prototype,"disposed",{get:function(){return this.subscription.closed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"watchQueryOptions",{get:function(){return this.observable.options},enumerable:!1,configurable:!0}),t.prototype.reinitialize=function(){var e=this.observable,n=this.watchQueryOptions.fetchPolicy,r=n==="no-cache"||n==="standby";try{if(r?e.silentSetOptions({fetchPolicy:"standby"}):(e.resetLastResults(),e.silentSetOptions({fetchPolicy:"cache-first"})),this.subscribeToQuery(),r)return;e.resetDiff(),this.setResult()}finally{e.silentSetOptions({fetchPolicy:n})}},t.prototype.retain=function(){var e=this;this.references++,clearTimeout(this.autoDisposeTimeoutId);var n=!1;return function(){n||(n=!0,e.references--,setTimeout(function(){e.references||e.dispose()}))}},t.prototype.softRetain=function(){var e=this;this.softReferences++;var n=!1;return function(){n||(n=!0,e.softReferences--,setTimeout(function(){!e.softReferences&&!e.references&&e.dispose()}))}},t.prototype.didChangeOptions=function(e){var n=this;return Dq.some(function(r){return r in e&&!We(n.watchQueryOptions[r],e[r])})},t.prototype.applyOptions=function(e){var n=this.watchQueryOptions,r=n.fetchPolicy,i=n.canonizeResults;return r==="standby"&&r!==e.fetchPolicy?this.initiateFetch(this.observable.reobserve(e)):(this.observable.silentSetOptions(e),i!==e.canonizeResults&&(this.result=C(C({},this.result),this.observable.getCurrentResult()),this.promise=vf(this.result))),this.promise},t.prototype.listen=function(e){var n=this;return this.listeners.add(e),function(){n.listeners.delete(e)}},t.prototype.refetch=function(e){return this.initiateFetch(this.observable.refetch(e))},t.prototype.fetchMore=function(e){return this.initiateFetch(this.observable.fetchMore(e))},t.prototype.dispose=function(){this.subscription.unsubscribe(),this.onDispose()},t.prototype.onDispose=function(){},t.prototype.handleNext=function(e){var n;switch(this.promise.status){case"pending":{e.data===void 0&&(e.data=this.result.data),this.result=e,(n=this.resolve)===null||n===void 0||n.call(this,e);break}default:{if(e.data===this.result.data&&e.networkStatus===this.result.networkStatus)return;e.data===void 0&&(e.data=this.result.data),this.result=e,this.promise=vf(e),this.deliver(this.promise);break}}},t.prototype.handleError=function(e){var n;switch(this.subscription.unsubscribe(),this.subscription=this.observable.resubscribeAfterError(this.handleNext,this.handleError),this.promise.status){case"pending":{(n=this.reject)===null||n===void 0||n.call(this,e);break}default:this.promise=yN(e),this.deliver(this.promise)}},t.prototype.deliver=function(e){this.listeners.forEach(function(n){return n(e)})},t.prototype.initiateFetch=function(e){var n=this;return this.promise=this.createPendingPromise(),this.promise.catch(function(){}),e.then(function(){setTimeout(function(){var r;n.promise.status==="pending"&&(n.result=n.observable.getCurrentResult(),(r=n.resolve)===null||r===void 0||r.call(n,n.result))})}).catch(function(r){var i;return(i=n.reject)===null||i===void 0?void 0:i.call(n,r)}),e},t.prototype.subscribeToQuery=function(){var e=this;this.subscription=this.observable.filter(function(n){return!We(n.data,{})&&!We(n,e.result)}).subscribe(this.handleNext,this.handleError)},t.prototype.setResult=function(){var e=this.observable.getCurrentResult(!1);We(e,this.result)||(this.result=e,this.promise=e.data&&(!e.partial||this.watchQueryOptions.returnPartialData)?vf(e):this.createPendingPromise())},t.prototype.createPendingPromise=function(){var e=this;return xv(new Promise(function(n,r){e.resolve=n,e.reject=r}))},t}(),Rq=function(){function t(e){e===void 0&&(e=Object.create(null)),this.queryRefs=new Fo(Bs),this.options=e}return t.prototype.getQueryRef=function(e,n){var r=this.queryRefs.lookupArray(e);return r.current||(r.current=new eA(n(),{autoDisposeTimeoutMs:this.options.autoDisposeTimeoutMs,onDispose:function(){delete r.current}})),r.current},t.prototype.add=function(e,n){var r=this.queryRefs.lookupArray(e);r.current=n},t}(),hm=Symbol.for("apollo.suspenseCache");function lb(t){var e;return t[hm]||(t[hm]=new Rq((e=t.defaultOptions.react)===null||e===void 0?void 0:e.suspense)),t[hm]}var tA=Symbol.for("apollo.skipToken");function Mq(t,e){return e===void 0&&(e=Object.create(null)),jo("useSuspenseQuery",Pq,Jn(typeof e=="object"?e.client:void 0))(t,e)}function Pq(t,e){var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=St([t,Ar(o)],[].concat(l),!0),d=r.getQueryRef(u,function(){return n.watchQuery(i)}),h=X.useState([d.key,d.promise]),p=h[0],g=h[1];p[0]!==d.key&&(p[0]=d.key,p[1]=d.promise);var y=p[1];d.didChangeOptions(i)&&(p[1]=y=d.applyOptions(i)),X.useEffect(function(){var I=d.retain(),P=d.listen(function(M){g([d.key,M])});return function(){P(),I()}},[d]);var b=X.useMemo(function(){var I=$g(d.result);return{loading:!1,data:d.result.data,networkStatus:I?Ge.error:Ge.ready,error:I}},[d.result]),_=s==="standby"?b:HN(y),w=X.useCallback(function(I){var P=d.fetchMore(I);return g([d.key,d.promise]),P},[d]),O=X.useCallback(function(I){var P=d.refetch(I);return g([d.key,d.promise]),P},[d]),N=d.observable.subscribeToMore;return X.useMemo(function(){return{client:n,data:_.data,error:$g(_),networkStatus:_.networkStatus,fetchMore:w,refetch:O,subscribeToMore:N}},[n,w,O,_,N])}function Fq(t){var e=t.query,n=t.fetchPolicy,r=t.returnPartialData;eh(e,ar.Query),$q(n),Lq(n,r)}function $q(t){t===void 0&&(t="cache-first");var e=["cache-first","network-only","no-cache","cache-and-network"];ie(e.includes(t),58,t)}function Lq(t,e){t==="no-cache"&&e&&globalThis.__DEV__!==!1&&ie.warn(59)}function $g(t){return Hn(t.errors)?new vn({graphQLErrors:t.errors}):t.error}function cb(t){var e=t.client,n=t.query,r=t.options;return tb(function(){var i;if(r===tA)return{query:n,fetchPolicy:"standby"};var s=r.fetchPolicy||((i=e.defaultOptions.watchQuery)===null||i===void 0?void 0:i.fetchPolicy)||"cache-first",o=C(C({},r),{fetchPolicy:s,query:n,notifyOnNetworkStatusChange:!1,nextFetchPolicy:void 0});return globalThis.__DEV__!==!1&&Fq(o),r.skip&&(o.fetchPolicy="standby"),o},[e,r,n])}function Vq(t,e){return e===void 0&&(e=Object.create(null)),jo("useBackgroundQuery",jq,Jn(typeof e=="object"?e.client:void 0))(t,e)}function jq(t,e){var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=i.fetchPolicy,o=i.variables,a=e.queryKey,l=a===void 0?[]:a,u=X.useRef(s!=="standby");u.current||(u.current=s!=="standby");var d=St([t,Ar(o)],[].concat(l),!0),h=r.getQueryRef(d,function(){return n.watchQuery(i)}),p=X.useState(li(h)),g=p[0],y=p[1];if(Bo(g)!==h&&y(li(h)),h.didChangeOptions(i)){var b=h.applyOptions(i);pc(g,b)}X.useEffect(function(){var O=setTimeout(function(){h.disposed&&r.add(d,h)});return function(){return clearTimeout(O)}});var _=X.useCallback(function(O){var N=h.fetchMore(O);return y(li(h)),N},[h]),w=X.useCallback(function(O){var N=h.refetch(O);return y(li(h)),N},[h]);return X.useEffect(function(){return h.softRetain()},[h]),[u.current?g:void 0,{fetchMore:_,refetch:w,subscribeToMore:h.observable.subscribeToMore}]}function Bq(t,e){e===void 0&&(e=Object.create(null));var n=Jn(e.client),r=lb(n),i=cb({client:n,query:t,options:e}),s=e.queryKey,o=s===void 0?[]:s,a=X.useState(null),l=a[0],u=a[1];ob(l);var d=l&&Bo(l);if(l&&(d!=null&&d.didChangeOptions(i))){var h=d.applyOptions(i);pc(l,h)}var p=uq(),g=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.fetchMore(O);return u(li(d)),N},[d]),y=X.useCallback(function(O){if(!d)throw new Error("The query has not been loaded. Please load the query.");var N=d.refetch(O);return u(li(d)),N},[d]),b=X.useCallback(function(){for(var O=[],N=0;N<arguments.length;N++)O[N]=arguments[N];ie(!p(),51);var I=O[0],P=St([t,Ar(I)],[].concat(o),!0),M=r.getQueryRef(P,function(){return n.watchQuery(C(C({},i),{variables:I}))});u(li(M))},[t,o,r,i,p,n]),_=X.useCallback(function(O){return ie(d,52),d.observable.subscribeToMore(O)},[d]),w=X.useCallback(function(){u(null)},[]);return[b,l,{fetchMore:g,refetch:y,reset:w,subscribeToMore:_}]}function Uq(t){var e=Bo(t);return jo("useQueryRefHandlers",qq,e?e.observable:Jn())(t)}function qq(t){ob(t);var e=X.useState(t),n=e[0],r=e[1],i=X.useState(t),s=i[0],o=i[1],a=Bo(t);n!==t?(r(t),o(t)):pc(t,ab(s));var l=X.useCallback(function(d){var h=a.refetch(d);return o(li(a)),h},[a]),u=X.useCallback(function(d){var h=a.fetchMore(d);return o(li(a)),h},[a]);return{refetch:l,fetchMore:u,subscribeToMore:a.observable.subscribeToMore}}function Wq(t){var e=Bo(t);return jo("useReadQuery",zq,e?e.observable:Jn())(t)}function zq(t){ob(t);var e=X.useMemo(function(){return Bo(t)},[t]),n=X.useCallback(function(){return ab(t)},[t]);e.disposed&&(e.reinitialize(),pc(t,e.promise)),X.useEffect(function(){return e.retain()},[e]);var r=Uc(X.useCallback(function(s){return e.listen(function(o){pc(t,o),s()})},[e,t]),n,n),i=HN(r);return X.useMemo(function(){return{data:i.data,networkStatus:i.networkStatus,error:$g(i)}},[i])}function Qq(t){return jo("createQueryPreloader",Gq,t)(t)}var Gq=function(t){return function(n,r){var i,s;r===void 0&&(r=Object.create(null));var o=new eA(t.watchQuery(C(C({},r),{query:n})),{autoDisposeTimeoutMs:(s=(i=t.defaultOptions.react)===null||i===void 0?void 0:i.suspense)===null||s===void 0?void 0:s.autoDisposeTimeoutMs});return li(o)}};const Hq=Object.freeze(Object.defineProperty({__proto__:null,ApolloCache:Jd,ApolloClient:Zd,ApolloConsumer:oq,ApolloError:vn,ApolloLink:Fn,ApolloProvider:GN,get Cache(){return Gf},DocumentTransform:Bc,get DocumentType(){return ar},HttpLink:Kd,InMemoryCache:Hv,MissingFieldError:Yd,get NetworkStatus(){return Ge},Observable:Xe,ObservableQuery:hc,checkFetcher:Vv,concat:kN,createHttpLink:Uv,createQueryPreloader:Qq,createSignalIfSupported:IN,defaultDataIdFromObject:Xd,defaultPrinter:Gd,disableExperimentalFragmentVariables:Xv,disableFragmentWarnings:Jv,empty:ON,enableExperimentalFragmentVariables:Yv,execute:cc,fallbackHttpConfig:Lv,from:Mv,fromError:Ql,fromPromise:SN,getApolloContext:Ka,get gql(){return No},isApolloError:Qd,isNetworkRequestSettled:BN,isReference:nt,makeReference:Fi,makeVar:Wv,mergeOptions:fi,operationName:Mg,parseAndCheckHttpResponse:$v,parser:eb,resetApolloContext:sq,resetCaches:Kv,rewriteURIForGET:Bv,selectHttpOptionsAndBody:AN,selectHttpOptionsAndBodyInternal:Hd,selectURI:jv,serializeFetchParameter:uc,setLogVerbosity:Ey,skipToken:tA,split:Pv,throwServerError:zd,toPromise:TN,useApolloClient:Jn,useBackgroundQuery:Vq,useFragment:Iq,useLazyQuery:rb,useLoadableQuery:Bq,useMutation:Oq,useQuery:th,useQueryRefHandlers:Uq,useReactiveVar:Aq,useReadQuery:Wq,useSubscription:kq,useSuspenseQuery:Mq},Symbol.toStringTag,{value:"Module"})),Kq=(t,e)=>{const{data:n,loading:r,refetch:i,fetchMore:s}=th(t,{...e,notifyOnNetworkStatusChange:!0,variables:{...e==null?void 0:e.variables,page:{first:(e==null?void 0:e.pageSize)??100}}}),o=t.definitions[0].selectionSet.selections[0].name.value;return{data:n,loading:r,loadNextPage:a=>{const l=n==null?void 0:n[o];if(l!=null&&l.pageInfo.hasNextPage)return i({...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l.pageInfo.endCursor}})},loadNextPageWithoutAppendingOldData:a=>{const l=n==null?void 0:n[o];return s({variables:{...e==null?void 0:e.variables,...a,page:{first:(e==null?void 0:e.pageSize)??100,after:l==null?void 0:l.pageInfo.endCursor}}})}}},ub=(t,e)=>{const[n,r]=ae.useState(!(e!=null&&e.skip)),[i,s]=ae.useState([]),[o]=rb(t,e),a=async l=>{var g;const u=t.definitions[0].selectionSet.selections[0].name.value;r(!0);let d=!0,h=null;const p=[];for(;d;){const{data:y,error:b}=await o({variables:{...e==null?void 0:e.variables,...l,page:{first:100,after:h}}});if(b)throw b;const _=y==null?void 0:y[u];_&&(p.push(..._.nodes??[]),d=_.pageInfo.hasNextPage,h=_.pageInfo.endCursor)}return s(p),(g=e==null?void 0:e.onResults)==null||g.call(e,p),r(!1),p};return ae.useEffect(()=>{e!=null&&e.skip||a()},[e==null?void 0:e.skip]),{loading:n,results:i,refetch:a}};var Lg={exports:{}},Nl={};/**
186
186
  * @license React
187
187
  * react-jsx-runtime.production.js
188
188
  *
@@ -198,22 +198,22 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
198
198
  *
199
199
  * This source code is licensed under the MIT license found in the
200
200
  * LICENSE file in the root directory of this source tree.
201
- */var dT;function Yq(){return dT||(dT=1,process.env.NODE_ENV!=="production"&&function(){function t(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===Ee?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case M:return"Fragment";case P:return"Portal";case Q:return"Profiler";case B:return"StrictMode";case Oe:return"Suspense";case ke:return"SuspenseList"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case U:return(R.displayName||"Context")+".Provider";case x:return(R._context.displayName||"Context")+".Consumer";case be:var oe=R.render;return R=R.displayName,R||(R=oe.displayName||oe.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case Le:return oe=R.displayName||null,oe!==null?oe:t(R.type)||"Memo";case te:oe=R._payload,R=R._init;try{return t(R(oe))}catch{}}return null}function e(R){return""+R}function n(R){try{e(R);var oe=!1}catch{oe=!0}if(oe){oe=console;var ae=oe.error,et=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return ae.call(oe,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",et),e(R)}}function r(){}function i(){if(Y===0){ee=console.log,we=console.info,Me=console.warn,Ye=console.error,Zt=console.group,Hi=console.groupCollapsed,Vr=console.groupEnd;var R={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}Y++}function s(){if(Y--,Y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},R,{value:ee}),info:ve({},R,{value:we}),warn:ve({},R,{value:Me}),error:ve({},R,{value:Ye}),group:ve({},R,{value:Zt}),groupCollapsed:ve({},R,{value:Hi}),groupEnd:ve({},R,{value:Vr})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(R){if(Pt===void 0)try{throw Error()}catch(ae){var oe=ae.stack.trim().match(/\n( *(at )?)/);Pt=oe&&oe[1]||"",sl=-1<ae.stack.indexOf(`
202
- at`)?" (<anonymous>)":-1<ae.stack.indexOf("@")?"@unknown:0:0":""}return`
203
- `+Pt+R+sl}function a(R,oe){if(!R||wn)return"";var ae=bi.get(R);if(ae!==void 0)return ae;wn=!0,ae=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var et=null;et=ge.H,ge.H=null,i();try{var Ot={DetermineComponentFrameRoot:function(){try{if(oe){var pr=function(){throw Error()};if(Object.defineProperty(pr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pr,[])}catch(Xn){var Ji=Xn}Reflect.construct(R,[],pr)}else{try{pr.call()}catch(Xn){Ji=Xn}R.call(pr.prototype)}}else{try{throw Error()}catch(Xn){Ji=Xn}(pr=R())&&typeof pr.catch=="function"&&pr.catch(function(){})}}catch(Xn){if(Xn&&Ji&&typeof Xn.stack=="string")return[Xn.stack,Ji.stack]}return[null,null]}};Ot.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var gt=Object.getOwnPropertyDescriptor(Ot.DetermineComponentFrameRoot,"name");gt&&gt.configurable&&Object.defineProperty(Ot.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var Ne=Ot.DetermineComponentFrameRoot(),un=Ne[0],ei=Ne[1];if(un&&ei){var Vt=un.split(`
201
+ */var dT;function Yq(){return dT||(dT=1,process.env.NODE_ENV!=="production"&&function(){function t(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===Ee?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case M:return"Fragment";case P:return"Portal";case Q:return"Profiler";case B:return"StrictMode";case Oe:return"Suspense";case ke:return"SuspenseList"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case U:return(R.displayName||"Context")+".Provider";case x:return(R._context.displayName||"Context")+".Consumer";case be:var oe=R.render;return R=R.displayName,R||(R=oe.displayName||oe.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case Le:return oe=R.displayName||null,oe!==null?oe:t(R.type)||"Memo";case te:oe=R._payload,R=R._init;try{return t(R(oe))}catch{}}return null}function e(R){return""+R}function n(R){try{e(R);var oe=!1}catch{oe=!0}if(oe){oe=console;var le=oe.error,et=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return le.call(oe,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",et),e(R)}}function r(){}function i(){if(Y===0){ee=console.log,we=console.info,Me=console.warn,Ye=console.error,Zt=console.group,Hi=console.groupCollapsed,Vr=console.groupEnd;var R={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}Y++}function s(){if(Y--,Y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},R,{value:ee}),info:ve({},R,{value:we}),warn:ve({},R,{value:Me}),error:ve({},R,{value:Ye}),group:ve({},R,{value:Zt}),groupCollapsed:ve({},R,{value:Hi}),groupEnd:ve({},R,{value:Vr})})}0>Y&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(R){if(Pt===void 0)try{throw Error()}catch(le){var oe=le.stack.trim().match(/\n( *(at )?)/);Pt=oe&&oe[1]||"",sl=-1<le.stack.indexOf(`
202
+ at`)?" (<anonymous>)":-1<le.stack.indexOf("@")?"@unknown:0:0":""}return`
203
+ `+Pt+R+sl}function a(R,oe){if(!R||wn)return"";var le=bi.get(R);if(le!==void 0)return le;wn=!0,le=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var et=null;et=ge.H,ge.H=null,i();try{var Ot={DetermineComponentFrameRoot:function(){try{if(oe){var pr=function(){throw Error()};if(Object.defineProperty(pr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pr,[])}catch(Xn){var Ji=Xn}Reflect.construct(R,[],pr)}else{try{pr.call()}catch(Xn){Ji=Xn}R.call(pr.prototype)}}else{try{throw Error()}catch(Xn){Ji=Xn}(pr=R())&&typeof pr.catch=="function"&&pr.catch(function(){})}}catch(Xn){if(Xn&&Ji&&typeof Xn.stack=="string")return[Xn.stack,Ji.stack]}return[null,null]}};Ot.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var gt=Object.getOwnPropertyDescriptor(Ot.DetermineComponentFrameRoot,"name");gt&&gt.configurable&&Object.defineProperty(Ot.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var Ne=Ot.DetermineComponentFrameRoot(),un=Ne[0],ei=Ne[1];if(un&&ei){var Vt=un.split(`
204
204
  `),jr=ei.split(`
205
205
  `);for(Ne=gt=0;gt<Vt.length&&!Vt[gt].includes("DetermineComponentFrameRoot");)gt++;for(;Ne<jr.length&&!jr[Ne].includes("DetermineComponentFrameRoot");)Ne++;if(gt===Vt.length||Ne===jr.length)for(gt=Vt.length-1,Ne=jr.length-1;1<=gt&&0<=Ne&&Vt[gt]!==jr[Ne];)Ne--;for(;1<=gt&&0<=Ne;gt--,Ne--)if(Vt[gt]!==jr[Ne]){if(gt!==1||Ne!==1)do if(gt--,Ne--,0>Ne||Vt[gt]!==jr[Ne]){var _i=`
206
- `+Vt[gt].replace(" at new "," at ");return R.displayName&&_i.includes("<anonymous>")&&(_i=_i.replace("<anonymous>",R.displayName)),typeof R=="function"&&bi.set(R,_i),_i}while(1<=gt&&0<=Ne);break}}}finally{wn=!1,ge.H=et,s(),Error.prepareStackTrace=ae}return Vt=(Vt=R?R.displayName||R.name:"")?o(Vt):"",typeof R=="function"&&bi.set(R,Vt),Vt}function l(R){if(R==null)return"";if(typeof R=="function"){var oe=R.prototype;return a(R,!(!oe||!oe.isReactComponent))}if(typeof R=="string")return o(R);switch(R){case Oe:return o("Suspense");case ke:return o("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case be:return R=a(R.render,!1),R;case Le:return l(R.type);case te:oe=R._payload,R=R._init;try{return l(R(oe))}catch{}}return""}function u(){var R=ge.A;return R===null?null:R.getOwner()}function d(R){if(ct.call(R,"key")){var oe=Object.getOwnPropertyDescriptor(R,"key").get;if(oe&&oe.isReactWarning)return!1}return R.key!==void 0}function h(R,oe){function ae(){hr||(hr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",oe))}ae.isReactWarning=!0,Object.defineProperty(R,"key",{get:ae,configurable:!0})}function p(){var R=t(this.type);return ol[R]||(ol[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function g(R,oe,ae,et,Ot,gt){return ae=gt.ref,R={$$typeof:I,type:R,key:oe,props:gt,_owner:Ot},(ae!==void 0?ae:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:p}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function y(R,oe,ae,et,Ot,gt){if(typeof R=="string"||typeof R=="function"||R===M||R===Q||R===B||R===Oe||R===ke||R===Ae||typeof R=="object"&&R!==null&&(R.$$typeof===te||R.$$typeof===Le||R.$$typeof===U||R.$$typeof===x||R.$$typeof===be||R.$$typeof===L||R.getModuleId!==void 0)){var Ne=oe.children;if(Ne!==void 0)if(et)if(Z(Ne)){for(et=0;et<Ne.length;et++)b(Ne[et],R);Object.freeze&&Object.freeze(Ne)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(Ne,R)}else Ne="",(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(Ne+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),R===null?et="null":Z(R)?et="array":R!==void 0&&R.$$typeof===I?(et="<"+(t(R.type)||"Unknown")+" />",Ne=" Did you accidentally export a JSX literal instead of a component?"):et=typeof R,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,Ne);if(ct.call(oe,"key")){Ne=t(R);var un=Object.keys(oe).filter(function(Vt){return Vt!=="key"});et=0<un.length?"{key: someKey, "+un.join(": ..., ")+": ...}":"{key: someKey}",tu[Ne+et]||(un=0<un.length?"{"+un.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
206
+ `+Vt[gt].replace(" at new "," at ");return R.displayName&&_i.includes("<anonymous>")&&(_i=_i.replace("<anonymous>",R.displayName)),typeof R=="function"&&bi.set(R,_i),_i}while(1<=gt&&0<=Ne);break}}}finally{wn=!1,ge.H=et,s(),Error.prepareStackTrace=le}return Vt=(Vt=R?R.displayName||R.name:"")?o(Vt):"",typeof R=="function"&&bi.set(R,Vt),Vt}function l(R){if(R==null)return"";if(typeof R=="function"){var oe=R.prototype;return a(R,!(!oe||!oe.isReactComponent))}if(typeof R=="string")return o(R);switch(R){case Oe:return o("Suspense");case ke:return o("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case be:return R=a(R.render,!1),R;case Le:return l(R.type);case te:oe=R._payload,R=R._init;try{return l(R(oe))}catch{}}return""}function u(){var R=ge.A;return R===null?null:R.getOwner()}function d(R){if(ct.call(R,"key")){var oe=Object.getOwnPropertyDescriptor(R,"key").get;if(oe&&oe.isReactWarning)return!1}return R.key!==void 0}function h(R,oe){function le(){hr||(hr=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",oe))}le.isReactWarning=!0,Object.defineProperty(R,"key",{get:le,configurable:!0})}function p(){var R=t(this.type);return ol[R]||(ol[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function g(R,oe,le,et,Ot,gt){return le=gt.ref,R={$$typeof:I,type:R,key:oe,props:gt,_owner:Ot},(le!==void 0?le:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:p}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function y(R,oe,le,et,Ot,gt){if(typeof R=="string"||typeof R=="function"||R===M||R===Q||R===B||R===Oe||R===ke||R===Ae||typeof R=="object"&&R!==null&&(R.$$typeof===te||R.$$typeof===Le||R.$$typeof===U||R.$$typeof===x||R.$$typeof===be||R.$$typeof===L||R.getModuleId!==void 0)){var Ne=oe.children;if(Ne!==void 0)if(et)if(Z(Ne)){for(et=0;et<Ne.length;et++)b(Ne[et],R);Object.freeze&&Object.freeze(Ne)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(Ne,R)}else Ne="",(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(Ne+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),R===null?et="null":Z(R)?et="array":R!==void 0&&R.$$typeof===I?(et="<"+(t(R.type)||"Unknown")+" />",Ne=" Did you accidentally export a JSX literal instead of a component?"):et=typeof R,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,Ne);if(ct.call(oe,"key")){Ne=t(R);var un=Object.keys(oe).filter(function(Vt){return Vt!=="key"});et=0<un.length?"{key: someKey, "+un.join(": ..., ")+": ...}":"{key: someKey}",tu[Ne+et]||(un=0<un.length?"{"+un.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
- <%s key={someKey} {...props} />`,et,Ne,un,Ne),tu[Ne+et]=!0)}if(Ne=null,ae!==void 0&&(n(ae),Ne=""+ae),d(oe)&&(n(oe.key),Ne=""+oe.key),"key"in oe){ae={};for(var ei in oe)ei!=="key"&&(ae[ei]=oe[ei])}else ae=oe;return Ne&&h(ae,typeof R=="function"?R.displayName||R.name||"Unknown":R),g(R,Ne,gt,Ot,u(),ae)}function b(R,oe){if(typeof R=="object"&&R&&R.$$typeof!==Mh){if(Z(R))for(var ae=0;ae<R.length;ae++){var et=R[ae];_(et)&&w(et,oe)}else if(_(R))R._store&&(R._store.validated=1);else if(R===null||typeof R!="object"?ae=null:(ae=fe&&R[fe]||R["@@iterator"],ae=typeof ae=="function"?ae:null),typeof ae=="function"&&ae!==R.entries&&(ae=ae.call(R),ae!==R))for(;!(R=ae.next()).done;)_(R.value)&&w(R.value,oe)}}function _(R){return typeof R=="object"&&R!==null&&R.$$typeof===I}function w(R,oe){if(R._store&&!R._store.validated&&R.key==null&&(R._store.validated=1,oe=O(oe),!Ki[oe])){Ki[oe]=!0;var ae="";R&&R._owner!=null&&R._owner!==u()&&(ae=null,typeof R._owner.tag=="number"?ae=t(R._owner.type):typeof R._owner.name=="string"&&(ae=R._owner.name),ae=" It was passed a child from "+ae+".");var et=ge.getCurrentStack;ge.getCurrentStack=function(){var Ot=l(R.type);return et&&(Ot+=et()||""),Ot},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',oe,ae),ge.getCurrentStack=et}}function O(R){var oe="",ae=u();return ae&&(ae=t(ae.type))&&(oe=`
211
+ <%s key={someKey} {...props} />`,et,Ne,un,Ne),tu[Ne+et]=!0)}if(Ne=null,le!==void 0&&(n(le),Ne=""+le),d(oe)&&(n(oe.key),Ne=""+oe.key),"key"in oe){le={};for(var ei in oe)ei!=="key"&&(le[ei]=oe[ei])}else le=oe;return Ne&&h(le,typeof R=="function"?R.displayName||R.name||"Unknown":R),g(R,Ne,gt,Ot,u(),le)}function b(R,oe){if(typeof R=="object"&&R&&R.$$typeof!==Mh){if(Z(R))for(var le=0;le<R.length;le++){var et=R[le];_(et)&&w(et,oe)}else if(_(R))R._store&&(R._store.validated=1);else if(R===null||typeof R!="object"?le=null:(le=fe&&R[fe]||R["@@iterator"],le=typeof le=="function"?le:null),typeof le=="function"&&le!==R.entries&&(le=le.call(R),le!==R))for(;!(R=le.next()).done;)_(R.value)&&w(R.value,oe)}}function _(R){return typeof R=="object"&&R!==null&&R.$$typeof===I}function w(R,oe){if(R._store&&!R._store.validated&&R.key==null&&(R._store.validated=1,oe=O(oe),!Ki[oe])){Ki[oe]=!0;var le="";R&&R._owner!=null&&R._owner!==u()&&(le=null,typeof R._owner.tag=="number"?le=t(R._owner.type):typeof R._owner.name=="string"&&(le=R._owner.name),le=" It was passed a child from "+le+".");var et=ge.getCurrentStack;ge.getCurrentStack=function(){var Ot=l(R.type);return et&&(Ot+=et()||""),Ot},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',oe,le),ge.getCurrentStack=et}}function O(R){var oe="",le=u();return le&&(le=t(le.type))&&(oe=`
212
212
 
213
- Check the render method of \``+ae+"`."),oe||(R=t(R))&&(oe=`
213
+ Check the render method of \``+le+"`."),oe||(R=t(R))&&(oe=`
214
214
 
215
- Check the top-level render call using <`+R+">."),oe}var N=le,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),Le=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),Ae=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ge=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ct=Object.prototype.hasOwnProperty,ve=Object.assign,L=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Me,Ye,Zt,Hi,Vr;r.__reactDisabledLog=!0;var Pt,sl,wn=!1,bi=new(typeof WeakMap=="function"?WeakMap:Map),Mh=Symbol.for("react.client.reference"),hr,ol={},tu={},Ki={};Al.Fragment=M,Al.jsx=function(R,oe,ae,et,Ot){return y(R,oe,ae,!1,et,Ot)},Al.jsxs=function(R,oe,ae,et,Ot){return y(R,oe,ae,!0,et,Ot)}}()),Al}process.env.NODE_ENV==="production"?Lg.exports=Jq():Lg.exports=Yq();var he=Lg.exports;let Fa=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const hT=2e3,sa=console;class Xq{constructor(e,n,r,i=hT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||hT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(sa.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(sa.debug(e),sa.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):sa.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){sa.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(sa.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Ir=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var mc=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(mc||{});const Zq=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),eW=t=>JSON.parse(Zq(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),pT=t=>{try{return t&&tW(t,".")===2?eW(t.split(".")[1]):null}catch(e){console.warn(e)}return null},tW=(t,e)=>t.split(e).length-1,Vg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function nW(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const fb=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=pT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:pT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=nW(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===Vg.access_token_invalid?u=l:n===Vg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},db=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),fb(r,e,n)},Kl=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},mT=(t,e=0)=>t?Kl(e,t.expiresAt)>0:!1,nA=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!mT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await nh({milliseconds:e});r=r-1}return{isTokensValid:mT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},rA=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},$a=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),gT="7.22.32";let yT=null,Xf;const nh=({milliseconds:t})=>new Promise(e=>$a.setTimeout(e,t)),iA=(t="/")=>{try{Xf=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:Xf.signal}).catch(e=>{console.log(e)}),nh({milliseconds:150*1e3}).then(iA)}catch(e){console.log(e)}},vT=()=>{Xf&&Xf.abort()},rW=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),iW=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await nh({milliseconds:2e3}),t.reload()},sW=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},kn=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:sW(e.configurationName)},[i.port2])}),xr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,vT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await kn(i)({type:"claim"})}catch{return null}const s=async g=>kn(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await kn(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==gT&&(console.warn(`Service worker ${O} version mismatch with js client version ${gT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,vT))),{tokens:db(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{yT==null&&(yT="not_null",iA(g))},l=g=>kn(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await kn(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,kn(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await kn(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>rW(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await kn(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,kn(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await kn(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,kn(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await kn(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await kn(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await kn(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await kn(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},ua={},oW=(t,e=window.sessionStorage,n)=>{if(!ua[t]&&e){const i=e.getItem(t);i&&(ua[t]=JSON.parse(i))}const r=1e3*n;return ua[t]&&ua[t].timestamp+r>Date.now()?ua[t].result:null},aW=(t,e,n=window.sessionStorage)=>{const r=Date.now();ua[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function sA(t){return new TextEncoder().encode(t)}function oA(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function lW(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const hb=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),oA(e)};function bT(t){return oA(lW(t))}const cW={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},uW=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:bT(JSON.stringify(n)),payload:bT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=sA(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=hb(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},fW={sign:uW},dW=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},hW=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},pW={generate:dW,neuter:hW},mW=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,sA(r));return hb(new Uint8Array(i))},gW={thumbprint:mW},yW=t=>async e=>await pW.generate(t)(e),aA=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(vW()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await gW.thumbprint(t)(n,e.digestAlgorithm);return await fW.sign(t)(n,{kid:a},o,e)},vW=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},lA=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",bW=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%jg.length;e.push(jg[r])}return e.join("")},Bg=t=>{const e=new Uint8Array(t),{hasCrypto:n}=lA();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*jg.length|0;return bW(e)};function _W(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function cA(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",_W(t)).then(r=>e(hb(new Uint8Array(r))),r=>n(r))})}const EW=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=lA();return e?cA(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},wW=60*60,TW=t=>async(e,n=wW,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=oW(o,r,n);if(a)return new qg(a);const l=await qc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return aW(o,u,r),new qg(u)},qc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await qc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},Ug={refresh_token:"refresh_token",access_token:"access_token"},_T=t=>async(e,n,r=Ug.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await qc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},SW=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await qc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(Zf)&&(p=d.headers.get(Zf)),{success:!0,status:d.status,data:db(h,i,o),demonstratingProofOfPossessionNonce:p}},OW=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Bg(128),s=await EW(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},Zf="DPoP-Nonce",kW=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await qc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(Zf)&&(u=l.headers.get(Zf));const d=await l.json();return{success:!0,data:{state:n.state,tokens:db(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function ET(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await Sf(t)(r,0,e,n);return await xr(t.configuration,t.configurationName)||await Ir(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function uA(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await xr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await ET(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await ET(t,e,n):(t.publishEvent($i.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=gc(t,t.tokens.expiresAt,n)),t.tokens):null}const gc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&$a.clearTimeout(t.timeoutId),$a.setTimeout(async()=>{const i={timeLeft:Kl(r,e)};t.publishEvent($i.eventNames.token_timer,i),await uA(t,!1,n)},1e3)},as={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},NW=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await xr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=Kl(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Ir(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=fb(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=Kl(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=Kl(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},Sf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await nh({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>pb(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await xr(a,t.configurationName);h?d=h.getLoginParams():d=Ir(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent($i.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await Sf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await NW(t)(a,t.configurationName,t.tokens,r);switch(d){case as.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case as.NOT_CONNECTED:return e(null),{tokens:null,status:null};case as.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case as.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent($i.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case as.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case as.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted&&as.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted&&as.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const M=await SW(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(M.success){const{isValid:B,reason:Q}=rA(M.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(M.data),M.demonstratingProofOfPossessionNonce){const x=await xr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce):await Ir(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:M.success}),t.publishEvent($i.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:M.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:M}),M.status>=400&&M.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${M.status}`}),{tokens:null,status:"SESSION_LOST"}):await Sf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{Sf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},pb=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},AW=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>pb(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&$a.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=gc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},IW=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>pb(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new Xq(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},xW=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),CW=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function DW(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const RW=()=>{const{name:t,version:e}=DW();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=CW(navigator);return!xW(n)},MW=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await xr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=gc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Ir(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=fb(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=gc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},fA=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},Il=t=>{const e=fA(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},yc=t=>{const e=fA(t),{search:n}=e;return PW(n)},PW=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},FW=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Bg(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Bg(12));const g={nonce:p.nonce},y=await xr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Ir(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await OW(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},$W=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=yc(l).session_state,d=await xr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Ir(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=yc(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await yW(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Ir(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await aA(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await kW(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const M=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=rA(M,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(M.refreshToken&&!M.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&M!=null&&M.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Ir(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:M,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},wT={access_token:"access_token",refresh_token:"refresh_token"},pm=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},LW=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},VW=t=>async e=>{$a.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await xr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Ir(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},jW=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(wT.access_token)){const M=pm(o,":revoke_access_token"),B=_T(n)(O,I,Ug.access_token,u.client_id,M);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(wT.refresh_token)){const M=pm(o,":revoke_refresh_token"),B=_T(n)(O,P,Ug.refresh_token,u.client_id,M);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=pm(o,":oidc");if(_&&_.no_reload==="true")return;const w=LW(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},dA=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await nA(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},BW=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await dA(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},hA=()=>fetch;let qg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const fo={},UW=(t,e=new Fa)=>(n,r="default")=>(fo[r]||(fo[r]=new $i(n,r,t,e)),fo[r]),qW=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=gc(t,e.expiresAt),{callbackPath:n}},WW=t=>Math.floor(Math.random()*t),Wg=class pA{constructor(e,n="default",r,i=new Fa){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new Fa;const a=e.service_worker_update_require_callback??iW(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??mc.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??Vg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??RW,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??cW,preload_user_info:e.preload_user_info??!1},this.getFetch=r??hA,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=WW(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(fo,e)&&n)throw Error(`OIDC library does seem initialized.
216
- Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return fo[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=yc(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=yc(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new qg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await xr(this.configuration,this.configurationName)?window.localStorage:null;return await TW(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=MW(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await IW(this,fo,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?AW(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=FW(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await $W(this)(e),i=r.tokens;return this.tokens=i,await xr(this.configuration,this.configurationName)||Ir(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(pA.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await cA(e),...i};if(await xr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Ir(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await aA(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=qW(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=BW(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return $a.clearTimeout(this.timeoutId),this.renewTokensPromise=uA(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await VW(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=jW(this,fo,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Wg.getOrCreate=(t,e)=>(n,r="default")=>UW(t,e)(n,r),Wg.eventNames=qe;let $i=Wg;const Of=class mA{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new mA($i.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return nA(i,e,n)}fetchWithTokens(e,n=!1){return dA(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Of.getOrCreate=(t,e=new Fa)=>(n,r="default")=>new Of($i.getOrCreate(t,e)(n,r)),Of.eventNames=$i.eventNames;let tt=Of;const gA=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),zW=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),QW=()=>Math.random().toString(36).slice(2,8),GW=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},HW=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),KW=()=>HW(window,GW(window,document),QW),yA=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),JW=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=le.useState(!1);le.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():KW()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||gA,a=e||yA;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},YW=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),XW=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),ZW=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),ez=({configurationName:t})=>(le.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),tz=({configurationName:t})=>{const e=yc(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return le.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},nz=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?Il(window.location.href):"",[u,d]=le.useState(l);le.useEffect(()=>{const p=()=>d(Il(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=Il(n);if(r&&u===Il(r))return he.jsx(ez,{configurationName:o});if(i&&u===Il(i))return he.jsx(tz,{configurationName:o});switch(u){case h:return he.jsx(JW,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},rz=le.memo(nz),TT={name:"",data:null},iz=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=le.useState(!0),s=tt.get,o=s(n);return le.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},xl=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},sz=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=yA,authenticatingComponent:i=zW,loadingComponent:s=YW,serviceWorkerNotSupportedComponent:o=XW,authenticatingErrorComponent:a=gA,sessionLostComponent:l=ZW,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(Le="default")=>tt.getOrCreate(y??hA,b??new Fa)(e,Le),[w,O]=le.useState(!0),[N,I]=le.useState(TT),[P,M]=le.useState("default");le.useEffect(()=>{const Le=_(n).subscribeEvents((te,Ae)=>{g&&g(n,te,Ae)});return()=>{_(n).removeEventSubscription(Le)}},[n,g]),le.useEffect(()=>{const Le=_(n).subscribeEvents((te,Ae)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:Ae})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:Ae})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:Ae}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:Ae})});return M(n),O(!1),()=>{_(n).removeEventSubscription(Le),I(TT)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(rz,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new Fa,children:he.jsx(iz,{loadingComponent:x,configurationName:n,children:t})})})}},vA="default",mm=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},oz=(t=vA)=>{const e=tt.get,[n,r]=le.useState(mm(e,t));return le.useEffect(()=>{let i=!0;const s=e(t);r(mm(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(mm(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},bA={accessToken:null,accessTokenPayload:null},az=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return bA};function lz(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const cz=(t=vA)=>{const e=tt.get,[n,r]=le.useState(az(t));return le.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:lz(s,u)}:bA)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};var Zu={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class uz extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Rt(t){return new uz(`Syntax Error: Unexpected token at ${me} in ${t}`)}function lr(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var ef=/ +(?=[^\s])/y;function fz(t){for(var e=t.split(`
215
+ Check the top-level render call using <`+R+">."),oe}var N=ae,I=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),U=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),Oe=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),Le=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),Ae=Symbol.for("react.offscreen"),fe=Symbol.iterator,Ee=Symbol.for("react.client.reference"),ge=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ct=Object.prototype.hasOwnProperty,ve=Object.assign,L=Symbol.for("react.client.reference"),Z=Array.isArray,Y=0,ee,we,Me,Ye,Zt,Hi,Vr;r.__reactDisabledLog=!0;var Pt,sl,wn=!1,bi=new(typeof WeakMap=="function"?WeakMap:Map),Mh=Symbol.for("react.client.reference"),hr,ol={},tu={},Ki={};Al.Fragment=M,Al.jsx=function(R,oe,le,et,Ot){return y(R,oe,le,!1,et,Ot)},Al.jsxs=function(R,oe,le,et,Ot){return y(R,oe,le,!0,et,Ot)}}()),Al}process.env.NODE_ENV==="production"?Lg.exports=Jq():Lg.exports=Yq();var he=Lg.exports;let Fa=class{open(e){window.location.href=e}reload(){window.location.reload()}getCurrentHref(){return window.location.href}getPath(){const e=window.location;return e.pathname+(e.search||"")+(e.hash||"")}getOrigin(){return window.origin}};const hT=2e3,sa=console;class Xq{constructor(e,n,r,i=hT,s=!0){this._callback=e,this._client_id=n,this._url=r,this._interval=i||hT,this._stopOnError=s;const o=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substring(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.width=0,this._frame.height=0,this._frame.src=r}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1)})}_message(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&(e.data==="error"?(sa.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):e.data==="changed"?(sa.debug(e),sa.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):sa.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}start(e){sa.debug("CheckSessionIFrame.start :"+e),this.stop();const n=()=>{this._frame.contentWindow.postMessage(this._client_id+" "+e,this._frame_origin)};n(),this._timer=window.setInterval(n,this._interval)}stop(){this._timer&&(sa.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}const qe={service_worker_not_supported_by_browser:"service_worker_not_supported_by_browser",token_acquired:"token_acquired",logout_from_another_tab:"logout_from_another_tab",logout_from_same_tab:"logout_from_same_tab",token_renewed:"token_renewed",token_timer:"token_timer",loginAsync_begin:"loginAsync_begin",loginAsync_error:"loginAsync_error",loginCallbackAsync_begin:"loginCallbackAsync_begin",loginCallbackAsync_end:"loginCallbackAsync_end",loginCallbackAsync_error:"loginCallbackAsync_error",refreshTokensAsync_begin:"refreshTokensAsync_begin",refreshTokensAsync:"refreshTokensAsync",refreshTokensAsync_end:"refreshTokensAsync_end",refreshTokensAsync_error:"refreshTokensAsync_error",refreshTokensAsync_silent_error:"refreshTokensAsync_silent_error",tryKeepExistingSessionAsync_begin:"tryKeepExistingSessionAsync_begin",tryKeepExistingSessionAsync_end:"tryKeepExistingSessionAsync_end",tryKeepExistingSessionAsync_error:"tryKeepExistingSessionAsync_error",silentLoginAsync_begin:"silentLoginAsync_begin",silentLoginAsync:"silentLoginAsync",silentLoginAsync_end:"silentLoginAsync_end",silentLoginAsync_error:"silentLoginAsync_error",syncTokensAsync_begin:"syncTokensAsync_begin",syncTokensAsync_lock_not_available:"syncTokensAsync_lock_not_available",syncTokensAsync_end:"syncTokensAsync_end",syncTokensAsync_error:"syncTokensAsync_error",tokensInvalidAndWaitingActionsToRefresh:"tokensInvalidAndWaitingActionsToRefresh"},Ir=(t,e=sessionStorage)=>{const n=b=>(e[`oidc.${t}`]=JSON.stringify({tokens:null,status:b}),Promise.resolve()),r=async()=>{if(!e[`oidc.${t}`])return e[`oidc.${t}`]=JSON.stringify({tokens:null,status:null}),{tokens:null,status:null};const b=JSON.parse(e[`oidc.${t}`]);return Promise.resolve({tokens:b.tokens,status:b.status})},i=b=>{e[`oidc.${t}`]=JSON.stringify({tokens:b})},s=async b=>{e[`oidc.session_state.${t}`]=b},o=async()=>e[`oidc.session_state.${t}`],a=b=>{e[`oidc.nonce.${t}`]=b.nonce},l=b=>{e[`oidc.jwk.${t}`]=JSON.stringify(b)},u=()=>JSON.parse(e[`oidc.jwk.${t}`]),d=async()=>({nonce:e[`oidc.nonce.${t}`]}),h=async b=>{e[`oidc.dpop_nonce.${t}`]=b},p=()=>e[`oidc.dpop_nonce.${t}`],g=()=>e[`oidc.${t}`]?JSON.stringify({tokens:JSON.parse(e[`oidc.${t}`]).tokens}):null,y={};return{clearAsync:n,initAsync:r,setTokens:i,getTokens:g,setSessionStateAsync:s,getSessionStateAsync:o,setNonceAsync:a,getNonceAsync:d,setLoginParams:b=>{y[t]=b,e[`oidc.login.${t}`]=JSON.stringify(b)},getLoginParams:()=>{const b=e[`oidc.login.${t}`];return b?(y[t]||(y[t]=JSON.parse(b)),y[t]):(console.warn(`storage[oidc.login.${t}] is empty, you should have an bad OIDC or code configuration somewhere.`),null)},getStateAsync:async()=>e[`oidc.state.${t}`],setStateAsync:async b=>{e[`oidc.state.${t}`]=b},getCodeVerifierAsync:async()=>e[`oidc.code_verifier.${t}`],setCodeVerifierAsync:async b=>{e[`oidc.code_verifier.${t}`]=b},setDemonstratingProofOfPossessionNonce:h,getDemonstratingProofOfPossessionNonce:p,setDemonstratingProofOfPossessionJwkAsync:l,getDemonstratingProofOfPossessionJwkAsync:u}};var mc=(t=>(t.AutomaticBeforeTokenExpiration="AutomaticBeforeTokensExpiration",t.AutomaticOnlyWhenFetchExecuted="AutomaticOnlyWhenFetchExecuted",t))(mc||{});const Zq=t=>decodeURIComponent(Array.prototype.map.call(atob(t),e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),eW=t=>JSON.parse(Zq(t.replaceAll(/-/g,"+").replaceAll(/_/g,"/"))),pT=t=>{try{return t&&tW(t,".")===2?eW(t.split(".")[1]):null}catch(e){console.warn(e)}return null},tW=(t,e)=>t.split(e).length-1,Vg={access_token_or_id_token_invalid:"access_token_or_id_token_invalid",access_token_invalid:"access_token_invalid",id_token_invalid:"id_token_invalid"};function nW(t,e,n){if(t.issuedAt){if(typeof t.issuedAt=="string")return parseInt(t.issuedAt,10)}else return e&&e.iat?e.iat:n&&n.iat?n.iat:new Date().getTime()/1e3;return t.issuedAt}const fb=(t,e=null,n)=>{if(!t)return null;let r;const i=typeof t.expiresIn=="string"?parseInt(t.expiresIn,10):t.expiresIn;t.accessTokenPayload!==void 0?r=t.accessTokenPayload:r=pT(t.accessToken);let s;e!=null&&"idToken"in e&&!("idToken"in t)?s=e.idToken:s=t.idToken;const o=t.idTokenPayload?t.idTokenPayload:pT(s),a=o&&o.exp?o.exp:Number.MAX_VALUE,l=r&&r.exp?r.exp:t.issuedAt+i;t.issuedAt=nW(t,r,o);let u;t.expiresAt?u=t.expiresAt:n===Vg.access_token_invalid?u=l:n===Vg.id_token_invalid?u=a:u=a<l?a:l;const d={...t,idTokenPayload:o,accessTokenPayload:r,expiresAt:u,idToken:s};if(e!=null&&"refreshToken"in e&&!("refreshToken"in t)){const h=e.refreshToken;return{...d,refreshToken:h}}return d},db=(t,e,n)=>{if(!t)return null;if(!t.issued_at){const i=new Date().getTime()/1e3;t.issued_at=i}const r={accessToken:t.access_token,expiresIn:t.expires_in,idToken:t.id_token,scope:t.scope,tokenType:t.token_type,issuedAt:t.issued_at};return"refresh_token"in t&&(r.refreshToken=t.refresh_token),t.accessTokenPayload!==void 0&&(r.accessTokenPayload=t.accessTokenPayload),t.idTokenPayload!==void 0&&(r.idTokenPayload=t.idTokenPayload),fb(r,e,n)},Kl=(t,e)=>{const n=new Date().getTime()/1e3,r=e-n;return Math.round(r-t)},mT=(t,e=0)=>t?Kl(e,t.expiresAt)>0:!1,nA=async(t,e=200,n=50)=>{let r=n;if(!t.getTokens())return null;for(;!mT(t.getTokens(),t.configuration.refresh_time_before_tokens_expiration_in_second)&&r>0;){if(t.configuration.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted){await t.renewTokensAsync({});break}else await nh({milliseconds:e});r=r-1}return{isTokensValid:mT(t.getTokens()),tokens:t.getTokens(),numberWaited:r-n}},rA=(t,e,n)=>{if(t.idTokenPayload){const r=t.idTokenPayload;if(n.issuer!==r.iss)return{isValid:!1,reason:`Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${r.iss}`};const i=new Date().getTime()/1e3;if(r.exp&&r.exp<i)return{isValid:!1,reason:`Token expired (idTokenPayload exp) ${r.exp} < (currentTimeUnixSecond) ${i}`};const s=60*60*24*7;if(r.iat&&r.iat+s<i)return{isValid:!1,reason:`Token is used from too long time (idTokenPayload iat + timeInSevenDays) ${r.iat+s} < (currentTimeUnixSecond) ${i}`};if(r.nonce&&r.nonce!==e)return{isValid:!1,reason:`Nonce does not match (idTokenPayload nonce) ${r.nonce} !== (nonce) ${e}`}}return{isValid:!0,reason:""}},$a=function(){const t=typeof window>"u"?global:window;return{setTimeout:setTimeout.bind(t),clearTimeout:clearTimeout.bind(t),setInterval:setInterval.bind(t),clearInterval:clearInterval.bind(t)}}(),gT="7.22.32";let yT=null,Xf;const nh=({milliseconds:t})=>new Promise(e=>$a.setTimeout(e,t)),iA=(t="/")=>{try{Xf=new AbortController,fetch(`${t}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`,{signal:Xf.signal}).catch(e=>{console.log(e)}),nh({milliseconds:150*1e3}).then(iA)}catch(e){console.log(e)}},vT=()=>{Xf&&Xf.abort()},rW=(t="/")=>fetch(`${t}OidcKeepAliveServiceWorker.json`,{headers:{"oidc-vanilla":"true"}}).then(e=>e.statusText==="oidc-service-worker").catch(e=>{console.log(e)}),iW=t=>async(e,n)=>{n(),await e.update();const r=await e.unregister();console.log(`Service worker unregistration ${r?"successful":"failed"}`),await nh({milliseconds:2e3}),t.reload()},sW=t=>{const e=sessionStorage.getItem(`oidc.tabId.${t}`);if(e)return e;const n=globalThis.crypto.randomUUID();return sessionStorage.setItem(`oidc.tabId.${t}`,n),n},kn=t=>e=>new Promise(function(n,r){const i=new MessageChannel;i.port1.onmessage=function(s){s!=null&&s.data.error?r(s.data.error):n(s.data),i.port1.close(),i.port2.close()},t.active.postMessage({...e,tabId:sW(e.configurationName)},[i.port2])}),xr=async(t,e)=>{var n;const r=t.service_worker_relative_url;if(typeof window>"u"||typeof navigator>"u"||!navigator.serviceWorker||!r||t.service_worker_activate()===!1)return null;let i=null;t.service_worker_register?i=await t.service_worker_register(r):(i=await navigator.serviceWorker.register(r),i.active&&i.waiting&&(console.log("Detected new service worker waiting, unregistering and reloading"),await((n=t.service_worker_update_require_callback)==null?void 0:n.call(t,i,vT))));try{await navigator.serviceWorker.ready,navigator.serviceWorker.controller||await kn(i)({type:"claim"})}catch{return null}const s=async g=>kn(i)({type:"clear",data:{status:g},configurationName:e}),o=async(g,y,b)=>{var _;const w=await kn(i)({type:"init",data:{oidcServerConfiguration:g,where:y,oidcConfiguration:{token_renew_mode:b.token_renew_mode,service_worker_convert_all_requests_to_cors:b.service_worker_convert_all_requests_to_cors}},configurationName:e}),O=w.version;return O!==gT&&(console.warn(`Service worker ${O} version mismatch with js client version ${gT}, unregistering and reloading`),await((_=b.service_worker_update_require_callback)==null?void 0:_.call(b,i,vT))),{tokens:db(w.tokens,null,b.token_renew_mode),status:w.status}},a=(g="/")=>{yT==null&&(yT="not_null",iA(g))},l=g=>kn(i)({type:"setSessionState",data:{sessionState:g},configurationName:e}),u=async()=>(await kn(i)({type:"getSessionState",data:null,configurationName:e})).sessionState,d=g=>(sessionStorage[`oidc.nonce.${e}`]=g.nonce,kn(i)({type:"setNonce",data:{nonce:g},configurationName:e})),h=async()=>{let g=(await kn(i)({type:"getNonce",data:null,configurationName:e})).nonce;return g||(g=sessionStorage[`oidc.nonce.${e}`],console.warn("nonce not found in service worker, using sessionStorage")),{nonce:g}},p={};return{clearAsync:s,initAsync:o,startKeepAliveServiceWorker:()=>a(t.service_worker_keep_alive_path),isServiceWorkerProxyActiveAsync:()=>rW(t.service_worker_keep_alive_path),setSessionStateAsync:l,getSessionStateAsync:u,setNonceAsync:d,getNonceAsync:h,setLoginParams:g=>{p[e]=g,localStorage[`oidc.login.${e}`]=JSON.stringify(g)},getLoginParams:()=>{const g=localStorage[`oidc.login.${e}`];return p[e]||(p[e]=JSON.parse(g)),p[e]},getStateAsync:async()=>{let g=(await kn(i)({type:"getState",data:null,configurationName:e})).state;return g||(g=sessionStorage[`oidc.state.${e}`],console.warn("state not found in service worker, using sessionStorage")),g},setStateAsync:async g=>(sessionStorage[`oidc.state.${e}`]=g,kn(i)({type:"setState",data:{state:g},configurationName:e})),getCodeVerifierAsync:async()=>{let g=(await kn(i)({type:"getCodeVerifier",data:null,configurationName:e})).codeVerifier;return g||(g=sessionStorage[`oidc.code_verifier.${e}`],console.warn("codeVerifier not found in service worker, using sessionStorage")),g},setCodeVerifierAsync:async g=>(sessionStorage[`oidc.code_verifier.${e}`]=g,kn(i)({type:"setCodeVerifier",data:{codeVerifier:g},configurationName:e})),setDemonstratingProofOfPossessionNonce:async g=>{await kn(i)({type:"setDemonstratingProofOfPossessionNonce",data:{demonstratingProofOfPossessionNonce:g},configurationName:e})},getDemonstratingProofOfPossessionNonce:async()=>(await kn(i)({type:"getDemonstratingProofOfPossessionNonce",data:null,configurationName:e})).demonstratingProofOfPossessionNonce,setDemonstratingProofOfPossessionJwkAsync:async g=>{const y=JSON.stringify(g);await kn(i)({type:"setDemonstratingProofOfPossessionJwk",data:{demonstratingProofOfPossessionJwkJson:y},configurationName:e})},getDemonstratingProofOfPossessionJwkAsync:async()=>{const g=await kn(i)({type:"getDemonstratingProofOfPossessionJwk",data:null,configurationName:e});return g.demonstratingProofOfPossessionJwkJson?JSON.parse(g.demonstratingProofOfPossessionJwkJson):null}}},ua={},oW=(t,e=window.sessionStorage,n)=>{if(!ua[t]&&e){const i=e.getItem(t);i&&(ua[t]=JSON.parse(i))}const r=1e3*n;return ua[t]&&ua[t].timestamp+r>Date.now()?ua[t].result:null},aW=(t,e,n=window.sessionStorage)=>{const r=Date.now();ua[t]={result:e,timestamp:r},n&&n.setItem(t,JSON.stringify({result:e,timestamp:r}))};function sA(t){return new TextEncoder().encode(t)}function oA(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function lW(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,n){return String.fromCharCode(parseInt(n,16))})}const hb=t=>{let e="";return t.forEach(function(n){e+=String.fromCharCode(n)}),oA(e)};function bT(t){return oA(lW(t))}const cW={importKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256",hash:{name:"ES256"}},signAlgorithm:{name:"ECDSA",hash:{name:"SHA-256"}},generateKeyAlgorithm:{name:"ECDSA",namedCurve:"P-256"},digestAlgorithm:{name:"SHA-256"},jwtHeaderAlgorithm:"ES256"},uW=t=>async(e,n,r,i,s="dpop+jwt")=>{switch(e=Object.assign({},e),n.typ=s,n.alg=i.jwtHeaderAlgorithm,n.alg){case"ES256":n.jwk={kty:e.kty,crv:e.crv,x:e.x,y:e.y};break;case"RS256":n.jwk={kty:e.kty,n:e.n,e:e.e,kid:n.kid};break;default:throw new Error("Unknown or not implemented JWS algorithm")}const o={protected:bT(JSON.stringify(n)),payload:bT(JSON.stringify(r))},a=i.importKeyAlgorithm,l=!0,u=["sign"],d=await t.crypto.subtle.importKey("jwk",e,a,l,u),h=sA(`${o.protected}.${o.payload}`),p=i.signAlgorithm,g=await t.crypto.subtle.sign(p,d,h);return o.signature=hb(new Uint8Array(g)),`${o.protected}.${o.payload}.${o.signature}`},fW={sign:uW},dW=t=>async e=>{const n=e,r=!0,i=["sign","verify"],s=await t.crypto.subtle.generateKey(n,r,i);return await t.crypto.subtle.exportKey("jwk",s.privateKey)},hW=t=>{const e=Object.assign({},t);return delete e.d,e.key_ops=["verify"],e},pW={generate:dW,neuter:hW},mW=t=>async(e,n)=>{let r;switch(e.kty){case"EC":r='{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV",e.crv).replace("X",e.x).replace("Y",e.y);break;case"RSA":r='{"e":"E","kty":"RSA","n":"N"}'.replace("E",e.e).replace("N",e.n);break;default:throw new Error("Unknown or not implemented JWK type")}const i=await t.crypto.subtle.digest(n,sA(r));return hb(new Uint8Array(i))},gW={thumbprint:mW},yW=t=>async e=>await pW.generate(t)(e),aA=t=>e=>async(n,r="POST",i,s={})=>{const o={jti:btoa(vW()),htm:r,htu:i,iat:Math.round(Date.now()/1e3),...s},a=await gW.thumbprint(t)(n,e.digestAlgorithm);return await fW.sign(t)(n,{kid:a},o,e)},vW=()=>{const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef";let n=0,r="";for(let i=0;i<36;i++)t[i]!=="-"&&t[i]!=="4"&&(n=Math.random()*16|0),t[i]==="x"?r+=e[n]:t[i]==="y"?(n&=3,n|=8,r+=e[n]):r+=t[i];return r},lA=()=>{const t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return{hasCrypto:t,hasSubtleCrypto:e}},jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",bW=t=>{const e=[];for(let n=0;n<t.byteLength;n+=1){const r=t[n]%jg.length;e.push(jg[r])}return e.join("")},Bg=t=>{const e=new Uint8Array(t),{hasCrypto:n}=lA();if(n)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.random()*jg.length|0;return bW(e)};function _W(t){const e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function cA(t){return new Promise((e,n)=>{crypto.subtle.digest("SHA-256",_W(t)).then(r=>e(hb(new Uint8Array(r))),r=>n(r))})}const EW=t=>{if(t.length<43||t.length>128)return Promise.reject(new Error("Invalid code length."));const{hasSubtleCrypto:e}=lA();return e?cA(t):Promise.reject(new Error("window.crypto.subtle is unavailable."))},wW=60*60,TW=t=>async(e,n=wW,r=window.sessionStorage,i=1e4)=>{const s=`${e}/.well-known/openid-configuration`,o=`oidc.server:${e}`,a=oW(o,r,n);if(a)return new qg(a);const l=await qc(t)(s,{},i);if(l.status!==200)return null;const u=await l.json();return aW(o,u,r),new qg(u)},qc=t=>async(e,n={},r=1e4,i=0)=>{let s;try{const o=new AbortController;setTimeout(()=>o.abort(),r),s=await t(e,{...n,signal:o.signal})}catch(o){if(o.name==="AbortError"||o.message==="Network request failed"){if(i<=1)return await qc(t)(e,n,r,i+1);throw o}else throw console.error(o.message),o}return s},Ug={refresh_token:"refresh_token",access_token:"access_token"},_T=t=>async(e,n,r=Ug.refresh_token,i,s={},o=1e4)=>{const a={token:n,token_type_hint:r,client_id:i};for(const[d,h]of Object.entries(s))a[d]===void 0&&(a[d]=h);const l=[];for(const d in a){const h=encodeURIComponent(d),p=encodeURIComponent(a[d]);l.push(`${h}=${p}`)}const u=l.join("&");return(await qc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:u},o)).status!==200?{success:!1}:{success:!0}},SW=t=>async(e,n,r,i,s={},o,a=1e4)=>{for(const[g,y]of Object.entries(r))n[g]===void 0&&(n[g]=y);const l=[];for(const g in n){const y=encodeURIComponent(g),b=encodeURIComponent(n[g]);l.push(`${y}=${b}`)}const u=l.join("&"),d=await qc(t)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...s},body:u},a);if(d.status!==200)return{success:!1,status:d.status,demonstratingProofOfPossessionNonce:null};const h=await d.json();let p=null;return d.headers.has(Zf)&&(p=d.headers.get(Zf)),{success:!0,status:d.status,data:db(h,i,o),demonstratingProofOfPossessionNonce:p}},OW=(t,e)=>async(n,r)=>{r=r?{...r}:{};const i=Bg(128),s=await EW(i);await t.setCodeVerifierAsync(i),await t.setStateAsync(r.state),r.code_challenge=s,r.code_challenge_method="S256";let o="";if(r)for(const[a,l]of Object.entries(r))o===""?o+="?":o+="&",o+=`${a}=${encodeURIComponent(l)}`;e.open(`${n}${o}`)},Zf="DPoP-Nonce",kW=t=>async(e,n,r,i,s=1e4)=>{n=n?{...n}:{},n.code_verifier=await t.getCodeVerifierAsync();const o=[];for(const h in n){const p=encodeURIComponent(h),g=encodeURIComponent(n[h]);o.push(`${p}=${g}`)}const a=o.join("&"),l=await qc(fetch)(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",...r},body:a},s);if(await Promise.all([t.setCodeVerifierAsync(null),t.setStateAsync(null)]),l.status!==200)return{success:!1,status:l.status};let u=null;l.headers.has(Zf)&&(u=l.headers.get(Zf));const d=await l.json();return{success:!0,data:{state:n.state,tokens:db(d,null,i),demonstratingProofOfPossessionNonce:u}}};async function ET(t,e,n){const r=o=>{t.tokens=o},{tokens:i,status:s}=await Sf(t)(r,0,e,n);return await xr(t.configuration,t.configurationName)||await Ir(t.configurationName,t.configuration.storage).setTokens(t.tokens),t.tokens?i:(await t.destroyAsync(s),null)}async function uA(t,e=!1,n=null){const r=t.configuration,i=`${r.client_id}_${t.configurationName}_${r.authority}`;let s;const o=await xr(t.configuration,t.configurationName);if((r==null?void 0:r.storage)===(window==null?void 0:window.sessionStorage)&&!o||!navigator.locks)s=await ET(t,e,n);else{let a="retry";for(;a==="retry";)a=await navigator.locks.request(i,{ifAvailable:!0},async l=>l?await ET(t,e,n):(t.publishEvent($i.eventNames.syncTokensAsync_lock_not_available,{lock:"lock not available"}),"retry"));s=a}return s?(t.timeoutId&&(t.timeoutId=gc(t,t.tokens.expiresAt,n)),t.tokens):null}const gc=(t,e,n=null)=>{const r=t.configuration.refresh_time_before_tokens_expiration_in_second;return t.timeoutId&&$a.clearTimeout(t.timeoutId),$a.setTimeout(async()=>{const i={timeLeft:Kl(r,e)};t.publishEvent($i.eventNames.token_timer,i),await uA(t,!1,n)},1e3)},as={FORCE_REFRESH:"FORCE_REFRESH",SESSION_LOST:"SESSION_LOST",NOT_CONNECTED:"NOT_CONNECTED",TOKENS_VALID:"TOKENS_VALID",TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID",LOGOUT_FROM_ANOTHER_TAB:"LOGOUT_FROM_ANOTHER_TAB",REQUIRE_SYNC_TOKENS:"REQUIRE_SYNC_TOKENS"},NW=t=>async(e,n,r,i=!1)=>{const s={nonce:null};if(!r)return{tokens:null,status:"NOT_CONNECTED",nonce:s};let o=s;const a=await t.initAsync(e.authority,e.authority_configuration),l=await xr(e,n);if(l){const{status:d,tokens:h}=await l.initAsync(a,"syncTokensAsync",e);if(d==="LOGGED_OUT")return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};if(d==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(!d||!h)return{tokens:null,status:"REQUIRE_SYNC_TOKENS",nonce:s};if(h.issuedAt!==r.issuedAt){const p=Kl(e.refresh_time_before_tokens_expiration_in_second,h.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",g=await l.getNonceAsync();return{tokens:h,status:p,nonce:g}}o=await l.getNonceAsync()}else{const d=Ir(n,e.storage??sessionStorage),h=await d.initAsync();let{tokens:p}=h;const{status:g}=h;if(p&&(p=fb(p,t.tokens,e.token_renew_mode)),p){if(g==="SESSIONS_LOST")return{tokens:null,status:"SESSIONS_LOST",nonce:s};if(p.issuedAt!==r.issuedAt){const y=Kl(e.refresh_time_before_tokens_expiration_in_second,p.expiresAt)>0?"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID":"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_INVALID",b=await d.getNonceAsync();return{tokens:p,status:y,nonce:b}}}else return{tokens:null,status:"LOGOUT_FROM_ANOTHER_TAB",nonce:s};o=await d.getNonceAsync()}const u=Kl(e.refresh_time_before_tokens_expiration_in_second,r.expiresAt)>0?"TOKENS_VALID":"TOKENS_INVALID";return i?{tokens:r,status:"FORCE_REFRESH",nonce:o}:{tokens:r,status:u,nonce:o}},Sf=t=>async(e,n=0,r=!1,i=null)=>{if(!navigator.onLine&&document.hidden)return{tokens:t.tokens,status:"GIVE_UP"};let s=6;for(;!navigator.onLine&&s>0;)await nh({milliseconds:1e3}),s--,t.publishEvent(qe.refreshTokensAsync,{message:`wait because navigator is offline try ${s}`});const o=n+1;i||(i={});const a=t.configuration,l=(d,h=null,p=null)=>pb(t.configurationName,t.configuration,t.publishEvent.bind(t))(d,h,p),u=async()=>{try{let d;const h=await xr(a,t.configurationName);h?d=h.getLoginParams():d=Ir(t.configurationName,a.storage).getLoginParams();const p=await l({...d.extras,...i,prompt:"none"});return p?p.error?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent"}),{tokens:null,status:"SESSION_LOST"}):(e(p.tokens),t.publishEvent($i.eventNames.token_renewed,{}),{tokens:p.tokens,status:"LOGGED"}):(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token silent not active"}),{tokens:null,status:"SESSION_LOST"})}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exceptionSilent",exception:d.message}),await Sf(t)(e,o,r,i)}};try{const{status:d,tokens:h,nonce:p}=await NW(t)(a,t.configurationName,t.tokens,r);switch(d){case as.SESSION_LOST:return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:"refresh token session lost"}),{tokens:null,status:"SESSION_LOST"};case as.NOT_CONNECTED:return e(null),{tokens:null,status:null};case as.TOKENS_VALID:return e(h),{tokens:h,status:"LOGGED_IN"};case as.TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID:return e(h),t.publishEvent($i.eventNames.token_renewed,{reason:"TOKEN_UPDATED_BY_ANOTHER_TAB_TOKENS_VALID"}),{tokens:h,status:"LOGGED_IN"};case as.LOGOUT_FROM_ANOTHER_TAB:return e(null),t.publishEvent(qe.logout_from_another_tab,{status:"session syncTokensAsync"}),{tokens:null,status:"LOGGED_OUT"};case as.REQUIRE_SYNC_TOKENS:return a.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted&&as.FORCE_REFRESH!==d?(t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"}):(t.publishEvent(qe.refreshTokensAsync_begin,{tryNumber:n}),await u());default:{if(a.token_automatic_renew_mode==mc.AutomaticOnlyWhenFetchExecuted&&as.FORCE_REFRESH!==d)return t.publishEvent(qe.tokensInvalidAndWaitingActionsToRefresh,{}),{tokens:t.tokens,status:"GIVE_UP"};if(t.publishEvent(qe.refreshTokensAsync_begin,{refreshToken:h.refreshToken,status:d,tryNumber:n}),!h.refreshToken)return await u();const g=a.client_id,y=a.redirect_uri,b=a.authority,_={...a.token_request_extras?a.token_request_extras:{}};for(const[w,O]of Object.entries(i))w.endsWith(":token_request")&&(_[w.replace(":token_request","")]=O);return await(async()=>{const w={client_id:g,redirect_uri:y,grant_type:"refresh_token",refresh_token:h.refreshToken},O=await t.initAsync(b,a.authority_configuration),N=document.hidden?1e4:3e4*10,I=O.tokenEndpoint,P={};a.demonstrating_proof_of_possession&&(P.DPoP=await t.generateDemonstrationOfProofOfPossessionAsync(h.accessToken,I,"POST"));const M=await SW(t.getFetch())(I,w,_,h,P,a.token_renew_mode,N);if(M.success){const{isValid:B,reason:Q}=rA(M.data,p.nonce,O);if(!B)return e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`refresh token return not valid tokens, reason: ${Q}`}),{tokens:null,status:"SESSION_LOST"};if(e(M.data),M.demonstratingProofOfPossessionNonce){const x=await xr(a,t.configurationName);x?await x.setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce):await Ir(t.configurationName,a.storage).setDemonstratingProofOfPossessionNonce(M.demonstratingProofOfPossessionNonce)}return t.publishEvent(qe.refreshTokensAsync_end,{success:M.success}),t.publishEvent($i.eventNames.token_renewed,{reason:"REFRESH_TOKEN"}),{tokens:M.data,status:"LOGGED_IN"}}else return t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"bad request",tokenResponse:M}),M.status>=400&&M.status<500?(e(null),t.publishEvent(qe.refreshTokensAsync_error,{message:`session lost: ${M.status}`}),{tokens:null,status:"SESSION_LOST"}):await Sf(t)(e,o,r,i)})()}}}catch(d){return console.error(d),t.publishEvent(qe.refreshTokensAsync_silent_error,{message:"exception",exception:d.message}),new Promise((h,p)=>{setTimeout(()=>{Sf(t)(e,o,r,i).then(h).catch(p)},1e3)})}},pb=(t,e,n)=>(r=null,i=null,s=null)=>{if(!e.silent_redirect_uri||!e.silent_login_uri)return Promise.resolve(null);try{n(qe.silentLoginAsync_begin,{});let o="";if(i&&(r==null&&(r={}),r.state=i),s&&(r==null&&(r={}),r.scope=s),r!=null)for(const[h,p]of Object.entries(r))o===""?o=`?${encodeURIComponent(h)}=${encodeURIComponent(p)}`:o+=`&${encodeURIComponent(h)}=${encodeURIComponent(p)}`;const a=e.silent_login_uri+o,l=a.indexOf("/",a.indexOf("//")+2),u=a.substring(0,l),d=document.createElement("iframe");return d.width="0px",d.height="0px",d.id=`${t}_oidc_iframe`,d.setAttribute("src",a),document.body.appendChild(d),new Promise((h,p)=>{let g=!1;const y=()=>{window.removeEventListener("message",b),d.remove(),g=!0},b=_=>{if(_.origin===u&&_.source===d.contentWindow){const w=`${t}_oidc_tokens:`,O=`${t}_oidc_error:`,N=`${t}_oidc_exception:`,I=_.data;if(I&&typeof I=="string"&&!g){if(I.startsWith(w)){const P=JSON.parse(_.data.replace(w,""));n(qe.silentLoginAsync_end,{}),h(P),y()}else if(I.startsWith(O)){const P=JSON.parse(_.data.replace(O,""));n(qe.silentLoginAsync_error,P),h({error:"oidc_"+P.error,tokens:null,sessionState:null}),y()}else if(I.startsWith(N)){const P=JSON.parse(_.data.replace(N,""));n(qe.silentLoginAsync_error,P),p(new Error(P.error)),y()}}}};try{window.addEventListener("message",b);const _=e.silent_login_timeout;setTimeout(()=>{g||(y(),n(qe.silentLoginAsync_error,{reason:"timeout"}),p(new Error("timeout")))},_)}catch(_){y(),n(qe.silentLoginAsync_error,_),p(_)}})}catch(o){throw n(qe.silentLoginAsync_error,o),o}},AW=(t,e,n,r,i)=>(s=null,o=void 0)=>{s={...s};const a=(l,u,d)=>pb(e,n,r.bind(i))(l,u,d);return(async()=>{i.timeoutId&&$a.clearTimeout(i.timeoutId);let l;s&&"state"in s&&(l=s.state,delete s.state);try{const u=n.extras?{...n.extras,...s}:s,d=await a({...u,prompt:"none"},l,o);if(d)return i.tokens=d.tokens,r(qe.token_acquired,{}),i.timeoutId=gc(i,i.tokens.expiresAt,s),{}}catch(u){return u}})()},IW=(t,e,n)=>(r,i,s,o=!1)=>{const a=(l,u=void 0,d=void 0)=>pb(t.configurationName,n,t.publishEvent.bind(t))(l,u,d);return new Promise((l,u)=>{if(n.silent_login_uri&&n.silent_redirect_uri&&n.monitor_session&&r&&s&&!o){const d=()=>{t.checkSessionIFrame.stop();const h=t.tokens;if(h===null)return;const p=h.idToken,g=h.idTokenPayload;return a({prompt:"none",id_token_hint:p,scope:n.scope||"openid"}).then(y=>{if(y.error)throw new Error(y.error);const b=y.tokens.idTokenPayload;if(g.sub===b.sub){const _=y.sessionState;t.checkSessionIFrame.start(y.sessionState),g.sid===b.sid?console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",_):console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",_)}else console.debug("SessionMonitor._callback: Different subject signed into OP:",b.sub)}).catch(async y=>{console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:",y);for(const[,b]of Object.entries(e))await b.logoutOtherTabAsync(n.client_id,g.sub)})};t.checkSessionIFrame=new Xq(d,i,r),t.checkSessionIFrame.load().then(()=>{t.checkSessionIFrame.start(s),l(t.checkSessionIFrame)}).catch(h=>{u(h)})}else l(null)})},xW=t=>!!(t.os==="iOS"&&t.osVersion.startsWith("12")||t.os==="Mac OS X"&&t.osVersion.startsWith("10_15_6")),CW=t=>{const e=t.appVersion,n=t.userAgent,r="-";let i=r;const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const a in s){const l=s[a];if(l.r.test(n)){i=l.s;break}}let o=r;switch(/Windows/.test(i)&&(o=/Windows (.*)/.exec(i)[1],i="Windows"),i){case"Mac OS":case"Mac OS X":case"Android":o=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];break;case"iOS":{const a=/OS (\d+)_(\d+)_?(\d+)?/.exec(e);a!=null&&a.length>2&&(o=a[1]+"."+a[2]+"."+(parseInt(a[3])|0));break}}return{os:i,osVersion:o}};function DW(){const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],{name:"ie",version:e[1]||""};if(n[1]==="Chrome"&&(e=t.match(/\bOPR|Edge\/(\d+)/),e!=null)){let r=e[1];if(!r){const i=t.split(e[0]+"/");i.length>1&&(r=i[1])}return{name:"opera",version:r}}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(e=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,e[1]),{name:n[0].toLowerCase(),version:n[1]}}const RW=()=>{const{name:t,version:e}=DW();if(t==="chrome"&&parseInt(e)<=70||t==="opera"&&(!e||parseInt(e.split(".")[0])<80)||t==="ie")return!1;const n=CW(navigator);return!xW(n)},MW=async t=>{let e;if(t.tokens!=null)return!1;t.publishEvent(qe.tryKeepExistingSessionAsync_begin,{});try{const n=t.configuration,r=await t.initAsync(n.authority,n.authority_configuration);if(e=await xr(n,t.configurationName),e){const{tokens:i}=await e.initAsync(r,"tryKeepExistingSessionAsync",n);if(i){e.startKeepAliveServiceWorker(),t.tokens=i;const s=e.getLoginParams(t.configurationName);t.timeoutId=gc(t,t.tokens.expiresAt,s.extras);const o=await e.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,o),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside ServiceWorker are valid"}),!0}t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:"no exiting session found"})}else{n.service_worker_relative_url&&t.publishEvent(qe.service_worker_not_supported_by_browser,{message:"service worker is not supported by this browser"});const i=Ir(t.configurationName,n.storage??sessionStorage),{tokens:s}=await i.initAsync();if(s){t.tokens=fb(s,null,n.token_renew_mode);const o=i.getLoginParams();t.timeoutId=gc(t,t.tokens.expiresAt,o.extras);const a=await i.getSessionStateAsync();return await t.startCheckSessionAsync(r.check_session_iframe,n.client_id,a),n.preload_user_info&&await t.userInfoAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!0,message:"tokens inside storage are valid"}),!0}}return t.publishEvent(qe.tryKeepExistingSessionAsync_end,{success:!1,message:e?"service worker sessions not retrieved":"session storage sessions not retrieved"}),!1}catch(n){return console.error(n),e&&await e.clearAsync(),t.publishEvent(qe.tryKeepExistingSessionAsync_error,"tokens inside ServiceWorker are invalid"),!1}},fA=t=>{const e=t.match(/^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);if(!e)throw new Error("Invalid URL");let n=e[6],r=e[7];if(r){const i=r.split("?");i.length===2&&(r=i[0],n=i[1])}return n.startsWith("?")&&(n=n.slice(1)),e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],path:e[5],search:n,hash:r}},Il=t=>{const e=fA(t);let{path:n}=e;n.endsWith("/")&&(n=n.slice(0,-1));let{hash:r}=e;return r==="#_=_"&&(r=""),r&&(n+=r),n},yc=t=>{const e=fA(t),{search:n}=e;return PW(n)},PW=t=>{const e={};let n,r,i;const s=t.split("&");for(r=0,i=s.length;r<i;r++)n=s[r].split("="),e[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return e},FW=(t,e,n,r,i)=>(s=void 0,o=null,a=!1,l=void 0)=>{const u=o;return o={...o},(async()=>{const d=s||i.getPath();if("state"in o||(o.state=Bg(16)),n(qe.loginAsync_begin,{}),o)for(const h of Object.keys(o))h.endsWith(":token_request")&&delete o[h];try{const h=a?e.silent_redirect_uri:e.redirect_uri;l||(l=e.scope);const p=e.extras?{...e.extras,...o}:o;p.nonce||(p.nonce=Bg(12));const g={nonce:p.nonce},y=await xr(e,t),b=await r(e.authority,e.authority_configuration);let _;if(y)y.setLoginParams({callbackPath:d,extras:u}),await y.initAsync(b,"loginAsync",e),await y.setNonceAsync(g),y.startKeepAliveServiceWorker(),_=y;else{const O=Ir(t,e.storage??sessionStorage);O.setLoginParams({callbackPath:d,extras:u}),await O.setNonceAsync(g),_=O}const w={client_id:e.client_id,redirect_uri:h,scope:l,response_type:"code",...p};await OW(_,i)(b.authorizationEndpoint,w)}catch(h){throw n(qe.loginAsync_error,h),h}})()},$W=t=>async(e=!1)=>{try{t.publishEvent(qe.loginCallbackAsync_begin,{});const n=t.configuration,r=n.client_id,i=e?n.silent_redirect_uri:n.redirect_uri,s=n.authority,o=n.token_request_timeout,a=await t.initAsync(s,n.authority_configuration),l=t.location.getCurrentHref(),u=yc(l).session_state,d=await xr(n,t.configurationName);let h,p,g,y;if(d)await d.initAsync(a,"loginCallbackAsync",n),await d.setSessionStateAsync(u),p=await d.getNonceAsync(),g=d.getLoginParams(),y=await d.getStateAsync(),d.startKeepAliveServiceWorker(),h=d;else{const U=Ir(t.configurationName,n.storage??sessionStorage);await U.setSessionStateAsync(u),p=await U.getNonceAsync(),g=U.getLoginParams(),y=await U.getStateAsync(),h=U}const b=yc(l);if(b.error||b.error_description)throw new Error(`Error from OIDC server: ${b.error} - ${b.error_description}`);if(b.iss&&b.iss!==a.issuer)throw console.error(),new Error(`Issuer not valid (expected: ${a.issuer}, received: ${b.iss})`);if(b.state&&b.state!==y)throw new Error(`State not valid (expected: ${y}, received: ${b.state})`);const _={code:b.code,grant_type:"authorization_code",client_id:n.client_id,redirect_uri:i},w={};if(n.token_request_extras)for(const[U,be]of Object.entries(n.token_request_extras))w[U]=be;if(g!=null&&g.extras)for(const[U,be]of Object.entries(g.extras))U.endsWith(":token_request")&&(w[U.replace(":token_request","")]=be);const O=a.tokenEndpoint,N={};if(n.demonstrating_proof_of_possession)if(d)N.DPoP=`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${t.configurationName}`;else{const U=await yW(window)(n.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm);await Ir(t.configurationName,n.storage).setDemonstratingProofOfPossessionJwkAsync(U),N.DPoP=await aA(window)(n.demonstrating_proof_of_possession_configuration)(U,"POST",O)}const I=await kW(h)(O,{..._,...w},N,t.configuration.token_renew_mode,o);if(!I.success)throw new Error("Token request failed");let P;const M=I.data.tokens,B=I.data.demonstratingProofOfPossessionNonce;if(I.data.state!==w.state)throw new Error("state is not valid");const{isValid:Q,reason:x}=rA(M,p.nonce,a);if(!Q)throw new Error(`Tokens are not OpenID valid, reason: ${x}`);if(d){if(M.refreshToken&&!M.refreshToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Refresh token should be hidden by service worker");if(B&&M!=null&&M.accessToken.includes("SECURED_BY_OIDC_SERVICE_WORKER"))throw new Error("Demonstration of proof of possession require Access token not hidden by service worker")}if(d)await d.initAsync(a,"syncTokensAsync",n),P=d.getLoginParams(),B&&await d.setDemonstratingProofOfPossessionNonce(B);else{const U=Ir(t.configurationName,n.storage);P=U.getLoginParams(),B&&await U.setDemonstratingProofOfPossessionNonce(B)}return await t.startCheckSessionAsync(a.checkSessionIframe,r,u,e),t.publishEvent(qe.loginCallbackAsync_end,{}),{tokens:M,state:"request.state",callbackPath:P.callbackPath}}catch(n){throw console.error(n),t.publishEvent(qe.loginCallbackAsync_error,n),n}},wT={access_token:"access_token",refresh_token:"refresh_token"},pm=(t,e)=>{const n={};if(t){for(const[r,i]of Object.entries(t))if(r.endsWith(e)){const s=r.replace(e,"");n[s]=i}return n}return n},LW=t=>{const e={};if(t){for(const[n,r]of Object.entries(t))n.includes(":")||(e[n]=r);return e}return e},VW=t=>async e=>{$a.clearTimeout(t.timeoutId),t.timeoutId=null,t.checkSessionIFrame&&t.checkSessionIFrame.stop();const n=await xr(t.configuration,t.configurationName);n?await n.clearAsync(e):await Ir(t.configurationName,t.configuration.storage).clearAsync(e),t.tokens=null,t.userInfo=null},jW=(t,e,n,r,i)=>async(s=void 0,o=null)=>{var a,l;const u=t.configuration,d=await t.initAsync(u.authority,u.authority_configuration);s&&typeof s!="string"&&(s=void 0,r.warn("callbackPathOrUrl path is not a string"));const h=s??i.getPath();let p=!1;s&&(p=s.includes("https://")||s.includes("http://"));const g=p?s:i.getOrigin()+h,y=t.tokens?t.tokens.idToken:"";try{const O=d.revocationEndpoint;if(O){const N=[],I=t.tokens?t.tokens.accessToken:null;if(I&&u.logout_tokens_to_invalidate.includes(wT.access_token)){const M=pm(o,":revoke_access_token"),B=_T(n)(O,I,Ug.access_token,u.client_id,M);N.push(B)}const P=t.tokens?t.tokens.refreshToken:null;if(P&&u.logout_tokens_to_invalidate.includes(wT.refresh_token)){const M=pm(o,":revoke_refresh_token"),B=_T(n)(O,P,Ug.refresh_token,u.client_id,M);N.push(B)}N.length>0&&await Promise.all(N)}}catch(O){r.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"),r.warn(O)}const b=((l=(a=t.tokens)==null?void 0:a.idTokenPayload)==null?void 0:l.sub)??null;await t.destroyAsync("LOGGED_OUT");for(const[,O]of Object.entries(e))O!==t?await t.logoutSameTabAsync(t.configuration.client_id,b):t.publishEvent(qe.logout_from_same_tab,{});const _=pm(o,":oidc");if(_&&_.no_reload==="true")return;const w=LW(o);if(d.endSessionEndpoint){"id_token_hint"in w||(w.id_token_hint=y),!("post_logout_redirect_uri"in w)&&s!==null&&(w.post_logout_redirect_uri=g);let O="";for(const[N,I]of Object.entries(w))I!=null&&(O===""?O+="?":O+="&",O+=`${N}=${encodeURIComponent(I)}`);i.open(`${d.endSessionEndpoint}${O}`)}else i.reload()},dA=(t,e,n=!1)=>async(...r)=>{var i;const[s,o,...a]=r,l=o?{...o}:{method:"GET"};let u=new Headers;l.headers&&(u=l.headers instanceof Headers?l.headers:new Headers(l.headers));const d={getTokens:()=>e.tokens,configuration:{token_automatic_renew_mode:e.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:e.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:e.renewTokensAsync.bind(e)},h=await nA(d),p=(i=h==null?void 0:h.tokens)==null?void 0:i.accessToken;if(u.has("Accept")||u.set("Accept","application/json"),p){if(e.configuration.demonstrating_proof_of_possession&&n){const y=await e.generateDemonstrationOfProofOfPossessionAsync(p,s.toString(),l.method);u.set("Authorization",`PoP ${p}`),u.set("DPoP",y)}else u.set("Authorization",`Bearer ${p}`);l.credentials||(l.credentials="same-origin")}const g={...l,headers:u};return await t(s,g,...a)},BW=t=>async(e=!1,n=!1)=>{if(t.userInfo!=null&&!e)return t.userInfo;const r=t.configuration,i=(await t.initAsync(r.authority,r.authority_configuration)).userInfoEndpoint,s=await(async()=>{const o=await dA(fetch,t,n)(i);return o.status!==200?null:o.json()})();return t.userInfo=s,s},hA=()=>fetch;let qg=class{constructor(e){this.authorizationEndpoint=e.authorization_endpoint,this.tokenEndpoint=e.token_endpoint,this.revocationEndpoint=e.revocation_endpoint,this.userInfoEndpoint=e.userinfo_endpoint,this.checkSessionIframe=e.check_session_iframe,this.issuer=e.issuer,this.endSessionEndpoint=e.end_session_endpoint}};const fo={},UW=(t,e=new Fa)=>(n,r="default")=>(fo[r]||(fo[r]=new $i(n,r,t,e)),fo[r]),qW=async t=>{const{parsedTokens:e,callbackPath:n}=await t.loginCallbackAsync();return t.timeoutId=gc(t,e.expiresAt),{callbackPath:n}},WW=t=>Math.floor(Math.random()*t),Wg=class pA{constructor(e,n="default",r,i=new Fa){this.initPromise=null,this.tryKeepExistingSessionPromise=null,this.loginPromise=null,this.loginCallbackPromise=null,this.loginCallbackWithAutoTokensRenewPromise=null,this.userInfoPromise=null,this.renewTokensPromise=null,this.logoutPromise=null;let s=e.silent_login_uri;e.silent_redirect_uri&&!e.silent_login_uri&&(s=`${e.silent_redirect_uri.replace("-callback","").replace("callback","")}-login`);let o=e.refresh_time_before_tokens_expiration_in_second??120;o>60&&(o=o-Math.floor(Math.random()*40)),this.location=i??new Fa;const a=e.service_worker_update_require_callback??iW(this.location);this.configuration={...e,silent_login_uri:s,token_automatic_renew_mode:e.token_automatic_renew_mode??mc.AutomaticBeforeTokenExpiration,monitor_session:e.monitor_session??!1,refresh_time_before_tokens_expiration_in_second:o,silent_login_timeout:e.silent_login_timeout??12e3,token_renew_mode:e.token_renew_mode??Vg.access_token_or_id_token_invalid,demonstrating_proof_of_possession:e.demonstrating_proof_of_possession??!1,authority_timeout_wellknowurl_in_millisecond:e.authority_timeout_wellknowurl_in_millisecond??1e4,logout_tokens_to_invalidate:e.logout_tokens_to_invalidate??["access_token","refresh_token"],service_worker_update_require_callback:a,service_worker_activate:e.service_worker_activate??RW,demonstrating_proof_of_possession_configuration:e.demonstrating_proof_of_possession_configuration??cW,preload_user_info:e.preload_user_info??!1},this.getFetch=r??hA,this.configurationName=n,this.tokens=null,this.userInfo=null,this.events=[],this.timeoutId=null,this.loginCallbackWithAutoTokensRenewAsync.bind(this),this.initAsync.bind(this),this.loginCallbackAsync.bind(this),this.subscribeEvents.bind(this),this.removeEventSubscription.bind(this),this.publishEvent.bind(this),this.destroyAsync.bind(this),this.logoutAsync.bind(this),this.renewTokensAsync.bind(this),this.initAsync(this.configuration.authority,this.configuration.authority_configuration)}subscribeEvents(e){const n=WW(9999999999999).toString();return this.events.push({id:n,func:e}),n}removeEventSubscription(e){const n=this.events.filter(r=>r.id!==e);this.events=n}publishEvent(e,n){this.events.forEach(r=>{r.func(e,n)})}static get(e="default"){const n=typeof process>"u";if(!Object.prototype.hasOwnProperty.call(fo,e)&&n)throw Error(`OIDC library does seem initialized.
216
+ Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> component.`);return fo[e]}_silentLoginCallbackFromIFrame(){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const e=this.location,n=yc(e.getCurrentHref());window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({tokens:this.tokens,sessionState:n.session_state})}`,e.getOrigin())}}_silentLoginErrorCallbackFromIFrame(e=null){if(this.configuration.silent_redirect_uri&&this.configuration.silent_login_uri){const n=this.location,r=yc(n.getCurrentHref());r.error?window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({error:r.error})}`,n.getOrigin()):window.parent.postMessage(`${this.configurationName}_oidc_exception:${JSON.stringify({error:e==null?"":e.toString()})}`,n.getOrigin())}}async silentLoginCallbackAsync(){try{await this.loginCallbackAsync(!0),this._silentLoginCallbackFromIFrame()}catch(e){console.error(e),this._silentLoginErrorCallbackFromIFrame(e)}}async initAsync(e,n){if(this.initPromise!==null)return this.initPromise;const r=async()=>{if(n!=null)return new qg({authorization_endpoint:n.authorization_endpoint,end_session_endpoint:n.end_session_endpoint,revocation_endpoint:n.revocation_endpoint,token_endpoint:n.token_endpoint,userinfo_endpoint:n.userinfo_endpoint,check_session_iframe:n.check_session_iframe,issuer:n.issuer});const i=await xr(this.configuration,this.configurationName)?window.localStorage:null;return await TW(this.getFetch())(e,this.configuration.authority_time_cache_wellknowurl_in_second??60*60,i,this.configuration.authority_timeout_wellknowurl_in_millisecond)};return this.initPromise=r(),this.initPromise.finally(()=>{this.initPromise=null})}async tryKeepExistingSessionAsync(){return this.tryKeepExistingSessionPromise!==null?this.tryKeepExistingSessionPromise:(this.tryKeepExistingSessionPromise=MW(this),this.tryKeepExistingSessionPromise.finally(()=>{this.tryKeepExistingSessionPromise=null}))}async startCheckSessionAsync(e,n,r,i=!1){await IW(this,fo,this.configuration)(e,n,r,i)}async loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this.logoutPromise&&await this.logoutPromise,this.loginPromise!==null?this.loginPromise:s?AW(window,this.configurationName,this.configuration,this.publishEvent.bind(this),this)(n,i):(this.loginPromise=FW(this.configurationName,this.configuration,this.publishEvent.bind(this),this.initAsync.bind(this),this.location)(e,n,r,i),this.loginPromise.finally(()=>{this.loginPromise=null}))}async loginCallbackAsync(e=!1){if(this.loginCallbackPromise!==null)return this.loginCallbackPromise;const n=async()=>{const r=await $W(this)(e),i=r.tokens;return this.tokens=i,await xr(this.configuration,this.configurationName)||Ir(this.configurationName,this.configuration.storage).setTokens(i),this.publishEvent(pA.eventNames.token_acquired,i),this.configuration.preload_user_info&&await this.userInfoAsync(),{parsedTokens:i,state:r.state,callbackPath:r.callbackPath}};return this.loginCallbackPromise=n(),this.loginCallbackPromise.finally(()=>{this.loginCallbackPromise=null})}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){const s=this.configuration,o={ath:await cA(e),...i};if(await xr(s,this.configurationName))return`DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${this.configurationName}`;const a=Ir(this.configurationName,s.storage),l=await a.getDemonstratingProofOfPossessionJwkAsync(),u=a.getDemonstratingProofOfPossessionNonce();return u&&(o.nonce=u),await aA(window)(s.demonstrating_proof_of_possession_configuration)(l,r,n,o)}loginCallbackWithAutoTokensRenewAsync(){return this.loginCallbackWithAutoTokensRenewPromise!==null?this.loginCallbackWithAutoTokensRenewPromise:(this.loginCallbackWithAutoTokensRenewPromise=qW(this),this.loginCallbackWithAutoTokensRenewPromise.finally(()=>{this.loginCallbackWithAutoTokensRenewPromise=null}))}userInfoAsync(e=!1,n=!1){return this.userInfoPromise!==null?this.userInfoPromise:(this.userInfoPromise=BW(this)(e,n),this.userInfoPromise.finally(()=>{this.userInfoPromise=null}))}async renewTokensAsync(e=null){if(this.renewTokensPromise!==null)return this.renewTokensPromise;if(this.timeoutId)return $a.clearTimeout(this.timeoutId),this.renewTokensPromise=uA(this,!0,e),this.renewTokensPromise.finally(()=>{this.renewTokensPromise=null})}async destroyAsync(e){return await VW(this)(e)}async logoutSameTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_same_tab,{mmessage:"SessionMonitor",sub:n}))}async logoutOtherTabAsync(e,n){this.configuration.monitor_session&&this.configuration.client_id===e&&n&&this.tokens&&this.tokens.idTokenPayload&&this.tokens.idTokenPayload.sub===n&&(await this.destroyAsync("LOGGED_OUT"),this.publishEvent(qe.logout_from_another_tab,{message:"SessionMonitor",sub:n}))}async logoutAsync(e=void 0,n=null){return this.logoutPromise?this.logoutPromise:(this.logoutPromise=jW(this,fo,this.getFetch(),console,this.location)(e,n),this.logoutPromise.finally(()=>{this.logoutPromise=null}))}};Wg.getOrCreate=(t,e)=>(n,r="default")=>UW(t,e)(n,r),Wg.eventNames=qe;let $i=Wg;const Of=class mA{constructor(e){this._oidc=e}subscribeEvents(e){return this._oidc.subscribeEvents(e)}removeEventSubscription(e){this._oidc.removeEventSubscription(e)}publishEvent(e,n){this._oidc.publishEvent(e,n)}static get(e="default"){return new mA($i.get(e))}tryKeepExistingSessionAsync(){return this._oidc.tryKeepExistingSessionAsync()}loginAsync(e=void 0,n=null,r=!1,i=void 0,s=!1){return this._oidc.loginAsync(e,n,r,i,s)}logoutAsync(e=void 0,n=null){return this._oidc.logoutAsync(e,n)}silentLoginCallbackAsync(){return this._oidc.silentLoginCallbackAsync()}renewTokensAsync(e=null){return this._oidc.renewTokensAsync(e)}loginCallbackAsync(){return this._oidc.loginCallbackWithAutoTokensRenewAsync()}get tokens(){return this._oidc.tokens}get configuration(){return this._oidc.configuration}async generateDemonstrationOfProofOfPossessionAsync(e,n,r,i={}){return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e,n,r,i)}async getValidTokenAsync(e=200,n=50){const r=this._oidc,i={getTokens:()=>r.tokens,configuration:{token_automatic_renew_mode:r.configuration.token_automatic_renew_mode,refresh_time_before_tokens_expiration_in_second:r.configuration.refresh_time_before_tokens_expiration_in_second},renewTokensAsync:r.renewTokensAsync.bind(r)};return nA(i,e,n)}fetchWithTokens(e,n=!1){return dA(e,this._oidc,n)}async userInfoAsync(e=!1,n=!1){return this._oidc.userInfoAsync(e,n)}userInfo(){return this._oidc.userInfo}};Of.getOrCreate=(t,e=new Fa)=>(n,r="default")=>new Of($i.getOrCreate(t,e)(n,r)),Of.eventNames=$i.eventNames;let tt=Of;const gA=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),he.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),zW=()=>he.jsx("div",{className:"oidc-authenticating",children:he.jsxs("div",{className:"oidc-authenticating__container",children:[he.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),he.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),QW=()=>Math.random().toString(36).slice(2,8),GW=(t,e)=>(n,r)=>{if(typeof t.CustomEvent=="function")return new t.CustomEvent(n,r);const i=r||{bubbles:!1,cancelable:!1,detail:void 0},s=e.createEvent("CustomEvent");return s.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),s.prototype=t.Event.prototype,s},HW=(t,e,n)=>({replaceState:(r,i)=>{const s=n(),o=i||t.history.state;t.history.replaceState({key:s,state:o},null,r),t.dispatchEvent(e("popstate"))}}),KW=()=>HW(window,GW(window,document),QW),yA=()=>he.jsx("div",{className:"oidc-callback",children:he.jsxs("div",{className:"oidc-callback__container",children:[he.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),he.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),JW=({callBackError:t,callBackSuccess:e,configurationName:n,withCustomHistory:r})=>{const[i,s]=ae.useState(!1);ae.useEffect(()=>{let l=!0;return(async()=>{const u=tt.get;try{const{callbackPath:d}=await u(n).loginCallbackAsync();(r?r():KW()).replaceState(d||"/")}catch(d){l&&(console.warn(d),s(!0))}})(),()=>{l=!1}},[]);const o=t||gA,a=e||yA;return i?he.jsx(o,{configurationName:n}):he.jsx(a,{configurationName:n})},YW=()=>he.jsx("span",{className:"oidc-loading",children:"Loading"}),XW=()=>he.jsx("div",{className:"oidc-serviceworker",children:he.jsxs("div",{className:"oidc-serviceworker__container",children:[he.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),he.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),ZW=()=>he.jsx("div",{className:"oidc-session-lost",children:he.jsxs("div",{className:"oidc-session-lost__container",children:[he.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),he.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),ez=({configurationName:t})=>(ae.useEffect(()=>{(async()=>{tt.get(t).silentLoginCallbackAsync()})().catch(e=>{console.error("Error during silent login callback:",e)})},[t]),null),tz=({configurationName:t})=>{const e=yc(window.location.href),n=tt.get,r=n(t);let i=null;for(const[s,o]of Object.entries(e))s==="state"||s==="scope"||(i===null&&(i={}),i[s]=o);return ae.useEffect(()=>{r.tokens||r.loginAsync(null,i,!0,e.scope)},[]),he.jsx(he.Fragment,{})},nz=({callbackErrorComponent:t,callbackSuccessComponent:e,redirect_uri:n,silent_redirect_uri:r,silent_login_uri:i,children:s,configurationName:o,withCustomHistory:a=null})=>{const l=window?Il(window.location.href):"",[u,d]=ae.useState(l);ae.useEffect(()=>{const p=()=>d(Il(window.location.href));return p(),window.addEventListener("popstate",p,!1),()=>window.removeEventListener("popstate",p,!1)},[]);const h=Il(n);if(r&&u===Il(r))return he.jsx(ez,{configurationName:o});if(i&&u===Il(i))return he.jsx(tz,{configurationName:o});switch(u){case h:return he.jsx(JW,{callBackError:t,callBackSuccess:e,configurationName:o,withCustomHistory:a});default:return he.jsx(he.Fragment,{children:s})}},rz=ae.memo(nz),TT={name:"",data:null},iz=({loadingComponent:t,children:e,configurationName:n})=>{const[r,i]=ae.useState(!0),s=tt.get,o=s(n);return ae.useEffect(()=>{let a=!0;return o&&o.tryKeepExistingSessionAsync().then(()=>{a&&i(!1)}),()=>{a=!1}},[n]),he.jsx(he.Fragment,{children:r?he.jsx(t,{configurationName:n}):he.jsx(he.Fragment,{children:e})})},xl=({isLoading:t,loadingComponent:e,children:n,configurationName:r})=>{const i=e;return t?he.jsx(i,{configurationName:r,children:n}):he.jsx(he.Fragment,{children:n})},sz=({children:t,configuration:e,configurationName:n="default",callbackSuccessComponent:r=yA,authenticatingComponent:i=zW,loadingComponent:s=YW,serviceWorkerNotSupportedComponent:o=XW,authenticatingErrorComponent:a=gA,sessionLostComponent:l=ZW,onSessionLost:u=null,onLogoutFromAnotherTab:d=null,onLogoutFromSameTab:h=null,withCustomHistory:p=null,onEvent:g=null,getFetch:y=null,location:b=null})=>{const _=(Le="default")=>tt.getOrCreate(y??hA,b??new Fa)(e,Le),[w,O]=ae.useState(!0),[N,I]=ae.useState(TT),[P,M]=ae.useState("default");ae.useEffect(()=>{const Le=_(n).subscribeEvents((te,Ae)=>{g&&g(n,te,Ae)});return()=>{_(n).removeEventSubscription(Le)}},[n,g]),ae.useEffect(()=>{const Le=_(n).subscribeEvents((te,Ae)=>{if(te===tt.eventNames.refreshTokensAsync_error||te===tt.eventNames.syncTokensAsync_error){if(u!=null){u();return}I({name:te,data:Ae})}else if(te===tt.eventNames.logout_from_another_tab){if(d!=null){d();return}I({name:te,data:Ae})}else te===tt.eventNames.logout_from_same_tab?h!=null&&h():te===tt.eventNames.loginAsync_begin||te===tt.eventNames.loginCallbackAsync_end||te===tt.eventNames.loginAsync_error||te===tt.eventNames.loginCallbackAsync_error?I({name:te,data:Ae}):te===tt.eventNames.service_worker_not_supported_by_browser&&e.service_worker_only===!0&&I({name:te,data:Ae})});return M(n),O(!1),()=>{_(n).removeEventSubscription(Le),I(TT)}},[e,n]);const B=l,Q=i,x=s,U=o,be=a,Oe=w||P!==n,ke=_(n);switch(N.name){case tt.eventNames.service_worker_not_supported_by_browser:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(U,{configurationName:n})});case tt.eventNames.loginAsync_begin:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(Q,{configurationName:n})});case tt.eventNames.loginAsync_error:case tt.eventNames.loginCallbackAsync_error:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(be,{configurationName:n})});case tt.eventNames.refreshTokensAsync_error:case tt.eventNames.syncTokensAsync_error:case tt.eventNames.logout_from_another_tab:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(B,{configurationName:n})});default:return he.jsx(xl,{loadingComponent:x,isLoading:Oe,configurationName:n,children:he.jsx(rz,{redirect_uri:ke.configuration.redirect_uri,silent_redirect_uri:ke.configuration.silent_redirect_uri,silent_login_uri:ke.configuration.silent_login_uri,callbackSuccessComponent:r,callbackErrorComponent:a,authenticatingComponent:i,configurationName:n,withCustomHistory:p,location:b??new Fa,children:he.jsx(iz,{loadingComponent:x,configurationName:n,children:t})})})}},vA="default",mm=(t,e)=>{let n=!1;return t(e)&&(n=t(e).tokens!=null),n},oz=(t=vA)=>{const e=tt.get,[n,r]=ae.useState(mm(e,t));return ae.useEffect(()=>{let i=!0;const s=e(t);r(mm(e,t));const o=s.subscribeEvents((a,l)=>{(a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.token_acquired)&&i&&r(mm(e,t))});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),{login:(i=void 0,s=void 0,o=!1)=>e(t).loginAsync(i,s,!1,void 0,o),logout:(i=void 0,s=void 0)=>e(t).logoutAsync(i,s),renewTokens:async(i=void 0)=>{const s=await e(t).renewTokensAsync(i);return{accessToken:s.accessToken,accessTokenPayload:s.accessTokenPayload,idToken:s.idToken,idTokenPayload:s.idTokenPayload}},isAuthenticated:n}},bA={accessToken:null,accessTokenPayload:null},az=t=>{const e=tt.get,n=e(t);if(n.tokens){const r=n.tokens;return{accessToken:r.accessToken,accessTokenPayload:r.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:n.configuration.demonstrating_proof_of_possession?(i,s)=>n.generateDemonstrationOfProofOfPossessionAsync(r.accessToken,i,s):null}}return bA};function lz(t,e){return t.configuration.demonstrating_proof_of_possession?(n,r,i={})=>t.generateDemonstrationOfProofOfPossessionAsync(e.accessToken,n,r,i):null}const cz=(t=vA)=>{const e=tt.get,[n,r]=ae.useState(az(t));return ae.useEffect(()=>{let i=!0;const s=e(t);if(s.tokens){const a=s.tokens;r({accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload})}const o=s.subscribeEvents((a,l)=>{if((a===tt.eventNames.token_renewed||a===tt.eventNames.token_acquired||a===tt.eventNames.logout_from_another_tab||a===tt.eventNames.logout_from_same_tab||a===tt.eventNames.refreshTokensAsync_error||a===tt.eventNames.syncTokensAsync_error)&&i){const u=s.tokens;r(u!=null?{accessToken:u.accessToken,accessTokenPayload:u.accessTokenPayload,generateDemonstrationOfProofOfPossessionAsync:lz(s,u)}:bA)}});return()=>{i=!1,s.removeEventSubscription(o)}},[t]),n};var Zu={DOCUMENT:"Document",FRAGMENT_DEFINITION:"FragmentDefinition"};class uz extends Error{constructor(e,n,r,i,s,o,a){super(e),this.name="GraphQLError",this.message=e,s&&(this.path=s),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),i&&(this.positions=i),o&&(this.originalError=o);var l=a;if(!l&&o){var u=o.extensions;u&&typeof u=="object"&&(l=u)}this.extensions=l||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var rt,me;function Rt(t){return new uz(`Syntax Error: Unexpected token at ${me} in ${t}`)}function lr(t){if(t.lastIndex=me,t.test(rt))return rt.slice(me,me=t.lastIndex)}var ef=/ +(?=[^\s])/y;function fz(t){for(var e=t.split(`
217
217
  `),n="",r=0,i=0,s=e.length-1,o=0;o<e.length;o++)ef.lastIndex=0,ef.test(e[o])&&(o&&(!r||ef.lastIndex<r)&&(r=ef.lastIndex),i=i||o,s=o);for(var a=i;a<=s;a++)a!==i&&(n+=`
218
218
  `),n+=e[a].slice(r).replace(/\\"""/g,'"""');return n}function Pe(){for(var t=0|rt.charCodeAt(me++);t===9||t===10||t===13||t===32||t===35||t===44||t===65279;t=0|rt.charCodeAt(me++))if(t===35)for(;(t=rt.charCodeAt(me++))!==10&&t!==13;);me--}var Cn=/[_A-Za-z]\w*/y,gm=new RegExp("(?:(null|true|false)|\\$("+Cn.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+Cn.source+"))","y"),fs=function(t){return t[t.Const=1]="Const",t[t.Var=2]="Var",t[t.Int=3]="Int",t[t.Float=4]="Float",t[t.BlockString=5]="BlockString",t[t.String=6]="String",t[t.Enum=7]="Enum",t}(fs||{}),dz=/\\/;function ed(t){var e,n;if(gm.lastIndex=me,rt.charCodeAt(me)===91){me++,Pe();for(var r=[];rt.charCodeAt(me)!==93;)r.push(ed(t));return me++,Pe(),{kind:"ListValue",values:r}}else if(rt.charCodeAt(me)===123){me++,Pe();for(var i=[];rt.charCodeAt(me)!==125;){if((e=lr(Cn))==null||(Pe(),rt.charCodeAt(me++)!==58))throw Rt("ObjectField");Pe(),i.push({kind:"ObjectField",name:{kind:"Name",value:e},value:ed(t)})}return me++,Pe(),{kind:"ObjectValue",fields:i}}else if((n=gm.exec(rt))!=null){if(me=gm.lastIndex,Pe(),(e=n[fs.Const])!=null)return e==="null"?{kind:"NullValue"}:{kind:"BooleanValue",value:e==="true"};if((e=n[fs.Var])!=null){if(t)throw Rt("Variable");return{kind:"Variable",name:{kind:"Name",value:e}}}else if((e=n[fs.Int])!=null){var s;return(s=n[fs.Float])!=null?{kind:"FloatValue",value:e+s}:{kind:"IntValue",value:e}}else{if((e=n[fs.BlockString])!=null)return{kind:"StringValue",value:fz(e.slice(3,-3)),block:!0};if((e=n[fs.String])!=null)return{kind:"StringValue",value:dz.test(e)?JSON.parse(e):e.slice(1,-1),block:!1};if((e=n[fs.Enum])!=null)return{kind:"EnumValue",value:e}}}throw Rt("Value")}function _A(t){if(rt.charCodeAt(me)===40){var e=[];me++,Pe();var n;do{if((n=lr(Cn))==null||(Pe(),rt.charCodeAt(me++)!==58))throw Rt("Argument");Pe(),e.push({kind:"Argument",name:{kind:"Name",value:n},value:ed(t)})}while(rt.charCodeAt(me)!==41);return me++,Pe(),e}}function Ea(t){if(rt.charCodeAt(me)===64){var e=[],n;do{if(me++,(n=lr(Cn))==null)throw Rt("Directive");Pe(),e.push({kind:"Directive",name:{kind:"Name",value:n},arguments:_A(t)})}while(rt.charCodeAt(me)===64);return e}}function hz(){for(var t,e=0;rt.charCodeAt(me)===91;)e++,me++,Pe();if((t=lr(Cn))==null)throw Rt("NamedType");Pe();var n={kind:"NamedType",name:{kind:"Name",value:t}};do if(rt.charCodeAt(me)===33&&(me++,Pe(),n={kind:"NonNullType",type:n}),e){if(rt.charCodeAt(me++)!==93)throw Rt("NamedType");Pe(),n={kind:"ListType",type:n}}while(e--);return n}var ym=new RegExp("(?:(\\.{3})|("+Cn.source+"))","y"),zg=function(t){return t[t.Spread=1]="Spread",t[t.Name=2]="Name",t}(zg||{});function td(){var t=[],e,n;do if(ym.lastIndex=me,(n=ym.exec(rt))!=null){if(me=ym.lastIndex,n[zg.Spread]!=null){Pe();var r=lr(Cn);if(r!=null&&r!=="on")Pe(),t.push({kind:"FragmentSpread",name:{kind:"Name",value:r},directives:Ea(!1)});else{if(Pe(),r==="on"){if((r=lr(Cn))==null)throw Rt("NamedType");Pe()}var i=Ea(!1);if(rt.charCodeAt(me++)!==123)throw Rt("InlineFragment");Pe(),t.push({kind:"InlineFragment",typeCondition:r?{kind:"NamedType",name:{kind:"Name",value:r}}:void 0,directives:i,selectionSet:td()})}}else if((e=n[zg.Name])!=null){var s=void 0;if(Pe(),rt.charCodeAt(me)===58){if(me++,Pe(),s=e,(e=lr(Cn))==null)throw Rt("Field");Pe()}var o=_A(!1);Pe();var a=Ea(!1),l=void 0;rt.charCodeAt(me)===123&&(me++,Pe(),l=td()),t.push({kind:"Field",alias:s?{kind:"Name",value:s}:void 0,name:{kind:"Name",value:e},arguments:o,directives:a,selectionSet:l})}}else throw Rt("SelectionSet");while(rt.charCodeAt(me)!==125);return me++,Pe(),{kind:"SelectionSet",selections:t}}function pz(){var t,e;if((t=lr(Cn))==null||(Pe(),lr(Cn)!=="on")||(Pe(),(e=lr(Cn))==null))throw Rt("FragmentDefinition");Pe();var n=Ea(!1);if(rt.charCodeAt(me++)!==123)throw Rt("FragmentDefinition");return Pe(),{kind:"FragmentDefinition",name:{kind:"Name",value:t},typeCondition:{kind:"NamedType",name:{kind:"Name",value:e}},directives:n,selectionSet:td()}}var mz=/(?:query|mutation|subscription|fragment)/y;function gz(t){var e,n,r;if(t&&(Pe(),e=lr(Cn),n=function(){if(Pe(),rt.charCodeAt(me)===40){var s=[];me++,Pe();var o;do{if(rt.charCodeAt(me++)!==36||(o=lr(Cn))==null)throw Rt("Variable");if(Pe(),rt.charCodeAt(me++)!==58)throw Rt("VariableDefinition");Pe();var a=hz(),l=void 0;rt.charCodeAt(me)===61&&(me++,Pe(),l=ed(!0)),Pe(),s.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:o}},type:a,defaultValue:l,directives:Ea(!0)})}while(rt.charCodeAt(me)!==41);return me++,Pe(),s}}(),r=Ea(!1)),rt.charCodeAt(me)===123)return me++,Pe(),{kind:"OperationDefinition",operation:t||"query",name:e?{kind:"Name",value:e}:void 0,variableDefinitions:n,directives:r,selectionSet:td()}}function yz(t,e){return me=0,function(r,i){var s,o;Pe();var a=[];do if((s=lr(mz))==="fragment")Pe(),a.push(pz());else if((o=gz(s))!=null)a.push(o);else throw Rt("Document");while(me<r.length);{var l;return{kind:"Document",definitions:a,set loc(u){l=u},get loc(){return l||(l={start:0,end:r.length,startToken:void 0,endToken:void 0,source:{body:r,name:"graphql.web",locationOffset:{line:1,column:1}}}),l}}}}(rt=typeof t.body=="string"?t.body:t)}var ST=0,vm=new Set;function EA(){function t(e,n){var r=yz(e).definitions,i=new Set;for(var s of n||[])for(var o of s.definitions)o.kind===Zu.FRAGMENT_DEFINITION&&!i.has(o)&&(r.push(o),i.add(o));var a;(a=r[0].kind===Zu.FRAGMENT_DEFINITION)&&r[0].directives&&(r[0].directives=r[0].directives.filter(u=>u.name.value!=="_unmask"));var l;return{kind:Zu.DOCUMENT,definitions:r,get loc(){if(!l&&a){var u=e+function(h){try{ST++;var p="";for(var g of h)if(!vm.has(g)){vm.add(g);var{loc:y}=g;y&&(p+=y.source.body)}return p}finally{--ST==0&&vm.clear()}}(n||[]);return{start:0,end:u.length,source:{body:u,name:"GraphQLTada",locationOffset:{line:1,column:1}}}}return l},set loc(u){l=u}}}return t.scalar=function(n,r){return r},t.persisted=function(n,r){return{kind:Zu.DOCUMENT,definitions:r?r.definitions:[],documentId:n}},t}function vz(...t){return t.length===2?t[1]:t[0]}EA();const Ja=EA(),bz=Ja(`
219
219
  query players(
@@ -241,7 +241,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
241
241
  }
242
242
  }
243
243
  }
244
- `),wA=({playerIds:t,skip:e})=>{const[n,r]=le.useState([]),[i,s]=le.useState(!e),[o]=rb(bz),a=async l=>{var d,h;const u=[];for(;l.length>0;)u.push(...((h=(d=(await o({variables:{page:{first:100},ids:l.splice(0,100)}})).data)==null?void 0:d.players)==null?void 0:h.nodes)??[]);r(u)};return le.useEffect(()=>{!e&&t&&(s(!0),a(t).finally(()=>s(!1)))},[e,t]),{results:n,refetch:a,loading:i}},_z=Ja(`
244
+ `),wA=({playerIds:t,skip:e})=>{const[n,r]=ae.useState([]),[i,s]=ae.useState(!e),[o]=rb(bz),a=async l=>{var d,h;const u=[];for(;l.length>0;)u.push(...((h=(d=(await o({variables:{page:{first:100},ids:l.splice(0,100)}})).data)==null?void 0:d.players)==null?void 0:h.nodes)??[]);r(u)};return ae.useEffect(()=>{!e&&t&&(s(!0),a(t).finally(()=>s(!1)))},[e,t]),{results:n,refetch:a,loading:i}},_z=Ja(`
245
245
  query getMyAccount {
246
246
  getMyAccount {
247
247
  id
@@ -292,16 +292,16 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
292
292
  }
293
293
  }
294
294
  }
295
- `),TA=({tournamentId:t,skip:e,status:n})=>{const[r,i]=le.useState([]),{loading:s,results:o}=ub(wz,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=wA({playerIds:r,skip:s});return{loading:s||a,results:l.length>0&&o.map(u=>({...u,members:u.members.map(d=>({...d,player:l.find(h=>h.id===d.playerProfileId)}))}))||[]}};var nd={exports:{}};/**
295
+ `),TA=({tournamentId:t,skip:e,status:n})=>{const[r,i]=ae.useState([]),{loading:s,results:o}=ub(wz,{variables:{tournamentId:t,status:n},onResults:async u=>{i(u.flatMap(d=>d.members).map(d=>d.playerProfileId))},skip:e}),{loading:a,results:l}=wA({playerIds:r,skip:s});return{loading:s||a,results:l.length>0&&o.map(u=>({...u,members:u.members.map(d=>({...d,player:l.find(h=>h.id===d.playerProfileId)}))}))||[]}};var nd={exports:{}};/**
296
296
  * @license
297
297
  * Lodash <https://lodash.com/>
298
298
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
299
299
  * Released under MIT license <https://lodash.com/license>
300
300
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
301
301
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
302
- */nd.exports;(function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,y=1,b=2,_=1,w=2,O=4,N=8,I=16,P=32,M=64,B=128,Q=256,x=512,U=30,be="...",Oe=800,ke=16,Le=1,te=2,Ae=3,fe=1/0,Ee=9007199254740991,ge=17976931348623157e292,ct=NaN,ve=4294967295,L=ve-1,Z=ve>>>1,Y=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",M],["rearg",Q]],ee="[object Arguments]",we="[object Array]",Me="[object AsyncFunction]",Ye="[object Boolean]",Zt="[object Date]",Hi="[object DOMException]",Vr="[object Error]",Pt="[object Function]",sl="[object GeneratorFunction]",wn="[object Map]",bi="[object Number]",Mh="[object Null]",hr="[object Object]",ol="[object Promise]",tu="[object Proxy]",Ki="[object RegExp]",R="[object Set]",oe="[object String]",ae="[object Symbol]",et="[object Undefined]",Ot="[object WeakMap]",gt="[object WeakSet]",Ne="[object ArrayBuffer]",un="[object DataView]",ei="[object Float32Array]",Vt="[object Float64Array]",jr="[object Int8Array]",_i="[object Int16Array]",pr="[object Int32Array]",Ji="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Ph="[object Uint16Array]",Fh="[object Uint32Array]",sC=/\b__p \+= '';/g,oC=/\b(__p \+=) '' \+/g,aC=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m0=/&(?:amp|lt|gt|quot|#39);/g,g0=/[&<>"']/g,lC=RegExp(m0.source),cC=RegExp(g0.source),uC=/<%-([\s\S]+?)%>/g,fC=/<%([\s\S]+?)%>/g,y0=/<%=([\s\S]+?)%>/g,dC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hC=/^\w*$/,pC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$h=/[\\^$.*+?()[\]{}|]/g,mC=RegExp($h.source),Lh=/^\s+/,gC=/\s/,yC=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vC=/\{\n\/\* \[wrapped with (.+)\] \*/,bC=/,? & /,_C=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,EC=/[()=,{}\[\]\/\s]/,wC=/\\(\\)?/g,TC=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v0=/\w*$/,SC=/^[-+]0x[0-9a-f]+$/i,OC=/^0b[01]+$/i,kC=/^\[object .+?Constructor\]$/,NC=/^0o[0-7]+$/i,AC=/^(?:0|[1-9]\d*)$/,IC=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nu=/($^)/,xC=/['\n\r\u2028\u2029\\]/g,ru="\\ud800-\\udfff",CC="\\u0300-\\u036f",DC="\\ufe20-\\ufe2f",RC="\\u20d0-\\u20ff",b0=CC+DC+RC,_0="\\u2700-\\u27bf",E0="a-z\\xdf-\\xf6\\xf8-\\xff",MC="\\xac\\xb1\\xd7\\xf7",PC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",FC="\\u2000-\\u206f",$C=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",w0="A-Z\\xc0-\\xd6\\xd8-\\xde",T0="\\ufe0e\\ufe0f",S0=MC+PC+FC+$C,Vh="['’]",LC="["+ru+"]",O0="["+S0+"]",iu="["+b0+"]",k0="\\d+",VC="["+_0+"]",N0="["+E0+"]",A0="[^"+ru+S0+k0+_0+E0+w0+"]",jh="\\ud83c[\\udffb-\\udfff]",jC="(?:"+iu+"|"+jh+")",I0="[^"+ru+"]",Bh="(?:\\ud83c[\\udde6-\\uddff]){2}",Uh="[\\ud800-\\udbff][\\udc00-\\udfff]",zo="["+w0+"]",x0="\\u200d",C0="(?:"+N0+"|"+A0+")",BC="(?:"+zo+"|"+A0+")",D0="(?:"+Vh+"(?:d|ll|m|re|s|t|ve))?",R0="(?:"+Vh+"(?:D|LL|M|RE|S|T|VE))?",M0=jC+"?",P0="["+T0+"]?",UC="(?:"+x0+"(?:"+[I0,Bh,Uh].join("|")+")"+P0+M0+")*",qC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",F0=P0+M0+UC,zC="(?:"+[VC,Bh,Uh].join("|")+")"+F0,QC="(?:"+[I0+iu+"?",iu,Bh,Uh,LC].join("|")+")",GC=RegExp(Vh,"g"),HC=RegExp(iu,"g"),qh=RegExp(jh+"(?="+jh+")|"+QC+F0,"g"),KC=RegExp([zo+"?"+N0+"+"+D0+"(?="+[O0,zo,"$"].join("|")+")",BC+"+"+R0+"(?="+[O0,zo+C0,"$"].join("|")+")",zo+"?"+C0+"+"+D0,zo+"+"+R0,WC,qC,k0,zC].join("|"),"g"),JC=RegExp("["+x0+ru+b0+T0+"]"),YC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,XC=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ZC=-1,yt={};yt[ei]=yt[Vt]=yt[jr]=yt[_i]=yt[pr]=yt[Ji]=yt[Xn]=yt[Ph]=yt[Fh]=!0,yt[ee]=yt[we]=yt[Ne]=yt[Ye]=yt[un]=yt[Zt]=yt[Vr]=yt[Pt]=yt[wn]=yt[bi]=yt[hr]=yt[Ki]=yt[R]=yt[oe]=yt[Ot]=!1;var dt={};dt[ee]=dt[we]=dt[Ne]=dt[un]=dt[Ye]=dt[Zt]=dt[ei]=dt[Vt]=dt[jr]=dt[_i]=dt[pr]=dt[wn]=dt[bi]=dt[hr]=dt[Ki]=dt[R]=dt[oe]=dt[ae]=dt[Ji]=dt[Xn]=dt[Ph]=dt[Fh]=!0,dt[Vr]=dt[Pt]=dt[Ot]=!1;var eD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},rD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},iD=parseFloat,sD=parseInt,$0=typeof Re=="object"&&Re&&Re.Object===Object&&Re,oD=typeof self=="object"&&self&&self.Object===Object&&self,en=$0||oD||Function("return this")(),Wh=e&&!e.nodeType&&e,Gs=Wh&&!0&&t&&!t.nodeType&&t,L0=Gs&&Gs.exports===Wh,zh=L0&&$0.process,mr=function(){try{var F=Gs&&Gs.require&&Gs.require("util").types;return F||zh&&zh.binding&&zh.binding("util")}catch{}}(),V0=mr&&mr.isArrayBuffer,j0=mr&&mr.isDate,B0=mr&&mr.isMap,U0=mr&&mr.isRegExp,q0=mr&&mr.isSet,W0=mr&&mr.isTypedArray;function Zn(F,q,V){switch(V.length){case 0:return F.call(q);case 1:return F.call(q,V[0]);case 2:return F.call(q,V[0],V[1]);case 3:return F.call(q,V[0],V[1],V[2])}return F.apply(q,V)}function aD(F,q,V,se){for(var Ce=-1,it=F==null?0:F.length;++Ce<it;){var jt=F[Ce];q(se,jt,V(jt),F)}return se}function gr(F,q){for(var V=-1,se=F==null?0:F.length;++V<se&&q(F[V],V,F)!==!1;);return F}function lD(F,q){for(var V=F==null?0:F.length;V--&&q(F[V],V,F)!==!1;);return F}function z0(F,q){for(var V=-1,se=F==null?0:F.length;++V<se;)if(!q(F[V],V,F))return!1;return!0}function Yi(F,q){for(var V=-1,se=F==null?0:F.length,Ce=0,it=[];++V<se;){var jt=F[V];q(jt,V,F)&&(it[Ce++]=jt)}return it}function su(F,q){var V=F==null?0:F.length;return!!V&&Qo(F,q,0)>-1}function Qh(F,q,V){for(var se=-1,Ce=F==null?0:F.length;++se<Ce;)if(V(q,F[se]))return!0;return!1}function Et(F,q){for(var V=-1,se=F==null?0:F.length,Ce=Array(se);++V<se;)Ce[V]=q(F[V],V,F);return Ce}function Xi(F,q){for(var V=-1,se=q.length,Ce=F.length;++V<se;)F[Ce+V]=q[V];return F}function Gh(F,q,V,se){var Ce=-1,it=F==null?0:F.length;for(se&&it&&(V=F[++Ce]);++Ce<it;)V=q(V,F[Ce],Ce,F);return V}function cD(F,q,V,se){var Ce=F==null?0:F.length;for(se&&Ce&&(V=F[--Ce]);Ce--;)V=q(V,F[Ce],Ce,F);return V}function Hh(F,q){for(var V=-1,se=F==null?0:F.length;++V<se;)if(q(F[V],V,F))return!0;return!1}var uD=Kh("length");function fD(F){return F.split("")}function dD(F){return F.match(_C)||[]}function Q0(F,q,V){var se;return V(F,function(Ce,it,jt){if(q(Ce,it,jt))return se=it,!1}),se}function ou(F,q,V,se){for(var Ce=F.length,it=V+(se?1:-1);se?it--:++it<Ce;)if(q(F[it],it,F))return it;return-1}function Qo(F,q,V){return q===q?SD(F,q,V):ou(F,G0,V)}function hD(F,q,V,se){for(var Ce=V-1,it=F.length;++Ce<it;)if(se(F[Ce],q))return Ce;return-1}function G0(F){return F!==F}function H0(F,q){var V=F==null?0:F.length;return V?Yh(F,q)/V:ct}function Kh(F){return function(q){return q==null?n:q[F]}}function Jh(F){return function(q){return F==null?n:F[q]}}function K0(F,q,V,se,Ce){return Ce(F,function(it,jt,ut){V=se?(se=!1,it):q(V,it,jt,ut)}),V}function pD(F,q){var V=F.length;for(F.sort(q);V--;)F[V]=F[V].value;return F}function Yh(F,q){for(var V,se=-1,Ce=F.length;++se<Ce;){var it=q(F[se]);it!==n&&(V=V===n?it:V+it)}return V}function Xh(F,q){for(var V=-1,se=Array(F);++V<F;)se[V]=q(V);return se}function mD(F,q){return Et(q,function(V){return[V,F[V]]})}function J0(F){return F&&F.slice(0,e_(F)+1).replace(Lh,"")}function er(F){return function(q){return F(q)}}function Zh(F,q){return Et(q,function(V){return F[V]})}function al(F,q){return F.has(q)}function Y0(F,q){for(var V=-1,se=F.length;++V<se&&Qo(q,F[V],0)>-1;);return V}function X0(F,q){for(var V=F.length;V--&&Qo(q,F[V],0)>-1;);return V}function gD(F,q){for(var V=F.length,se=0;V--;)F[V]===q&&++se;return se}var yD=Jh(eD),vD=Jh(tD);function bD(F){return"\\"+rD[F]}function _D(F,q){return F==null?n:F[q]}function Go(F){return JC.test(F)}function ED(F){return YC.test(F)}function wD(F){for(var q,V=[];!(q=F.next()).done;)V.push(q.value);return V}function ep(F){var q=-1,V=Array(F.size);return F.forEach(function(se,Ce){V[++q]=[Ce,se]}),V}function Z0(F,q){return function(V){return F(q(V))}}function Zi(F,q){for(var V=-1,se=F.length,Ce=0,it=[];++V<se;){var jt=F[V];(jt===q||jt===d)&&(F[V]=d,it[Ce++]=V)}return it}function au(F){var q=-1,V=Array(F.size);return F.forEach(function(se){V[++q]=se}),V}function TD(F){var q=-1,V=Array(F.size);return F.forEach(function(se){V[++q]=[se,se]}),V}function SD(F,q,V){for(var se=V-1,Ce=F.length;++se<Ce;)if(F[se]===q)return se;return-1}function OD(F,q,V){for(var se=V+1;se--;)if(F[se]===q)return se;return se}function Ho(F){return Go(F)?ND(F):uD(F)}function Br(F){return Go(F)?AD(F):fD(F)}function e_(F){for(var q=F.length;q--&&gC.test(F.charAt(q)););return q}var kD=Jh(nD);function ND(F){for(var q=qh.lastIndex=0;qh.test(F);)++q;return q}function AD(F){return F.match(qh)||[]}function ID(F){return F.match(KC)||[]}var xD=function F(q){q=q==null?en:Ko.defaults(en.Object(),q,Ko.pick(en,XC));var V=q.Array,se=q.Date,Ce=q.Error,it=q.Function,jt=q.Math,ut=q.Object,tp=q.RegExp,CD=q.String,yr=q.TypeError,lu=V.prototype,DD=it.prototype,Jo=ut.prototype,cu=q["__core-js_shared__"],uu=DD.toString,at=Jo.hasOwnProperty,RD=0,t_=function(){var c=/[^.]+$/.exec(cu&&cu.keys&&cu.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),fu=Jo.toString,MD=uu.call(ut),PD=en._,FD=tp("^"+uu.call(at).replace($h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),du=L0?q.Buffer:n,es=q.Symbol,hu=q.Uint8Array,n_=du?du.allocUnsafe:n,pu=Z0(ut.getPrototypeOf,ut),r_=ut.create,i_=Jo.propertyIsEnumerable,mu=lu.splice,s_=es?es.isConcatSpreadable:n,ll=es?es.iterator:n,Hs=es?es.toStringTag:n,gu=function(){try{var c=Zs(ut,"defineProperty");return c({},"",{}),c}catch{}}(),$D=q.clearTimeout!==en.clearTimeout&&q.clearTimeout,LD=se&&se.now!==en.Date.now&&se.now,VD=q.setTimeout!==en.setTimeout&&q.setTimeout,yu=jt.ceil,vu=jt.floor,np=ut.getOwnPropertySymbols,jD=du?du.isBuffer:n,o_=q.isFinite,BD=lu.join,UD=Z0(ut.keys,ut),Bt=jt.max,fn=jt.min,qD=se.now,WD=q.parseInt,a_=jt.random,zD=lu.reverse,rp=Zs(q,"DataView"),cl=Zs(q,"Map"),ip=Zs(q,"Promise"),Yo=Zs(q,"Set"),ul=Zs(q,"WeakMap"),fl=Zs(ut,"create"),bu=ul&&new ul,Xo={},QD=eo(rp),GD=eo(cl),HD=eo(ip),KD=eo(Yo),JD=eo(ul),_u=es?es.prototype:n,dl=_u?_u.valueOf:n,l_=_u?_u.toString:n;function T(c){if(kt(c)&&!De(c)&&!(c instanceof He)){if(c instanceof vr)return c;if(at.call(c,"__wrapped__"))return cE(c)}return new vr(c)}var Zo=function(){function c(){}return function(f){if(!wt(f))return{};if(r_)return r_(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function Eu(){}function vr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:uC,evaluate:fC,interpolate:y0,variable:"",imports:{_:T}},T.prototype=Eu.prototype,T.prototype.constructor=T,vr.prototype=Zo(Eu.prototype),vr.prototype.constructor=vr;function He(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function YD(){var c=new He(this.__wrapped__);return c.__actions__=Ln(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ln(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ln(this.__views__),c}function XD(){if(this.__filtered__){var c=new He(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function ZD(){var c=this.__wrapped__.value(),f=this.__dir__,m=De(c),v=f<0,E=m?c.length:0,S=fM(0,E,this.__views__),A=S.start,D=S.end,$=D-A,G=v?D:A-1,H=this.__iteratees__,K=H.length,ne=0,de=fn($,this.__takeCount__);if(!m||!v&&E==$&&de==$)return D_(c,this.__actions__);var Te=[];e:for(;$--&&ne<de;){G+=f;for(var Ve=-1,Se=c[G];++Ve<K;){var Qe=H[Ve],Je=Qe.iteratee,rr=Qe.type,On=Je(Se);if(rr==te)Se=On;else if(!On){if(rr==Le)continue e;break e}}Te[ne++]=Se}return Te}He.prototype=Zo(Eu.prototype),He.prototype.constructor=He;function Ks(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function eR(){this.__data__=fl?fl(null):{},this.size=0}function tR(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function nR(c){var f=this.__data__;if(fl){var m=f[c];return m===l?n:m}return at.call(f,c)?f[c]:n}function rR(c){var f=this.__data__;return fl?f[c]!==n:at.call(f,c)}function iR(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=fl&&f===n?l:f,this}Ks.prototype.clear=eR,Ks.prototype.delete=tR,Ks.prototype.get=nR,Ks.prototype.has=rR,Ks.prototype.set=iR;function Ei(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function sR(){this.__data__=[],this.size=0}function oR(c){var f=this.__data__,m=wu(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():mu.call(f,m,1),--this.size,!0}function aR(c){var f=this.__data__,m=wu(f,c);return m<0?n:f[m][1]}function lR(c){return wu(this.__data__,c)>-1}function cR(c,f){var m=this.__data__,v=wu(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}Ei.prototype.clear=sR,Ei.prototype.delete=oR,Ei.prototype.get=aR,Ei.prototype.has=lR,Ei.prototype.set=cR;function wi(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function uR(){this.size=0,this.__data__={hash:new Ks,map:new(cl||Ei),string:new Ks}}function fR(c){var f=Mu(this,c).delete(c);return this.size-=f?1:0,f}function dR(c){return Mu(this,c).get(c)}function hR(c){return Mu(this,c).has(c)}function pR(c,f){var m=Mu(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}wi.prototype.clear=uR,wi.prototype.delete=fR,wi.prototype.get=dR,wi.prototype.has=hR,wi.prototype.set=pR;function Js(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new wi;++f<m;)this.add(c[f])}function mR(c){return this.__data__.set(c,l),this}function gR(c){return this.__data__.has(c)}Js.prototype.add=Js.prototype.push=mR,Js.prototype.has=gR;function Ur(c){var f=this.__data__=new Ei(c);this.size=f.size}function yR(){this.__data__=new Ei,this.size=0}function vR(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function bR(c){return this.__data__.get(c)}function _R(c){return this.__data__.has(c)}function ER(c,f){var m=this.__data__;if(m instanceof Ei){var v=m.__data__;if(!cl||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new wi(v)}return m.set(c,f),this.size=m.size,this}Ur.prototype.clear=yR,Ur.prototype.delete=vR,Ur.prototype.get=bR,Ur.prototype.has=_R,Ur.prototype.set=ER;function c_(c,f){var m=De(c),v=!m&&to(c),E=!m&&!v&&ss(c),S=!m&&!v&&!E&&ra(c),A=m||v||E||S,D=A?Xh(c.length,CD):[],$=D.length;for(var G in c)(f||at.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||ki(G,$)))&&D.push(G);return D}function u_(c){var f=c.length;return f?c[mp(0,f-1)]:n}function wR(c,f){return Pu(Ln(c),Ys(f,0,c.length))}function TR(c){return Pu(Ln(c))}function sp(c,f,m){(m!==n&&!qr(c[f],m)||m===n&&!(f in c))&&Ti(c,f,m)}function hl(c,f,m){var v=c[f];(!(at.call(c,f)&&qr(v,m))||m===n&&!(f in c))&&Ti(c,f,m)}function wu(c,f){for(var m=c.length;m--;)if(qr(c[m][0],f))return m;return-1}function SR(c,f,m,v){return ts(c,function(E,S,A){f(v,E,m(E),A)}),v}function f_(c,f){return c&&ni(f,Gt(f),c)}function OR(c,f){return c&&ni(f,jn(f),c)}function Ti(c,f,m){f=="__proto__"&&gu?gu(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function op(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:jp(c,f[m]);return E}function Ys(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function br(c,f,m,v,E,S){var A,D=f&h,$=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!wt(c))return c;var H=De(c);if(H){if(A=hM(c),!D)return Ln(c,A)}else{var K=dn(c),ne=K==Pt||K==sl;if(ss(c))return P_(c,D);if(K==hr||K==ee||ne&&!E){if(A=$||ne?{}:eE(c),!D)return $?nM(c,OR(A,c)):tM(c,f_(A,c))}else{if(!dt[K])return E?c:{};A=pM(c,K,D)}}S||(S=new Ur);var de=S.get(c);if(de)return de;S.set(c,A),IE(c)?c.forEach(function(Se){A.add(br(Se,f,m,Se,c,S))}):NE(c)&&c.forEach(function(Se,Qe){A.set(Qe,br(Se,f,m,Qe,c,S))});var Te=G?$?kp:Op:$?jn:Gt,Ve=H?n:Te(c);return gr(Ve||c,function(Se,Qe){Ve&&(Qe=Se,Se=c[Qe]),hl(A,Qe,br(Se,f,m,Qe,c,S))}),A}function kR(c){var f=Gt(c);return function(m){return d_(m,c,f)}}function d_(c,f,m){var v=m.length;if(c==null)return!v;for(c=ut(c);v--;){var E=m[v],S=f[E],A=c[E];if(A===n&&!(E in c)||!S(A))return!1}return!0}function h_(c,f,m){if(typeof c!="function")throw new yr(o);return _l(function(){c.apply(n,m)},f)}function pl(c,f,m,v){var E=-1,S=su,A=!0,D=c.length,$=[],G=f.length;if(!D)return $;m&&(f=Et(f,er(m))),v?(S=Qh,A=!1):f.length>=i&&(S=al,A=!1,f=new Js(f));e:for(;++E<D;){var H=c[E],K=m==null?H:m(H);if(H=v||H!==0?H:0,A&&K===K){for(var ne=G;ne--;)if(f[ne]===K)continue e;$.push(H)}else S(f,K,v)||$.push(H)}return $}var ts=j_(ti),p_=j_(lp,!0);function NR(c,f){var m=!0;return ts(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function Tu(c,f,m){for(var v=-1,E=c.length;++v<E;){var S=c[v],A=f(S);if(A!=null&&(D===n?A===A&&!nr(A):m(A,D)))var D=A,$=S}return $}function AR(c,f,m,v){var E=c.length;for(m=Fe(m),m<0&&(m=-m>E?0:E+m),v=v===n||v>E?E:Fe(v),v<0&&(v+=E),v=m>v?0:CE(v);m<v;)c[m++]=f;return c}function m_(c,f){var m=[];return ts(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function tn(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=gM),E||(E=[]);++S<A;){var D=c[S];f>0&&m(D)?f>1?tn(D,f-1,m,v,E):Xi(E,D):v||(E[E.length]=D)}return E}var ap=B_(),g_=B_(!0);function ti(c,f){return c&&ap(c,f,Gt)}function lp(c,f){return c&&g_(c,f,Gt)}function Su(c,f){return Yi(f,function(m){return Ni(c[m])})}function Xs(c,f){f=rs(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[ri(f[m++])];return m&&m==v?c:n}function y_(c,f,m){var v=f(c);return De(c)?v:Xi(v,m(c))}function Tn(c){return c==null?c===n?et:Mh:Hs&&Hs in ut(c)?uM(c):TM(c)}function cp(c,f){return c>f}function IR(c,f){return c!=null&&at.call(c,f)}function xR(c,f){return c!=null&&f in ut(c)}function CR(c,f,m){return c>=fn(f,m)&&c<Bt(f,m)}function up(c,f,m){for(var v=m?Qh:su,E=c[0].length,S=c.length,A=S,D=V(S),$=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Et(H,er(f))),$=fn(H.length,$),D[A]=!m&&(f||E>=120&&H.length>=120)?new Js(A&&H):n}H=c[0];var K=-1,ne=D[0];e:for(;++K<E&&G.length<$;){var de=H[K],Te=f?f(de):de;if(de=m||de!==0?de:0,!(ne?al(ne,Te):v(G,Te,m))){for(A=S;--A;){var Ve=D[A];if(!(Ve?al(Ve,Te):v(c[A],Te,m)))continue e}ne&&ne.push(Te),G.push(de)}}return G}function DR(c,f,m,v){return ti(c,function(E,S,A){f(v,m(E),S,A)}),v}function ml(c,f,m){f=rs(f,c),c=iE(c,f);var v=c==null?c:c[ri(Er(f))];return v==null?n:Zn(v,c,m)}function v_(c){return kt(c)&&Tn(c)==ee}function RR(c){return kt(c)&&Tn(c)==Ne}function MR(c){return kt(c)&&Tn(c)==Zt}function gl(c,f,m,v,E){return c===f?!0:c==null||f==null||!kt(c)&&!kt(f)?c!==c&&f!==f:PR(c,f,m,v,gl,E)}function PR(c,f,m,v,E,S){var A=De(c),D=De(f),$=A?we:dn(c),G=D?we:dn(f);$=$==ee?hr:$,G=G==ee?hr:G;var H=$==hr,K=G==hr,ne=$==G;if(ne&&ss(c)){if(!ss(f))return!1;A=!0,H=!1}if(ne&&!H)return S||(S=new Ur),A||ra(c)?Y_(c,f,m,v,E,S):lM(c,f,$,m,v,E,S);if(!(m&y)){var de=H&&at.call(c,"__wrapped__"),Te=K&&at.call(f,"__wrapped__");if(de||Te){var Ve=de?c.value():c,Se=Te?f.value():f;return S||(S=new Ur),E(Ve,Se,m,v,S)}}return ne?(S||(S=new Ur),cM(c,f,m,v,E,S)):!1}function FR(c){return kt(c)&&dn(c)==wn}function fp(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=ut(c);E--;){var D=m[E];if(A&&D[2]?D[1]!==c[D[0]]:!(D[0]in c))return!1}for(;++E<S;){D=m[E];var $=D[0],G=c[$],H=D[1];if(A&&D[2]){if(G===n&&!($ in c))return!1}else{var K=new Ur;if(v)var ne=v(G,H,$,c,f,K);if(!(ne===n?gl(H,G,y|b,v,K):ne))return!1}}return!0}function b_(c){if(!wt(c)||vM(c))return!1;var f=Ni(c)?FD:kC;return f.test(eo(c))}function $R(c){return kt(c)&&Tn(c)==Ki}function LR(c){return kt(c)&&dn(c)==R}function VR(c){return kt(c)&&Bu(c.length)&&!!yt[Tn(c)]}function __(c){return typeof c=="function"?c:c==null?Bn:typeof c=="object"?De(c)?T_(c[0],c[1]):w_(c):UE(c)}function dp(c){if(!bl(c))return UD(c);var f=[];for(var m in ut(c))at.call(c,m)&&m!="constructor"&&f.push(m);return f}function jR(c){if(!wt(c))return wM(c);var f=bl(c),m=[];for(var v in c)v=="constructor"&&(f||!at.call(c,v))||m.push(v);return m}function hp(c,f){return c<f}function E_(c,f){var m=-1,v=Vn(c)?V(c.length):[];return ts(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function w_(c){var f=Ap(c);return f.length==1&&f[0][2]?nE(f[0][0],f[0][1]):function(m){return m===c||fp(m,c,f)}}function T_(c,f){return xp(c)&&tE(f)?nE(ri(c),f):function(m){var v=jp(m,c);return v===n&&v===f?Bp(m,c):gl(f,v,y|b)}}function Ou(c,f,m,v,E){c!==f&&ap(f,function(S,A){if(E||(E=new Ur),wt(S))BR(c,f,A,m,Ou,v,E);else{var D=v?v(Dp(c,A),S,A+"",c,f,E):n;D===n&&(D=S),sp(c,A,D)}},jn)}function BR(c,f,m,v,E,S,A){var D=Dp(c,m),$=Dp(f,m),G=A.get($);if(G){sp(c,m,G);return}var H=S?S(D,$,m+"",c,f,A):n,K=H===n;if(K){var ne=De($),de=!ne&&ss($),Te=!ne&&!de&&ra($);H=$,ne||de||Te?De(D)?H=D:xt(D)?H=Ln(D):de?(K=!1,H=P_($,!0)):Te?(K=!1,H=F_($,!0)):H=[]:El($)||to($)?(H=D,to(D)?H=DE(D):(!wt(D)||Ni(D))&&(H=eE($))):K=!1}K&&(A.set($,H),E(H,$,v,S,A),A.delete($)),sp(c,m,H)}function S_(c,f){var m=c.length;if(m)return f+=f<0?m:0,ki(f,m)?c[f]:n}function O_(c,f,m){f.length?f=Et(f,function(S){return De(S)?function(A){return Xs(A,S.length===1?S[0]:S)}:S}):f=[Bn];var v=-1;f=Et(f,er(_e()));var E=E_(c,function(S,A,D){var $=Et(f,function(G){return G(S)});return{criteria:$,index:++v,value:S}});return pD(E,function(S,A){return eM(S,A,m)})}function UR(c,f){return k_(c,f,function(m,v){return Bp(c,v)})}function k_(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],D=Xs(c,A);m(D,A)&&yl(S,rs(A,c),D)}return S}function qR(c){return function(f){return Xs(f,c)}}function pp(c,f,m,v){var E=v?hD:Qo,S=-1,A=f.length,D=c;for(c===f&&(f=Ln(f)),m&&(D=Et(c,er(m)));++S<A;)for(var $=0,G=f[S],H=m?m(G):G;($=E(D,H,$,v))>-1;)D!==c&&mu.call(D,$,1),mu.call(c,$,1);return c}function N_(c,f){for(var m=c?f.length:0,v=m-1;m--;){var E=f[m];if(m==v||E!==S){var S=E;ki(E)?mu.call(c,E,1):vp(c,E)}}return c}function mp(c,f){return c+vu(a_()*(f-c+1))}function WR(c,f,m,v){for(var E=-1,S=Bt(yu((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function gp(c,f){var m="";if(!c||f<1||f>Ee)return m;do f%2&&(m+=c),f=vu(f/2),f&&(c+=c);while(f);return m}function Ue(c,f){return Rp(rE(c,f,Bn),c+"")}function zR(c){return u_(ia(c))}function QR(c,f){var m=ia(c);return Pu(m,Ys(f,0,m.length))}function yl(c,f,m,v){if(!wt(c))return c;f=rs(f,c);for(var E=-1,S=f.length,A=S-1,D=c;D!=null&&++E<S;){var $=ri(f[E]),G=m;if($==="__proto__"||$==="constructor"||$==="prototype")return c;if(E!=A){var H=D[$];G=v?v(H,$,D):n,G===n&&(G=wt(H)?H:ki(f[E+1])?[]:{})}hl(D,$,G),D=D[$]}return c}var A_=bu?function(c,f){return bu.set(c,f),c}:Bn,GR=gu?function(c,f){return gu(c,"toString",{configurable:!0,enumerable:!1,value:qp(f),writable:!0})}:Bn;function HR(c){return Pu(ia(c))}function _r(c,f,m){var v=-1,E=c.length;f<0&&(f=-f>E?0:E+f),m=m>E?E:m,m<0&&(m+=E),E=f>m?0:m-f>>>0,f>>>=0;for(var S=V(E);++v<E;)S[v]=c[v+f];return S}function KR(c,f){var m;return ts(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function ku(c,f,m){var v=0,E=c==null?v:c.length;if(typeof f=="number"&&f===f&&E<=Z){for(;v<E;){var S=v+E>>>1,A=c[S];A!==null&&!nr(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return yp(c,f,Bn,m)}function yp(c,f,m,v){var E=0,S=c==null?0:c.length;if(S===0)return 0;f=m(f);for(var A=f!==f,D=f===null,$=nr(f),G=f===n;E<S;){var H=vu((E+S)/2),K=m(c[H]),ne=K!==n,de=K===null,Te=K===K,Ve=nr(K);if(A)var Se=v||Te;else G?Se=Te&&(v||ne):D?Se=Te&&ne&&(v||!de):$?Se=Te&&ne&&!de&&(v||!Ve):de||Ve?Se=!1:Se=v?K<=f:K<f;Se?E=H+1:S=H}return fn(S,L)}function I_(c,f){for(var m=-1,v=c.length,E=0,S=[];++m<v;){var A=c[m],D=f?f(A):A;if(!m||!qr(D,$)){var $=D;S[E++]=A===0?0:A}}return S}function x_(c){return typeof c=="number"?c:nr(c)?ct:+c}function tr(c){if(typeof c=="string")return c;if(De(c))return Et(c,tr)+"";if(nr(c))return l_?l_.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function ns(c,f,m){var v=-1,E=su,S=c.length,A=!0,D=[],$=D;if(m)A=!1,E=Qh;else if(S>=i){var G=f?null:oM(c);if(G)return au(G);A=!1,E=al,$=new Js}else $=f?[]:D;e:for(;++v<S;){var H=c[v],K=f?f(H):H;if(H=m||H!==0?H:0,A&&K===K){for(var ne=$.length;ne--;)if($[ne]===K)continue e;f&&$.push(K),D.push(H)}else E($,K,m)||($!==D&&$.push(K),D.push(H))}return D}function vp(c,f){return f=rs(f,c),c=iE(c,f),c==null||delete c[ri(Er(f))]}function C_(c,f,m,v){return yl(c,f,m(Xs(c,f)),v)}function Nu(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?_r(c,v?0:S,v?S+1:E):_r(c,v?S+1:0,v?E:S)}function D_(c,f){var m=c;return m instanceof He&&(m=m.value()),Gh(f,function(v,E){return E.func.apply(E.thisArg,Xi([v],E.args))},m)}function bp(c,f,m){var v=c.length;if(v<2)return v?ns(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],D=-1;++D<v;)D!=E&&(S[E]=pl(S[E]||A,c[D],f,m));return ns(tn(S,1),f,m)}function R_(c,f,m){for(var v=-1,E=c.length,S=f.length,A={};++v<E;){var D=v<S?f[v]:n;m(A,c[v],D)}return A}function _p(c){return xt(c)?c:[]}function Ep(c){return typeof c=="function"?c:Bn}function rs(c,f){return De(c)?c:xp(c,f)?[c]:lE(st(c))}var JR=Ue;function is(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:_r(c,f,m)}var M_=$D||function(c){return en.clearTimeout(c)};function P_(c,f){if(f)return c.slice();var m=c.length,v=n_?n_(m):new c.constructor(m);return c.copy(v),v}function wp(c){var f=new c.constructor(c.byteLength);return new hu(f).set(new hu(c)),f}function YR(c,f){var m=f?wp(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function XR(c){var f=new c.constructor(c.source,v0.exec(c));return f.lastIndex=c.lastIndex,f}function ZR(c){return dl?ut(dl.call(c)):{}}function F_(c,f){var m=f?wp(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function $_(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=nr(c),A=f!==n,D=f===null,$=f===f,G=nr(f);if(!D&&!G&&!S&&c>f||S&&A&&$&&!D&&!G||v&&A&&$||!m&&$||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||D&&m&&E||!A&&E||!$)return-1}return 0}function eM(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,D=m.length;++v<A;){var $=$_(E[v],S[v]);if($){if(v>=D)return $;var G=m[v];return $*(G=="desc"?-1:1)}}return c.index-f.index}function L_(c,f,m,v){for(var E=-1,S=c.length,A=m.length,D=-1,$=f.length,G=Bt(S-A,0),H=V($+G),K=!v;++D<$;)H[D]=f[D];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[D++]=c[E++];return H}function V_(c,f,m,v){for(var E=-1,S=c.length,A=-1,D=m.length,$=-1,G=f.length,H=Bt(S-D,0),K=V(H+G),ne=!v;++E<H;)K[E]=c[E];for(var de=E;++$<G;)K[de+$]=f[$];for(;++A<D;)(ne||E<S)&&(K[de+m[A]]=c[E++]);return K}function Ln(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function ni(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var D=f[S],$=v?v(m[D],c[D],D,m,c):n;$===n&&($=c[D]),E?Ti(m,D,$):hl(m,D,$)}return m}function tM(c,f){return ni(c,Ip(c),f)}function nM(c,f){return ni(c,X_(c),f)}function Au(c,f){return function(m,v){var E=De(m)?aD:SR,S=f?f():{};return E(m,c,_e(v,2),S)}}function ea(c){return Ue(function(f,m){var v=-1,E=m.length,S=E>1?m[E-1]:n,A=E>2?m[2]:n;for(S=c.length>3&&typeof S=="function"?(E--,S):n,A&&Sn(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=ut(f);++v<E;){var D=m[v];D&&c(f,D,v,S)}return f})}function j_(c,f){return function(m,v){if(m==null)return m;if(!Vn(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=ut(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function B_(c){return function(f,m,v){for(var E=-1,S=ut(f),A=v(f),D=A.length;D--;){var $=A[c?D:++E];if(m(S[$],$,S)===!1)break}return f}}function rM(c,f,m){var v=f&_,E=vl(c);function S(){var A=this&&this!==en&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function U_(c){return function(f){f=st(f);var m=Go(f)?Br(f):n,v=m?m[0]:f.charAt(0),E=m?is(m,1).join(""):f.slice(1);return v[c]()+E}}function ta(c){return function(f){return Gh(jE(VE(f).replace(GC,"")),c,"")}}function vl(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var m=Zo(c.prototype),v=c.apply(m,f);return wt(v)?v:m}}function iM(c,f,m){var v=vl(c);function E(){for(var S=arguments.length,A=V(S),D=S,$=na(E);D--;)A[D]=arguments[D];var G=S<3&&A[0]!==$&&A[S-1]!==$?[]:Zi(A,$);if(S-=G.length,S<m)return G_(c,f,Iu,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==en&&this instanceof E?v:c;return Zn(H,this,A)}return E}function q_(c){return function(f,m,v){var E=ut(f);if(!Vn(f)){var S=_e(m,3);f=Gt(f),m=function(D){return S(E[D],D,E)}}var A=c(f,m,v);return A>-1?E[S?f[A]:A]:n}}function W_(c){return Oi(function(f){var m=f.length,v=m,E=vr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new yr(o);if(E&&!A&&Ru(S)=="wrapper")var A=new vr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var D=Ru(S),$=D=="wrapper"?Np(S):n;$&&Cp($[0])&&$[1]==(B|N|P|Q)&&!$[4].length&&$[9]==1?A=A[Ru($[0])].apply(A,$[3]):A=S.length==1&&Cp(S)?A[D]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&De(H))return A.plant(H).value();for(var K=0,ne=m?f[K].apply(this,G):H;++K<m;)ne=f[K].call(this,ne);return ne}})}function Iu(c,f,m,v,E,S,A,D,$,G){var H=f&B,K=f&_,ne=f&w,de=f&(N|I),Te=f&x,Ve=ne?n:vl(c);function Se(){for(var Qe=arguments.length,Je=V(Qe),rr=Qe;rr--;)Je[rr]=arguments[rr];if(de)var On=na(Se),ir=gD(Je,On);if(v&&(Je=L_(Je,v,E,de)),S&&(Je=V_(Je,S,A,de)),Qe-=ir,de&&Qe<G){var Ct=Zi(Je,On);return G_(c,f,Iu,Se.placeholder,m,Je,Ct,D,$,G-Qe)}var Wr=K?m:this,Ii=ne?Wr[c]:c;return Qe=Je.length,D?Je=SM(Je,D):Te&&Qe>1&&Je.reverse(),H&&$<Qe&&(Je.length=$),this&&this!==en&&this instanceof Se&&(Ii=Ve||vl(Ii)),Ii.apply(Wr,Je)}return Se}function z_(c,f){return function(m,v){return DR(m,c,f(v),{})}}function xu(c,f){return function(m,v){var E;if(m===n&&v===n)return f;if(m!==n&&(E=m),v!==n){if(E===n)return v;typeof m=="string"||typeof v=="string"?(m=tr(m),v=tr(v)):(m=x_(m),v=x_(v)),E=c(m,v)}return E}}function Tp(c){return Oi(function(f){return f=Et(f,er(_e())),Ue(function(m){var v=this;return c(f,function(E){return Zn(E,v,m)})})})}function Cu(c,f){f=f===n?" ":tr(f);var m=f.length;if(m<2)return m?gp(f,c):f;var v=gp(f,yu(c/Ho(f)));return Go(f)?is(Br(v),0,c).join(""):v.slice(0,c)}function sM(c,f,m,v){var E=f&_,S=vl(c);function A(){for(var D=-1,$=arguments.length,G=-1,H=v.length,K=V(H+$),ne=this&&this!==en&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;$--;)K[G++]=arguments[++D];return Zn(ne,E?m:this,K)}return A}function Q_(c){return function(f,m,v){return v&&typeof v!="number"&&Sn(f,m,v)&&(m=v=n),f=Ai(f),m===n?(m=f,f=0):m=Ai(m),v=v===n?f<m?1:-1:Ai(v),WR(f,m,v,c)}}function Du(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=wr(f),m=wr(m)),c(f,m)}}function G_(c,f,m,v,E,S,A,D,$,G){var H=f&N,K=H?A:n,ne=H?n:A,de=H?S:n,Te=H?n:S;f|=H?P:M,f&=~(H?M:P),f&O||(f&=~(_|w));var Ve=[c,f,E,de,K,Te,ne,D,$,G],Se=m.apply(n,Ve);return Cp(c)&&sE(Se,Ve),Se.placeholder=v,oE(Se,c,f)}function Sp(c){var f=jt[c];return function(m,v){if(m=wr(m),v=v==null?0:fn(Fe(v),292),v&&o_(m)){var E=(st(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(st(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var oM=Yo&&1/au(new Yo([,-0]))[1]==fe?function(c){return new Yo(c)}:Qp;function H_(c){return function(f){var m=dn(f);return m==wn?ep(f):m==R?TD(f):mD(f,c(f))}}function Si(c,f,m,v,E,S,A,D){var $=f&w;if(!$&&typeof c!="function")throw new yr(o);var G=v?v.length:0;if(G||(f&=~(P|M),v=E=n),A=A===n?A:Bt(Fe(A),0),D=D===n?D:Fe(D),G-=E?E.length:0,f&M){var H=v,K=E;v=E=n}var ne=$?n:Np(c),de=[c,f,m,v,E,H,K,S,A,D];if(ne&&EM(de,ne),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],D=de[9]=de[9]===n?$?0:c.length:Bt(de[9]-G,0),!D&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Te=rM(c,f,m);else f==N||f==I?Te=iM(c,f,D):(f==P||f==(_|P))&&!E.length?Te=sM(c,f,m,v):Te=Iu.apply(n,de);var Ve=ne?A_:sE;return oE(Ve(Te,de),c,f)}function K_(c,f,m,v){return c===n||qr(c,Jo[m])&&!at.call(v,m)?f:c}function J_(c,f,m,v,E,S){return wt(c)&&wt(f)&&(S.set(f,c),Ou(c,f,n,J_,S),S.delete(f)),c}function aM(c){return El(c)?n:c}function Y_(c,f,m,v,E,S){var A=m&y,D=c.length,$=f.length;if(D!=$&&!(A&&$>D))return!1;var G=S.get(c),H=S.get(f);if(G&&H)return G==f&&H==c;var K=-1,ne=!0,de=m&b?new Js:n;for(S.set(c,f),S.set(f,c);++K<D;){var Te=c[K],Ve=f[K];if(v)var Se=A?v(Ve,Te,K,f,c,S):v(Te,Ve,K,c,f,S);if(Se!==n){if(Se)continue;ne=!1;break}if(de){if(!Hh(f,function(Qe,Je){if(!al(de,Je)&&(Te===Qe||E(Te,Qe,m,v,S)))return de.push(Je)})){ne=!1;break}}else if(!(Te===Ve||E(Te,Ve,m,v,S))){ne=!1;break}}return S.delete(c),S.delete(f),ne}function lM(c,f,m,v,E,S,A){switch(m){case un:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Ne:return!(c.byteLength!=f.byteLength||!S(new hu(c),new hu(f)));case Ye:case Zt:case bi:return qr(+c,+f);case Vr:return c.name==f.name&&c.message==f.message;case Ki:case oe:return c==f+"";case wn:var D=ep;case R:var $=v&y;if(D||(D=au),c.size!=f.size&&!$)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=Y_(D(c),D(f),v,E,S,A);return A.delete(c),H;case ae:if(dl)return dl.call(c)==dl.call(f)}return!1}function cM(c,f,m,v,E,S){var A=m&y,D=Op(c),$=D.length,G=Op(f),H=G.length;if($!=H&&!A)return!1;for(var K=$;K--;){var ne=D[K];if(!(A?ne in f:at.call(f,ne)))return!1}var de=S.get(c),Te=S.get(f);if(de&&Te)return de==f&&Te==c;var Ve=!0;S.set(c,f),S.set(f,c);for(var Se=A;++K<$;){ne=D[K];var Qe=c[ne],Je=f[ne];if(v)var rr=A?v(Je,Qe,ne,f,c,S):v(Qe,Je,ne,c,f,S);if(!(rr===n?Qe===Je||E(Qe,Je,m,v,S):rr)){Ve=!1;break}Se||(Se=ne=="constructor")}if(Ve&&!Se){var On=c.constructor,ir=f.constructor;On!=ir&&"constructor"in c&&"constructor"in f&&!(typeof On=="function"&&On instanceof On&&typeof ir=="function"&&ir instanceof ir)&&(Ve=!1)}return S.delete(c),S.delete(f),Ve}function Oi(c){return Rp(rE(c,n,dE),c+"")}function Op(c){return y_(c,Gt,Ip)}function kp(c){return y_(c,jn,X_)}var Np=bu?function(c){return bu.get(c)}:Qp;function Ru(c){for(var f=c.name+"",m=Xo[f],v=at.call(Xo,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function na(c){var f=at.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||Wp;return c=c===Wp?__:c,arguments.length?c(arguments[0],arguments[1]):c}function Mu(c,f){var m=c.__data__;return yM(f)?m[typeof f=="string"?"string":"hash"]:m.map}function Ap(c){for(var f=Gt(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,tE(E)]}return f}function Zs(c,f){var m=_D(c,f);return b_(m)?m:n}function uM(c){var f=at.call(c,Hs),m=c[Hs];try{c[Hs]=n;var v=!0}catch{}var E=fu.call(c);return v&&(f?c[Hs]=m:delete c[Hs]),E}var Ip=np?function(c){return c==null?[]:(c=ut(c),Yi(np(c),function(f){return i_.call(c,f)}))}:Gp,X_=np?function(c){for(var f=[];c;)Xi(f,Ip(c)),c=pu(c);return f}:Gp,dn=Tn;(rp&&dn(new rp(new ArrayBuffer(1)))!=un||cl&&dn(new cl)!=wn||ip&&dn(ip.resolve())!=ol||Yo&&dn(new Yo)!=R||ul&&dn(new ul)!=Ot)&&(dn=function(c){var f=Tn(c),m=f==hr?c.constructor:n,v=m?eo(m):"";if(v)switch(v){case QD:return un;case GD:return wn;case HD:return ol;case KD:return R;case JD:return Ot}return f});function fM(c,f,m){for(var v=-1,E=m.length;++v<E;){var S=m[v],A=S.size;switch(S.type){case"drop":c+=A;break;case"dropRight":f-=A;break;case"take":f=fn(f,c+A);break;case"takeRight":c=Bt(c,f-A);break}}return{start:c,end:f}}function dM(c){var f=c.match(vC);return f?f[1].split(bC):[]}function Z_(c,f,m){f=rs(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=ri(f[v]);if(!(S=c!=null&&m(c,A)))break;c=c[A]}return S||++v!=E?S:(E=c==null?0:c.length,!!E&&Bu(E)&&ki(A,E)&&(De(c)||to(c)))}function hM(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&at.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function eE(c){return typeof c.constructor=="function"&&!bl(c)?Zo(pu(c)):{}}function pM(c,f,m){var v=c.constructor;switch(f){case Ne:return wp(c);case Ye:case Zt:return new v(+c);case un:return YR(c,m);case ei:case Vt:case jr:case _i:case pr:case Ji:case Xn:case Ph:case Fh:return F_(c,m);case wn:return new v;case bi:case oe:return new v(c);case Ki:return XR(c);case R:return new v;case ae:return ZR(c)}}function mM(c,f){var m=f.length;if(!m)return c;var v=m-1;return f[v]=(m>1?"& ":"")+f[v],f=f.join(m>2?", ":" "),c.replace(yC,`{
302
+ */nd.exports;(function(t,e){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,p=2,g=4,y=1,b=2,_=1,w=2,O=4,N=8,I=16,P=32,M=64,B=128,Q=256,x=512,U=30,be="...",Oe=800,ke=16,Le=1,te=2,Ae=3,fe=1/0,Ee=9007199254740991,ge=17976931348623157e292,ct=NaN,ve=4294967295,L=ve-1,Z=ve>>>1,Y=[["ary",B],["bind",_],["bindKey",w],["curry",N],["curryRight",I],["flip",x],["partial",P],["partialRight",M],["rearg",Q]],ee="[object Arguments]",we="[object Array]",Me="[object AsyncFunction]",Ye="[object Boolean]",Zt="[object Date]",Hi="[object DOMException]",Vr="[object Error]",Pt="[object Function]",sl="[object GeneratorFunction]",wn="[object Map]",bi="[object Number]",Mh="[object Null]",hr="[object Object]",ol="[object Promise]",tu="[object Proxy]",Ki="[object RegExp]",R="[object Set]",oe="[object String]",le="[object Symbol]",et="[object Undefined]",Ot="[object WeakMap]",gt="[object WeakSet]",Ne="[object ArrayBuffer]",un="[object DataView]",ei="[object Float32Array]",Vt="[object Float64Array]",jr="[object Int8Array]",_i="[object Int16Array]",pr="[object Int32Array]",Ji="[object Uint8Array]",Xn="[object Uint8ClampedArray]",Ph="[object Uint16Array]",Fh="[object Uint32Array]",sC=/\b__p \+= '';/g,oC=/\b(__p \+=) '' \+/g,aC=/(__e\(.*?\)|\b__t\)) \+\n'';/g,m0=/&(?:amp|lt|gt|quot|#39);/g,g0=/[&<>"']/g,lC=RegExp(m0.source),cC=RegExp(g0.source),uC=/<%-([\s\S]+?)%>/g,fC=/<%([\s\S]+?)%>/g,y0=/<%=([\s\S]+?)%>/g,dC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hC=/^\w*$/,pC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$h=/[\\^$.*+?()[\]{}|]/g,mC=RegExp($h.source),Lh=/^\s+/,gC=/\s/,yC=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vC=/\{\n\/\* \[wrapped with (.+)\] \*/,bC=/,? & /,_C=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,EC=/[()=,{}\[\]\/\s]/,wC=/\\(\\)?/g,TC=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v0=/\w*$/,SC=/^[-+]0x[0-9a-f]+$/i,OC=/^0b[01]+$/i,kC=/^\[object .+?Constructor\]$/,NC=/^0o[0-7]+$/i,AC=/^(?:0|[1-9]\d*)$/,IC=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nu=/($^)/,xC=/['\n\r\u2028\u2029\\]/g,ru="\\ud800-\\udfff",CC="\\u0300-\\u036f",DC="\\ufe20-\\ufe2f",RC="\\u20d0-\\u20ff",b0=CC+DC+RC,_0="\\u2700-\\u27bf",E0="a-z\\xdf-\\xf6\\xf8-\\xff",MC="\\xac\\xb1\\xd7\\xf7",PC="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",FC="\\u2000-\\u206f",$C=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",w0="A-Z\\xc0-\\xd6\\xd8-\\xde",T0="\\ufe0e\\ufe0f",S0=MC+PC+FC+$C,Vh="['’]",LC="["+ru+"]",O0="["+S0+"]",iu="["+b0+"]",k0="\\d+",VC="["+_0+"]",N0="["+E0+"]",A0="[^"+ru+S0+k0+_0+E0+w0+"]",jh="\\ud83c[\\udffb-\\udfff]",jC="(?:"+iu+"|"+jh+")",I0="[^"+ru+"]",Bh="(?:\\ud83c[\\udde6-\\uddff]){2}",Uh="[\\ud800-\\udbff][\\udc00-\\udfff]",zo="["+w0+"]",x0="\\u200d",C0="(?:"+N0+"|"+A0+")",BC="(?:"+zo+"|"+A0+")",D0="(?:"+Vh+"(?:d|ll|m|re|s|t|ve))?",R0="(?:"+Vh+"(?:D|LL|M|RE|S|T|VE))?",M0=jC+"?",P0="["+T0+"]?",UC="(?:"+x0+"(?:"+[I0,Bh,Uh].join("|")+")"+P0+M0+")*",qC="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",WC="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",F0=P0+M0+UC,zC="(?:"+[VC,Bh,Uh].join("|")+")"+F0,QC="(?:"+[I0+iu+"?",iu,Bh,Uh,LC].join("|")+")",GC=RegExp(Vh,"g"),HC=RegExp(iu,"g"),qh=RegExp(jh+"(?="+jh+")|"+QC+F0,"g"),KC=RegExp([zo+"?"+N0+"+"+D0+"(?="+[O0,zo,"$"].join("|")+")",BC+"+"+R0+"(?="+[O0,zo+C0,"$"].join("|")+")",zo+"?"+C0+"+"+D0,zo+"+"+R0,WC,qC,k0,zC].join("|"),"g"),JC=RegExp("["+x0+ru+b0+T0+"]"),YC=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,XC=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ZC=-1,yt={};yt[ei]=yt[Vt]=yt[jr]=yt[_i]=yt[pr]=yt[Ji]=yt[Xn]=yt[Ph]=yt[Fh]=!0,yt[ee]=yt[we]=yt[Ne]=yt[Ye]=yt[un]=yt[Zt]=yt[Vr]=yt[Pt]=yt[wn]=yt[bi]=yt[hr]=yt[Ki]=yt[R]=yt[oe]=yt[Ot]=!1;var dt={};dt[ee]=dt[we]=dt[Ne]=dt[un]=dt[Ye]=dt[Zt]=dt[ei]=dt[Vt]=dt[jr]=dt[_i]=dt[pr]=dt[wn]=dt[bi]=dt[hr]=dt[Ki]=dt[R]=dt[oe]=dt[le]=dt[Ji]=dt[Xn]=dt[Ph]=dt[Fh]=!0,dt[Vr]=dt[Pt]=dt[Ot]=!1;var eD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},rD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},iD=parseFloat,sD=parseInt,$0=typeof Re=="object"&&Re&&Re.Object===Object&&Re,oD=typeof self=="object"&&self&&self.Object===Object&&self,en=$0||oD||Function("return this")(),Wh=e&&!e.nodeType&&e,Gs=Wh&&!0&&t&&!t.nodeType&&t,L0=Gs&&Gs.exports===Wh,zh=L0&&$0.process,mr=function(){try{var F=Gs&&Gs.require&&Gs.require("util").types;return F||zh&&zh.binding&&zh.binding("util")}catch{}}(),V0=mr&&mr.isArrayBuffer,j0=mr&&mr.isDate,B0=mr&&mr.isMap,U0=mr&&mr.isRegExp,q0=mr&&mr.isSet,W0=mr&&mr.isTypedArray;function Zn(F,q,V){switch(V.length){case 0:return F.call(q);case 1:return F.call(q,V[0]);case 2:return F.call(q,V[0],V[1]);case 3:return F.call(q,V[0],V[1],V[2])}return F.apply(q,V)}function aD(F,q,V,se){for(var Ce=-1,it=F==null?0:F.length;++Ce<it;){var jt=F[Ce];q(se,jt,V(jt),F)}return se}function gr(F,q){for(var V=-1,se=F==null?0:F.length;++V<se&&q(F[V],V,F)!==!1;);return F}function lD(F,q){for(var V=F==null?0:F.length;V--&&q(F[V],V,F)!==!1;);return F}function z0(F,q){for(var V=-1,se=F==null?0:F.length;++V<se;)if(!q(F[V],V,F))return!1;return!0}function Yi(F,q){for(var V=-1,se=F==null?0:F.length,Ce=0,it=[];++V<se;){var jt=F[V];q(jt,V,F)&&(it[Ce++]=jt)}return it}function su(F,q){var V=F==null?0:F.length;return!!V&&Qo(F,q,0)>-1}function Qh(F,q,V){for(var se=-1,Ce=F==null?0:F.length;++se<Ce;)if(V(q,F[se]))return!0;return!1}function Et(F,q){for(var V=-1,se=F==null?0:F.length,Ce=Array(se);++V<se;)Ce[V]=q(F[V],V,F);return Ce}function Xi(F,q){for(var V=-1,se=q.length,Ce=F.length;++V<se;)F[Ce+V]=q[V];return F}function Gh(F,q,V,se){var Ce=-1,it=F==null?0:F.length;for(se&&it&&(V=F[++Ce]);++Ce<it;)V=q(V,F[Ce],Ce,F);return V}function cD(F,q,V,se){var Ce=F==null?0:F.length;for(se&&Ce&&(V=F[--Ce]);Ce--;)V=q(V,F[Ce],Ce,F);return V}function Hh(F,q){for(var V=-1,se=F==null?0:F.length;++V<se;)if(q(F[V],V,F))return!0;return!1}var uD=Kh("length");function fD(F){return F.split("")}function dD(F){return F.match(_C)||[]}function Q0(F,q,V){var se;return V(F,function(Ce,it,jt){if(q(Ce,it,jt))return se=it,!1}),se}function ou(F,q,V,se){for(var Ce=F.length,it=V+(se?1:-1);se?it--:++it<Ce;)if(q(F[it],it,F))return it;return-1}function Qo(F,q,V){return q===q?SD(F,q,V):ou(F,G0,V)}function hD(F,q,V,se){for(var Ce=V-1,it=F.length;++Ce<it;)if(se(F[Ce],q))return Ce;return-1}function G0(F){return F!==F}function H0(F,q){var V=F==null?0:F.length;return V?Yh(F,q)/V:ct}function Kh(F){return function(q){return q==null?n:q[F]}}function Jh(F){return function(q){return F==null?n:F[q]}}function K0(F,q,V,se,Ce){return Ce(F,function(it,jt,ut){V=se?(se=!1,it):q(V,it,jt,ut)}),V}function pD(F,q){var V=F.length;for(F.sort(q);V--;)F[V]=F[V].value;return F}function Yh(F,q){for(var V,se=-1,Ce=F.length;++se<Ce;){var it=q(F[se]);it!==n&&(V=V===n?it:V+it)}return V}function Xh(F,q){for(var V=-1,se=Array(F);++V<F;)se[V]=q(V);return se}function mD(F,q){return Et(q,function(V){return[V,F[V]]})}function J0(F){return F&&F.slice(0,e_(F)+1).replace(Lh,"")}function er(F){return function(q){return F(q)}}function Zh(F,q){return Et(q,function(V){return F[V]})}function al(F,q){return F.has(q)}function Y0(F,q){for(var V=-1,se=F.length;++V<se&&Qo(q,F[V],0)>-1;);return V}function X0(F,q){for(var V=F.length;V--&&Qo(q,F[V],0)>-1;);return V}function gD(F,q){for(var V=F.length,se=0;V--;)F[V]===q&&++se;return se}var yD=Jh(eD),vD=Jh(tD);function bD(F){return"\\"+rD[F]}function _D(F,q){return F==null?n:F[q]}function Go(F){return JC.test(F)}function ED(F){return YC.test(F)}function wD(F){for(var q,V=[];!(q=F.next()).done;)V.push(q.value);return V}function ep(F){var q=-1,V=Array(F.size);return F.forEach(function(se,Ce){V[++q]=[Ce,se]}),V}function Z0(F,q){return function(V){return F(q(V))}}function Zi(F,q){for(var V=-1,se=F.length,Ce=0,it=[];++V<se;){var jt=F[V];(jt===q||jt===d)&&(F[V]=d,it[Ce++]=V)}return it}function au(F){var q=-1,V=Array(F.size);return F.forEach(function(se){V[++q]=se}),V}function TD(F){var q=-1,V=Array(F.size);return F.forEach(function(se){V[++q]=[se,se]}),V}function SD(F,q,V){for(var se=V-1,Ce=F.length;++se<Ce;)if(F[se]===q)return se;return-1}function OD(F,q,V){for(var se=V+1;se--;)if(F[se]===q)return se;return se}function Ho(F){return Go(F)?ND(F):uD(F)}function Br(F){return Go(F)?AD(F):fD(F)}function e_(F){for(var q=F.length;q--&&gC.test(F.charAt(q)););return q}var kD=Jh(nD);function ND(F){for(var q=qh.lastIndex=0;qh.test(F);)++q;return q}function AD(F){return F.match(qh)||[]}function ID(F){return F.match(KC)||[]}var xD=function F(q){q=q==null?en:Ko.defaults(en.Object(),q,Ko.pick(en,XC));var V=q.Array,se=q.Date,Ce=q.Error,it=q.Function,jt=q.Math,ut=q.Object,tp=q.RegExp,CD=q.String,yr=q.TypeError,lu=V.prototype,DD=it.prototype,Jo=ut.prototype,cu=q["__core-js_shared__"],uu=DD.toString,at=Jo.hasOwnProperty,RD=0,t_=function(){var c=/[^.]+$/.exec(cu&&cu.keys&&cu.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),fu=Jo.toString,MD=uu.call(ut),PD=en._,FD=tp("^"+uu.call(at).replace($h,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),du=L0?q.Buffer:n,es=q.Symbol,hu=q.Uint8Array,n_=du?du.allocUnsafe:n,pu=Z0(ut.getPrototypeOf,ut),r_=ut.create,i_=Jo.propertyIsEnumerable,mu=lu.splice,s_=es?es.isConcatSpreadable:n,ll=es?es.iterator:n,Hs=es?es.toStringTag:n,gu=function(){try{var c=Zs(ut,"defineProperty");return c({},"",{}),c}catch{}}(),$D=q.clearTimeout!==en.clearTimeout&&q.clearTimeout,LD=se&&se.now!==en.Date.now&&se.now,VD=q.setTimeout!==en.setTimeout&&q.setTimeout,yu=jt.ceil,vu=jt.floor,np=ut.getOwnPropertySymbols,jD=du?du.isBuffer:n,o_=q.isFinite,BD=lu.join,UD=Z0(ut.keys,ut),Bt=jt.max,fn=jt.min,qD=se.now,WD=q.parseInt,a_=jt.random,zD=lu.reverse,rp=Zs(q,"DataView"),cl=Zs(q,"Map"),ip=Zs(q,"Promise"),Yo=Zs(q,"Set"),ul=Zs(q,"WeakMap"),fl=Zs(ut,"create"),bu=ul&&new ul,Xo={},QD=eo(rp),GD=eo(cl),HD=eo(ip),KD=eo(Yo),JD=eo(ul),_u=es?es.prototype:n,dl=_u?_u.valueOf:n,l_=_u?_u.toString:n;function T(c){if(kt(c)&&!De(c)&&!(c instanceof He)){if(c instanceof vr)return c;if(at.call(c,"__wrapped__"))return cE(c)}return new vr(c)}var Zo=function(){function c(){}return function(f){if(!wt(f))return{};if(r_)return r_(f);c.prototype=f;var m=new c;return c.prototype=n,m}}();function Eu(){}function vr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}T.templateSettings={escape:uC,evaluate:fC,interpolate:y0,variable:"",imports:{_:T}},T.prototype=Eu.prototype,T.prototype.constructor=T,vr.prototype=Zo(Eu.prototype),vr.prototype.constructor=vr;function He(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function YD(){var c=new He(this.__wrapped__);return c.__actions__=Ln(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ln(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ln(this.__views__),c}function XD(){if(this.__filtered__){var c=new He(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function ZD(){var c=this.__wrapped__.value(),f=this.__dir__,m=De(c),v=f<0,E=m?c.length:0,S=fM(0,E,this.__views__),A=S.start,D=S.end,$=D-A,G=v?D:A-1,H=this.__iteratees__,K=H.length,ne=0,de=fn($,this.__takeCount__);if(!m||!v&&E==$&&de==$)return D_(c,this.__actions__);var Te=[];e:for(;$--&&ne<de;){G+=f;for(var Ve=-1,Se=c[G];++Ve<K;){var Qe=H[Ve],Je=Qe.iteratee,rr=Qe.type,On=Je(Se);if(rr==te)Se=On;else if(!On){if(rr==Le)continue e;break e}}Te[ne++]=Se}return Te}He.prototype=Zo(Eu.prototype),He.prototype.constructor=He;function Ks(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function eR(){this.__data__=fl?fl(null):{},this.size=0}function tR(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function nR(c){var f=this.__data__;if(fl){var m=f[c];return m===l?n:m}return at.call(f,c)?f[c]:n}function rR(c){var f=this.__data__;return fl?f[c]!==n:at.call(f,c)}function iR(c,f){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=fl&&f===n?l:f,this}Ks.prototype.clear=eR,Ks.prototype.delete=tR,Ks.prototype.get=nR,Ks.prototype.has=rR,Ks.prototype.set=iR;function Ei(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function sR(){this.__data__=[],this.size=0}function oR(c){var f=this.__data__,m=wu(f,c);if(m<0)return!1;var v=f.length-1;return m==v?f.pop():mu.call(f,m,1),--this.size,!0}function aR(c){var f=this.__data__,m=wu(f,c);return m<0?n:f[m][1]}function lR(c){return wu(this.__data__,c)>-1}function cR(c,f){var m=this.__data__,v=wu(m,c);return v<0?(++this.size,m.push([c,f])):m[v][1]=f,this}Ei.prototype.clear=sR,Ei.prototype.delete=oR,Ei.prototype.get=aR,Ei.prototype.has=lR,Ei.prototype.set=cR;function wi(c){var f=-1,m=c==null?0:c.length;for(this.clear();++f<m;){var v=c[f];this.set(v[0],v[1])}}function uR(){this.size=0,this.__data__={hash:new Ks,map:new(cl||Ei),string:new Ks}}function fR(c){var f=Mu(this,c).delete(c);return this.size-=f?1:0,f}function dR(c){return Mu(this,c).get(c)}function hR(c){return Mu(this,c).has(c)}function pR(c,f){var m=Mu(this,c),v=m.size;return m.set(c,f),this.size+=m.size==v?0:1,this}wi.prototype.clear=uR,wi.prototype.delete=fR,wi.prototype.get=dR,wi.prototype.has=hR,wi.prototype.set=pR;function Js(c){var f=-1,m=c==null?0:c.length;for(this.__data__=new wi;++f<m;)this.add(c[f])}function mR(c){return this.__data__.set(c,l),this}function gR(c){return this.__data__.has(c)}Js.prototype.add=Js.prototype.push=mR,Js.prototype.has=gR;function Ur(c){var f=this.__data__=new Ei(c);this.size=f.size}function yR(){this.__data__=new Ei,this.size=0}function vR(c){var f=this.__data__,m=f.delete(c);return this.size=f.size,m}function bR(c){return this.__data__.get(c)}function _R(c){return this.__data__.has(c)}function ER(c,f){var m=this.__data__;if(m instanceof Ei){var v=m.__data__;if(!cl||v.length<i-1)return v.push([c,f]),this.size=++m.size,this;m=this.__data__=new wi(v)}return m.set(c,f),this.size=m.size,this}Ur.prototype.clear=yR,Ur.prototype.delete=vR,Ur.prototype.get=bR,Ur.prototype.has=_R,Ur.prototype.set=ER;function c_(c,f){var m=De(c),v=!m&&to(c),E=!m&&!v&&ss(c),S=!m&&!v&&!E&&ra(c),A=m||v||E||S,D=A?Xh(c.length,CD):[],$=D.length;for(var G in c)(f||at.call(c,G))&&!(A&&(G=="length"||E&&(G=="offset"||G=="parent")||S&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||ki(G,$)))&&D.push(G);return D}function u_(c){var f=c.length;return f?c[mp(0,f-1)]:n}function wR(c,f){return Pu(Ln(c),Ys(f,0,c.length))}function TR(c){return Pu(Ln(c))}function sp(c,f,m){(m!==n&&!qr(c[f],m)||m===n&&!(f in c))&&Ti(c,f,m)}function hl(c,f,m){var v=c[f];(!(at.call(c,f)&&qr(v,m))||m===n&&!(f in c))&&Ti(c,f,m)}function wu(c,f){for(var m=c.length;m--;)if(qr(c[m][0],f))return m;return-1}function SR(c,f,m,v){return ts(c,function(E,S,A){f(v,E,m(E),A)}),v}function f_(c,f){return c&&ni(f,Gt(f),c)}function OR(c,f){return c&&ni(f,jn(f),c)}function Ti(c,f,m){f=="__proto__"&&gu?gu(c,f,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[f]=m}function op(c,f){for(var m=-1,v=f.length,E=V(v),S=c==null;++m<v;)E[m]=S?n:jp(c,f[m]);return E}function Ys(c,f,m){return c===c&&(m!==n&&(c=c<=m?c:m),f!==n&&(c=c>=f?c:f)),c}function br(c,f,m,v,E,S){var A,D=f&h,$=f&p,G=f&g;if(m&&(A=E?m(c,v,E,S):m(c)),A!==n)return A;if(!wt(c))return c;var H=De(c);if(H){if(A=hM(c),!D)return Ln(c,A)}else{var K=dn(c),ne=K==Pt||K==sl;if(ss(c))return P_(c,D);if(K==hr||K==ee||ne&&!E){if(A=$||ne?{}:eE(c),!D)return $?nM(c,OR(A,c)):tM(c,f_(A,c))}else{if(!dt[K])return E?c:{};A=pM(c,K,D)}}S||(S=new Ur);var de=S.get(c);if(de)return de;S.set(c,A),IE(c)?c.forEach(function(Se){A.add(br(Se,f,m,Se,c,S))}):NE(c)&&c.forEach(function(Se,Qe){A.set(Qe,br(Se,f,m,Qe,c,S))});var Te=G?$?kp:Op:$?jn:Gt,Ve=H?n:Te(c);return gr(Ve||c,function(Se,Qe){Ve&&(Qe=Se,Se=c[Qe]),hl(A,Qe,br(Se,f,m,Qe,c,S))}),A}function kR(c){var f=Gt(c);return function(m){return d_(m,c,f)}}function d_(c,f,m){var v=m.length;if(c==null)return!v;for(c=ut(c);v--;){var E=m[v],S=f[E],A=c[E];if(A===n&&!(E in c)||!S(A))return!1}return!0}function h_(c,f,m){if(typeof c!="function")throw new yr(o);return _l(function(){c.apply(n,m)},f)}function pl(c,f,m,v){var E=-1,S=su,A=!0,D=c.length,$=[],G=f.length;if(!D)return $;m&&(f=Et(f,er(m))),v?(S=Qh,A=!1):f.length>=i&&(S=al,A=!1,f=new Js(f));e:for(;++E<D;){var H=c[E],K=m==null?H:m(H);if(H=v||H!==0?H:0,A&&K===K){for(var ne=G;ne--;)if(f[ne]===K)continue e;$.push(H)}else S(f,K,v)||$.push(H)}return $}var ts=j_(ti),p_=j_(lp,!0);function NR(c,f){var m=!0;return ts(c,function(v,E,S){return m=!!f(v,E,S),m}),m}function Tu(c,f,m){for(var v=-1,E=c.length;++v<E;){var S=c[v],A=f(S);if(A!=null&&(D===n?A===A&&!nr(A):m(A,D)))var D=A,$=S}return $}function AR(c,f,m,v){var E=c.length;for(m=Fe(m),m<0&&(m=-m>E?0:E+m),v=v===n||v>E?E:Fe(v),v<0&&(v+=E),v=m>v?0:CE(v);m<v;)c[m++]=f;return c}function m_(c,f){var m=[];return ts(c,function(v,E,S){f(v,E,S)&&m.push(v)}),m}function tn(c,f,m,v,E){var S=-1,A=c.length;for(m||(m=gM),E||(E=[]);++S<A;){var D=c[S];f>0&&m(D)?f>1?tn(D,f-1,m,v,E):Xi(E,D):v||(E[E.length]=D)}return E}var ap=B_(),g_=B_(!0);function ti(c,f){return c&&ap(c,f,Gt)}function lp(c,f){return c&&g_(c,f,Gt)}function Su(c,f){return Yi(f,function(m){return Ni(c[m])})}function Xs(c,f){f=rs(f,c);for(var m=0,v=f.length;c!=null&&m<v;)c=c[ri(f[m++])];return m&&m==v?c:n}function y_(c,f,m){var v=f(c);return De(c)?v:Xi(v,m(c))}function Tn(c){return c==null?c===n?et:Mh:Hs&&Hs in ut(c)?uM(c):TM(c)}function cp(c,f){return c>f}function IR(c,f){return c!=null&&at.call(c,f)}function xR(c,f){return c!=null&&f in ut(c)}function CR(c,f,m){return c>=fn(f,m)&&c<Bt(f,m)}function up(c,f,m){for(var v=m?Qh:su,E=c[0].length,S=c.length,A=S,D=V(S),$=1/0,G=[];A--;){var H=c[A];A&&f&&(H=Et(H,er(f))),$=fn(H.length,$),D[A]=!m&&(f||E>=120&&H.length>=120)?new Js(A&&H):n}H=c[0];var K=-1,ne=D[0];e:for(;++K<E&&G.length<$;){var de=H[K],Te=f?f(de):de;if(de=m||de!==0?de:0,!(ne?al(ne,Te):v(G,Te,m))){for(A=S;--A;){var Ve=D[A];if(!(Ve?al(Ve,Te):v(c[A],Te,m)))continue e}ne&&ne.push(Te),G.push(de)}}return G}function DR(c,f,m,v){return ti(c,function(E,S,A){f(v,m(E),S,A)}),v}function ml(c,f,m){f=rs(f,c),c=iE(c,f);var v=c==null?c:c[ri(Er(f))];return v==null?n:Zn(v,c,m)}function v_(c){return kt(c)&&Tn(c)==ee}function RR(c){return kt(c)&&Tn(c)==Ne}function MR(c){return kt(c)&&Tn(c)==Zt}function gl(c,f,m,v,E){return c===f?!0:c==null||f==null||!kt(c)&&!kt(f)?c!==c&&f!==f:PR(c,f,m,v,gl,E)}function PR(c,f,m,v,E,S){var A=De(c),D=De(f),$=A?we:dn(c),G=D?we:dn(f);$=$==ee?hr:$,G=G==ee?hr:G;var H=$==hr,K=G==hr,ne=$==G;if(ne&&ss(c)){if(!ss(f))return!1;A=!0,H=!1}if(ne&&!H)return S||(S=new Ur),A||ra(c)?Y_(c,f,m,v,E,S):lM(c,f,$,m,v,E,S);if(!(m&y)){var de=H&&at.call(c,"__wrapped__"),Te=K&&at.call(f,"__wrapped__");if(de||Te){var Ve=de?c.value():c,Se=Te?f.value():f;return S||(S=new Ur),E(Ve,Se,m,v,S)}}return ne?(S||(S=new Ur),cM(c,f,m,v,E,S)):!1}function FR(c){return kt(c)&&dn(c)==wn}function fp(c,f,m,v){var E=m.length,S=E,A=!v;if(c==null)return!S;for(c=ut(c);E--;){var D=m[E];if(A&&D[2]?D[1]!==c[D[0]]:!(D[0]in c))return!1}for(;++E<S;){D=m[E];var $=D[0],G=c[$],H=D[1];if(A&&D[2]){if(G===n&&!($ in c))return!1}else{var K=new Ur;if(v)var ne=v(G,H,$,c,f,K);if(!(ne===n?gl(H,G,y|b,v,K):ne))return!1}}return!0}function b_(c){if(!wt(c)||vM(c))return!1;var f=Ni(c)?FD:kC;return f.test(eo(c))}function $R(c){return kt(c)&&Tn(c)==Ki}function LR(c){return kt(c)&&dn(c)==R}function VR(c){return kt(c)&&Bu(c.length)&&!!yt[Tn(c)]}function __(c){return typeof c=="function"?c:c==null?Bn:typeof c=="object"?De(c)?T_(c[0],c[1]):w_(c):UE(c)}function dp(c){if(!bl(c))return UD(c);var f=[];for(var m in ut(c))at.call(c,m)&&m!="constructor"&&f.push(m);return f}function jR(c){if(!wt(c))return wM(c);var f=bl(c),m=[];for(var v in c)v=="constructor"&&(f||!at.call(c,v))||m.push(v);return m}function hp(c,f){return c<f}function E_(c,f){var m=-1,v=Vn(c)?V(c.length):[];return ts(c,function(E,S,A){v[++m]=f(E,S,A)}),v}function w_(c){var f=Ap(c);return f.length==1&&f[0][2]?nE(f[0][0],f[0][1]):function(m){return m===c||fp(m,c,f)}}function T_(c,f){return xp(c)&&tE(f)?nE(ri(c),f):function(m){var v=jp(m,c);return v===n&&v===f?Bp(m,c):gl(f,v,y|b)}}function Ou(c,f,m,v,E){c!==f&&ap(f,function(S,A){if(E||(E=new Ur),wt(S))BR(c,f,A,m,Ou,v,E);else{var D=v?v(Dp(c,A),S,A+"",c,f,E):n;D===n&&(D=S),sp(c,A,D)}},jn)}function BR(c,f,m,v,E,S,A){var D=Dp(c,m),$=Dp(f,m),G=A.get($);if(G){sp(c,m,G);return}var H=S?S(D,$,m+"",c,f,A):n,K=H===n;if(K){var ne=De($),de=!ne&&ss($),Te=!ne&&!de&&ra($);H=$,ne||de||Te?De(D)?H=D:xt(D)?H=Ln(D):de?(K=!1,H=P_($,!0)):Te?(K=!1,H=F_($,!0)):H=[]:El($)||to($)?(H=D,to(D)?H=DE(D):(!wt(D)||Ni(D))&&(H=eE($))):K=!1}K&&(A.set($,H),E(H,$,v,S,A),A.delete($)),sp(c,m,H)}function S_(c,f){var m=c.length;if(m)return f+=f<0?m:0,ki(f,m)?c[f]:n}function O_(c,f,m){f.length?f=Et(f,function(S){return De(S)?function(A){return Xs(A,S.length===1?S[0]:S)}:S}):f=[Bn];var v=-1;f=Et(f,er(_e()));var E=E_(c,function(S,A,D){var $=Et(f,function(G){return G(S)});return{criteria:$,index:++v,value:S}});return pD(E,function(S,A){return eM(S,A,m)})}function UR(c,f){return k_(c,f,function(m,v){return Bp(c,v)})}function k_(c,f,m){for(var v=-1,E=f.length,S={};++v<E;){var A=f[v],D=Xs(c,A);m(D,A)&&yl(S,rs(A,c),D)}return S}function qR(c){return function(f){return Xs(f,c)}}function pp(c,f,m,v){var E=v?hD:Qo,S=-1,A=f.length,D=c;for(c===f&&(f=Ln(f)),m&&(D=Et(c,er(m)));++S<A;)for(var $=0,G=f[S],H=m?m(G):G;($=E(D,H,$,v))>-1;)D!==c&&mu.call(D,$,1),mu.call(c,$,1);return c}function N_(c,f){for(var m=c?f.length:0,v=m-1;m--;){var E=f[m];if(m==v||E!==S){var S=E;ki(E)?mu.call(c,E,1):vp(c,E)}}return c}function mp(c,f){return c+vu(a_()*(f-c+1))}function WR(c,f,m,v){for(var E=-1,S=Bt(yu((f-c)/(m||1)),0),A=V(S);S--;)A[v?S:++E]=c,c+=m;return A}function gp(c,f){var m="";if(!c||f<1||f>Ee)return m;do f%2&&(m+=c),f=vu(f/2),f&&(c+=c);while(f);return m}function Ue(c,f){return Rp(rE(c,f,Bn),c+"")}function zR(c){return u_(ia(c))}function QR(c,f){var m=ia(c);return Pu(m,Ys(f,0,m.length))}function yl(c,f,m,v){if(!wt(c))return c;f=rs(f,c);for(var E=-1,S=f.length,A=S-1,D=c;D!=null&&++E<S;){var $=ri(f[E]),G=m;if($==="__proto__"||$==="constructor"||$==="prototype")return c;if(E!=A){var H=D[$];G=v?v(H,$,D):n,G===n&&(G=wt(H)?H:ki(f[E+1])?[]:{})}hl(D,$,G),D=D[$]}return c}var A_=bu?function(c,f){return bu.set(c,f),c}:Bn,GR=gu?function(c,f){return gu(c,"toString",{configurable:!0,enumerable:!1,value:qp(f),writable:!0})}:Bn;function HR(c){return Pu(ia(c))}function _r(c,f,m){var v=-1,E=c.length;f<0&&(f=-f>E?0:E+f),m=m>E?E:m,m<0&&(m+=E),E=f>m?0:m-f>>>0,f>>>=0;for(var S=V(E);++v<E;)S[v]=c[v+f];return S}function KR(c,f){var m;return ts(c,function(v,E,S){return m=f(v,E,S),!m}),!!m}function ku(c,f,m){var v=0,E=c==null?v:c.length;if(typeof f=="number"&&f===f&&E<=Z){for(;v<E;){var S=v+E>>>1,A=c[S];A!==null&&!nr(A)&&(m?A<=f:A<f)?v=S+1:E=S}return E}return yp(c,f,Bn,m)}function yp(c,f,m,v){var E=0,S=c==null?0:c.length;if(S===0)return 0;f=m(f);for(var A=f!==f,D=f===null,$=nr(f),G=f===n;E<S;){var H=vu((E+S)/2),K=m(c[H]),ne=K!==n,de=K===null,Te=K===K,Ve=nr(K);if(A)var Se=v||Te;else G?Se=Te&&(v||ne):D?Se=Te&&ne&&(v||!de):$?Se=Te&&ne&&!de&&(v||!Ve):de||Ve?Se=!1:Se=v?K<=f:K<f;Se?E=H+1:S=H}return fn(S,L)}function I_(c,f){for(var m=-1,v=c.length,E=0,S=[];++m<v;){var A=c[m],D=f?f(A):A;if(!m||!qr(D,$)){var $=D;S[E++]=A===0?0:A}}return S}function x_(c){return typeof c=="number"?c:nr(c)?ct:+c}function tr(c){if(typeof c=="string")return c;if(De(c))return Et(c,tr)+"";if(nr(c))return l_?l_.call(c):"";var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function ns(c,f,m){var v=-1,E=su,S=c.length,A=!0,D=[],$=D;if(m)A=!1,E=Qh;else if(S>=i){var G=f?null:oM(c);if(G)return au(G);A=!1,E=al,$=new Js}else $=f?[]:D;e:for(;++v<S;){var H=c[v],K=f?f(H):H;if(H=m||H!==0?H:0,A&&K===K){for(var ne=$.length;ne--;)if($[ne]===K)continue e;f&&$.push(K),D.push(H)}else E($,K,m)||($!==D&&$.push(K),D.push(H))}return D}function vp(c,f){return f=rs(f,c),c=iE(c,f),c==null||delete c[ri(Er(f))]}function C_(c,f,m,v){return yl(c,f,m(Xs(c,f)),v)}function Nu(c,f,m,v){for(var E=c.length,S=v?E:-1;(v?S--:++S<E)&&f(c[S],S,c););return m?_r(c,v?0:S,v?S+1:E):_r(c,v?S+1:0,v?E:S)}function D_(c,f){var m=c;return m instanceof He&&(m=m.value()),Gh(f,function(v,E){return E.func.apply(E.thisArg,Xi([v],E.args))},m)}function bp(c,f,m){var v=c.length;if(v<2)return v?ns(c[0]):[];for(var E=-1,S=V(v);++E<v;)for(var A=c[E],D=-1;++D<v;)D!=E&&(S[E]=pl(S[E]||A,c[D],f,m));return ns(tn(S,1),f,m)}function R_(c,f,m){for(var v=-1,E=c.length,S=f.length,A={};++v<E;){var D=v<S?f[v]:n;m(A,c[v],D)}return A}function _p(c){return xt(c)?c:[]}function Ep(c){return typeof c=="function"?c:Bn}function rs(c,f){return De(c)?c:xp(c,f)?[c]:lE(st(c))}var JR=Ue;function is(c,f,m){var v=c.length;return m=m===n?v:m,!f&&m>=v?c:_r(c,f,m)}var M_=$D||function(c){return en.clearTimeout(c)};function P_(c,f){if(f)return c.slice();var m=c.length,v=n_?n_(m):new c.constructor(m);return c.copy(v),v}function wp(c){var f=new c.constructor(c.byteLength);return new hu(f).set(new hu(c)),f}function YR(c,f){var m=f?wp(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function XR(c){var f=new c.constructor(c.source,v0.exec(c));return f.lastIndex=c.lastIndex,f}function ZR(c){return dl?ut(dl.call(c)):{}}function F_(c,f){var m=f?wp(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function $_(c,f){if(c!==f){var m=c!==n,v=c===null,E=c===c,S=nr(c),A=f!==n,D=f===null,$=f===f,G=nr(f);if(!D&&!G&&!S&&c>f||S&&A&&$&&!D&&!G||v&&A&&$||!m&&$||!E)return 1;if(!v&&!S&&!G&&c<f||G&&m&&E&&!v&&!S||D&&m&&E||!A&&E||!$)return-1}return 0}function eM(c,f,m){for(var v=-1,E=c.criteria,S=f.criteria,A=E.length,D=m.length;++v<A;){var $=$_(E[v],S[v]);if($){if(v>=D)return $;var G=m[v];return $*(G=="desc"?-1:1)}}return c.index-f.index}function L_(c,f,m,v){for(var E=-1,S=c.length,A=m.length,D=-1,$=f.length,G=Bt(S-A,0),H=V($+G),K=!v;++D<$;)H[D]=f[D];for(;++E<A;)(K||E<S)&&(H[m[E]]=c[E]);for(;G--;)H[D++]=c[E++];return H}function V_(c,f,m,v){for(var E=-1,S=c.length,A=-1,D=m.length,$=-1,G=f.length,H=Bt(S-D,0),K=V(H+G),ne=!v;++E<H;)K[E]=c[E];for(var de=E;++$<G;)K[de+$]=f[$];for(;++A<D;)(ne||E<S)&&(K[de+m[A]]=c[E++]);return K}function Ln(c,f){var m=-1,v=c.length;for(f||(f=V(v));++m<v;)f[m]=c[m];return f}function ni(c,f,m,v){var E=!m;m||(m={});for(var S=-1,A=f.length;++S<A;){var D=f[S],$=v?v(m[D],c[D],D,m,c):n;$===n&&($=c[D]),E?Ti(m,D,$):hl(m,D,$)}return m}function tM(c,f){return ni(c,Ip(c),f)}function nM(c,f){return ni(c,X_(c),f)}function Au(c,f){return function(m,v){var E=De(m)?aD:SR,S=f?f():{};return E(m,c,_e(v,2),S)}}function ea(c){return Ue(function(f,m){var v=-1,E=m.length,S=E>1?m[E-1]:n,A=E>2?m[2]:n;for(S=c.length>3&&typeof S=="function"?(E--,S):n,A&&Sn(m[0],m[1],A)&&(S=E<3?n:S,E=1),f=ut(f);++v<E;){var D=m[v];D&&c(f,D,v,S)}return f})}function j_(c,f){return function(m,v){if(m==null)return m;if(!Vn(m))return c(m,v);for(var E=m.length,S=f?E:-1,A=ut(m);(f?S--:++S<E)&&v(A[S],S,A)!==!1;);return m}}function B_(c){return function(f,m,v){for(var E=-1,S=ut(f),A=v(f),D=A.length;D--;){var $=A[c?D:++E];if(m(S[$],$,S)===!1)break}return f}}function rM(c,f,m){var v=f&_,E=vl(c);function S(){var A=this&&this!==en&&this instanceof S?E:c;return A.apply(v?m:this,arguments)}return S}function U_(c){return function(f){f=st(f);var m=Go(f)?Br(f):n,v=m?m[0]:f.charAt(0),E=m?is(m,1).join(""):f.slice(1);return v[c]()+E}}function ta(c){return function(f){return Gh(jE(VE(f).replace(GC,"")),c,"")}}function vl(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var m=Zo(c.prototype),v=c.apply(m,f);return wt(v)?v:m}}function iM(c,f,m){var v=vl(c);function E(){for(var S=arguments.length,A=V(S),D=S,$=na(E);D--;)A[D]=arguments[D];var G=S<3&&A[0]!==$&&A[S-1]!==$?[]:Zi(A,$);if(S-=G.length,S<m)return G_(c,f,Iu,E.placeholder,n,A,G,n,n,m-S);var H=this&&this!==en&&this instanceof E?v:c;return Zn(H,this,A)}return E}function q_(c){return function(f,m,v){var E=ut(f);if(!Vn(f)){var S=_e(m,3);f=Gt(f),m=function(D){return S(E[D],D,E)}}var A=c(f,m,v);return A>-1?E[S?f[A]:A]:n}}function W_(c){return Oi(function(f){var m=f.length,v=m,E=vr.prototype.thru;for(c&&f.reverse();v--;){var S=f[v];if(typeof S!="function")throw new yr(o);if(E&&!A&&Ru(S)=="wrapper")var A=new vr([],!0)}for(v=A?v:m;++v<m;){S=f[v];var D=Ru(S),$=D=="wrapper"?Np(S):n;$&&Cp($[0])&&$[1]==(B|N|P|Q)&&!$[4].length&&$[9]==1?A=A[Ru($[0])].apply(A,$[3]):A=S.length==1&&Cp(S)?A[D]():A.thru(S)}return function(){var G=arguments,H=G[0];if(A&&G.length==1&&De(H))return A.plant(H).value();for(var K=0,ne=m?f[K].apply(this,G):H;++K<m;)ne=f[K].call(this,ne);return ne}})}function Iu(c,f,m,v,E,S,A,D,$,G){var H=f&B,K=f&_,ne=f&w,de=f&(N|I),Te=f&x,Ve=ne?n:vl(c);function Se(){for(var Qe=arguments.length,Je=V(Qe),rr=Qe;rr--;)Je[rr]=arguments[rr];if(de)var On=na(Se),ir=gD(Je,On);if(v&&(Je=L_(Je,v,E,de)),S&&(Je=V_(Je,S,A,de)),Qe-=ir,de&&Qe<G){var Ct=Zi(Je,On);return G_(c,f,Iu,Se.placeholder,m,Je,Ct,D,$,G-Qe)}var Wr=K?m:this,Ii=ne?Wr[c]:c;return Qe=Je.length,D?Je=SM(Je,D):Te&&Qe>1&&Je.reverse(),H&&$<Qe&&(Je.length=$),this&&this!==en&&this instanceof Se&&(Ii=Ve||vl(Ii)),Ii.apply(Wr,Je)}return Se}function z_(c,f){return function(m,v){return DR(m,c,f(v),{})}}function xu(c,f){return function(m,v){var E;if(m===n&&v===n)return f;if(m!==n&&(E=m),v!==n){if(E===n)return v;typeof m=="string"||typeof v=="string"?(m=tr(m),v=tr(v)):(m=x_(m),v=x_(v)),E=c(m,v)}return E}}function Tp(c){return Oi(function(f){return f=Et(f,er(_e())),Ue(function(m){var v=this;return c(f,function(E){return Zn(E,v,m)})})})}function Cu(c,f){f=f===n?" ":tr(f);var m=f.length;if(m<2)return m?gp(f,c):f;var v=gp(f,yu(c/Ho(f)));return Go(f)?is(Br(v),0,c).join(""):v.slice(0,c)}function sM(c,f,m,v){var E=f&_,S=vl(c);function A(){for(var D=-1,$=arguments.length,G=-1,H=v.length,K=V(H+$),ne=this&&this!==en&&this instanceof A?S:c;++G<H;)K[G]=v[G];for(;$--;)K[G++]=arguments[++D];return Zn(ne,E?m:this,K)}return A}function Q_(c){return function(f,m,v){return v&&typeof v!="number"&&Sn(f,m,v)&&(m=v=n),f=Ai(f),m===n?(m=f,f=0):m=Ai(m),v=v===n?f<m?1:-1:Ai(v),WR(f,m,v,c)}}function Du(c){return function(f,m){return typeof f=="string"&&typeof m=="string"||(f=wr(f),m=wr(m)),c(f,m)}}function G_(c,f,m,v,E,S,A,D,$,G){var H=f&N,K=H?A:n,ne=H?n:A,de=H?S:n,Te=H?n:S;f|=H?P:M,f&=~(H?M:P),f&O||(f&=~(_|w));var Ve=[c,f,E,de,K,Te,ne,D,$,G],Se=m.apply(n,Ve);return Cp(c)&&sE(Se,Ve),Se.placeholder=v,oE(Se,c,f)}function Sp(c){var f=jt[c];return function(m,v){if(m=wr(m),v=v==null?0:fn(Fe(v),292),v&&o_(m)){var E=(st(m)+"e").split("e"),S=f(E[0]+"e"+(+E[1]+v));return E=(st(S)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return f(m)}}var oM=Yo&&1/au(new Yo([,-0]))[1]==fe?function(c){return new Yo(c)}:Qp;function H_(c){return function(f){var m=dn(f);return m==wn?ep(f):m==R?TD(f):mD(f,c(f))}}function Si(c,f,m,v,E,S,A,D){var $=f&w;if(!$&&typeof c!="function")throw new yr(o);var G=v?v.length:0;if(G||(f&=~(P|M),v=E=n),A=A===n?A:Bt(Fe(A),0),D=D===n?D:Fe(D),G-=E?E.length:0,f&M){var H=v,K=E;v=E=n}var ne=$?n:Np(c),de=[c,f,m,v,E,H,K,S,A,D];if(ne&&EM(de,ne),c=de[0],f=de[1],m=de[2],v=de[3],E=de[4],D=de[9]=de[9]===n?$?0:c.length:Bt(de[9]-G,0),!D&&f&(N|I)&&(f&=~(N|I)),!f||f==_)var Te=rM(c,f,m);else f==N||f==I?Te=iM(c,f,D):(f==P||f==(_|P))&&!E.length?Te=sM(c,f,m,v):Te=Iu.apply(n,de);var Ve=ne?A_:sE;return oE(Ve(Te,de),c,f)}function K_(c,f,m,v){return c===n||qr(c,Jo[m])&&!at.call(v,m)?f:c}function J_(c,f,m,v,E,S){return wt(c)&&wt(f)&&(S.set(f,c),Ou(c,f,n,J_,S),S.delete(f)),c}function aM(c){return El(c)?n:c}function Y_(c,f,m,v,E,S){var A=m&y,D=c.length,$=f.length;if(D!=$&&!(A&&$>D))return!1;var G=S.get(c),H=S.get(f);if(G&&H)return G==f&&H==c;var K=-1,ne=!0,de=m&b?new Js:n;for(S.set(c,f),S.set(f,c);++K<D;){var Te=c[K],Ve=f[K];if(v)var Se=A?v(Ve,Te,K,f,c,S):v(Te,Ve,K,c,f,S);if(Se!==n){if(Se)continue;ne=!1;break}if(de){if(!Hh(f,function(Qe,Je){if(!al(de,Je)&&(Te===Qe||E(Te,Qe,m,v,S)))return de.push(Je)})){ne=!1;break}}else if(!(Te===Ve||E(Te,Ve,m,v,S))){ne=!1;break}}return S.delete(c),S.delete(f),ne}function lM(c,f,m,v,E,S,A){switch(m){case un:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Ne:return!(c.byteLength!=f.byteLength||!S(new hu(c),new hu(f)));case Ye:case Zt:case bi:return qr(+c,+f);case Vr:return c.name==f.name&&c.message==f.message;case Ki:case oe:return c==f+"";case wn:var D=ep;case R:var $=v&y;if(D||(D=au),c.size!=f.size&&!$)return!1;var G=A.get(c);if(G)return G==f;v|=b,A.set(c,f);var H=Y_(D(c),D(f),v,E,S,A);return A.delete(c),H;case le:if(dl)return dl.call(c)==dl.call(f)}return!1}function cM(c,f,m,v,E,S){var A=m&y,D=Op(c),$=D.length,G=Op(f),H=G.length;if($!=H&&!A)return!1;for(var K=$;K--;){var ne=D[K];if(!(A?ne in f:at.call(f,ne)))return!1}var de=S.get(c),Te=S.get(f);if(de&&Te)return de==f&&Te==c;var Ve=!0;S.set(c,f),S.set(f,c);for(var Se=A;++K<$;){ne=D[K];var Qe=c[ne],Je=f[ne];if(v)var rr=A?v(Je,Qe,ne,f,c,S):v(Qe,Je,ne,c,f,S);if(!(rr===n?Qe===Je||E(Qe,Je,m,v,S):rr)){Ve=!1;break}Se||(Se=ne=="constructor")}if(Ve&&!Se){var On=c.constructor,ir=f.constructor;On!=ir&&"constructor"in c&&"constructor"in f&&!(typeof On=="function"&&On instanceof On&&typeof ir=="function"&&ir instanceof ir)&&(Ve=!1)}return S.delete(c),S.delete(f),Ve}function Oi(c){return Rp(rE(c,n,dE),c+"")}function Op(c){return y_(c,Gt,Ip)}function kp(c){return y_(c,jn,X_)}var Np=bu?function(c){return bu.get(c)}:Qp;function Ru(c){for(var f=c.name+"",m=Xo[f],v=at.call(Xo,f)?m.length:0;v--;){var E=m[v],S=E.func;if(S==null||S==c)return E.name}return f}function na(c){var f=at.call(T,"placeholder")?T:c;return f.placeholder}function _e(){var c=T.iteratee||Wp;return c=c===Wp?__:c,arguments.length?c(arguments[0],arguments[1]):c}function Mu(c,f){var m=c.__data__;return yM(f)?m[typeof f=="string"?"string":"hash"]:m.map}function Ap(c){for(var f=Gt(c),m=f.length;m--;){var v=f[m],E=c[v];f[m]=[v,E,tE(E)]}return f}function Zs(c,f){var m=_D(c,f);return b_(m)?m:n}function uM(c){var f=at.call(c,Hs),m=c[Hs];try{c[Hs]=n;var v=!0}catch{}var E=fu.call(c);return v&&(f?c[Hs]=m:delete c[Hs]),E}var Ip=np?function(c){return c==null?[]:(c=ut(c),Yi(np(c),function(f){return i_.call(c,f)}))}:Gp,X_=np?function(c){for(var f=[];c;)Xi(f,Ip(c)),c=pu(c);return f}:Gp,dn=Tn;(rp&&dn(new rp(new ArrayBuffer(1)))!=un||cl&&dn(new cl)!=wn||ip&&dn(ip.resolve())!=ol||Yo&&dn(new Yo)!=R||ul&&dn(new ul)!=Ot)&&(dn=function(c){var f=Tn(c),m=f==hr?c.constructor:n,v=m?eo(m):"";if(v)switch(v){case QD:return un;case GD:return wn;case HD:return ol;case KD:return R;case JD:return Ot}return f});function fM(c,f,m){for(var v=-1,E=m.length;++v<E;){var S=m[v],A=S.size;switch(S.type){case"drop":c+=A;break;case"dropRight":f-=A;break;case"take":f=fn(f,c+A);break;case"takeRight":c=Bt(c,f-A);break}}return{start:c,end:f}}function dM(c){var f=c.match(vC);return f?f[1].split(bC):[]}function Z_(c,f,m){f=rs(f,c);for(var v=-1,E=f.length,S=!1;++v<E;){var A=ri(f[v]);if(!(S=c!=null&&m(c,A)))break;c=c[A]}return S||++v!=E?S:(E=c==null?0:c.length,!!E&&Bu(E)&&ki(A,E)&&(De(c)||to(c)))}function hM(c){var f=c.length,m=new c.constructor(f);return f&&typeof c[0]=="string"&&at.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function eE(c){return typeof c.constructor=="function"&&!bl(c)?Zo(pu(c)):{}}function pM(c,f,m){var v=c.constructor;switch(f){case Ne:return wp(c);case Ye:case Zt:return new v(+c);case un:return YR(c,m);case ei:case Vt:case jr:case _i:case pr:case Ji:case Xn:case Ph:case Fh:return F_(c,m);case wn:return new v;case bi:case oe:return new v(c);case Ki:return XR(c);case R:return new v;case le:return ZR(c)}}function mM(c,f){var m=f.length;if(!m)return c;var v=m-1;return f[v]=(m>1?"& ":"")+f[v],f=f.join(m>2?", ":" "),c.replace(yC,`{
303
303
  /* [wrapped with `+f+`] */
304
- `)}function gM(c){return De(c)||to(c)||!!(s_&&c&&c[s_])}function ki(c,f){var m=typeof c;return f=f??Ee,!!f&&(m=="number"||m!="symbol"&&AC.test(c))&&c>-1&&c%1==0&&c<f}function Sn(c,f,m){if(!wt(m))return!1;var v=typeof f;return(v=="number"?Vn(m)&&ki(f,m.length):v=="string"&&f in m)?qr(m[f],c):!1}function xp(c,f){if(De(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||nr(c)?!0:hC.test(c)||!dC.test(c)||f!=null&&c in ut(f)}function yM(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Cp(c){var f=Ru(c),m=T[f];if(typeof m!="function"||!(f in He.prototype))return!1;if(c===m)return!0;var v=Np(m);return!!v&&c===v[0]}function vM(c){return!!t_&&t_ in c}var bM=cu?Ni:Hp;function bl(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||Jo;return c===m}function tE(c){return c===c&&!wt(c)}function nE(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in ut(m))}}function _M(c){var f=Vu(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function EM(c,f){var m=c[1],v=f[1],E=m|v,S=E<(_|w|B),A=v==B&&m==N||v==B&&m==Q&&c[7].length<=f[8]||v==(B|Q)&&f[7].length<=f[8]&&m==N;if(!(S||A))return c;v&_&&(c[2]=f[2],E|=m&_?0:O);var D=f[3];if(D){var $=c[3];c[3]=$?L_($,D,f[4]):D,c[4]=$?Zi(c[3],d):f[4]}return D=f[5],D&&($=c[5],c[5]=$?V_($,D,f[6]):D,c[6]=$?Zi(c[5],d):f[6]),D=f[7],D&&(c[7]=D),v&B&&(c[8]=c[8]==null?f[8]:fn(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function wM(c){var f=[];if(c!=null)for(var m in ut(c))f.push(m);return f}function TM(c){return fu.call(c)}function rE(c,f,m){return f=Bt(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Bt(v.length-f,0),A=V(S);++E<S;)A[E]=v[f+E];E=-1;for(var D=V(f+1);++E<f;)D[E]=v[E];return D[f]=m(A),Zn(c,this,D)}}function iE(c,f){return f.length<2?c:Xs(c,_r(f,0,-1))}function SM(c,f){for(var m=c.length,v=fn(f.length,m),E=Ln(c);v--;){var S=f[v];c[v]=ki(S,m)?E[S]:n}return c}function Dp(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var sE=aE(A_),_l=VD||function(c,f){return en.setTimeout(c,f)},Rp=aE(GR);function oE(c,f,m){var v=f+"";return Rp(c,mM(v,OM(dM(v),m)))}function aE(c){var f=0,m=0;return function(){var v=qD(),E=ke-(v-m);if(m=v,E>0){if(++f>=Oe)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Pu(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=mp(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var lE=_M(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(pC,function(m,v,E,S){f.push(E?S.replace(wC,"$1"):v||m)}),f});function ri(c){if(typeof c=="string"||nr(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function eo(c){if(c!=null){try{return uu.call(c)}catch{}try{return c+""}catch{}}return""}function OM(c,f){return gr(Y,function(m){var v="_."+m[0];f&m[1]&&!su(c,v)&&c.push(v)}),c.sort()}function cE(c){if(c instanceof He)return c.clone();var f=new vr(c.__wrapped__,c.__chain__);return f.__actions__=Ln(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function kM(c,f,m){(m?Sn(c,f,m):f===n)?f=1:f=Bt(Fe(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(yu(v/f));E<v;)A[S++]=_r(c,E,E+=f);return A}function NM(c){for(var f=-1,m=c==null?0:c.length,v=0,E=[];++f<m;){var S=c[f];S&&(E[v++]=S)}return E}function AM(){var c=arguments.length;if(!c)return[];for(var f=V(c-1),m=arguments[0],v=c;v--;)f[v-1]=arguments[v];return Xi(De(m)?Ln(m):[m],tn(f,1))}var IM=Ue(function(c,f){return xt(c)?pl(c,tn(f,1,xt,!0)):[]}),xM=Ue(function(c,f){var m=Er(f);return xt(m)&&(m=n),xt(c)?pl(c,tn(f,1,xt,!0),_e(m,2)):[]}),CM=Ue(function(c,f){var m=Er(f);return xt(m)&&(m=n),xt(c)?pl(c,tn(f,1,xt,!0),n,m):[]});function DM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),_r(c,f<0?0:f,v)):[]}function RM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),f=v-f,_r(c,0,f<0?0:f)):[]}function MM(c,f){return c&&c.length?Nu(c,_e(f,3),!0,!0):[]}function PM(c,f){return c&&c.length?Nu(c,_e(f,3),!0):[]}function FM(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Sn(c,f,m)&&(m=0,v=E),AR(c,f,m,v)):[]}function uE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Fe(m);return E<0&&(E=Bt(v+E,0)),ou(c,_e(f,3),E)}function fE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v-1;return m!==n&&(E=Fe(m),E=m<0?Bt(v+E,0):fn(E,v-1)),ou(c,_e(f,3),E,!0)}function dE(c){var f=c==null?0:c.length;return f?tn(c,1):[]}function $M(c){var f=c==null?0:c.length;return f?tn(c,fe):[]}function LM(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:Fe(f),tn(c,f)):[]}function VM(c){for(var f=-1,m=c==null?0:c.length,v={};++f<m;){var E=c[f];v[E[0]]=E[1]}return v}function hE(c){return c&&c.length?c[0]:n}function jM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Fe(m);return E<0&&(E=Bt(v+E,0)),Qo(c,f,E)}function BM(c){var f=c==null?0:c.length;return f?_r(c,0,-1):[]}var UM=Ue(function(c){var f=Et(c,_p);return f.length&&f[0]===c[0]?up(f):[]}),qM=Ue(function(c){var f=Er(c),m=Et(c,_p);return f===Er(m)?f=n:m.pop(),m.length&&m[0]===c[0]?up(m,_e(f,2)):[]}),WM=Ue(function(c){var f=Er(c),m=Et(c,_p);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?up(m,n,f):[]});function zM(c,f){return c==null?"":BD.call(c,f)}function Er(c){var f=c==null?0:c.length;return f?c[f-1]:n}function QM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v;return m!==n&&(E=Fe(m),E=E<0?Bt(v+E,0):fn(E,v-1)),f===f?OD(c,f,E):ou(c,G0,E,!0)}function GM(c,f){return c&&c.length?S_(c,Fe(f)):n}var HM=Ue(pE);function pE(c,f){return c&&c.length&&f&&f.length?pp(c,f):c}function KM(c,f,m){return c&&c.length&&f&&f.length?pp(c,f,_e(m,2)):c}function JM(c,f,m){return c&&c.length&&f&&f.length?pp(c,f,n,m):c}var YM=Oi(function(c,f){var m=c==null?0:c.length,v=op(c,f);return N_(c,Et(f,function(E){return ki(E,m)?+E:E}).sort($_)),v});function XM(c,f){var m=[];if(!(c&&c.length))return m;var v=-1,E=[],S=c.length;for(f=_e(f,3);++v<S;){var A=c[v];f(A,v,c)&&(m.push(A),E.push(v))}return N_(c,E),m}function Mp(c){return c==null?c:zD.call(c)}function ZM(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&Sn(c,f,m)?(f=0,m=v):(f=f==null?0:Fe(f),m=m===n?v:Fe(m)),_r(c,f,m)):[]}function eP(c,f){return ku(c,f)}function tP(c,f,m){return yp(c,f,_e(m,2))}function nP(c,f){var m=c==null?0:c.length;if(m){var v=ku(c,f);if(v<m&&qr(c[v],f))return v}return-1}function rP(c,f){return ku(c,f,!0)}function iP(c,f,m){return yp(c,f,_e(m,2),!0)}function sP(c,f){var m=c==null?0:c.length;if(m){var v=ku(c,f,!0)-1;if(qr(c[v],f))return v}return-1}function oP(c){return c&&c.length?I_(c):[]}function aP(c,f){return c&&c.length?I_(c,_e(f,2)):[]}function lP(c){var f=c==null?0:c.length;return f?_r(c,1,f):[]}function cP(c,f,m){return c&&c.length?(f=m||f===n?1:Fe(f),_r(c,0,f<0?0:f)):[]}function uP(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),f=v-f,_r(c,f<0?0:f,v)):[]}function fP(c,f){return c&&c.length?Nu(c,_e(f,3),!1,!0):[]}function dP(c,f){return c&&c.length?Nu(c,_e(f,3)):[]}var hP=Ue(function(c){return ns(tn(c,1,xt,!0))}),pP=Ue(function(c){var f=Er(c);return xt(f)&&(f=n),ns(tn(c,1,xt,!0),_e(f,2))}),mP=Ue(function(c){var f=Er(c);return f=typeof f=="function"?f:n,ns(tn(c,1,xt,!0),n,f)});function gP(c){return c&&c.length?ns(c):[]}function yP(c,f){return c&&c.length?ns(c,_e(f,2)):[]}function vP(c,f){return f=typeof f=="function"?f:n,c&&c.length?ns(c,n,f):[]}function Pp(c){if(!(c&&c.length))return[];var f=0;return c=Yi(c,function(m){if(xt(m))return f=Bt(m.length,f),!0}),Xh(f,function(m){return Et(c,Kh(m))})}function mE(c,f){if(!(c&&c.length))return[];var m=Pp(c);return f==null?m:Et(m,function(v){return Zn(f,n,v)})}var bP=Ue(function(c,f){return xt(c)?pl(c,f):[]}),_P=Ue(function(c){return bp(Yi(c,xt))}),EP=Ue(function(c){var f=Er(c);return xt(f)&&(f=n),bp(Yi(c,xt),_e(f,2))}),wP=Ue(function(c){var f=Er(c);return f=typeof f=="function"?f:n,bp(Yi(c,xt),n,f)}),TP=Ue(Pp);function SP(c,f){return R_(c||[],f||[],hl)}function OP(c,f){return R_(c||[],f||[],yl)}var kP=Ue(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,mE(c,m)});function gE(c){var f=T(c);return f.__chain__=!0,f}function NP(c,f){return f(c),c}function Fu(c,f){return f(c)}var AP=Oi(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return op(S,c)};return f>1||this.__actions__.length||!(v instanceof He)||!ki(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:Fu,args:[E],thisArg:n}),new vr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function IP(){return gE(this)}function xP(){return new vr(this.value(),this.__chain__)}function CP(){this.__values__===n&&(this.__values__=xE(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function DP(){return this}function RP(c){for(var f,m=this;m instanceof Eu;){var v=cE(m);v.__index__=0,v.__values__=n,f?E.__wrapped__=v:f=v;var E=v;m=m.__wrapped__}return E.__wrapped__=c,f}function MP(){var c=this.__wrapped__;if(c instanceof He){var f=c;return this.__actions__.length&&(f=new He(this)),f=f.reverse(),f.__actions__.push({func:Fu,args:[Mp],thisArg:n}),new vr(f,this.__chain__)}return this.thru(Mp)}function PP(){return D_(this.__wrapped__,this.__actions__)}var FP=Au(function(c,f,m){at.call(c,m)?++c[m]:Ti(c,m,1)});function $P(c,f,m){var v=De(c)?z0:NR;return m&&Sn(c,f,m)&&(f=n),v(c,_e(f,3))}function LP(c,f){var m=De(c)?Yi:m_;return m(c,_e(f,3))}var VP=q_(uE),jP=q_(fE);function BP(c,f){return tn($u(c,f),1)}function UP(c,f){return tn($u(c,f),fe)}function qP(c,f,m){return m=m===n?1:Fe(m),tn($u(c,f),m)}function yE(c,f){var m=De(c)?gr:ts;return m(c,_e(f,3))}function vE(c,f){var m=De(c)?lD:p_;return m(c,_e(f,3))}var WP=Au(function(c,f,m){at.call(c,m)?c[m].push(f):Ti(c,m,[f])});function zP(c,f,m,v){c=Vn(c)?c:ia(c),m=m&&!v?Fe(m):0;var E=c.length;return m<0&&(m=Bt(E+m,0)),Uu(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&Qo(c,f,m)>-1}var QP=Ue(function(c,f,m){var v=-1,E=typeof f=="function",S=Vn(c)?V(c.length):[];return ts(c,function(A){S[++v]=E?Zn(f,A,m):ml(A,f,m)}),S}),GP=Au(function(c,f,m){Ti(c,m,f)});function $u(c,f){var m=De(c)?Et:E_;return m(c,_e(f,3))}function HP(c,f,m,v){return c==null?[]:(De(f)||(f=f==null?[]:[f]),m=v?n:m,De(m)||(m=m==null?[]:[m]),O_(c,f,m))}var KP=Au(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function JP(c,f,m){var v=De(c)?Gh:K0,E=arguments.length<3;return v(c,_e(f,4),m,E,ts)}function YP(c,f,m){var v=De(c)?cD:K0,E=arguments.length<3;return v(c,_e(f,4),m,E,p_)}function XP(c,f){var m=De(c)?Yi:m_;return m(c,ju(_e(f,3)))}function ZP(c){var f=De(c)?u_:zR;return f(c)}function eF(c,f,m){(m?Sn(c,f,m):f===n)?f=1:f=Fe(f);var v=De(c)?wR:QR;return v(c,f)}function tF(c){var f=De(c)?TR:HR;return f(c)}function nF(c){if(c==null)return 0;if(Vn(c))return Uu(c)?Ho(c):c.length;var f=dn(c);return f==wn||f==R?c.size:dp(c).length}function rF(c,f,m){var v=De(c)?Hh:KR;return m&&Sn(c,f,m)&&(f=n),v(c,_e(f,3))}var iF=Ue(function(c,f){if(c==null)return[];var m=f.length;return m>1&&Sn(c,f[0],f[1])?f=[]:m>2&&Sn(f[0],f[1],f[2])&&(f=[f[0]]),O_(c,tn(f,1),[])}),Lu=LD||function(){return en.Date.now()};function sF(c,f){if(typeof f!="function")throw new yr(o);return c=Fe(c),function(){if(--c<1)return f.apply(this,arguments)}}function bE(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,Si(c,B,n,n,n,n,f)}function _E(c,f){var m;if(typeof f!="function")throw new yr(o);return c=Fe(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var Fp=Ue(function(c,f,m){var v=_;if(m.length){var E=Zi(m,na(Fp));v|=P}return Si(c,v,f,m,E)}),EE=Ue(function(c,f,m){var v=_|w;if(m.length){var E=Zi(m,na(EE));v|=P}return Si(f,v,c,m,E)});function wE(c,f,m){f=m?n:f;var v=Si(c,N,n,n,n,n,n,f);return v.placeholder=wE.placeholder,v}function TE(c,f,m){f=m?n:f;var v=Si(c,I,n,n,n,n,n,f);return v.placeholder=TE.placeholder,v}function SE(c,f,m){var v,E,S,A,D,$,G=0,H=!1,K=!1,ne=!0;if(typeof c!="function")throw new yr(o);f=wr(f)||0,wt(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Bt(wr(m.maxWait)||0,f):S,ne="trailing"in m?!!m.trailing:ne);function de(Ct){var Wr=v,Ii=E;return v=E=n,G=Ct,A=c.apply(Ii,Wr),A}function Te(Ct){return G=Ct,D=_l(Qe,f),H?de(Ct):A}function Ve(Ct){var Wr=Ct-$,Ii=Ct-G,qE=f-Wr;return K?fn(qE,S-Ii):qE}function Se(Ct){var Wr=Ct-$,Ii=Ct-G;return $===n||Wr>=f||Wr<0||K&&Ii>=S}function Qe(){var Ct=Lu();if(Se(Ct))return Je(Ct);D=_l(Qe,Ve(Ct))}function Je(Ct){return D=n,ne&&v?de(Ct):(v=E=n,A)}function rr(){D!==n&&M_(D),G=0,v=$=E=D=n}function On(){return D===n?A:Je(Lu())}function ir(){var Ct=Lu(),Wr=Se(Ct);if(v=arguments,E=this,$=Ct,Wr){if(D===n)return Te($);if(K)return M_(D),D=_l(Qe,f),de($)}return D===n&&(D=_l(Qe,f)),A}return ir.cancel=rr,ir.flush=On,ir}var oF=Ue(function(c,f){return h_(c,1,f)}),aF=Ue(function(c,f,m){return h_(c,wr(f)||0,m)});function lF(c){return Si(c,x)}function Vu(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new yr(o);var m=function(){var v=arguments,E=f?f.apply(this,v):v[0],S=m.cache;if(S.has(E))return S.get(E);var A=c.apply(this,v);return m.cache=S.set(E,A)||S,A};return m.cache=new(Vu.Cache||wi),m}Vu.Cache=wi;function ju(c){if(typeof c!="function")throw new yr(o);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function cF(c){return _E(2,c)}var uF=JR(function(c,f){f=f.length==1&&De(f[0])?Et(f[0],er(_e())):Et(tn(f,1),er(_e()));var m=f.length;return Ue(function(v){for(var E=-1,S=fn(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return Zn(c,this,v)})}),$p=Ue(function(c,f){var m=Zi(f,na($p));return Si(c,P,n,f,m)}),OE=Ue(function(c,f){var m=Zi(f,na(OE));return Si(c,M,n,f,m)}),fF=Oi(function(c,f){return Si(c,Q,n,n,n,f)});function dF(c,f){if(typeof c!="function")throw new yr(o);return f=f===n?f:Fe(f),Ue(c,f)}function hF(c,f){if(typeof c!="function")throw new yr(o);return f=f==null?0:Bt(Fe(f),0),Ue(function(m){var v=m[f],E=is(m,0,f);return v&&Xi(E,v),Zn(c,this,E)})}function pF(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new yr(o);return wt(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),SE(c,f,{leading:v,maxWait:f,trailing:E})}function mF(c){return bE(c,1)}function gF(c,f){return $p(Ep(f),c)}function yF(){if(!arguments.length)return[];var c=arguments[0];return De(c)?c:[c]}function vF(c){return br(c,g)}function bF(c,f){return f=typeof f=="function"?f:n,br(c,g,f)}function _F(c){return br(c,h|g)}function EF(c,f){return f=typeof f=="function"?f:n,br(c,h|g,f)}function wF(c,f){return f==null||d_(c,f,Gt(f))}function qr(c,f){return c===f||c!==c&&f!==f}var TF=Du(cp),SF=Du(function(c,f){return c>=f}),to=v_(function(){return arguments}())?v_:function(c){return kt(c)&&at.call(c,"callee")&&!i_.call(c,"callee")},De=V.isArray,OF=V0?er(V0):RR;function Vn(c){return c!=null&&Bu(c.length)&&!Ni(c)}function xt(c){return kt(c)&&Vn(c)}function kF(c){return c===!0||c===!1||kt(c)&&Tn(c)==Ye}var ss=jD||Hp,NF=j0?er(j0):MR;function AF(c){return kt(c)&&c.nodeType===1&&!El(c)}function IF(c){if(c==null)return!0;if(Vn(c)&&(De(c)||typeof c=="string"||typeof c.splice=="function"||ss(c)||ra(c)||to(c)))return!c.length;var f=dn(c);if(f==wn||f==R)return!c.size;if(bl(c))return!dp(c).length;for(var m in c)if(at.call(c,m))return!1;return!0}function xF(c,f){return gl(c,f)}function CF(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?gl(c,f,n,m):!!v}function Lp(c){if(!kt(c))return!1;var f=Tn(c);return f==Vr||f==Hi||typeof c.message=="string"&&typeof c.name=="string"&&!El(c)}function DF(c){return typeof c=="number"&&o_(c)}function Ni(c){if(!wt(c))return!1;var f=Tn(c);return f==Pt||f==sl||f==Me||f==tu}function kE(c){return typeof c=="number"&&c==Fe(c)}function Bu(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Ee}function wt(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function kt(c){return c!=null&&typeof c=="object"}var NE=B0?er(B0):FR;function RF(c,f){return c===f||fp(c,f,Ap(f))}function MF(c,f,m){return m=typeof m=="function"?m:n,fp(c,f,Ap(f),m)}function PF(c){return AE(c)&&c!=+c}function FF(c){if(bM(c))throw new Ce(s);return b_(c)}function $F(c){return c===null}function LF(c){return c==null}function AE(c){return typeof c=="number"||kt(c)&&Tn(c)==bi}function El(c){if(!kt(c)||Tn(c)!=hr)return!1;var f=pu(c);if(f===null)return!0;var m=at.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&uu.call(m)==MD}var Vp=U0?er(U0):$R;function VF(c){return kE(c)&&c>=-Ee&&c<=Ee}var IE=q0?er(q0):LR;function Uu(c){return typeof c=="string"||!De(c)&&kt(c)&&Tn(c)==oe}function nr(c){return typeof c=="symbol"||kt(c)&&Tn(c)==ae}var ra=W0?er(W0):VR;function jF(c){return c===n}function BF(c){return kt(c)&&dn(c)==Ot}function UF(c){return kt(c)&&Tn(c)==gt}var qF=Du(hp),WF=Du(function(c,f){return c<=f});function xE(c){if(!c)return[];if(Vn(c))return Uu(c)?Br(c):Ln(c);if(ll&&c[ll])return wD(c[ll]());var f=dn(c),m=f==wn?ep:f==R?au:ia;return m(c)}function Ai(c){if(!c)return c===0?c:0;if(c=wr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*ge}return c===c?c:0}function Fe(c){var f=Ai(c),m=f%1;return f===f?m?f-m:f:0}function CE(c){return c?Ys(Fe(c),0,ve):0}function wr(c){if(typeof c=="number")return c;if(nr(c))return ct;if(wt(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=wt(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=J0(c);var m=OC.test(c);return m||NC.test(c)?sD(c.slice(2),m?2:8):SC.test(c)?ct:+c}function DE(c){return ni(c,jn(c))}function zF(c){return c?Ys(Fe(c),-Ee,Ee):c===0?c:0}function st(c){return c==null?"":tr(c)}var QF=ea(function(c,f){if(bl(f)||Vn(f)){ni(f,Gt(f),c);return}for(var m in f)at.call(f,m)&&hl(c,m,f[m])}),RE=ea(function(c,f){ni(f,jn(f),c)}),qu=ea(function(c,f,m,v){ni(f,jn(f),c,v)}),GF=ea(function(c,f,m,v){ni(f,Gt(f),c,v)}),HF=Oi(op);function KF(c,f){var m=Zo(c);return f==null?m:f_(m,f)}var JF=Ue(function(c,f){c=ut(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&Sn(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=jn(S),D=-1,$=A.length;++D<$;){var G=A[D],H=c[G];(H===n||qr(H,Jo[G])&&!at.call(c,G))&&(c[G]=S[G])}return c}),YF=Ue(function(c){return c.push(n,J_),Zn(ME,n,c)});function XF(c,f){return Q0(c,_e(f,3),ti)}function ZF(c,f){return Q0(c,_e(f,3),lp)}function e$(c,f){return c==null?c:ap(c,_e(f,3),jn)}function t$(c,f){return c==null?c:g_(c,_e(f,3),jn)}function n$(c,f){return c&&ti(c,_e(f,3))}function r$(c,f){return c&&lp(c,_e(f,3))}function i$(c){return c==null?[]:Su(c,Gt(c))}function s$(c){return c==null?[]:Su(c,jn(c))}function jp(c,f,m){var v=c==null?n:Xs(c,f);return v===n?m:v}function o$(c,f){return c!=null&&Z_(c,f,IR)}function Bp(c,f){return c!=null&&Z_(c,f,xR)}var a$=z_(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=fu.call(f)),c[f]=m},qp(Bn)),l$=z_(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=fu.call(f)),at.call(c,f)?c[f].push(m):c[f]=[m]},_e),c$=Ue(ml);function Gt(c){return Vn(c)?c_(c):dp(c)}function jn(c){return Vn(c)?c_(c,!0):jR(c)}function u$(c,f){var m={};return f=_e(f,3),ti(c,function(v,E,S){Ti(m,f(v,E,S),v)}),m}function f$(c,f){var m={};return f=_e(f,3),ti(c,function(v,E,S){Ti(m,E,f(v,E,S))}),m}var d$=ea(function(c,f,m){Ou(c,f,m)}),ME=ea(function(c,f,m,v){Ou(c,f,m,v)}),h$=Oi(function(c,f){var m={};if(c==null)return m;var v=!1;f=Et(f,function(S){return S=rs(S,c),v||(v=S.length>1),S}),ni(c,kp(c),m),v&&(m=br(m,h|p|g,aM));for(var E=f.length;E--;)vp(m,f[E]);return m});function p$(c,f){return PE(c,ju(_e(f)))}var m$=Oi(function(c,f){return c==null?{}:UR(c,f)});function PE(c,f){if(c==null)return{};var m=Et(kp(c),function(v){return[v]});return f=_e(f),k_(c,m,function(v,E){return f(v,E[0])})}function g$(c,f,m){f=rs(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[ri(f[v])];S===n&&(v=E,S=m),c=Ni(S)?S.call(c):S}return c}function y$(c,f,m){return c==null?c:yl(c,f,m)}function v$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:yl(c,f,m,v)}var FE=H_(Gt),$E=H_(jn);function b$(c,f,m){var v=De(c),E=v||ss(c)||ra(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:wt(c)?m=Ni(S)?Zo(pu(c)):{}:m={}}return(E?gr:ti)(c,function(A,D,$){return f(m,A,D,$)}),m}function _$(c,f){return c==null?!0:vp(c,f)}function E$(c,f,m){return c==null?c:C_(c,f,Ep(m))}function w$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:C_(c,f,Ep(m),v)}function ia(c){return c==null?[]:Zh(c,Gt(c))}function T$(c){return c==null?[]:Zh(c,jn(c))}function S$(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=wr(m),m=m===m?m:0),f!==n&&(f=wr(f),f=f===f?f:0),Ys(wr(c),f,m)}function O$(c,f,m){return f=Ai(f),m===n?(m=f,f=0):m=Ai(m),c=wr(c),CR(c,f,m)}function k$(c,f,m){if(m&&typeof m!="boolean"&&Sn(c,f,m)&&(f=m=n),m===n&&(typeof f=="boolean"?(m=f,f=n):typeof c=="boolean"&&(m=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Ai(c),f===n?(f=c,c=0):f=Ai(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=a_();return fn(c+E*(f-c+iD("1e-"+((E+"").length-1))),f)}return mp(c,f)}var N$=ta(function(c,f,m){return f=f.toLowerCase(),c+(m?LE(f):f)});function LE(c){return Up(st(c).toLowerCase())}function VE(c){return c=st(c),c&&c.replace(IC,yD).replace(HC,"")}function A$(c,f,m){c=st(c),f=tr(f);var v=c.length;m=m===n?v:Ys(Fe(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function I$(c){return c=st(c),c&&cC.test(c)?c.replace(g0,vD):c}function x$(c){return c=st(c),c&&mC.test(c)?c.replace($h,"\\$&"):c}var C$=ta(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),D$=ta(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),R$=U_("toLowerCase");function M$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return Cu(vu(E),m)+c+Cu(yu(E),m)}function P$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;return f&&v<f?c+Cu(f-v,m):c}function F$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;return f&&v<f?Cu(f-v,m)+c:c}function $$(c,f,m){return m||f==null?f=0:f&&(f=+f),WD(st(c).replace(Lh,""),f||0)}function L$(c,f,m){return(m?Sn(c,f,m):f===n)?f=1:f=Fe(f),gp(st(c),f)}function V$(){var c=arguments,f=st(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var j$=ta(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function B$(c,f,m){return m&&typeof m!="number"&&Sn(c,f,m)&&(f=m=n),m=m===n?ve:m>>>0,m?(c=st(c),c&&(typeof f=="string"||f!=null&&!Vp(f))&&(f=tr(f),!f&&Go(c))?is(Br(c),0,m):c.split(f,m)):[]}var U$=ta(function(c,f,m){return c+(m?" ":"")+Up(f)});function q$(c,f,m){return c=st(c),m=m==null?0:Ys(Fe(m),0,c.length),f=tr(f),c.slice(m,m+f.length)==f}function W$(c,f,m){var v=T.templateSettings;m&&Sn(c,f,m)&&(f=n),c=st(c),f=qu({},f,v,K_);var E=qu({},f.imports,v.imports,K_),S=Gt(E),A=Zh(E,S),D,$,G=0,H=f.interpolate||nu,K="__p += '",ne=tp((f.escape||nu).source+"|"+H.source+"|"+(H===y0?TC:nu).source+"|"+(f.evaluate||nu).source+"|$","g"),de="//# sourceURL="+(at.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ZC+"]")+`
304
+ `)}function gM(c){return De(c)||to(c)||!!(s_&&c&&c[s_])}function ki(c,f){var m=typeof c;return f=f??Ee,!!f&&(m=="number"||m!="symbol"&&AC.test(c))&&c>-1&&c%1==0&&c<f}function Sn(c,f,m){if(!wt(m))return!1;var v=typeof f;return(v=="number"?Vn(m)&&ki(f,m.length):v=="string"&&f in m)?qr(m[f],c):!1}function xp(c,f){if(De(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||nr(c)?!0:hC.test(c)||!dC.test(c)||f!=null&&c in ut(f)}function yM(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Cp(c){var f=Ru(c),m=T[f];if(typeof m!="function"||!(f in He.prototype))return!1;if(c===m)return!0;var v=Np(m);return!!v&&c===v[0]}function vM(c){return!!t_&&t_ in c}var bM=cu?Ni:Hp;function bl(c){var f=c&&c.constructor,m=typeof f=="function"&&f.prototype||Jo;return c===m}function tE(c){return c===c&&!wt(c)}function nE(c,f){return function(m){return m==null?!1:m[c]===f&&(f!==n||c in ut(m))}}function _M(c){var f=Vu(c,function(v){return m.size===u&&m.clear(),v}),m=f.cache;return f}function EM(c,f){var m=c[1],v=f[1],E=m|v,S=E<(_|w|B),A=v==B&&m==N||v==B&&m==Q&&c[7].length<=f[8]||v==(B|Q)&&f[7].length<=f[8]&&m==N;if(!(S||A))return c;v&_&&(c[2]=f[2],E|=m&_?0:O);var D=f[3];if(D){var $=c[3];c[3]=$?L_($,D,f[4]):D,c[4]=$?Zi(c[3],d):f[4]}return D=f[5],D&&($=c[5],c[5]=$?V_($,D,f[6]):D,c[6]=$?Zi(c[5],d):f[6]),D=f[7],D&&(c[7]=D),v&B&&(c[8]=c[8]==null?f[8]:fn(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=E,c}function wM(c){var f=[];if(c!=null)for(var m in ut(c))f.push(m);return f}function TM(c){return fu.call(c)}function rE(c,f,m){return f=Bt(f===n?c.length-1:f,0),function(){for(var v=arguments,E=-1,S=Bt(v.length-f,0),A=V(S);++E<S;)A[E]=v[f+E];E=-1;for(var D=V(f+1);++E<f;)D[E]=v[E];return D[f]=m(A),Zn(c,this,D)}}function iE(c,f){return f.length<2?c:Xs(c,_r(f,0,-1))}function SM(c,f){for(var m=c.length,v=fn(f.length,m),E=Ln(c);v--;){var S=f[v];c[v]=ki(S,m)?E[S]:n}return c}function Dp(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var sE=aE(A_),_l=VD||function(c,f){return en.setTimeout(c,f)},Rp=aE(GR);function oE(c,f,m){var v=f+"";return Rp(c,mM(v,OM(dM(v),m)))}function aE(c){var f=0,m=0;return function(){var v=qD(),E=ke-(v-m);if(m=v,E>0){if(++f>=Oe)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Pu(c,f){var m=-1,v=c.length,E=v-1;for(f=f===n?v:f;++m<f;){var S=mp(m,E),A=c[S];c[S]=c[m],c[m]=A}return c.length=f,c}var lE=_M(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(pC,function(m,v,E,S){f.push(E?S.replace(wC,"$1"):v||m)}),f});function ri(c){if(typeof c=="string"||nr(c))return c;var f=c+"";return f=="0"&&1/c==-fe?"-0":f}function eo(c){if(c!=null){try{return uu.call(c)}catch{}try{return c+""}catch{}}return""}function OM(c,f){return gr(Y,function(m){var v="_."+m[0];f&m[1]&&!su(c,v)&&c.push(v)}),c.sort()}function cE(c){if(c instanceof He)return c.clone();var f=new vr(c.__wrapped__,c.__chain__);return f.__actions__=Ln(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function kM(c,f,m){(m?Sn(c,f,m):f===n)?f=1:f=Bt(Fe(f),0);var v=c==null?0:c.length;if(!v||f<1)return[];for(var E=0,S=0,A=V(yu(v/f));E<v;)A[S++]=_r(c,E,E+=f);return A}function NM(c){for(var f=-1,m=c==null?0:c.length,v=0,E=[];++f<m;){var S=c[f];S&&(E[v++]=S)}return E}function AM(){var c=arguments.length;if(!c)return[];for(var f=V(c-1),m=arguments[0],v=c;v--;)f[v-1]=arguments[v];return Xi(De(m)?Ln(m):[m],tn(f,1))}var IM=Ue(function(c,f){return xt(c)?pl(c,tn(f,1,xt,!0)):[]}),xM=Ue(function(c,f){var m=Er(f);return xt(m)&&(m=n),xt(c)?pl(c,tn(f,1,xt,!0),_e(m,2)):[]}),CM=Ue(function(c,f){var m=Er(f);return xt(m)&&(m=n),xt(c)?pl(c,tn(f,1,xt,!0),n,m):[]});function DM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),_r(c,f<0?0:f,v)):[]}function RM(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),f=v-f,_r(c,0,f<0?0:f)):[]}function MM(c,f){return c&&c.length?Nu(c,_e(f,3),!0,!0):[]}function PM(c,f){return c&&c.length?Nu(c,_e(f,3),!0):[]}function FM(c,f,m,v){var E=c==null?0:c.length;return E?(m&&typeof m!="number"&&Sn(c,f,m)&&(m=0,v=E),AR(c,f,m,v)):[]}function uE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Fe(m);return E<0&&(E=Bt(v+E,0)),ou(c,_e(f,3),E)}function fE(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v-1;return m!==n&&(E=Fe(m),E=m<0?Bt(v+E,0):fn(E,v-1)),ou(c,_e(f,3),E,!0)}function dE(c){var f=c==null?0:c.length;return f?tn(c,1):[]}function $M(c){var f=c==null?0:c.length;return f?tn(c,fe):[]}function LM(c,f){var m=c==null?0:c.length;return m?(f=f===n?1:Fe(f),tn(c,f)):[]}function VM(c){for(var f=-1,m=c==null?0:c.length,v={};++f<m;){var E=c[f];v[E[0]]=E[1]}return v}function hE(c){return c&&c.length?c[0]:n}function jM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=m==null?0:Fe(m);return E<0&&(E=Bt(v+E,0)),Qo(c,f,E)}function BM(c){var f=c==null?0:c.length;return f?_r(c,0,-1):[]}var UM=Ue(function(c){var f=Et(c,_p);return f.length&&f[0]===c[0]?up(f):[]}),qM=Ue(function(c){var f=Er(c),m=Et(c,_p);return f===Er(m)?f=n:m.pop(),m.length&&m[0]===c[0]?up(m,_e(f,2)):[]}),WM=Ue(function(c){var f=Er(c),m=Et(c,_p);return f=typeof f=="function"?f:n,f&&m.pop(),m.length&&m[0]===c[0]?up(m,n,f):[]});function zM(c,f){return c==null?"":BD.call(c,f)}function Er(c){var f=c==null?0:c.length;return f?c[f-1]:n}function QM(c,f,m){var v=c==null?0:c.length;if(!v)return-1;var E=v;return m!==n&&(E=Fe(m),E=E<0?Bt(v+E,0):fn(E,v-1)),f===f?OD(c,f,E):ou(c,G0,E,!0)}function GM(c,f){return c&&c.length?S_(c,Fe(f)):n}var HM=Ue(pE);function pE(c,f){return c&&c.length&&f&&f.length?pp(c,f):c}function KM(c,f,m){return c&&c.length&&f&&f.length?pp(c,f,_e(m,2)):c}function JM(c,f,m){return c&&c.length&&f&&f.length?pp(c,f,n,m):c}var YM=Oi(function(c,f){var m=c==null?0:c.length,v=op(c,f);return N_(c,Et(f,function(E){return ki(E,m)?+E:E}).sort($_)),v});function XM(c,f){var m=[];if(!(c&&c.length))return m;var v=-1,E=[],S=c.length;for(f=_e(f,3);++v<S;){var A=c[v];f(A,v,c)&&(m.push(A),E.push(v))}return N_(c,E),m}function Mp(c){return c==null?c:zD.call(c)}function ZM(c,f,m){var v=c==null?0:c.length;return v?(m&&typeof m!="number"&&Sn(c,f,m)?(f=0,m=v):(f=f==null?0:Fe(f),m=m===n?v:Fe(m)),_r(c,f,m)):[]}function eP(c,f){return ku(c,f)}function tP(c,f,m){return yp(c,f,_e(m,2))}function nP(c,f){var m=c==null?0:c.length;if(m){var v=ku(c,f);if(v<m&&qr(c[v],f))return v}return-1}function rP(c,f){return ku(c,f,!0)}function iP(c,f,m){return yp(c,f,_e(m,2),!0)}function sP(c,f){var m=c==null?0:c.length;if(m){var v=ku(c,f,!0)-1;if(qr(c[v],f))return v}return-1}function oP(c){return c&&c.length?I_(c):[]}function aP(c,f){return c&&c.length?I_(c,_e(f,2)):[]}function lP(c){var f=c==null?0:c.length;return f?_r(c,1,f):[]}function cP(c,f,m){return c&&c.length?(f=m||f===n?1:Fe(f),_r(c,0,f<0?0:f)):[]}function uP(c,f,m){var v=c==null?0:c.length;return v?(f=m||f===n?1:Fe(f),f=v-f,_r(c,f<0?0:f,v)):[]}function fP(c,f){return c&&c.length?Nu(c,_e(f,3),!1,!0):[]}function dP(c,f){return c&&c.length?Nu(c,_e(f,3)):[]}var hP=Ue(function(c){return ns(tn(c,1,xt,!0))}),pP=Ue(function(c){var f=Er(c);return xt(f)&&(f=n),ns(tn(c,1,xt,!0),_e(f,2))}),mP=Ue(function(c){var f=Er(c);return f=typeof f=="function"?f:n,ns(tn(c,1,xt,!0),n,f)});function gP(c){return c&&c.length?ns(c):[]}function yP(c,f){return c&&c.length?ns(c,_e(f,2)):[]}function vP(c,f){return f=typeof f=="function"?f:n,c&&c.length?ns(c,n,f):[]}function Pp(c){if(!(c&&c.length))return[];var f=0;return c=Yi(c,function(m){if(xt(m))return f=Bt(m.length,f),!0}),Xh(f,function(m){return Et(c,Kh(m))})}function mE(c,f){if(!(c&&c.length))return[];var m=Pp(c);return f==null?m:Et(m,function(v){return Zn(f,n,v)})}var bP=Ue(function(c,f){return xt(c)?pl(c,f):[]}),_P=Ue(function(c){return bp(Yi(c,xt))}),EP=Ue(function(c){var f=Er(c);return xt(f)&&(f=n),bp(Yi(c,xt),_e(f,2))}),wP=Ue(function(c){var f=Er(c);return f=typeof f=="function"?f:n,bp(Yi(c,xt),n,f)}),TP=Ue(Pp);function SP(c,f){return R_(c||[],f||[],hl)}function OP(c,f){return R_(c||[],f||[],yl)}var kP=Ue(function(c){var f=c.length,m=f>1?c[f-1]:n;return m=typeof m=="function"?(c.pop(),m):n,mE(c,m)});function gE(c){var f=T(c);return f.__chain__=!0,f}function NP(c,f){return f(c),c}function Fu(c,f){return f(c)}var AP=Oi(function(c){var f=c.length,m=f?c[0]:0,v=this.__wrapped__,E=function(S){return op(S,c)};return f>1||this.__actions__.length||!(v instanceof He)||!ki(m)?this.thru(E):(v=v.slice(m,+m+(f?1:0)),v.__actions__.push({func:Fu,args:[E],thisArg:n}),new vr(v,this.__chain__).thru(function(S){return f&&!S.length&&S.push(n),S}))});function IP(){return gE(this)}function xP(){return new vr(this.value(),this.__chain__)}function CP(){this.__values__===n&&(this.__values__=xE(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function DP(){return this}function RP(c){for(var f,m=this;m instanceof Eu;){var v=cE(m);v.__index__=0,v.__values__=n,f?E.__wrapped__=v:f=v;var E=v;m=m.__wrapped__}return E.__wrapped__=c,f}function MP(){var c=this.__wrapped__;if(c instanceof He){var f=c;return this.__actions__.length&&(f=new He(this)),f=f.reverse(),f.__actions__.push({func:Fu,args:[Mp],thisArg:n}),new vr(f,this.__chain__)}return this.thru(Mp)}function PP(){return D_(this.__wrapped__,this.__actions__)}var FP=Au(function(c,f,m){at.call(c,m)?++c[m]:Ti(c,m,1)});function $P(c,f,m){var v=De(c)?z0:NR;return m&&Sn(c,f,m)&&(f=n),v(c,_e(f,3))}function LP(c,f){var m=De(c)?Yi:m_;return m(c,_e(f,3))}var VP=q_(uE),jP=q_(fE);function BP(c,f){return tn($u(c,f),1)}function UP(c,f){return tn($u(c,f),fe)}function qP(c,f,m){return m=m===n?1:Fe(m),tn($u(c,f),m)}function yE(c,f){var m=De(c)?gr:ts;return m(c,_e(f,3))}function vE(c,f){var m=De(c)?lD:p_;return m(c,_e(f,3))}var WP=Au(function(c,f,m){at.call(c,m)?c[m].push(f):Ti(c,m,[f])});function zP(c,f,m,v){c=Vn(c)?c:ia(c),m=m&&!v?Fe(m):0;var E=c.length;return m<0&&(m=Bt(E+m,0)),Uu(c)?m<=E&&c.indexOf(f,m)>-1:!!E&&Qo(c,f,m)>-1}var QP=Ue(function(c,f,m){var v=-1,E=typeof f=="function",S=Vn(c)?V(c.length):[];return ts(c,function(A){S[++v]=E?Zn(f,A,m):ml(A,f,m)}),S}),GP=Au(function(c,f,m){Ti(c,m,f)});function $u(c,f){var m=De(c)?Et:E_;return m(c,_e(f,3))}function HP(c,f,m,v){return c==null?[]:(De(f)||(f=f==null?[]:[f]),m=v?n:m,De(m)||(m=m==null?[]:[m]),O_(c,f,m))}var KP=Au(function(c,f,m){c[m?0:1].push(f)},function(){return[[],[]]});function JP(c,f,m){var v=De(c)?Gh:K0,E=arguments.length<3;return v(c,_e(f,4),m,E,ts)}function YP(c,f,m){var v=De(c)?cD:K0,E=arguments.length<3;return v(c,_e(f,4),m,E,p_)}function XP(c,f){var m=De(c)?Yi:m_;return m(c,ju(_e(f,3)))}function ZP(c){var f=De(c)?u_:zR;return f(c)}function eF(c,f,m){(m?Sn(c,f,m):f===n)?f=1:f=Fe(f);var v=De(c)?wR:QR;return v(c,f)}function tF(c){var f=De(c)?TR:HR;return f(c)}function nF(c){if(c==null)return 0;if(Vn(c))return Uu(c)?Ho(c):c.length;var f=dn(c);return f==wn||f==R?c.size:dp(c).length}function rF(c,f,m){var v=De(c)?Hh:KR;return m&&Sn(c,f,m)&&(f=n),v(c,_e(f,3))}var iF=Ue(function(c,f){if(c==null)return[];var m=f.length;return m>1&&Sn(c,f[0],f[1])?f=[]:m>2&&Sn(f[0],f[1],f[2])&&(f=[f[0]]),O_(c,tn(f,1),[])}),Lu=LD||function(){return en.Date.now()};function sF(c,f){if(typeof f!="function")throw new yr(o);return c=Fe(c),function(){if(--c<1)return f.apply(this,arguments)}}function bE(c,f,m){return f=m?n:f,f=c&&f==null?c.length:f,Si(c,B,n,n,n,n,f)}function _E(c,f){var m;if(typeof f!="function")throw new yr(o);return c=Fe(c),function(){return--c>0&&(m=f.apply(this,arguments)),c<=1&&(f=n),m}}var Fp=Ue(function(c,f,m){var v=_;if(m.length){var E=Zi(m,na(Fp));v|=P}return Si(c,v,f,m,E)}),EE=Ue(function(c,f,m){var v=_|w;if(m.length){var E=Zi(m,na(EE));v|=P}return Si(f,v,c,m,E)});function wE(c,f,m){f=m?n:f;var v=Si(c,N,n,n,n,n,n,f);return v.placeholder=wE.placeholder,v}function TE(c,f,m){f=m?n:f;var v=Si(c,I,n,n,n,n,n,f);return v.placeholder=TE.placeholder,v}function SE(c,f,m){var v,E,S,A,D,$,G=0,H=!1,K=!1,ne=!0;if(typeof c!="function")throw new yr(o);f=wr(f)||0,wt(m)&&(H=!!m.leading,K="maxWait"in m,S=K?Bt(wr(m.maxWait)||0,f):S,ne="trailing"in m?!!m.trailing:ne);function de(Ct){var Wr=v,Ii=E;return v=E=n,G=Ct,A=c.apply(Ii,Wr),A}function Te(Ct){return G=Ct,D=_l(Qe,f),H?de(Ct):A}function Ve(Ct){var Wr=Ct-$,Ii=Ct-G,qE=f-Wr;return K?fn(qE,S-Ii):qE}function Se(Ct){var Wr=Ct-$,Ii=Ct-G;return $===n||Wr>=f||Wr<0||K&&Ii>=S}function Qe(){var Ct=Lu();if(Se(Ct))return Je(Ct);D=_l(Qe,Ve(Ct))}function Je(Ct){return D=n,ne&&v?de(Ct):(v=E=n,A)}function rr(){D!==n&&M_(D),G=0,v=$=E=D=n}function On(){return D===n?A:Je(Lu())}function ir(){var Ct=Lu(),Wr=Se(Ct);if(v=arguments,E=this,$=Ct,Wr){if(D===n)return Te($);if(K)return M_(D),D=_l(Qe,f),de($)}return D===n&&(D=_l(Qe,f)),A}return ir.cancel=rr,ir.flush=On,ir}var oF=Ue(function(c,f){return h_(c,1,f)}),aF=Ue(function(c,f,m){return h_(c,wr(f)||0,m)});function lF(c){return Si(c,x)}function Vu(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new yr(o);var m=function(){var v=arguments,E=f?f.apply(this,v):v[0],S=m.cache;if(S.has(E))return S.get(E);var A=c.apply(this,v);return m.cache=S.set(E,A)||S,A};return m.cache=new(Vu.Cache||wi),m}Vu.Cache=wi;function ju(c){if(typeof c!="function")throw new yr(o);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function cF(c){return _E(2,c)}var uF=JR(function(c,f){f=f.length==1&&De(f[0])?Et(f[0],er(_e())):Et(tn(f,1),er(_e()));var m=f.length;return Ue(function(v){for(var E=-1,S=fn(v.length,m);++E<S;)v[E]=f[E].call(this,v[E]);return Zn(c,this,v)})}),$p=Ue(function(c,f){var m=Zi(f,na($p));return Si(c,P,n,f,m)}),OE=Ue(function(c,f){var m=Zi(f,na(OE));return Si(c,M,n,f,m)}),fF=Oi(function(c,f){return Si(c,Q,n,n,n,f)});function dF(c,f){if(typeof c!="function")throw new yr(o);return f=f===n?f:Fe(f),Ue(c,f)}function hF(c,f){if(typeof c!="function")throw new yr(o);return f=f==null?0:Bt(Fe(f),0),Ue(function(m){var v=m[f],E=is(m,0,f);return v&&Xi(E,v),Zn(c,this,E)})}function pF(c,f,m){var v=!0,E=!0;if(typeof c!="function")throw new yr(o);return wt(m)&&(v="leading"in m?!!m.leading:v,E="trailing"in m?!!m.trailing:E),SE(c,f,{leading:v,maxWait:f,trailing:E})}function mF(c){return bE(c,1)}function gF(c,f){return $p(Ep(f),c)}function yF(){if(!arguments.length)return[];var c=arguments[0];return De(c)?c:[c]}function vF(c){return br(c,g)}function bF(c,f){return f=typeof f=="function"?f:n,br(c,g,f)}function _F(c){return br(c,h|g)}function EF(c,f){return f=typeof f=="function"?f:n,br(c,h|g,f)}function wF(c,f){return f==null||d_(c,f,Gt(f))}function qr(c,f){return c===f||c!==c&&f!==f}var TF=Du(cp),SF=Du(function(c,f){return c>=f}),to=v_(function(){return arguments}())?v_:function(c){return kt(c)&&at.call(c,"callee")&&!i_.call(c,"callee")},De=V.isArray,OF=V0?er(V0):RR;function Vn(c){return c!=null&&Bu(c.length)&&!Ni(c)}function xt(c){return kt(c)&&Vn(c)}function kF(c){return c===!0||c===!1||kt(c)&&Tn(c)==Ye}var ss=jD||Hp,NF=j0?er(j0):MR;function AF(c){return kt(c)&&c.nodeType===1&&!El(c)}function IF(c){if(c==null)return!0;if(Vn(c)&&(De(c)||typeof c=="string"||typeof c.splice=="function"||ss(c)||ra(c)||to(c)))return!c.length;var f=dn(c);if(f==wn||f==R)return!c.size;if(bl(c))return!dp(c).length;for(var m in c)if(at.call(c,m))return!1;return!0}function xF(c,f){return gl(c,f)}function CF(c,f,m){m=typeof m=="function"?m:n;var v=m?m(c,f):n;return v===n?gl(c,f,n,m):!!v}function Lp(c){if(!kt(c))return!1;var f=Tn(c);return f==Vr||f==Hi||typeof c.message=="string"&&typeof c.name=="string"&&!El(c)}function DF(c){return typeof c=="number"&&o_(c)}function Ni(c){if(!wt(c))return!1;var f=Tn(c);return f==Pt||f==sl||f==Me||f==tu}function kE(c){return typeof c=="number"&&c==Fe(c)}function Bu(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Ee}function wt(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function kt(c){return c!=null&&typeof c=="object"}var NE=B0?er(B0):FR;function RF(c,f){return c===f||fp(c,f,Ap(f))}function MF(c,f,m){return m=typeof m=="function"?m:n,fp(c,f,Ap(f),m)}function PF(c){return AE(c)&&c!=+c}function FF(c){if(bM(c))throw new Ce(s);return b_(c)}function $F(c){return c===null}function LF(c){return c==null}function AE(c){return typeof c=="number"||kt(c)&&Tn(c)==bi}function El(c){if(!kt(c)||Tn(c)!=hr)return!1;var f=pu(c);if(f===null)return!0;var m=at.call(f,"constructor")&&f.constructor;return typeof m=="function"&&m instanceof m&&uu.call(m)==MD}var Vp=U0?er(U0):$R;function VF(c){return kE(c)&&c>=-Ee&&c<=Ee}var IE=q0?er(q0):LR;function Uu(c){return typeof c=="string"||!De(c)&&kt(c)&&Tn(c)==oe}function nr(c){return typeof c=="symbol"||kt(c)&&Tn(c)==le}var ra=W0?er(W0):VR;function jF(c){return c===n}function BF(c){return kt(c)&&dn(c)==Ot}function UF(c){return kt(c)&&Tn(c)==gt}var qF=Du(hp),WF=Du(function(c,f){return c<=f});function xE(c){if(!c)return[];if(Vn(c))return Uu(c)?Br(c):Ln(c);if(ll&&c[ll])return wD(c[ll]());var f=dn(c),m=f==wn?ep:f==R?au:ia;return m(c)}function Ai(c){if(!c)return c===0?c:0;if(c=wr(c),c===fe||c===-fe){var f=c<0?-1:1;return f*ge}return c===c?c:0}function Fe(c){var f=Ai(c),m=f%1;return f===f?m?f-m:f:0}function CE(c){return c?Ys(Fe(c),0,ve):0}function wr(c){if(typeof c=="number")return c;if(nr(c))return ct;if(wt(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=wt(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=J0(c);var m=OC.test(c);return m||NC.test(c)?sD(c.slice(2),m?2:8):SC.test(c)?ct:+c}function DE(c){return ni(c,jn(c))}function zF(c){return c?Ys(Fe(c),-Ee,Ee):c===0?c:0}function st(c){return c==null?"":tr(c)}var QF=ea(function(c,f){if(bl(f)||Vn(f)){ni(f,Gt(f),c);return}for(var m in f)at.call(f,m)&&hl(c,m,f[m])}),RE=ea(function(c,f){ni(f,jn(f),c)}),qu=ea(function(c,f,m,v){ni(f,jn(f),c,v)}),GF=ea(function(c,f,m,v){ni(f,Gt(f),c,v)}),HF=Oi(op);function KF(c,f){var m=Zo(c);return f==null?m:f_(m,f)}var JF=Ue(function(c,f){c=ut(c);var m=-1,v=f.length,E=v>2?f[2]:n;for(E&&Sn(f[0],f[1],E)&&(v=1);++m<v;)for(var S=f[m],A=jn(S),D=-1,$=A.length;++D<$;){var G=A[D],H=c[G];(H===n||qr(H,Jo[G])&&!at.call(c,G))&&(c[G]=S[G])}return c}),YF=Ue(function(c){return c.push(n,J_),Zn(ME,n,c)});function XF(c,f){return Q0(c,_e(f,3),ti)}function ZF(c,f){return Q0(c,_e(f,3),lp)}function e$(c,f){return c==null?c:ap(c,_e(f,3),jn)}function t$(c,f){return c==null?c:g_(c,_e(f,3),jn)}function n$(c,f){return c&&ti(c,_e(f,3))}function r$(c,f){return c&&lp(c,_e(f,3))}function i$(c){return c==null?[]:Su(c,Gt(c))}function s$(c){return c==null?[]:Su(c,jn(c))}function jp(c,f,m){var v=c==null?n:Xs(c,f);return v===n?m:v}function o$(c,f){return c!=null&&Z_(c,f,IR)}function Bp(c,f){return c!=null&&Z_(c,f,xR)}var a$=z_(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=fu.call(f)),c[f]=m},qp(Bn)),l$=z_(function(c,f,m){f!=null&&typeof f.toString!="function"&&(f=fu.call(f)),at.call(c,f)?c[f].push(m):c[f]=[m]},_e),c$=Ue(ml);function Gt(c){return Vn(c)?c_(c):dp(c)}function jn(c){return Vn(c)?c_(c,!0):jR(c)}function u$(c,f){var m={};return f=_e(f,3),ti(c,function(v,E,S){Ti(m,f(v,E,S),v)}),m}function f$(c,f){var m={};return f=_e(f,3),ti(c,function(v,E,S){Ti(m,E,f(v,E,S))}),m}var d$=ea(function(c,f,m){Ou(c,f,m)}),ME=ea(function(c,f,m,v){Ou(c,f,m,v)}),h$=Oi(function(c,f){var m={};if(c==null)return m;var v=!1;f=Et(f,function(S){return S=rs(S,c),v||(v=S.length>1),S}),ni(c,kp(c),m),v&&(m=br(m,h|p|g,aM));for(var E=f.length;E--;)vp(m,f[E]);return m});function p$(c,f){return PE(c,ju(_e(f)))}var m$=Oi(function(c,f){return c==null?{}:UR(c,f)});function PE(c,f){if(c==null)return{};var m=Et(kp(c),function(v){return[v]});return f=_e(f),k_(c,m,function(v,E){return f(v,E[0])})}function g$(c,f,m){f=rs(f,c);var v=-1,E=f.length;for(E||(E=1,c=n);++v<E;){var S=c==null?n:c[ri(f[v])];S===n&&(v=E,S=m),c=Ni(S)?S.call(c):S}return c}function y$(c,f,m){return c==null?c:yl(c,f,m)}function v$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:yl(c,f,m,v)}var FE=H_(Gt),$E=H_(jn);function b$(c,f,m){var v=De(c),E=v||ss(c)||ra(c);if(f=_e(f,4),m==null){var S=c&&c.constructor;E?m=v?new S:[]:wt(c)?m=Ni(S)?Zo(pu(c)):{}:m={}}return(E?gr:ti)(c,function(A,D,$){return f(m,A,D,$)}),m}function _$(c,f){return c==null?!0:vp(c,f)}function E$(c,f,m){return c==null?c:C_(c,f,Ep(m))}function w$(c,f,m,v){return v=typeof v=="function"?v:n,c==null?c:C_(c,f,Ep(m),v)}function ia(c){return c==null?[]:Zh(c,Gt(c))}function T$(c){return c==null?[]:Zh(c,jn(c))}function S$(c,f,m){return m===n&&(m=f,f=n),m!==n&&(m=wr(m),m=m===m?m:0),f!==n&&(f=wr(f),f=f===f?f:0),Ys(wr(c),f,m)}function O$(c,f,m){return f=Ai(f),m===n?(m=f,f=0):m=Ai(m),c=wr(c),CR(c,f,m)}function k$(c,f,m){if(m&&typeof m!="boolean"&&Sn(c,f,m)&&(f=m=n),m===n&&(typeof f=="boolean"?(m=f,f=n):typeof c=="boolean"&&(m=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Ai(c),f===n?(f=c,c=0):f=Ai(f)),c>f){var v=c;c=f,f=v}if(m||c%1||f%1){var E=a_();return fn(c+E*(f-c+iD("1e-"+((E+"").length-1))),f)}return mp(c,f)}var N$=ta(function(c,f,m){return f=f.toLowerCase(),c+(m?LE(f):f)});function LE(c){return Up(st(c).toLowerCase())}function VE(c){return c=st(c),c&&c.replace(IC,yD).replace(HC,"")}function A$(c,f,m){c=st(c),f=tr(f);var v=c.length;m=m===n?v:Ys(Fe(m),0,v);var E=m;return m-=f.length,m>=0&&c.slice(m,E)==f}function I$(c){return c=st(c),c&&cC.test(c)?c.replace(g0,vD):c}function x$(c){return c=st(c),c&&mC.test(c)?c.replace($h,"\\$&"):c}var C$=ta(function(c,f,m){return c+(m?"-":"")+f.toLowerCase()}),D$=ta(function(c,f,m){return c+(m?" ":"")+f.toLowerCase()}),R$=U_("toLowerCase");function M$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;if(!f||v>=f)return c;var E=(f-v)/2;return Cu(vu(E),m)+c+Cu(yu(E),m)}function P$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;return f&&v<f?c+Cu(f-v,m):c}function F$(c,f,m){c=st(c),f=Fe(f);var v=f?Ho(c):0;return f&&v<f?Cu(f-v,m)+c:c}function $$(c,f,m){return m||f==null?f=0:f&&(f=+f),WD(st(c).replace(Lh,""),f||0)}function L$(c,f,m){return(m?Sn(c,f,m):f===n)?f=1:f=Fe(f),gp(st(c),f)}function V$(){var c=arguments,f=st(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var j$=ta(function(c,f,m){return c+(m?"_":"")+f.toLowerCase()});function B$(c,f,m){return m&&typeof m!="number"&&Sn(c,f,m)&&(f=m=n),m=m===n?ve:m>>>0,m?(c=st(c),c&&(typeof f=="string"||f!=null&&!Vp(f))&&(f=tr(f),!f&&Go(c))?is(Br(c),0,m):c.split(f,m)):[]}var U$=ta(function(c,f,m){return c+(m?" ":"")+Up(f)});function q$(c,f,m){return c=st(c),m=m==null?0:Ys(Fe(m),0,c.length),f=tr(f),c.slice(m,m+f.length)==f}function W$(c,f,m){var v=T.templateSettings;m&&Sn(c,f,m)&&(f=n),c=st(c),f=qu({},f,v,K_);var E=qu({},f.imports,v.imports,K_),S=Gt(E),A=Zh(E,S),D,$,G=0,H=f.interpolate||nu,K="__p += '",ne=tp((f.escape||nu).source+"|"+H.source+"|"+(H===y0?TC:nu).source+"|"+(f.evaluate||nu).source+"|$","g"),de="//# sourceURL="+(at.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ZC+"]")+`
305
305
  `;c.replace(ne,function(Se,Qe,Je,rr,On,ir){return Je||(Je=rr),K+=c.slice(G,ir).replace(xC,bD),Qe&&(D=!0,K+=`' +
306
306
  __e(`+Qe+`) +
307
307
  '`),On&&($=!0,K+=`';
@@ -453,7 +453,7 @@ img.ProseMirror-separator {
453
453
  *
454
454
  * This source code is licensed under the MIT license found in the
455
455
  * LICENSE file in the root directory of this source tree.
456
- */var xS;function N4(){if(xS)return $m;xS=1;var t=le;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,p){var g=p(),y=r({inst:{value:g,getSnapshot:p}}),b=y[0].inst,_=y[1];return s(function(){b.value=g,b.getSnapshot=p,l(b)&&_({inst:b})},[h,g,p]),i(function(){return l(b)&&_({inst:b}),h(function(){l(b)&&_({inst:b})})},[h]),o(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return $m.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,$m}var Lm={};/**
456
+ */var xS;function N4(){if(xS)return $m;xS=1;var t=ae;function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,o=t.useDebugValue;function a(h,p){var g=p(),y=r({inst:{value:g,getSnapshot:p}}),b=y[0].inst,_=y[1];return s(function(){b.value=g,b.getSnapshot=p,l(b)&&_({inst:b})},[h,g,p]),i(function(){return l(b)&&_({inst:b}),h(function(){l(b)&&_({inst:b})})},[h]),o(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return $m.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,$m}var Lm={};/**
457
457
  * @license React
458
458
  * use-sync-external-store-shim.development.js
459
459
  *
@@ -461,7 +461,7 @@ img.ProseMirror-separator {
461
461
  *
462
462
  * This source code is licensed under the MIT license found in the
463
463
  * LICENSE file in the root directory of this source tree.
464
- */var CS;function A4(){return CS||(CS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=le,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(N){{for(var I=arguments.length,P=new Array(I>1?I-1:0),M=1;M<I;M++)P[M-1]=arguments[M];r("error",N,P)}}function r(N,I,P){{var M=e.ReactDebugCurrentFrame,B=M.getStackAddendum();B!==""&&(I+="%s",P=P.concat([B]));var Q=P.map(function(x){return String(x)});Q.unshift("Warning: "+I),Function.prototype.apply.call(console[N],console,Q)}}function i(N,I){return N===I&&(N!==0||1/N===1/I)||N!==N&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue,d=!1,h=!1;function p(N,I,P){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=I();if(!h){var B=I();s(M,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:M,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=M,x.getSnapshot=I,g(x)&&U({inst:x})},[N,M,I]),a(function(){g(x)&&U({inst:x});var be=function(){g(x)&&U({inst:x})};return N(be)},[N]),u(M),M}function g(N){var I=N.getSnapshot,P=N.value;try{var M=I();return!s(P,M)}catch{return!0}}function y(N,I,P){return I()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!b,w=_?y:p,O=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;Lm.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Lm}process.env.NODE_ENV==="production"?dy.exports=N4():dy.exports=A4();var gh=dy.exports;const I4=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},x4=({contentComponent:t})=>{const e=gh.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return le.createElement(le.Fragment,null,Object.values(e))};function C4(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:LL.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class D4 extends le.Component{constructor(e){var n;super(e),this.editorContentRef=le.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=C4(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return le.createElement(le.Fragment,null,le.createElement("div",{ref:I4(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&le.createElement(x4,{contentComponent:e.contentComponent}))}}const R4=le.forwardRef((t,e)=>{const n=le.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return le.createElement(D4,{key:n,innerRef:e,...t})}),M4=le.memo(R4);var P4=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},F4=k4(P4),hy={exports:{}},Vm={};/**
464
+ */var CS;function A4(){return CS||(CS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=ae,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(N){{for(var I=arguments.length,P=new Array(I>1?I-1:0),M=1;M<I;M++)P[M-1]=arguments[M];r("error",N,P)}}function r(N,I,P){{var M=e.ReactDebugCurrentFrame,B=M.getStackAddendum();B!==""&&(I+="%s",P=P.concat([B]));var Q=P.map(function(x){return String(x)});Q.unshift("Warning: "+I),Function.prototype.apply.call(console[N],console,Q)}}function i(N,I){return N===I&&(N!==0||1/N===1/I)||N!==N&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue,d=!1,h=!1;function p(N,I,P){d||t.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=I();if(!h){var B=I();s(M,B)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var Q=o({inst:{value:M,getSnapshot:I}}),x=Q[0].inst,U=Q[1];return l(function(){x.value=M,x.getSnapshot=I,g(x)&&U({inst:x})},[N,M,I]),a(function(){g(x)&&U({inst:x});var be=function(){g(x)&&U({inst:x})};return N(be)},[N]),u(M),M}function g(N){var I=N.getSnapshot,P=N.value;try{var M=I();return!s(P,M)}catch{return!0}}function y(N,I,P){return I()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=!b,w=_?y:p,O=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:w;Lm.useSyncExternalStore=O,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Lm}process.env.NODE_ENV==="production"?dy.exports=N4():dy.exports=A4();var gh=dy.exports;const I4=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},x4=({contentComponent:t})=>{const e=gh.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return ae.createElement(ae.Fragment,null,Object.values(e))};function C4(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:LL.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class D4 extends ae.Component{constructor(e){var n;super(e),this.editorContentRef=ae.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=C4(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return ae.createElement(ae.Fragment,null,ae.createElement("div",{ref:I4(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&ae.createElement(x4,{contentComponent:e.contentComponent}))}}const R4=ae.forwardRef((t,e)=>{const n=ae.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ae.createElement(D4,{key:n,innerRef:e,...t})}),M4=ae.memo(R4);var P4=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(i of e.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(e[i]!==n[i])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n},F4=k4(P4),hy={exports:{}},Vm={};/**
465
465
  * @license React
466
466
  * use-sync-external-store-shim/with-selector.production.min.js
467
467
  *
@@ -469,7 +469,7 @@ img.ProseMirror-separator {
469
469
  *
470
470
  * This source code is licensed under the MIT license found in the
471
471
  * LICENSE file in the root directory of this source tree.
472
- */var DS;function $4(){if(DS)return Vm;DS=1;var t=le,e=gh;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Vm.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var y=s(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=a(function(){function w(M){if(!O){if(O=!0,N=M,M=p(M),g!==void 0&&b.hasValue){var B=b.value;if(g(B,M))return I=B}return I=M}if(B=I,r(N,M))return B;var Q=p(M);return g!==void 0&&g(B,Q)?B:(N=M,I=Q)}var O=!1,N,I,P=h===void 0?null:h;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,h,p,g]);var _=i(u,y[0],y[1]);return o(function(){b.hasValue=!0,b.value=_},[_]),l(_),_},Vm}var jm={};/**
472
+ */var DS;function $4(){if(DS)return Vm;DS=1;var t=ae,e=gh;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Vm.useSyncExternalStoreWithSelector=function(u,d,h,p,g){var y=s(null);if(y.current===null){var b={hasValue:!1,value:null};y.current=b}else b=y.current;y=a(function(){function w(M){if(!O){if(O=!0,N=M,M=p(M),g!==void 0&&b.hasValue){var B=b.value;if(g(B,M))return I=B}return I=M}if(B=I,r(N,M))return B;var Q=p(M);return g!==void 0&&g(B,Q)?B:(N=M,I=Q)}var O=!1,N,I,P=h===void 0?null:h;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,h,p,g]);var _=i(u,y[0],y[1]);return o(function(){b.hasValue=!0,b.value=_},[_]),l(_),_},Vm}var jm={};/**
473
473
  * @license React
474
474
  * use-sync-external-store-shim/with-selector.development.js
475
475
  *
@@ -477,7 +477,7 @@ img.ProseMirror-separator {
477
477
  *
478
478
  * This source code is licensed under the MIT license found in the
479
479
  * LICENSE file in the root directory of this source tree.
480
- */var RS;function L4(){return RS||(RS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=le,e=gh;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,M,B,Q=function(Oe){if(!P){P=!0,M=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var Le=_.value;if(y(Le,ke))return B=Le,Le}return B=ke,ke}var te=M,Ae=B;if(r(te,Oe))return Ae;var fe=g(Oe);return y!==void 0&&y(Ae,fe)?Ae:(M=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}jm.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jm}process.env.NODE_ENV==="production"?hy.exports=$4():hy.exports=L4();var V4=hy.exports;class j4{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function B4(t){var e;const[n]=le.useState(()=>new j4(t.editor)),r=V4.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:F4);return le.useEffect(()=>n.watch(t.editor),[t.editor,n]),le.useDebugValue(r),r}const MS=process.env.NODE_ENV!=="production",py=typeof window>"u",U4=py||!!(typeof window<"u"&&window.next);class q4{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return py||U4?(MS&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&py&&MS)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new y4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function W4(t={},e=[]){const n=le.useRef(t);n.current=t;const[r]=le.useState(()=>new q4(n)),i=gh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return le.useDebugValue(i),le.useEffect(r.onRender(e)),B4({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const ox=le.createContext({editor:null}),z4=ox.Consumer;function Q4({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=W4(i);return s?le.createElement(ox.Provider,{value:{editor:s}},n,le.createElement(z4,null,({editor:o})=>le.createElement(M4,{editor:o,...r})),t,e):null}const G4=le.createContext({onDragStart:void 0}),H4=()=>le.useContext(G4);le.forwardRef((t,e)=>{const{onDragStart:n}=H4(),r=t.as||"div";return le.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const K4=/^\s*>\s$/,J4=Kn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[kc({find:K4,type:this.type})]}}),Y4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,X4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Z4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,e6=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,t6=Fr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Co({find:Y4,type:this.type}),Co({find:Z4,type:this.type})]},addPasteRules(){return[Do({find:X4,type:this.type}),Do({find:e6,type:this.type})]}}),n6="listItem",PS="textStyle",FS=/^\s*([-+*])\s$/,r6=Kn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(n6,this.editor.getAttributes(PS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=kc({find:FS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=kc({find:FS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(PS),editor:this.editor})),[t]}}),i6=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,s6=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,o6=Fr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Co({find:i6,type:this.type})]},addPasteRules(){return[Do({find:s6,type:this.type})]}}),a6=/^```([a-z]+)?[\s\n]$/,l6=/^~~~([a-z]+)?[\s\n]$/,c6=Kn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
480
+ */var RS;function L4(){return RS||(RS=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=ae,e=gh;function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,o=t.useEffect,a=t.useMemo,l=t.useDebugValue;function u(d,h,p,g,y){var b=s(null),_;b.current===null?(_={hasValue:!1,value:null},b.current=_):_=b.current;var w=a(function(){var P=!1,M,B,Q=function(Oe){if(!P){P=!0,M=Oe;var ke=g(Oe);if(y!==void 0&&_.hasValue){var Le=_.value;if(y(Le,ke))return B=Le,Le}return B=ke,ke}var te=M,Ae=B;if(r(te,Oe))return Ae;var fe=g(Oe);return y!==void 0&&y(Ae,fe)?Ae:(M=Oe,B=fe,fe)},x=p===void 0?null:p,U=function(){return Q(h())},be=x===null?void 0:function(){return Q(x())};return[U,be]},[h,p,g,y]),O=w[0],N=w[1],I=i(d,O,N);return o(function(){_.hasValue=!0,_.value=I},[I]),l(I),I}jm.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jm}process.env.NODE_ENV==="production"?hy.exports=$4():hy.exports=L4();var V4=hy.exports;class j4{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function B4(t){var e;const[n]=ae.useState(()=>new j4(t.editor)),r=V4.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:F4);return ae.useEffect(()=>n.watch(t.editor),[t.editor,n]),ae.useDebugValue(r),r}const MS=process.env.NODE_ENV!=="production",py=typeof window>"u",U4=py||!!(typeof window<"u"&&window.next);class q4{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return py||U4?(MS&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&py&&MS)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)===null||s===void 0?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)===null||s===void 0?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)===null||s===void 0?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)===null||s===void 0?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)===null||s===void 0?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)===null||s===void 0?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)===null||s===void 0?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)===null||s===void 0?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)===null||s===void 0?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)===null||s===void 0?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)===null||s===void 0?void 0:s.call(i,...r)}};return new y4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function W4(t={},e=[]){const n=ae.useRef(t);n.current=t;const[r]=ae.useState(()=>new q4(n)),i=gh.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ae.useDebugValue(i),ae.useEffect(r.onRender(e)),B4({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&s===0?0:s+1}),i}const ox=ae.createContext({editor:null}),z4=ox.Consumer;function Q4({children:t,slotAfter:e,slotBefore:n,editorContainerProps:r={},...i}){const s=W4(i);return s?ae.createElement(ox.Provider,{value:{editor:s}},n,ae.createElement(z4,null,({editor:o})=>ae.createElement(M4,{editor:o,...r})),t,e):null}const G4=ae.createContext({onDragStart:void 0}),H4=()=>ae.useContext(G4);ae.forwardRef((t,e)=>{const{onDragStart:n}=H4(),r=t.as||"div";return ae.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});const K4=/^\s*>\s$/,J4=Kn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[kc({find:K4,type:this.type})]}}),Y4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,X4=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Z4=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,e6=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,t6=Fr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Co({find:Y4,type:this.type}),Co({find:Z4,type:this.type})]},addPasteRules(){return[Do({find:X4,type:this.type}),Do({find:e6,type:this.type})]}}),n6="listItem",PS="textStyle",FS=/^\s*([-+*])\s$/,r6=Kn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(n6,this.editor.getAttributes(PS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=kc({find:FS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=kc({find:FS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(PS),editor:this.editor})),[t]}}),i6=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,s6=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,o6=Fr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Co({find:i6,type:this.type})]},addPasteRules(){return[Do({find:s6,type:this.type})]}}),a6=/^```([a-z]+)?[\s\n]$/,l6=/^~~~([a-z]+)?[\s\n]$/,c6=Kn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
481
481
 
482
482
  `);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection($e.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[fy({find:a6,type:this.type,getAttributes:t=>({language:t[1]})}),fy({find:l6,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Yn({key:new yi("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
483
483
  `));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(xe.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),u6=Kn.create({name:"doc",topNode:!0,content:"block+"});function f6(t={}){return new Yn({view(e){return new d6(e,t)}})}class d6{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let d=u.getBoundingClientRect(),h=a?d.bottom:d.top;a&&l&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let a=i.getBoundingClientRect();s=a.left-i.scrollLeft,o=a.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-o+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=JA(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const h6=_n.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[f6(this.options)]}});class Nt extends $e{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Nt.valid(r)?new Nt(r):$e.near(r)}content(){return re.empty}eq(e){return e instanceof Nt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Nt(e.resolve(n.pos))}getBookmark(){return new $b(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!p6(e)||!m6(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Nt.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if(Nt.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!ye.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if(Nt.valid(a))return a}return null}}}Nt.prototype.visible=!1;Nt.findFrom=Nt.findGapCursorFrom;$e.jsonID("gapcursor",Nt);class $b{constructor(e){this.pos=e}map(e){return new $b(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Nt.valid(n)?new Nt(n):$e.near(n)}}function p6(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function m6(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function g6(){return new Yn({props:{decorations:_6,createSelectionBetween(t,e,n){return e.pos==n.pos&&Nt.valid(n)?new Nt(n):null},handleClick:v6,handleKeyDown:y6,handleDOMEvents:{beforeinput:b6}}})}const y6=$I({ArrowLeft:lf("horiz",-1),ArrowRight:lf("horiz",1),ArrowUp:lf("vert",-1),ArrowDown:lf("vert",1)});function lf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof xe){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Nt.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new Nt(u))),!0):!1}}function v6(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Nt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ye.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Nt(r))),!0)}function b6(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Nt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=J.empty;for(let o=r.length-1;o>=0;o--)i=J.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new re(i,0,0));return s.setSelection(xe.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function _6(t){if(!(t.selection instanceof Nt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qt.create(t.doc,[Nr.widget(t.selection.head,e,{key:"gapcursor"})])}const E6=_n.create({name:"gapCursor",addProseMirrorPlugins(){return[g6()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ze(ue(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),w6=Kn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Qt(this.options.HTMLAttributes,t)]},renderText(){return`
@@ -491,4 +491,4 @@ img.ProseMirror-separator {
491
491
  data
492
492
  id
493
493
  }
494
- `,data:{__typename:Zm.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,ls.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,si.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,si.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,si.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Nn.InvalidationPolicyEvent.Read))return n;const r=(0,si.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===Ml.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===Ml.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Nn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,si.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===Ml.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===Ml.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,Gse.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=Xm(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,zse.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,Zm.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,ls.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,Jse.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,Qse.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,Yse.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,Kse.default)(i)?a:(0,Hse.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=Xm(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}yh.default=eoe;(function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=Lb;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=yh;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})})(dx);var Jx={},l0={},$s={};const toe=Ha(xB);Object.defineProperty($s,"__esModule",{value:!0});$s.buildWatchFragmentWhereQuery=$s.buildWatchFragmentQuery=void 0;const cs=toe,noe=Gc;function Yx({fieldName:t,fragmentDefinition:e}){return{kind:cs.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:cs.Kind.OPERATION_DEFINITION,operation:cs.OperationTypeNode.QUERY,selectionSet:{kind:cs.Kind.SELECTION_SET,selections:[{arguments:[],kind:cs.Kind.FIELD,name:{kind:cs.Kind.NAME,value:t},directives:[{arguments:[],kind:cs.Kind.DIRECTIVE,name:{kind:cs.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function roe(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=Yx({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,noe.makeReference)(n)}}}}}),o}$s.buildWatchFragmentQuery=roe;function ioe(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=Yx({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}$s.buildWatchFragmentWhereQuery=ioe;Object.defineProperty(l0,"__esModule",{value:!0});const ff=Gc,zO=$s,QO=zs;class soe extends ff.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,QO.generateFragmentFieldName)(),r=(0,zO.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,QO.generateFragmentFieldName)(),r=(0,ff.makeVar)(e.filter),i=(0,ff.makeVar)(e.limit),s=(0,ff.makeVar)(e.orderBy),o=(0,zO.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}l0.default=soe;(function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=l0;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})})(Jx);var Xx={},c0={},Mo={},ooe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.usePrevious=Mo.useOnce=void 0;const Td=le,aoe=ooe(_h);function loe(t){const e=(0,Td.useRef)(),n=(0,Td.useRef)(!1);return n.current||((0,aoe.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}Mo.useOnce=loe;const coe=t=>{const e=(0,Td.useRef)(null);return(0,Td.useEffect)(()=>{e.current=t}),e.current};Mo.usePrevious=coe;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.useFragmentTypePolicyFieldName=void 0;const uoe=Xa,GO=le,foe=zs,doe=Mo,hoe=({fragmentName:t}={})=>{const e=(0,GO.useMemo)(()=>(0,foe.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,doe.usePrevious)(e),r=(0,uoe.useApolloClient)();return(0,GO.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};Xc.useFragmentTypePolicyFieldName=hoe;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.useGetQueryDataByFieldName=void 0;const poe=Xa,moe=(t,e,n)=>{var r,i;const s=(0,poe.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};Zc.useGetQueryDataByFieldName=moe;Object.defineProperty(c0,"__esModule",{value:!0});const goe=Xa,yoe=le,voe=Mo,boe=$s,_oe=Xc,Eoe=Zc;function woe(t,e){const r=(0,yoe.useContext)((0,goe.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,_oe.useFragmentTypePolicyFieldName)(),o=(0,voe.useOnce)(()=>(0,boe.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,Eoe.useGetQueryDataByFieldName)(o,s,e)}c0.default=woe;var u0={};const Toe=Ha(xU);Object.defineProperty(u0,"__esModule",{value:!0});const Soe=Xa,Ri=le,Ooe=$s,koe=Xc,Noe=Zc,eg=Xa,HO=Toe;function Aoe(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Ri.useRef)((0,eg.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Ri.useRef)((0,eg.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Ri.useRef)((0,eg.makeVar)(u)).current,g=(0,Ri.useContext)((0,Soe.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,koe.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Ri.useRef)([]);(0,Ri.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,HO.equal)(r,s()))&&s(r)},[r]),(0,Ri.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Ri.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,HO.equal)(u,h()))&&h(u)},[u]);const w=(0,Ri.useMemo)(()=>(0,Ooe.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,Noe.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}u0.default=Aoe;(function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=c0;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=u0;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})})(Xx);var Zx={},f0={},eu={},Ioe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});eu.AuditType=void 0;const xoe=Ioe(Ih);var ec;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(ec||(eu.AuditType=ec={}));class Coe extends xoe.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",ec.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",ec.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",ec.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}eu.default=Coe;var d0={},Doe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d0,"__esModule",{value:!0});const Roe=Doe(Dh);var Sd;(function(t){t.Write="Write",t.Evict="Evict"})(Sd||(Sd={}));class Moe extends Roe.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Sd.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Sd.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}d0.default=Moe;var h0={},Poe=Wb;function Foe(t,e){var n=[];return Poe(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var $oe=Foe,Loe=Sx,Voe=$oe,joe=Zb,Boe=$n;function Uoe(t,e){var n=Boe(t)?Loe:Voe;return n(t,joe(e))}var qoe=Uoe,Woe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(h0,"__esModule",{value:!0});const zoe=Woe(qoe);class Qoe{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,zoe.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}h0.default=Qoe;var Rh=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(f0,"__esModule",{value:!0});const Goe=Rh(yh),Hoe=Ro,Koe=Rh(eu),Joe=Rh(d0),Yoe=Rh(h0),Xoe=s0;class Zoe extends Goe.default{constructor(e){super(e),this.auditLog=new Yoe.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new Joe.default({auditLog:this.auditLog}),new Xoe.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new Koe.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new Hoe.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}f0.default=Zoe;(function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=f0;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})})(Zx);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=dx;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=Jx;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=Xx;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=Zx;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Rr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})})(my);var tg=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},eae=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,tg([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=tg(tg([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),tae=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),df=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},hf=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},eC=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return df(this,void 0,void 0,function(){return hf(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return df(this,void 0,void 0,function(){return hf(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return df(this,void 0,void 0,function(){return hf(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return df(this,void 0,void 0,function(){var e;return hf(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),ng=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},rg=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},tC=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return ng(this,void 0,void 0,function(){var e,n;return rg(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return ng(this,void 0,void 0,function(){var e,n;return rg(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return ng(this,void 0,void 0,function(){var e;return rg(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const nC=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},nae=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),nC({cache:n})(r)}};var rae=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=nC({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=nae({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),iae=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new eae(e),r=new tae(e),i=new eC(e),s=new tC({log:n,cache:r,storage:i},e),o=new rae({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),p0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sae=function(t){var e=new oae(t);e.restoreSync()},oae=function(t){p0(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new lae(n),r.persistor=new aae({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(iae),aae=function(t){p0(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(tC),lae=function(t){p0(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(eC),cae=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}();function qn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function so(t){return qn(t)==="object"}function uae(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function KO(t,e){return t.length<124?t:e}const fae="graphql-transport-ws";var sr;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(sr||(sr={}));var Dt;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Dt||(Dt={}));function rC(t){if(!so(t))throw new Error(`Message is expected to be an object, but got ${qn(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${qn(t.type)}`);switch(t.type){case Dt.ConnectionInit:case Dt.ConnectionAck:case Dt.Ping:case Dt.Pong:{if(t.payload!=null&&!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Dt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${qn(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${qn(t.payload.query)}`);if(t.payload.variables!=null&&!so(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${qn(t.payload.variables)}`);if(t.payload.operationName!=null&&qn(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${qn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!so(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${qn(t.payload.extensions)}`);break}case Dt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${qn(t.payload)}`);break}case Dt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!uae(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Dt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function dae(t,e){return rC(typeof t=="string"?JSON.parse(t,e):t)}function Pl(t,e){return rC(t),JSON.stringify(t,e)}var Oa=function(t){return this instanceof Oa?(this.v=t,this):new Oa(t)},hae=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof Oa?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function pae(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(Ae){let fe=1e3;for(let Ee=0;Ee<Ae;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=ig,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Ae=>{const fe=Math.random()*16|0;return(Ae=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!gae(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ge){return fe[Ee]=ge,()=>{delete fe[Ee]}},emit(Ee){var ge;"id"in Ee&&((ge=fe[Ee.id])===null||ge===void 0||ge.call(fe,Ee))}}})(),Ae={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ge=Ae[fe];return ge.push(Ee),()=>{ge.splice(ge.indexOf(Ee),1)}},emit(fe,...Ee){for(const ge of[...Ae[fe]])ge(...Ee)}}})();function P(te){const Ae=[I.on("error",fe=>{Ae.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{Ae.forEach(Ee=>Ee()),te(fe)})]}let M,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,Ae]=await(M??(M=new Promise((ge,ct)=>(async()=>{if(x){if(await d(U),!B)return M=void 0,ct({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,fae);let L,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send(Pl({type:Dt.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{M=void 0,clearTimeout(L),clearTimeout(Z),ct(we),we instanceof JO&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send(Pl(we?{type:Dt.ConnectionInit,payload:we}:{type:Dt.ConnectionInit},_)),isFinite(l)&&l>0&&(L=setTimeout(()=>{ve.close(sr.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(sr.InternalClientError,KO(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Me=dae(we,w);if(I.emit("message",Me),Me.type==="ping"||Me.type==="pong"){I.emit(Me.type,!0,Me.payload),Me.type==="pong"?Y():a||(ve.send(Pl(Me.payload?{type:Dt.Pong,payload:Me.payload}:{type:Dt.Pong})),I.emit("pong",!1,Me.payload));return}if(ee)return;if(Me.type!==Dt.ConnectionAck)throw new Error(`First message cannot be of type ${Me.type}`);clearTimeout(L),ee=!0,I.emit("connected",ve,Me.payload,x),x=!1,U=0,ge([ve,new Promise((Ye,Zt)=>P(Zt))])}catch(Me){ve.onmessage=null,I.emit("error",Me),ve.close(sr.BadResponse,KO(Me instanceof Error?Me.message:new Error(Me).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await Ae;let fe=()=>{};const Ee=new Promise(ge=>fe=ge);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ge=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ge()},s):ge()}}),Ae])]}function ke(te){if(ig(te)&&(mae(te.code)||[sr.InternalServerError,sr.InternalClientError,sr.BadRequest,sr.BadResponse,sr.Unauthorized,sr.SubprotocolNotAcceptable,sr.SubscriberAlreadyExists,sr.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(ig(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(Ae){return i==null?void 0:i(Ae)}}})();function Le(te,Ae){const fe=b(te);let Ee=!1,ge=!1,ct=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,L,Z]=await Oe();if(Ee)return L();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Dt.Next:{Ae.next(ee.payload);return}case Dt.Error:{ge=!0,Ee=!0,Ae.error(ee.payload),ct();return}case Dt.Complete:{Ee=!0,ct();return}}});ve.send(Pl({id:fe,type:Dt.Subscribe,payload:te},_)),ct=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send(Pl({id:fe,type:Dt.Complete},_)),B--,Ee=!0,L()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ge||Ae.complete()}).catch(ve=>{Ae.error(ve)}),()=>{Ee||ct()}}return{on:I.on,subscribe:Le,iterate(te){const Ae=[],fe={done:!1,error:null,resolve:()=>{}},Ee=Le(te,{next(ct){Ae.push(ct),fe.resolve()},error(ct){fe.done=!0,fe.error=ct,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ge=function(){return hae(this,arguments,function*(){for(;;){for(Ae.length||(yield Oa(new Promise(L=>fe.resolve=L)));Ae.length;)yield yield Oa(Ae.shift());if(fe.error)throw fe.error;if(fe.done)return yield Oa(void 0)}})}();return ge.throw=async ct=>(fe.done||(fe.done=!0,fe.error=ct,fe.resolve()),{done:!0,value:void 0}),ge.return=async()=>(Ee(),{done:!0,value:void 0}),ge},async dispose(){if(be=!0,M){const[te]=await M;te.close(1e3,"Normal Closure")}},terminate(){M&&I.emit("closed",new JO)}}}class JO extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function ig(t){return so(t)&&"code"in t&&"reason"in t}function mae(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function gae(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const yae=({apiUrl:t,organizationId:e,listeners:n,lazy:r=!1,token:i})=>{const s=pae({url:`wss://${t}`,lazy:r,connectionParams:vc.omitBy({"organization-id":e,authorization:i?`Bearer ${i}`:void 0},vc.isNil),keepAlive:1e4});return n&&(n.onConnected&&s.on("connected",n.onConnected),n.onClosed&&s.on("closed",n.onClosed),n.onError&&s.on("error",n.onError)),s},vae=({token:t,organizationId:e,invalidationPolicies:n,handlers:r,fetchPolicy:i,websocket:s,apiBaseUrl:o})=>{const a=new my.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??my.RenewalPolicy.None}});sae({cache:a,storage:new cae(window.localStorage)});const l=`api.warrior.${o??"well-played.gg"}/graphql`,u=Pv(({query:d})=>{const h=Vo(d);return h.kind==="OperationDefinition"&&h.operation==="subscription"},new Z6(yae({apiUrl:l,listeners:r==null?void 0:r.webSocket,organizationId:e,lazy:s==null?void 0:s.lazy,token:t})),Mv([J6(async()=>({headers:vc.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},vc.isNil)})),...r!=null&&r.onError?[fx(r==null?void 0:r.onError)]:[],new Kd({uri:`https://${l}`})]));return new Zd({cache:a,link:u,defaultOptions:{watchQuery:{fetchPolicy:i??"network-only",errorPolicy:"ignore"},query:{fetchPolicy:i??"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},iC=le.createContext({}),bae=()=>{const t=le.useContext(iC);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},_ae=({children:t,clientConfig:e,organizationId:n})=>{const r=cz(),i=vae({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e});return he.jsx(GN,{client:i,children:he.jsx(iC.Provider,{value:{organizationId:n,apiClient:i},children:t})})},Eae=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(sz,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:`https://oauth.warrior.${r.apiBaseUrl??"well-played.gg"}`},children:he.jsx(_ae,{...r,children:t})});exports.RichTextEditorContent=K6;exports.WellPlayedProvider=Eae;exports.graphql=Ja;exports.readFragment=vz;exports.useConnectedPlayer=Ez;exports.usePaginatedLoadAll=ub;exports.usePaginatedQuery=Kq;exports.usePlayers=wA;exports.useTournamentStep=Oz;exports.useTournamentTeams=TA;exports.useWellPlayed=bae;
494
+ `,data:{__typename:Zm.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(n)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[r]||(this.pendingCollectionUpdates[r]={}),this.pendingCollectionUpdates[r][n]||(this.pendingCollectionUpdates[r][n]=(0,ls.makeReference)(n)))}_expire(e=!1){const{entitiesById:n}=this.entityTypeMap.extract(),r=[];return Object.keys(n).forEach(i=>{const s=n[i],{storeFieldNames:o,dataId:a,fieldName:l,typename:u}=s;(0,si.isQuery)(a)&&o?Object.keys(o.entries).forEach(d=>{this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,storeFieldName:d,reportOnly:e})&&r.push((0,si.makeEntityId)(a,d))}):this.invalidationPolicyManager.runReadPolicy({typename:u,dataId:a,fieldName:l,reportOnly:e})&&r.push((0,si.makeEntityId)(a))}),r.length>0&&this.broadcastWatches(),r}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[Nn.InvalidationPolicyEvent.Read,Nn.InvalidationPolicyEvent.Write,Nn.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const n=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Nn.InvalidationPolicyEvent.Read))return n;const r=(0,si.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===Ml.ReadResultStatus.Complete?n:(this.broadcastWatches(),i===Ml.ReadResultStatus.Evicted?null:r)}diff(e){const n=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(Nn.InvalidationPolicyEvent.Read)||this.isBroadcasting)return n;const{result:r}=n,i=(0,si.maybeDeepClone)(r),s=this.cacheResultProcessor.processReadResult(i,e);return s===Ml.ReadResultStatus.Complete||(this.broadcastWatches(),n.complete=!1,n.result=s===Ml.ReadResultStatus.Evicted?void 0:i),n}extract(e=!1,n=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const r=super.extract(e);return n&&(r.invalidation=(0,Gse.default)(this.entityTypeMap.extract(),"entitiesById")),r}readFragmentWhere(e){const{fragment:n,filter:r,limit:i,orderBy:s}=e,o=Xm(e,["fragment","filter","limit","orderBy"]),l=n.definitions[0].typeCondition.name.value,d=this.readReferenceWhere({__typename:l,filter:r,limit:i,orderBy:s}).map(h=>this.readFragment(Object.assign(Object.assign({},o),{fragment:n,id:h.__ref})));return(0,zse.default)(d)}readReferenceWhere(e){const{__typename:n,filter:r,limit:i,orderBy:s}=e,o=(0,Zm.collectionEntityIdForType)(n);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,ls.makeReference)(o));if(!a)return[];const l=this.readField.bind(this);if(r&&(a=a.filter(u=>{if((0,Jse.default)(r))return r(u,l);const d=Object.keys(r).map(h=>{const p=r[h],g=this.readField(h,u);return p===g});return(0,Qse.default)(d,Boolean)})),s){const{field:u,descending:d}=s;a=(0,Yse.default)(a,h=>l(u,h),[d?"desc":"asc"])}return(0,Kse.default)(i)?a:(0,Hse.default)(a,i)}writeFragmentWhere(e){const{update:n}=e,r=Xm(e,["update"]);this.readFragmentWhere(r).forEach(i=>{this.writeFragment({id:this.identify(i),fragment:e.fragment,data:n(i),broadcast:!1})}),this.broadcastWatches()}}yh.default=eoe;(function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCache=t.makeCachedVar=void 0;var n=Lb;Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=yh;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e(r).default}})})(dx);var Jx={},l0={},$s={};const toe=Ha(xB);Object.defineProperty($s,"__esModule",{value:!0});$s.buildWatchFragmentWhereQuery=$s.buildWatchFragmentQuery=void 0;const cs=toe,noe=Gc;function Yx({fieldName:t,fragmentDefinition:e}){return{kind:cs.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:cs.Kind.OPERATION_DEFINITION,operation:cs.OperationTypeNode.QUERY,selectionSet:{kind:cs.Kind.SELECTION_SET,selections:[{arguments:[],kind:cs.Kind.FIELD,name:{kind:cs.Kind.NAME,value:t},directives:[{arguments:[],kind:cs.Kind.DIRECTIVE,name:{kind:cs.Kind.NAME,value:"client"}}],selectionSet:e.selectionSet}]}}]}}function roe(t){const{fragment:e,id:n,policies:r,fieldName:i}=t,s=e.definitions[0],o=Yx({fragmentDefinition:s,fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read(a){return(0,noe.makeReference)(n)}}}}}),o}$s.buildWatchFragmentQuery=roe;function ioe(t){const{fragment:e,filterVar:n,limitVar:r,orderByVar:i,policies:s,cache:o,fieldName:a}=t,l=e.definitions[0],u=l.typeCondition.name.value,d=Yx({fragmentDefinition:l,fieldName:a});return s.getFieldPolicy("Query",a)||s.addTypePolicies({Query:{fields:{[a]:{read(h){return o.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}}),d}$s.buildWatchFragmentWhereQuery=ioe;Object.defineProperty(l0,"__esModule",{value:!0});const ff=Gc,zO=$s,QO=zs;class soe extends ff.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,n){const r=this.watchQuery({fetchPolicy:"cache-only",query:e}),i=r.subscribe.bind(r);return r.subscribe=(s,...o)=>{typeof s!="object"&&(s={next:s,error:o[0],complete:o[1]});const a=s.next;s.next=d=>{var h;a&&a((h=d==null?void 0:d.data)===null||h===void 0?void 0:h[n])};const l=i(s),u=l.unsubscribe.bind(l);return l.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[n],u()},l},r}watchFragment(e){const n=(0,QO.generateFragmentFieldName)(),r=(0,zO.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:n,policies:this.policies}));return this.watchQueryForField(r,n)}watchFragmentWhere(e){const n=(0,QO.generateFragmentFieldName)(),r=(0,ff.makeVar)(e.filter),i=(0,ff.makeVar)(e.limit),s=(0,ff.makeVar)(e.orderBy),o=(0,zO.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:n,filterVar:r,limitVar:i,orderByVar:s,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,n)}}l0.default=soe;(function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.ApolloExtensionsClient=void 0;var n=l0;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return e(n).default}})})(Jx);var Xx={},c0={},Mo={},ooe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.usePrevious=Mo.useOnce=void 0;const Td=ae,aoe=ooe(_h);function loe(t){const e=(0,Td.useRef)(),n=(0,Td.useRef)(!1);return n.current||((0,aoe.default)(t)?e.current=t():e.current=t,n.current=!0),e.current}Mo.useOnce=loe;const coe=t=>{const e=(0,Td.useRef)(null);return(0,Td.useEffect)(()=>{e.current=t}),e.current};Mo.usePrevious=coe;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});Xc.useFragmentTypePolicyFieldName=void 0;const uoe=Xa,GO=ae,foe=zs,doe=Mo,hoe=({fragmentName:t}={})=>{const e=(0,GO.useMemo)(()=>(0,foe.generateFragmentFieldName)({fragmentName:t}),[t]),n=(0,doe.usePrevious)(e),r=(0,uoe.useApolloClient)();return(0,GO.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[e,n]),e};Xc.useFragmentTypePolicyFieldName=hoe;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0});Zc.useGetQueryDataByFieldName=void 0;const poe=Xa,moe=(t,e,n)=>{var r,i;const s=(0,poe.useQuery)(t,{fetchPolicy:"cache-only",returnPartialData:n==null?void 0:n.returnPartialData});return{data:(i=(r=s==null?void 0:s.data)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:null}};Zc.useGetQueryDataByFieldName=moe;Object.defineProperty(c0,"__esModule",{value:!0});const goe=Xa,yoe=ae,voe=Mo,boe=$s,_oe=Xc,Eoe=Zc;function woe(t,e){const r=(0,yoe.useContext)((0,goe.getApolloContext)()).client,i=r==null?void 0:r.cache,s=(0,_oe.useFragmentTypePolicyFieldName)(),o=(0,voe.useOnce)(()=>(0,boe.buildWatchFragmentQuery)({fragment:t,fieldName:s,id:e.id,policies:i.policies}));return(0,Eoe.useGetQueryDataByFieldName)(o,s,e)}c0.default=woe;var u0={};const Toe=Ha(xU);Object.defineProperty(u0,"__esModule",{value:!0});const Soe=Xa,Ri=ae,Ooe=$s,koe=Xc,Noe=Zc,eg=Xa,HO=Toe;function Aoe(t,e){var n;const r=e==null?void 0:e.filter,s=(0,Ri.useRef)((0,eg.makeVar)(r)).current,o=e==null?void 0:e.limit,l=(0,Ri.useRef)((0,eg.makeVar)(o)).current,u=e==null?void 0:e.orderBy,h=(0,Ri.useRef)((0,eg.makeVar)(u)).current,g=(0,Ri.useContext)((0,Soe.getApolloContext)()).client,y=g==null?void 0:g.cache,b=(0,koe.useFragmentTypePolicyFieldName)({fragmentName:e==null?void 0:e.fragmentName}),_=(0,Ri.useRef)([]);(0,Ri.useEffect)(()=>{(typeof r=="function"&&r!==s()||!(0,HO.equal)(r,s()))&&s(r)},[r]),(0,Ri.useEffect)(()=>{o!==l()&&l(o)},[o]),(0,Ri.useEffect)(()=>{(typeof u=="function"&&u!==h()||!(0,HO.equal)(u,h()))&&h(u)},[u]);const w=(0,Ri.useMemo)(()=>(0,Ooe.buildWatchFragmentWhereQuery)({filter:r,filterVar:s,limitVar:l,orderByVar:h,fragment:t,fieldName:b,cache:y,policies:y.policies}),[b]),O=(0,Noe.useGetQueryDataByFieldName)(w,b,e);return Object.assign(Object.assign({},O),{data:(n=O.data)!==null&&n!==void 0?n:_.current})}u0.default=Aoe;(function(t){var e=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.useFragmentWhere=t.useFragment=void 0;var n=c0;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return e(n).default}});var r=u0;Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return e(r).default}})})(Xx);var Zx={},f0={},eu={},Ioe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eu,"__esModule",{value:!0});eu.AuditType=void 0;const xoe=Ioe(Ih);var ec;(function(t){t.Read="Read",t.Write="Write",t.Evict="Evict"})(ec||(eu.AuditType=ec={}));class Coe extends xoe.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s=!1}){return this.auditLog.log("Running read policy",ec.Read,"InvalidationPolicyManager",{storeFieldName:i,typename:e,dataId:n,fieldName:r}),super.runReadPolicy({typename:e,dataId:n,fieldName:r,storeFieldName:i,reportOnly:s})}runWritePolicy(e,n){return this.auditLog.log("Running write policy",ec.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runWritePolicy(e,n)}runEvictPolicy(e,n){return this.auditLog.log("Running evict policy",ec.Write,"InvalidationPolicyManager",Object.assign({typeName:e},n)),super.runEvictPolicy(e,n)}}eu.default=Coe;var d0={},Doe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d0,"__esModule",{value:!0});const Roe=Doe(Dh);var Sd;(function(t){t.Write="Write",t.Evict="Evict"})(Sd||(Sd={}));class Moe extends Roe.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,n,r,i){return this.auditLog.log("Writing to type map",Sd.Write,"EntityTypeMap",{typename:e,dataId:n,storeFieldName:r,variables:i}),super.write(e,n,r,i)}evict(e,n){return this.auditLog.log("Evicting from type map",Sd.Evict,"EntityTypeMap",{dataId:e,storeFieldName:n}),super.evict(e,n)}}d0.default=Moe;var h0={},Poe=Wb;function Foe(t,e){var n=[];return Poe(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}var $oe=Foe,Loe=Sx,Voe=$oe,joe=Zb,Boe=$n;function Uoe(t,e){var n=Boe(t)?Loe:Voe;return n(t,joe(e))}var qoe=Uoe,Woe=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(h0,"__esModule",{value:!0});const zoe=Woe(qoe);class Qoe{constructor(){this._log=[]}log(e,n,r,i){const s={time:Date.now(),type:n,event:e,meta:i,group:r};this._log.push(s)}getLog(e){return(0,zoe.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var n;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify((n=e.meta)!==null&&n!==void 0?n:{})}`),console.groupEnd()}}h0.default=Qoe;var Rh=Re&&Re.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(f0,"__esModule",{value:!0});const Goe=Rh(yh),Hoe=Ro,Koe=Rh(eu),Joe=Rh(d0),Yoe=Rh(h0),Xoe=s0;class Zoe extends Goe.default{constructor(e){super(e),this.auditLog=new Yoe.default;const{invalidationPolicies:n={}}=e;this.entityTypeMap=new Joe.default({auditLog:this.auditLog}),new Xoe.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new Koe.default({auditLog:this.auditLog,policies:n,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new Hoe.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}f0.default=Zoe;(function(t){var e=Re&&Re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidationPolicyCacheAuditor=void 0;var n=f0;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return e(n).default}})})(Zx);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RenewalPolicy=t.InvalidationPolicyEvent=t.InvalidationPolicyCacheAuditor=t.useFragmentWhere=t.useFragment=t.ApolloExtensionsClient=t.makeCachedVar=t.InvalidationPolicyCache=void 0;var e=dx;Object.defineProperty(t,"InvalidationPolicyCache",{enumerable:!0,get:function(){return e.InvalidationPolicyCache}}),Object.defineProperty(t,"makeCachedVar",{enumerable:!0,get:function(){return e.makeCachedVar}});var n=Jx;Object.defineProperty(t,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=Xx;Object.defineProperty(t,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(t,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=Zx;Object.defineProperty(t,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var s=Rr;Object.defineProperty(t,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return s.InvalidationPolicyEvent}}),Object.defineProperty(t,"RenewalPolicy",{enumerable:!0,get:function(){return s.RenewalPolicy}})})(my);var tg=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))},eae=function(){function t(e){var n=e.debug,r=n===void 0?!1:n;this.debug=r,this.lines=[]}return t.prototype.emit=function(e,n){if(e in console){var r=t.prefix;console[e].apply(console,tg([r],n,!1))}},t.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(n){var r=n[0],i=n[1];return e.emit(r,i)})},t.prototype.getLogs=function(){return this.lines},t.prototype.write=function(e,n){var r=t.buffer;this.lines=tg(tg([],this.lines.slice(1-r),!0),[[e,n]],!1),(this.debug||e!=="log")&&this.emit(e,n)},t.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("log",e)},t.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("warn",e)},t.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.write("error",e)},t.buffer=30,t.prefix="[apollo-cache-persist]",t}(),tae=function(){function t(e){var n=e.cache,r=e.serialize,i=r===void 0?!0:r;this.cache=n,this.serialize=i}return t.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},t.prototype.restore=function(e){this.serialize&&typeof e=="string"&&(e=JSON.parse(e)),e!=null&&this.cache.restore(e)},t}(),df=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},hf=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},eC=function(){function t(e){var n=e.storage,r=e.key,i=r===void 0?"apollo-cache-persist":r;this.storage=n,this.key=i}return t.prototype.read=function(){return df(this,void 0,void 0,function(){return hf(this,function(e){return[2,this.storage.getItem(this.key)]})})},t.prototype.write=function(e){return df(this,void 0,void 0,function(){return hf(this,function(n){switch(n.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return n.sent(),[2]}})})},t.prototype.purge=function(){return df(this,void 0,void 0,function(){return hf(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},t.prototype.getSize=function(){return df(this,void 0,void 0,function(){var e;return hf(this,function(n){switch(n.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return e=n.sent(),e==null?[2,0]:[2,typeof e=="string"?e.length:null]}})})},t}(),ng=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(h){o(h)}}function l(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(t,e||[])).next())})},rg=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},tC=function(){function t(e,n){var r=e.log,i=e.cache,s=e.storage,o=n.maxSize,a=o===void 0?1024*1024:o,l=n.persistenceMapper;this.log=r,this.cache=i,this.storage=s,this.paused=!1,l&&(this.persistenceMapper=l),a&&(this.maxSize=a)}return t.prototype.persist=function(){return ng(this,void 0,void 0,function(){var e,n;return rg(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),e=this.cache.extract(),!this.paused&&this.persistenceMapper?[4,this.persistenceMapper(e)]:[3,2];case 1:e=r.sent(),r.label=2;case 2:return this.maxSize!=null&&typeof e=="string"&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return r.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return r.sent(),this.log.info(typeof e=="string"?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw n=r.sent(),this.log.error("Error persisting cache",n),n;case 7:return[2]}})})},t.prototype.restore=function(){return ng(this,void 0,void 0,function(){var e,n;return rg(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return e=r.sent(),e==null?[3,3]:[4,this.cache.restore(e)];case 2:return r.sent(),this.log.info(typeof e=="string"?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),r.label=4;case 4:return[3,6];case 5:throw n=r.sent(),this.log.error("Error restoring cache",n),n;case 6:return[2]}})})},t.prototype.purge=function(){return ng(this,void 0,void 0,function(){var e;return rg(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return n.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=n.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},t}();const nC=function(t){var e=t.cache;return function(n){var r=e.write,i=e.evict,s=e.modify,o=e.gc;return e.write=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=r.apply(e,a);return n(),u},e.evict=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=i.apply(e,a);return n(),u},e.modify=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=s.apply(e,a);return n(),u},e.gc=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var u=o.apply(e,a);return n(),u},function(){e.write=r,e.evict=i,e.modify=s,e.gc=o}}},nae=function(t){var e=t.log,n=t.cache;return function(r){return e.warn("Trigger option `background` not available on web; using `write` trigger"),nC({cache:n})(r)}};var rae=function(){function t(e,n){var r=e.log,i=e.persistor,s=this;this.fire=function(){if(!s.debounce){s.persist();return}s.timeout!=null&&clearTimeout(s.timeout),s.timeout=setTimeout(s.persist,s.debounce)},this.persist=function(){s.paused||s.persistor.persist()};var o=t.defaultDebounce,a=n.cache,l=n.debounce,u=n.trigger,d=u===void 0?"write":u;if(d)switch(this.debounce=l??o,this.persistor=i,this.paused=!1,d){case"write":this.uninstall=nC({cache:a})(this.fire);break;case"background":l&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=l,this.uninstall=nae({cache:a,log:r})(this.fire);break;default:if(typeof d=="function")this.uninstall=d(this.fire);else throw Error("Unrecognized trigger option: ".concat(d))}}return t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},t.defaultDebounce=1e3,t}(),iae=function(){function t(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var n=new eae(e),r=new tae(e),i=new eC(e),s=new tC({log:n,cache:r,storage:i},e),o=new rae({log:n,persistor:s},e);this.log=n,this.cache=r,this.storage=i,this.persistor=s,this.trigger=o}return t.prototype.persist=function(){return this.persistor.persist()},t.prototype.restore=function(){return this.persistor.restore()},t.prototype.purge=function(){return this.persistor.purge()},t.prototype.pause=function(){this.trigger.pause()},t.prototype.resume=function(){this.trigger.resume()},t.prototype.remove=function(){this.trigger.remove()},t.prototype.getLogs=function(e){if(e===void 0&&(e=!1),e)this.log.tailLogs();else return this.log.getLogs()},t.prototype.getSize=function(){return this.storage.getSize()},t}(),p0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sae=function(t){var e=new oae(t);e.restoreSync()},oae=function(t){p0(e,t);function e(n){var r=t.call(this,n)||this;return r.storage=new lae(n),r.persistor=new aae({log:r.log,cache:r.cache,storage:r.storage},n),r}return e.prototype.restoreSync=function(){this.persistor.restoreSync()},e}(iae),aae=function(t){p0(e,t);function e(n,r){var i=n.log,s=n.cache,o=n.storage;return t.call(this,{log:i,cache:s,storage:o},r)||this}return e.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},e}(tC),lae=function(t){p0(e,t);function e(n){return t.call(this,n)||this}return e.prototype.readSync=function(){return this.storage.getItem(this.key)},e}(eC),cae=function(){function t(e){this.storage=e}return t.prototype.getItem=function(e){return this.storage.getItem(e)},t.prototype.removeItem=function(e){return this.storage.removeItem(e)},t.prototype.setItem=function(e,n){return n!==null?this.storage.setItem(e,n):this.removeItem(e)},t}();function qn(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function so(t){return qn(t)==="object"}function uae(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function KO(t,e){return t.length<124?t:e}const fae="graphql-transport-ws";var sr;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(sr||(sr={}));var Dt;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Dt||(Dt={}));function rC(t){if(!so(t))throw new Error(`Message is expected to be an object, but got ${qn(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${qn(t.type)}`);switch(t.type){case Dt.ConnectionInit:case Dt.ConnectionAck:case Dt.Ping:case Dt.Pong:{if(t.payload!=null&&!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Dt.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${qn(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${qn(t.payload.query)}`);if(t.payload.variables!=null&&!so(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${qn(t.payload.variables)}`);if(t.payload.operationName!=null&&qn(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${qn(t.payload.operationName)}`);if(t.payload.extensions!=null&&!so(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${qn(t.payload.extensions)}`);break}case Dt.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!so(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${qn(t.payload)}`);break}case Dt.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!uae(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Dt.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${qn(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function dae(t,e){return rC(typeof t=="string"?JSON.parse(t,e):t)}function Pl(t,e){return rC(t),JSON.stringify(t,e)}var Oa=function(t){return this instanceof Oa?(this.v=t,this):new Oa(t)},hae=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(g){return new Promise(function(y,b){s.push([p,g,y,b])>1||a(p,g)})})}function a(p,g){try{l(r[p](g))}catch(y){h(s[0][3],y)}}function l(p){p.value instanceof Oa?Promise.resolve(p.value.v).then(u,d):h(s[0][2],p)}function u(p){a("next",p)}function d(p){a("throw",p)}function h(p,g){p(g),s.shift(),s.length&&a(s[0][0],s[0][1])}};function pae(t){const{url:e,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:s=0,keepAlive:o=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(Ae){let fe=1e3;for(let Ee=0;Ee<Ae;Ee++)fe*=2;await new Promise(Ee=>setTimeout(Ee,fe+Math.floor(Math.random()*2700+300)))},shouldRetry:h=ig,isFatalConnectionProblem:p,on:g,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Ae=>{const fe=Math.random()*16|0;return(Ae=="x"?fe:fe&3|8).toString(16)})},jsonMessageReplacer:_,jsonMessageReviver:w}=t;let O;if(y){if(!gae(y))throw new Error("Invalid WebSocket implementation provided");O=y}else typeof WebSocket<"u"?O=WebSocket:typeof global<"u"?O=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(O=window.WebSocket||window.MozWebSocket);if(!O)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const N=O,I=(()=>{const te=(()=>{const fe={};return{on(Ee,ge){return fe[Ee]=ge,()=>{delete fe[Ee]}},emit(Ee){var ge;"id"in Ee&&((ge=fe[Ee.id])===null||ge===void 0||ge.call(fe,Ee))}}})(),Ae={connecting:g!=null&&g.connecting?[g.connecting]:[],opened:g!=null&&g.opened?[g.opened]:[],connected:g!=null&&g.connected?[g.connected]:[],ping:g!=null&&g.ping?[g.ping]:[],pong:g!=null&&g.pong?[g.pong]:[],message:g!=null&&g.message?[te.emit,g.message]:[te.emit],closed:g!=null&&g.closed?[g.closed]:[],error:g!=null&&g.error?[g.error]:[]};return{onMessage:te.on,on(fe,Ee){const ge=Ae[fe];return ge.push(Ee),()=>{ge.splice(ge.indexOf(Ee),1)}},emit(fe,...Ee){for(const ge of[...Ae[fe]])ge(...Ee)}}})();function P(te){const Ae=[I.on("error",fe=>{Ae.forEach(Ee=>Ee()),te(fe)}),I.on("closed",fe=>{Ae.forEach(Ee=>Ee()),te(fe)})]}let M,B=0,Q,x=!1,U=0,be=!1;async function Oe(){clearTimeout(Q);const[te,Ae]=await(M??(M=new Promise((ge,ct)=>(async()=>{if(x){if(await d(U),!B)return M=void 0,ct({code:1e3,reason:"All Subscriptions Gone"});U++}I.emit("connecting",x);const ve=new N(typeof e=="function"?await e():e,fae);let L,Z;function Y(){isFinite(o)&&o>0&&(clearTimeout(Z),Z=setTimeout(()=>{ve.readyState===N.OPEN&&(ve.send(Pl({type:Dt.Ping})),I.emit("ping",!1,void 0))},o))}P(we=>{M=void 0,clearTimeout(L),clearTimeout(Z),ct(we),we instanceof JO&&(ve.close(4499,"Terminated"),ve.onerror=null,ve.onclose=null)}),ve.onerror=we=>I.emit("error",we),ve.onclose=we=>I.emit("closed",we),ve.onopen=async()=>{try{I.emit("opened",ve);const we=typeof n=="function"?await n():n;if(ve.readyState!==N.OPEN)return;ve.send(Pl(we?{type:Dt.ConnectionInit,payload:we}:{type:Dt.ConnectionInit},_)),isFinite(l)&&l>0&&(L=setTimeout(()=>{ve.close(sr.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),Y()}catch(we){I.emit("error",we),ve.close(sr.InternalClientError,KO(we instanceof Error?we.message:new Error(we).message,"Internal client error"))}};let ee=!1;ve.onmessage=({data:we})=>{try{const Me=dae(we,w);if(I.emit("message",Me),Me.type==="ping"||Me.type==="pong"){I.emit(Me.type,!0,Me.payload),Me.type==="pong"?Y():a||(ve.send(Pl(Me.payload?{type:Dt.Pong,payload:Me.payload}:{type:Dt.Pong})),I.emit("pong",!1,Me.payload));return}if(ee)return;if(Me.type!==Dt.ConnectionAck)throw new Error(`First message cannot be of type ${Me.type}`);clearTimeout(L),ee=!0,I.emit("connected",ve,Me.payload,x),x=!1,U=0,ge([ve,new Promise((Ye,Zt)=>P(Zt))])}catch(Me){ve.onmessage=null,I.emit("error",Me),ve.close(sr.BadResponse,KO(Me instanceof Error?Me.message:new Error(Me).message,"Bad response"))}}})())));te.readyState===N.CLOSING&&await Ae;let fe=()=>{};const Ee=new Promise(ge=>fe=ge);return[te,fe,Promise.race([Ee.then(()=>{if(!B){const ge=()=>te.close(1e3,"Normal Closure");isFinite(s)&&s>0?Q=setTimeout(()=>{te.readyState===N.OPEN&&ge()},s):ge()}}),Ae])]}function ke(te){if(ig(te)&&(mae(te.code)||[sr.InternalServerError,sr.InternalClientError,sr.BadRequest,sr.BadResponse,sr.Unauthorized,sr.SubprotocolNotAcceptable,sr.SubscriberAlreadyExists,sr.TooManyInitialisationRequests].includes(te.code)))throw te;if(be)return!1;if(ig(te)&&te.code===1e3)return B>0;if(!u||U>=u||!h(te)||p!=null&&p(te))throw te;return x=!0}r||(async()=>{for(B++;;)try{const[,,te]=await Oe();await te}catch(te){try{if(!ke(te))return}catch(Ae){return i==null?void 0:i(Ae)}}})();function Le(te,Ae){const fe=b(te);let Ee=!1,ge=!1,ct=()=>{B--,Ee=!0};return(async()=>{for(B++;;)try{const[ve,L,Z]=await Oe();if(Ee)return L();const Y=I.onMessage(fe,ee=>{switch(ee.type){case Dt.Next:{Ae.next(ee.payload);return}case Dt.Error:{ge=!0,Ee=!0,Ae.error(ee.payload),ct();return}case Dt.Complete:{Ee=!0,ct();return}}});ve.send(Pl({id:fe,type:Dt.Subscribe,payload:te},_)),ct=()=>{!Ee&&ve.readyState===N.OPEN&&ve.send(Pl({id:fe,type:Dt.Complete},_)),B--,Ee=!0,L()},await Z.finally(Y);return}catch(ve){if(!ke(ve))return}})().then(()=>{ge||Ae.complete()}).catch(ve=>{Ae.error(ve)}),()=>{Ee||ct()}}return{on:I.on,subscribe:Le,iterate(te){const Ae=[],fe={done:!1,error:null,resolve:()=>{}},Ee=Le(te,{next(ct){Ae.push(ct),fe.resolve()},error(ct){fe.done=!0,fe.error=ct,fe.resolve()},complete(){fe.done=!0,fe.resolve()}}),ge=function(){return hae(this,arguments,function*(){for(;;){for(Ae.length||(yield Oa(new Promise(L=>fe.resolve=L)));Ae.length;)yield yield Oa(Ae.shift());if(fe.error)throw fe.error;if(fe.done)return yield Oa(void 0)}})}();return ge.throw=async ct=>(fe.done||(fe.done=!0,fe.error=ct,fe.resolve()),{done:!0,value:void 0}),ge.return=async()=>(Ee(),{done:!0,value:void 0}),ge},async dispose(){if(be=!0,M){const[te]=await M;te.close(1e3,"Normal Closure")}},terminate(){M&&I.emit("closed",new JO)}}}class JO extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function ig(t){return so(t)&&"code"in t&&"reason"in t}function mae(t){return[1e3,1001,1006,1005,1012,1013,1014].includes(t)?!1:t>=1e3&&t<=1999}function gae(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}const yae=({apiUrl:t,organizationId:e,listeners:n,lazy:r=!1,token:i})=>{const s=pae({url:`wss://${t}`,lazy:r,connectionParams:vc.omitBy({"organization-id":e,authorization:i?`Bearer ${i}`:void 0},vc.isNil),keepAlive:1e4});return n&&(n.onConnected&&s.on("connected",n.onConnected),n.onClosed&&s.on("closed",n.onClosed),n.onError&&s.on("error",n.onError)),s},vae=({token:t,organizationId:e,invalidationPolicies:n,handlers:r,fetchPolicy:i,websocket:s,apiBaseUrl:o})=>{const a=new my.InvalidationPolicyCache({invalidationPolicies:{...n,timeToLive:(n==null?void 0:n.timeToLive)??12e4,renewalPolicy:(n==null?void 0:n.renewalPolicy)??my.RenewalPolicy.None}});sae({cache:a,storage:new cae(window.localStorage)});const l=`api.warrior.${o??"well-played.gg"}/graphql`,u=Pv(({query:d})=>{const h=Vo(d);return h.kind==="OperationDefinition"&&h.operation==="subscription"},new Z6(yae({apiUrl:l,listeners:r==null?void 0:r.webSocket,organizationId:e,lazy:s==null?void 0:s.lazy,token:t})),Mv([J6(async()=>({headers:vc.omitBy({"organization-id":e,authorization:t?`Bearer ${t}`:void 0},vc.isNil)})),...r!=null&&r.onError?[fx(r==null?void 0:r.onError)]:[],new Kd({uri:`https://${l}`})]));return new Zd({cache:a,link:u,defaultOptions:{watchQuery:{fetchPolicy:i??"network-only",errorPolicy:"ignore"},query:{fetchPolicy:i??"network-only",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})},iC=ae.createContext({}),bae=()=>{const t=ae.useContext(iC);if(!t)throw new Error("useWellPlayed must be used within a WellPlayedProvider");return t},_ae=({children:t,clientConfig:e,organizationId:n})=>{const r=cz(),i=ae.useMemo(()=>(console.log("accessToken",r==null?void 0:r.accessToken),vae({token:(r==null?void 0:r.accessToken)??void 0,organizationId:n,...e})),[r==null?void 0:r.accessToken,n,e]);return he.jsx(GN,{client:i,children:he.jsx(iC.Provider,{value:{organizationId:n,apiClient:i},children:t})})},Eae=({children:t,oidcConfig:e,wpAppConfig:n,...r})=>he.jsx(sz,{...e,configuration:{...n,...e==null?void 0:e.configuration,authority:`https://oauth.warrior.${r.apiBaseUrl??"well-played.gg"}`},children:he.jsx(_ae,{...r,children:t})});exports.RichTextEditorContent=K6;exports.WellPlayedProvider=Eae;exports.graphql=Ja;exports.readFragment=vz;exports.useConnectedPlayer=Ez;exports.usePaginatedLoadAll=ub;exports.usePaginatedQuery=Kq;exports.usePlayers=wA;exports.useTournamentStep=Oz;exports.useTournamentTeams=TA;exports.useWellPlayed=bae;