@banou/stub 0.0.20 → 0.0.22

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.
Files changed (67) hide show
  1. package/build/.well-known/fkn.json +1 -1
  2. package/build/assets/embed-VjpeLPHx.js +1461 -0
  3. package/build/assets/index-Cq0deG16.js +1964 -0
  4. package/build/assets/lib-DHuurgWT.js +71 -0
  5. package/build/assets/{lib-account-BuVN6Bsx.js → lib-account-B_rZrj_U.js} +1 -1
  6. package/build/assets/lib-account-ZA7I4UZl.js +2 -0
  7. package/build/assets/lib-api-0oE17Lze.js +2 -0
  8. package/build/assets/{lib-build-DEOZ3A7n.js → lib-api-DLvscoll-INenJIDp.js} +863 -556
  9. package/build/assets/lib-worker-B7p9HUJX.js +2 -0
  10. package/build/assets/lib-worker-C6VkH7Kf.js +9006 -0
  11. package/build/assets/lib-worker-index-DCktGn3b.js +1964 -0
  12. package/build/assets/main-BC_h4vk9.js +3844 -0
  13. package/build/assets/main-DZ0Ws1xk.css +1 -0
  14. package/build/assets/uri-CY1i0hlC.js +1 -0
  15. package/build/assets/worker-CaEIruuB.js +1 -0
  16. package/build/assets/worker-juGKbgx7.js +1 -0
  17. package/build/embed.html +4 -8
  18. package/build/fkn.json +1 -1
  19. package/build/index.html +5 -8
  20. package/build/index.js +23838 -35935
  21. package/fkn.json +1 -1
  22. package/package.json +6 -3
  23. package/build/assets/Preview-DG9nqCV0.js +0 -1
  24. package/build/assets/compat-CusyxzKh.js +0 -1
  25. package/build/assets/custom-media-element-BDICDseJ.js +0 -43
  26. package/build/assets/dash.all.min-Dbg8AB-J.js +0 -19
  27. package/build/assets/dist-BgIerfpp.js +0 -3136
  28. package/build/assets/dist-BrpV89uJ.js +0 -1
  29. package/build/assets/dist-D-OKiX-f.js +0 -1
  30. package/build/assets/dist-D_XB-JLn.js +0 -40
  31. package/build/assets/embed-DBjG5JMH.js +0 -1
  32. package/build/assets/index-BHgdalnH.js +0 -1401
  33. package/build/assets/lib-Preview-B6uZKyhl.js +0 -82
  34. package/build/assets/lib-account-Cw8yCZtf.js +0 -2
  35. package/build/assets/lib-api-DLvscoll-DhlBp9Wz.js +0 -312
  36. package/build/assets/lib-api-DVwR-22s.js +0 -2
  37. package/build/assets/lib-compat-D8G4_Lzi.js +0 -860
  38. package/build/assets/lib-custom-media-element-CnANKrGl.js +0 -217
  39. package/build/assets/lib-dash.all.min-CDvdorbj.js +0 -27251
  40. package/build/assets/lib-dist-Dv8d3Kr0.js +0 -7
  41. package/build/assets/lib-dist-S8Gxnnq-.js +0 -12468
  42. package/build/assets/lib-dist-T0QlKbbk.js +0 -18578
  43. package/build/assets/lib-dist-xBHT3Lfz.js +0 -911
  44. package/build/assets/lib-react-BEg4mBBK.js +0 -112
  45. package/build/assets/lib-react-C0OCUIWX.js +0 -434
  46. package/build/assets/lib-react-CAkOlDha.js +0 -367
  47. package/build/assets/lib-react-CGlZXIjl.js +0 -2187
  48. package/build/assets/lib-react-CLVoi_ZM.js +0 -334
  49. package/build/assets/lib-react-DUxKSzCt.js +0 -311
  50. package/build/assets/lib-react-QvmpnEVK.js +0 -334
  51. package/build/assets/lib-react-WTnxAo6F.js +0 -202
  52. package/build/assets/lib-remote-DeY2A2G7.js +0 -416
  53. package/build/assets/lib-remote-DxEZmpd0.js +0 -2
  54. package/build/assets/lib-worker-index-C7ynIZYg.js +0 -1401
  55. package/build/assets/main-DejLBzlj.js +0 -3349
  56. package/build/assets/players-BIbP12aF.js +0 -1530
  57. package/build/assets/preload-helper-D2XUqLHy.js +0 -1
  58. package/build/assets/react-BDr8Ag8b.js +0 -19
  59. package/build/assets/react-BTju4bmn.js +0 -22
  60. package/build/assets/react-CLMfdUXR.js +0 -2
  61. package/build/assets/react-CjmRCHoG.js +0 -34
  62. package/build/assets/react-Cs34a503.js +0 -19
  63. package/build/assets/react-DKSDz1wJ.js +0 -6
  64. package/build/assets/react-bkM_mQGd.js +0 -17
  65. package/build/assets/react-kPj0f67l.js +0 -21
  66. package/build/assets/rolldown-runtime-CNC7AqOf.js +0 -1
  67. /package/build/assets/{players-3a7RYKgR.css → embed-3a7RYKgR.css} +0 -0
@@ -1,1401 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);const f=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function p(e,t){if(!e)throw Error(t)}function m(e){return typeof e==`object`&&!!e}function h(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}const g=/\r\n|[\n\r]/g;function _(e,t){let n=0,r=1;for(let i of e.body.matchAll(g)){if(typeof i.index==`number`||h(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function ee(e){return v(e.source,_(e.source,e.start))}function v(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+y([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+y([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function y(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(`
2
- `)}function te(e){let t=e[0];return t==null||`kind`in t||`length`in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}var b=class e extends Error{constructor(t,...n){let{nodes:r,source:i,positions:a,path:o,originalError:s,extensions:c}=te(n);super(t),this.name=`GraphQLError`,this.path=o??void 0,this.originalError=s??void 0,this.nodes=ne(Array.isArray(r)?r:r?[r]:void 0);let l=ne(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??l?.[0]?.source,this.positions=a??l?.map(e=>e.start),this.locations=a&&i?a.map(e=>_(i,e)):l?.map(e=>_(e.source,e.start));let u=m(s?.extensions)?s?.extensions:void 0;this.extensions=c??u??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}}),s!=null&&s.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=`
3
-
4
- `+ee(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=`
5
-
6
- `+v(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function ne(e){return e===void 0||e.length===0?void 0:e}function x(e,t,n){return new b(`Syntax Error: ${n}`,{source:e,positions:[t]})}var re=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},ie=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return`Token`}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}};const ae={Name:[],Document:[`definitions`],OperationDefinition:[`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentSpread:[`name`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`locations`],SchemaExtension:[`directives`,`operationTypes`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`]},oe=new Set(Object.keys(ae));function se(e){let t=e?.kind;return typeof t==`string`&&oe.has(t)}var ce;(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(ce||={});var S;(function(e){e.QUERY=`QUERY`,e.MUTATION=`MUTATION`,e.SUBSCRIPTION=`SUBSCRIPTION`,e.FIELD=`FIELD`,e.FRAGMENT_DEFINITION=`FRAGMENT_DEFINITION`,e.FRAGMENT_SPREAD=`FRAGMENT_SPREAD`,e.INLINE_FRAGMENT=`INLINE_FRAGMENT`,e.VARIABLE_DEFINITION=`VARIABLE_DEFINITION`,e.SCHEMA=`SCHEMA`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.FIELD_DEFINITION=`FIELD_DEFINITION`,e.ARGUMENT_DEFINITION=`ARGUMENT_DEFINITION`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.ENUM_VALUE=`ENUM_VALUE`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.INPUT_FIELD_DEFINITION=`INPUT_FIELD_DEFINITION`})(S||={});var C;(function(e){e.NAME=`Name`,e.DOCUMENT=`Document`,e.OPERATION_DEFINITION=`OperationDefinition`,e.VARIABLE_DEFINITION=`VariableDefinition`,e.SELECTION_SET=`SelectionSet`,e.FIELD=`Field`,e.ARGUMENT=`Argument`,e.FRAGMENT_SPREAD=`FragmentSpread`,e.INLINE_FRAGMENT=`InlineFragment`,e.FRAGMENT_DEFINITION=`FragmentDefinition`,e.VARIABLE=`Variable`,e.INT=`IntValue`,e.FLOAT=`FloatValue`,e.STRING=`StringValue`,e.BOOLEAN=`BooleanValue`,e.NULL=`NullValue`,e.ENUM=`EnumValue`,e.LIST=`ListValue`,e.OBJECT=`ObjectValue`,e.OBJECT_FIELD=`ObjectField`,e.DIRECTIVE=`Directive`,e.NAMED_TYPE=`NamedType`,e.LIST_TYPE=`ListType`,e.NON_NULL_TYPE=`NonNullType`,e.SCHEMA_DEFINITION=`SchemaDefinition`,e.OPERATION_TYPE_DEFINITION=`OperationTypeDefinition`,e.SCALAR_TYPE_DEFINITION=`ScalarTypeDefinition`,e.OBJECT_TYPE_DEFINITION=`ObjectTypeDefinition`,e.FIELD_DEFINITION=`FieldDefinition`,e.INPUT_VALUE_DEFINITION=`InputValueDefinition`,e.INTERFACE_TYPE_DEFINITION=`InterfaceTypeDefinition`,e.UNION_TYPE_DEFINITION=`UnionTypeDefinition`,e.ENUM_TYPE_DEFINITION=`EnumTypeDefinition`,e.ENUM_VALUE_DEFINITION=`EnumValueDefinition`,e.INPUT_OBJECT_TYPE_DEFINITION=`InputObjectTypeDefinition`,e.DIRECTIVE_DEFINITION=`DirectiveDefinition`,e.SCHEMA_EXTENSION=`SchemaExtension`,e.SCALAR_TYPE_EXTENSION=`ScalarTypeExtension`,e.OBJECT_TYPE_EXTENSION=`ObjectTypeExtension`,e.INTERFACE_TYPE_EXTENSION=`InterfaceTypeExtension`,e.UNION_TYPE_EXTENSION=`UnionTypeExtension`,e.ENUM_TYPE_EXTENSION=`EnumTypeExtension`,e.INPUT_OBJECT_TYPE_EXTENSION=`InputObjectTypeExtension`})(C||={});function le(e){return e===9||e===32}function ue(e){return e>=48&&e<=57}function de(e){return e>=97&&e<=122||e>=65&&e<=90}function fe(e){return de(e)||e===95}function pe(e){return de(e)||ue(e)||e===95}function me(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=he(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function he(e){let t=0;for(;t<e.length&&le(e.charCodeAt(t));)++t;return t}function ge(e,t){let n=e.replace(/"""/g,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||le(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!(t!=null&&t.minimize)&&(!i||e.length>70||l||a||o),d=``,f=i&&le(e.charCodeAt(0));return(u&&!f||a)&&(d+=`
7
- `),d+=n,(u||l)&&(d+=`
8
- `),`"""`+d+`"""`}var w;(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(w||={});var _e=class{constructor(e){let t=new ie(w.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==w.EOF)do if(e.next)e=e.next;else{let t=we(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===w.COMMENT);return e}};function ve(e){return e===w.BANG||e===w.DOLLAR||e===w.AMP||e===w.PAREN_L||e===w.PAREN_R||e===w.SPREAD||e===w.COLON||e===w.EQUALS||e===w.AT||e===w.BRACKET_L||e===w.BRACKET_R||e===w.BRACE_L||e===w.PIPE||e===w.BRACE_R}function ye(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function be(e,t){return xe(e.charCodeAt(t))&&Se(e.charCodeAt(t+1))}function xe(e){return e>=55296&&e<=56319}function Se(e){return e>=56320&&e<=57343}function Ce(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return w.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function T(e,t,n,r,i){let a=e.line;return new ie(t,n,r,a,1+n-e.lineStart,i)}function we(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Te(e,i);case 33:return T(e,w.BANG,i,i+1);case 36:return T(e,w.DOLLAR,i,i+1);case 38:return T(e,w.AMP,i,i+1);case 40:return T(e,w.PAREN_L,i,i+1);case 41:return T(e,w.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return T(e,w.SPREAD,i,i+3);break;case 58:return T(e,w.COLON,i,i+1);case 61:return T(e,w.EQUALS,i,i+1);case 64:return T(e,w.AT,i,i+1);case 91:return T(e,w.BRACKET_L,i,i+1);case 93:return T(e,w.BRACKET_R,i,i+1);case 123:return T(e,w.BRACE_L,i,i+1);case 124:return T(e,w.PIPE,i,i+1);case 125:return T(e,w.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Pe(e,i):Oe(e,i)}if(ue(t)||t===45)return Ee(e,i,t);if(fe(t))return Fe(e,i);throw x(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:ye(t)||be(n,i)?`Unexpected character: ${Ce(e,i)}.`:`Invalid character: ${Ce(e,i)}.`)}return T(e,w.EOF,r,r)}function Te(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(ye(e))++i;else if(be(n,i))i+=2;else break}return T(e,w.COMMENT,t,i,n.slice(t+1,i))}function Ee(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),ue(a))throw x(e.source,i,`Invalid number, unexpected digit after 0: ${Ce(e,i)}.`)}else i=De(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=De(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=De(e,i,a),a=r.charCodeAt(i)),a===46||fe(a))throw x(e.source,i,`Invalid number, expected digit but got: ${Ce(e,i)}.`);return T(e,o?w.FLOAT:w.INT,t,i,r.slice(t,i))}function De(e,t,n){if(!ue(n))throw x(e.source,t,`Invalid number, expected digit but got: ${Ce(e,t)}.`);let r=e.source.body,i=t+1;for(;ue(r.charCodeAt(i));)++i;return i}function Oe(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),T(e,w.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?ke(e,i):Ae(e,i):Ne(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(ye(r))++i;else if(be(n,i))i+=2;else throw x(e.source,i,`Invalid character within String: ${Ce(e,i)}.`)}throw x(e.source,i,`Unterminated string.`)}function ke(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+i++);if(e===125){if(i<5||!ye(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Me(e),r<0)break}throw x(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Ae(e,t){let n=e.source.body,r=je(n,t+2);if(ye(r))return{value:String.fromCodePoint(r),size:6};if(xe(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=je(n,t+8);if(Se(e))return{value:String.fromCodePoint(r,e),size:12}}throw x(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function je(e,t){return Me(e.charCodeAt(t))<<12|Me(e.charCodeAt(t+1))<<8|Me(e.charCodeAt(t+2))<<4|Me(e.charCodeAt(t+3))}function Me(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Ne(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:`"`,size:2};case 92:return{value:`\\`,size:2};case 47:return{value:`/`,size:2};case 98:return{value:`\b`,size:2};case 102:return{value:`\f`,size:2};case 110:return{value:`
9
- `,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw x(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Pe(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=T(e,w.BLOCK_STRING,t,a+3,me(c).join(`
10
- `));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(ye(r))++a;else if(be(n,a))a+=2;else throw x(e.source,a,`Invalid character within String: ${Ce(e,a)}.`)}throw x(e.source,a,`Unterminated string.`)}function Fe(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&pe(n.charCodeAt(i));)++i;return T(e,w.NAME,t,i,n.slice(t,i))}function E(e){return Ie(e,[])}function Ie(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return Le(e,t);default:return String(e)}}function Le(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(Re(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:Ie(t,n)}else if(Array.isArray(e))return Be(e,n);return ze(e,n)}function Re(e){return typeof e.toJSON==`function`}function ze(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>2?`[`+Ve(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+Ie(n,t)).join(`, `)+` }`}function Be(e,t){if(e.length===0)return`[]`;if(t.length>2)return`[Array]`;let n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(Ie(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function Ve(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}const He=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e==`object`&&e){let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){let t=E(e);throw Error(`Cannot use ${n} "${t}" from another module or realm.
11
-
12
- Ensure that there is only one instance of "graphql" in the node_modules
13
- directory. If different versions of "graphql" are the dependencies of other
14
- relied on modules, use "resolutions" to ensure only one version is installed.
15
-
16
- https://yarnpkg.com/en/docs/selective-version-resolutions
17
-
18
- Duplicate "graphql" modules cannot be used at the same time since different
19
- versions may have different capabilities and behavior. The data from one
20
- version used in the function from another could produce confusing and
21
- spurious results.`)}}return!1};var Ue=class{constructor(e,t=`GraphQL request`,n={line:1,column:1}){typeof e==`string`||p(!1,`Body must be a string. Received: ${E(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||p(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||p(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}};function We(e){return He(e,Ue)}function Ge(e,t){let n=new Ke(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var Ke=class{constructor(e,t={}){let n=We(e)?e:new Ue(e);this._lexer=new _e(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(w.NAME);return this.node(e,{kind:C.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:C.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF)})}parseDefinition(){if(this.peek(w.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===w.NAME){switch(t.value){case`schema`:return this.parseSchemaDefinition();case`scalar`:return this.parseScalarTypeDefinition();case`type`:return this.parseObjectTypeDefinition();case`interface`:return this.parseInterfaceTypeDefinition();case`union`:return this.parseUnionTypeDefinition();case`enum`:return this.parseEnumTypeDefinition();case`input`:return this.parseInputObjectTypeDefinition();case`directive`:return this.parseDirectiveDefinition()}if(e)throw x(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are supported only on type definitions.`);switch(t.value){case`query`:case`mutation`:case`subscription`:return this.parseOperationDefinition();case`fragment`:return this.parseFragmentDefinition();case`extend`:return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(w.BRACE_L))return this.node(e,{kind:C.OPERATION_DEFINITION,operation:ce.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseOperationType(),n;return this.peek(w.NAME)&&(n=this.parseName()),this.node(e,{kind:C.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(w.NAME);switch(e.value){case`query`:return ce.QUERY;case`mutation`:return ce.MUTATION;case`subscription`:return ce.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(w.DOLLAR),this.node(e,{kind:C.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:C.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R)})}parseSelection(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(w.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:C.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,t,w.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(w.COLON),this.node(t,{kind:C.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(w.SPREAD);let t=this.expectOptionalKeyword(`on`);return!t&&this.peek(w.NAME)?this.node(e,{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token;return this.expectKeyword(`fragment`),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case w.BRACKET_L:return this.parseList(e);case w.BRACE_L:return this.parseObject(e);case w.INT:return this.advanceLexer(),this.node(t,{kind:C.INT,value:t.value});case w.FLOAT:return this.advanceLexer(),this.node(t,{kind:C.FLOAT,value:t.value});case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:C.BOOLEAN,value:!0});case`false`:return this.node(t,{kind:C.BOOLEAN,value:!1});case`null`:return this.node(t,{kind:C.NULL});default:return this.node(t,{kind:C.ENUM,value:t.value})}case w.DOLLAR:if(e)if(this.expectToken(w.DOLLAR),this._lexer.token.kind===w.NAME){let e=this._lexer.token.value;throw x(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:C.STRING,value:e.value,block:e.kind===w.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:C.LIST,values:this.any(w.BRACKET_L,()=>this.parseValueLiteral(e),w.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:C.OBJECT,fields:this.any(w.BRACE_L,()=>this.parseObjectField(e),w.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(w.COLON),this.node(t,{kind:C.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(w.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(w.AT),this.node(t,{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(w.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(w.BRACKET_R),t=this.node(e,{kind:C.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(w.BANG)?this.node(e,{kind:C.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:C.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(w.STRING)||this.peek(w.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return this.node(e,{kind:C.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(w.COLON);let n=this.parseNamedType();return this.node(e,{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(w.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(w.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:C.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(w.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(w.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:C.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:C.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:C.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:C.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw x(this._lexer.source,this._lexer.token.start,`${qe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===w.NAME)switch(e.value){case`schema`:return this.parseSchemaExtension();case`scalar`:return this.parseScalarTypeExtension();case`type`:return this.parseObjectTypeExtension();case`interface`:return this.parseInterfaceTypeExtension();case`union`:return this.parseUnionTypeExtension();case`enum`:return this.parseEnumTypeExtension();case`input`:return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:C.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(w.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let a=this.parseDirectiveLocations();return this.node(e,{kind:C.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(S,t.value))return t;throw this.unexpected(e)}node(e,t){return this._options.noLocation!==!0&&(t.loc=new re(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw x(this._lexer.source,t.start,`Expected ${Je(e)}, found ${qe(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===w.NAME&&t.value===e)this.advanceLexer();else throw x(this._lexer.source,t.start,`Expected "${e}", found ${qe(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===w.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return x(this._lexer.source,t.start,`Unexpected ${qe(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==w.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw x(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}};function qe(e){let t=e.value;return Je(e.kind)+(t==null?``:` "${t}"`)}function Je(e){return ve(e)?`"${e}"`:e}function Ye(e,t){let[n,r]=t?[e,t]:[void 0,e],i=` Did you mean `;n&&(i+=n+` `);let a=r.map(e=>`"${e}"`);switch(a.length){case 0:return``;case 1:return i+a[0]+`?`;case 2:return i+a[0]+` or `+a[1]+`?`}let o=a.slice(0,5),s=o.pop();return i+o.join(`, `)+`, or `+s+`?`}function Xe(e){return e}function Ze(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}function Qe(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}function $e(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}function et(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(nt(i)&&nt(a)){let o=0;do++n,o=o*10+i-tt,i=e.charCodeAt(n);while(nt(i)&&o>0);let s=0;do++r,s=s*10+a-tt,a=t.charCodeAt(r);while(nt(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}const tt=48;function nt(e){return!isNaN(e)&&48<=e&&e<=57}function rt(e,t){let n=Object.create(null),r=new it(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?et(e,t):r})}var it=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=at(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=at(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}};function at(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function ot(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}function st(e){return`"${e.replace(ct,lt)}"`}const ct=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function lt(e){return ut[e.charCodeAt(0)]}const ut=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`),dt=Object.freeze({});function ft(e,t,n=ae){let r=new Map;for(let e of Object.values(C))r.set(e,mt(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],m=[];do{s++;let e=s===o.length,h=e&&c.length!==0;if(e){if(u=m.length===0?void 0:f[f.length-1],l=d,d=m.pop(),h)if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let g;if(!Array.isArray(l)){if(se(l)||p(!1,`Invalid AST Node: ${E(l)}.`),g=(e?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,f,m),g===dt)break;if(g===!1){if(!e){f.pop();continue}}else if(g!==void 0&&(c.push([u,g]),!e))if(se(g))l=g;else{f.pop();continue}}g===void 0&&h&&c.push([u,l]),e?f.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:n[l.kind]??[],s=-1,c=[],d&&m.push(d),d=l)}while(i!==void 0);return c.length===0?e:c[c.length-1][1]}function pt(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(C)){let i=!1,a=Array(e.length).fill(void 0),o=Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){let{enter:n,leave:s}=mt(e[t],r);i||=n!=null||s!=null,a[t]=n,o[t]=s}i&&(n[r]={enter(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let o=a[i]?.apply(e[i],n);if(o===!1)t[i]=r;else if(o===dt)t[i]=dt;else if(o!==void 0)return o}},leave(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let r=o[i]?.apply(e[i],n);if(r===dt)t[i]=dt;else if(r!==void 0&&r!==!1)return r}else t[i]===r&&(t[i]=null)}})}return n}function mt(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function ht(e){return ft(e,gt)}const gt={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>D(e.definitions,`
22
-
23
- `)},OperationDefinition:{leave(e){let t=O(`(`,D(e.variableDefinitions,`, `),`)`),n=D([e.operation,D([e.name,t]),D(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+`: `+t+O(` = `,n)+O(` `,D(r,` `))},SelectionSet:{leave:({selections:e})=>_t(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=O(``,e,`: `)+t,o=a+O(`(`,D(n,`, `),`)`);return o.length>80&&(o=a+O(`(
24
- `,vt(D(n,`
25
- `)),`
26
- )`)),D([o,D(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+O(` `,D(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>D([`...`,O(`on `,e),D(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${O(`(`,D(n,`, `),`)`)} on ${t} ${O(``,D(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?ge(e):st(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+D(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+D(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+O(`(`,D(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>O(``,e,`
27
- `)+D([`schema`,D(t,` `),_t(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>O(``,e,`
28
- `)+D([`scalar`,t,D(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>O(``,e,`
29
- `)+D([`type`,t,O(`implements `,D(n,` & `)),D(r,` `),_t(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>O(``,e,`
30
- `)+t+(yt(n)?O(`(
31
- `,vt(D(n,`
32
- `)),`
33
- )`):O(`(`,D(n,`, `),`)`))+`: `+r+O(` `,D(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>O(``,e,`
34
- `)+D([t+`: `+n,O(`= `,r),D(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>O(``,e,`
35
- `)+D([`interface`,t,O(`implements `,D(n,` & `)),D(r,` `),_t(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>O(``,e,`
36
- `)+D([`union`,t,D(n,` `),O(`= `,D(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>O(``,e,`
37
- `)+D([`enum`,t,D(n,` `),_t(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>O(``,e,`
38
- `)+D([t,D(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>O(``,e,`
39
- `)+D([`input`,t,D(n,` `),_t(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>O(``,e,`
40
- `)+`directive @`+t+(yt(n)?O(`(
41
- `,vt(D(n,`
42
- `)),`
43
- )`):O(`(`,D(n,`, `),`)`))+(r?` repeatable`:``)+` on `+D(i,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>D([`extend schema`,D(e,` `),_t(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>D([`extend scalar`,e,D(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend type`,e,O(`implements `,D(t,` & `)),D(n,` `),_t(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>D([`extend interface`,e,O(`implements `,D(t,` & `)),D(n,` `),_t(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>D([`extend union`,e,D(t,` `),O(`= `,D(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>D([`extend enum`,e,D(t,` `),_t(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>D([`extend input`,e,D(t,` `),_t(n)],` `)}};function D(e,t=``){return e?.filter(e=>e).join(t)??``}function _t(e){return O(`{
44
- `,vt(D(e,`
45
- `)),`
46
- }`)}function O(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function vt(e){return O(` `,e.replace(/\n/g,`
47
- `))}function yt(e){return e?.some(e=>e.includes(`
48
- `))??!1}function bt(e,t){switch(e.kind){case C.NULL:return null;case C.INT:return parseInt(e.value,10);case C.FLOAT:return parseFloat(e.value);case C.STRING:case C.ENUM:case C.BOOLEAN:return e.value;case C.LIST:return e.values.map(e=>bt(e,t));case C.OBJECT:return Qe(e.fields,e=>e.name.value,e=>bt(e.value,t));case C.VARIABLE:return t?.[e.name.value]}}function xt(e){if(e??p(!1,`Must provide name.`),typeof e==`string`||p(!1,`Expected name to be a string.`),e.length===0)throw new b(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!pe(e.charCodeAt(t)))throw new b(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!fe(e.charCodeAt(0)))throw new b(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function St(e){if(e===`true`||e===`false`||e===`null`)throw new b(`Enum values cannot be named: ${e}`);return xt(e)}function Ct(e){return wt(e)||k(e)||A(e)||Tt(e)||Et(e)||Dt(e)||Ot(e)||j(e)}function wt(e){return He(e,Ht)}function k(e){return He(e,Ut)}function A(e){return He(e,Zt)}function Tt(e){return He(e,Qt)}function Et(e){return He(e,en)}function Dt(e){return He(e,rn)}function Ot(e){return He(e,Pt)}function j(e){return He(e,M)}function kt(e){return wt(e)||Et(e)||Dt(e)||Ft(e)&&kt(e.ofType)}function At(e){return wt(e)||k(e)||A(e)||Tt(e)||Et(e)||Ft(e)&&At(e.ofType)}function jt(e){return wt(e)||Et(e)}function Mt(e){return k(e)||A(e)||Tt(e)}function Nt(e){return A(e)||Tt(e)}var Pt=class{constructor(e){Ct(e)||p(!1,`Expected ${E(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},M=class{constructor(e){It(e)||p(!1,`Expected ${E(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLNonNull`}toString(){return String(this.ofType)+`!`}toJSON(){return this.toString()}};function Ft(e){return Ot(e)||j(e)}function It(e){return Ct(e)&&!j(e)}function Lt(e){if(e)return j(e)?e.ofType:e}function Rt(e){return wt(e)||k(e)||A(e)||Tt(e)||Et(e)||Dt(e)}function zt(e){if(e){let t=e;for(;Ft(t);)t=t.ofType;return t}}function Bt(e){return typeof e==`function`?e():e}function Vt(e){return typeof e==`function`?e():e}var Ht=class{constructor(e){let t=e.parseValue??Xe;this.name=xt(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??Xe,this.parseValue=t,this.parseLiteral=e.parseLiteral??((e,n)=>t(bt(e,n))),this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.specifiedByURL==null||typeof e.specifiedByURL==`string`||p(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${E(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize==`function`||p(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||p(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return`GraphQLScalarType`}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Ut=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>Gt(e),this._interfaces=()=>Wt(e),e.isTypeOf==null||typeof e.isTypeOf==`function`||p(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${E(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Jt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Wt(e){let t=Bt(e.interfaces??[]);return Array.isArray(t)||p(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function Gt(e){let t=Vt(e.fields);return qt(t)||p(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),$e(t,(t,n)=>{qt(t)||p(!1,`${e.name}.${n} field config must be an object.`),t.resolve==null||typeof t.resolve==`function`||p(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${E(t.resolve)}.`);let r=t.args??{};return qt(r)||p(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:xt(n),description:t.description,type:t.type,args:Kt(r),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:ot(t.extensions),astNode:t.astNode}})}function Kt(e){return Object.entries(e).map(([e,t])=>({name:xt(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:ot(t.extensions),astNode:t.astNode}))}function qt(e){return m(e)&&!Array.isArray(e)}function Jt(e){return $e(e,e=>({description:e.description,type:e.type,args:Yt(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Yt(e){return Qe(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Xt(e){return j(e.type)&&e.defaultValue===void 0}var Zt=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=Gt.bind(void 0,e),this._interfaces=Wt.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||p(!1,`${this.name} must provide "resolveType" as a function, but got: ${E(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Jt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Qt=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=$t.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||p(!1,`${this.name} must provide "resolveType" as a function, but got: ${E(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function $t(e){let t=Bt(e.types);return Array.isArray(t)||p(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}var en=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=typeof e.values==`function`?e.values:nn(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=nn(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=Ze(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(t===void 0)throw new b(`Enum "${this.name}" cannot represent value: ${E(e)}`);return t.name}parseValue(e){if(typeof e!=`string`){let t=E(e);throw new b(`Enum "${this.name}" cannot represent non-string value: ${t}.`+tn(this,t))}let t=this.getValue(e);if(t==null)throw new b(`Value "${e}" does not exist in "${this.name}" enum.`+tn(this,e));return t.value}parseLiteral(e,t){if(e.kind!==C.ENUM){let t=ht(e);throw new b(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+tn(this,t),{nodes:e})}let n=this.getValue(e.value);if(n==null){let t=ht(e);throw new b(`Value "${t}" does not exist in "${this.name}" enum.`+tn(this,t),{nodes:e})}return n.value}toConfig(){let e=Qe(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function tn(e,t){return Ye(`the enum value`,rt(t,e.getValues().map(e=>e.name)))}function nn(e,t){return qt(t)||p(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(qt(n)||p(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${E(n)}.`),{name:St(t),description:n.description,value:n.value===void 0?t:n.value,deprecationReason:n.deprecationReason,extensions:ot(n.extensions),astNode:n.astNode}))}var rn=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=an.bind(void 0,e)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){let e=$e(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function an(e){let t=Vt(e.fields);return qt(t)||p(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),$e(t,(t,n)=>(!(`resolve`in t)||p(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:xt(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:ot(t.extensions),astNode:t.astNode}))}function on(e){return j(e.type)&&e.defaultValue===void 0}function sn(e,t){return e===t?!0:j(e)&&j(t)||Ot(e)&&Ot(t)?sn(e.ofType,t.ofType):!1}function cn(e,t,n){return t===n?!0:j(n)?j(t)?cn(e,t.ofType,n.ofType):!1:j(t)?cn(e,t.ofType,n):Ot(n)?Ot(t)?cn(e,t.ofType,n.ofType):!1:Ot(t)?!1:Nt(n)&&(A(t)||k(t))&&e.isSubType(n,t)}function ln(e,t,n){return t===n?!0:Nt(t)?Nt(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):Nt(n)?e.isSubType(n,t):!1}const un=new Ht({name:`Int`,description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=_n(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isInteger(n))throw new b(`Int cannot represent non-integer value: ${E(t)}`);if(n>2147483647||n<-2147483648)throw new b(`Int cannot represent non 32-bit signed integer value: `+E(t));return n},parseValue(e){if(typeof e!=`number`||!Number.isInteger(e))throw new b(`Int cannot represent non-integer value: ${E(e)}`);if(e>2147483647||e<-2147483648)throw new b(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==C.INT)throw new b(`Int cannot represent non-integer value: ${ht(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new b(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),dn=new Ht({name:`Float`,description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=_n(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isFinite(n))throw new b(`Float cannot represent non numeric value: ${E(t)}`);return n},parseValue(e){if(typeof e!=`number`||!Number.isFinite(e))throw new b(`Float cannot represent non numeric value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==C.FLOAT&&e.kind!==C.INT)throw new b(`Float cannot represent non numeric value: ${ht(e)}`,e);return parseFloat(e.value)}}),fn=new Ht({name:`String`,description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=_n(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`&&Number.isFinite(t))return t.toString();throw new b(`String cannot represent value: ${E(e)}`)},parseValue(e){if(typeof e!=`string`)throw new b(`String cannot represent a non string value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==C.STRING)throw new b(`String cannot represent a non string value: ${ht(e)}`,{nodes:e});return e.value}}),pn=new Ht({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=_n(e);if(typeof t==`boolean`)return t;if(Number.isFinite(t))return t!==0;throw new b(`Boolean cannot represent a non boolean value: ${E(t)}`)},parseValue(e){if(typeof e!=`boolean`)throw new b(`Boolean cannot represent a non boolean value: ${E(e)}`);return e},parseLiteral(e){if(e.kind!==C.BOOLEAN)throw new b(`Boolean cannot represent a non boolean value: ${ht(e)}`,{nodes:e});return e.value}}),mn=new Ht({name:`ID`,description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=_n(e);if(typeof t==`string`)return t;if(Number.isInteger(t))return String(t);throw new b(`ID cannot represent value: ${E(e)}`)},parseValue(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isInteger(e))return e.toString();throw new b(`ID cannot represent value: ${E(e)}`)},parseLiteral(e){if(e.kind!==C.STRING&&e.kind!==C.INT)throw new b(`ID cannot represent a non-string and non-integer value: `+ht(e),{nodes:e});return e.value}}),hn=Object.freeze([fn,un,dn,pn,mn]);function gn(e){return hn.some(({name:t})=>e.name===t)}function _n(e){if(m(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!m(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}function vn(e){return He(e,yn)}var yn=class{constructor(e){this.name=xt(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=ot(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||p(!1,`@${e.name} locations must be an Array.`);let t=e.args??{};m(t)&&!Array.isArray(t)||p(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=Kt(t)}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Yt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return`@`+this.name}toJSON(){return this.toString()}};const bn=new yn({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[S.FIELD,S.FRAGMENT_SPREAD,S.INLINE_FRAGMENT],args:{if:{type:new M(pn),description:`Included when true.`}}}),xn=new yn({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[S.FIELD,S.FRAGMENT_SPREAD,S.INLINE_FRAGMENT],args:{if:{type:new M(pn),description:`Skipped when true.`}}}),Sn=new yn({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[S.FIELD_DEFINITION,S.ARGUMENT_DEFINITION,S.INPUT_FIELD_DEFINITION,S.ENUM_VALUE],args:{reason:{type:fn,description:`Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).`,defaultValue:`No longer supported`}}}),Cn=new yn({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[S.SCALAR],args:{url:{type:new M(fn),description:`The URL that specifies the behavior of this scalar.`}}}),wn=new yn({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[S.INPUT_OBJECT],args:{}}),Tn=Object.freeze([bn,xn,Sn,Cn,wn]);function En(e){return Tn.some(({name:t})=>t===e.name)}function Dn(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}function On(e,t){if(j(t)){let n=On(e,t.ofType);return n?.kind===C.NULL?null:n}if(e===null)return{kind:C.NULL};if(e===void 0)return null;if(Ot(t)){let n=t.ofType;if(Dn(e)){let t=[];for(let r of e){let e=On(r,n);e!=null&&t.push(e)}return{kind:C.LIST,values:t}}return On(e,n)}if(Dt(t)){if(!m(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=On(e[r.name],r.type);t&&n.push({kind:C.OBJECT_FIELD,name:{kind:C.NAME,value:r.name},value:t})}return{kind:C.OBJECT,fields:n}}if(jt(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:C.BOOLEAN,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return kn.test(e)?{kind:C.INT,value:e}:{kind:C.FLOAT,value:e}}if(typeof n==`string`)return Et(t)?{kind:C.ENUM,value:n}:t===mn&&kn.test(n)?{kind:C.INT,value:n}:{kind:C.STRING,value:n};throw TypeError(`Cannot convert value to AST: ${E(n)}.`)}h(!1,`Unexpected input type: `+E(t))}const kn=/^-?(?:0|[1-9][0-9]*)$/,An=new Ut({name:`__Schema`,description:`A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.`,fields:()=>({description:{type:fn,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new M(new Pt(new M(Nn))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new M(Nn),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:Nn,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:Nn,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new M(new Pt(new M(jn))),resolve:e=>e.getDirectives()}})}),jn=new Ut({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
49
-
50
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new M(fn),resolve:e=>e.name},description:{type:fn,resolve:e=>e.description},isRepeatable:{type:new M(pn),resolve:e=>e.isRepeatable},locations:{type:new M(new Pt(new M(Mn))),resolve:e=>e.locations},args:{type:new M(new Pt(new M(Fn))),args:{includeDeprecated:{type:pn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}}})}),Mn=new en({name:`__DirectiveLocation`,description:`A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.`,values:{QUERY:{value:S.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:S.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:S.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:S.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:S.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:S.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:S.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:S.VARIABLE_DEFINITION,description:`Location adjacent to a variable definition.`},SCHEMA:{value:S.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:S.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:S.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:S.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:S.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:S.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:S.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:S.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:S.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:S.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:S.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`}}}),Nn=new Ut({name:`__Type`,description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new M(Rn),resolve(e){if(wt(e))return Ln.SCALAR;if(k(e))return Ln.OBJECT;if(A(e))return Ln.INTERFACE;if(Tt(e))return Ln.UNION;if(Et(e))return Ln.ENUM;if(Dt(e))return Ln.INPUT_OBJECT;if(Ot(e))return Ln.LIST;if(j(e))return Ln.NON_NULL;h(!1,`Unexpected type: "${E(e)}".`)}},name:{type:fn,resolve:e=>`name`in e?e.name:void 0},description:{type:fn,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:fn,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new Pt(new M(Pn)),args:{includeDeprecated:{type:pn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(k(e)||A(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new Pt(new M(Nn)),resolve(e){if(k(e)||A(e))return e.getInterfaces()}},possibleTypes:{type:new Pt(new M(Nn)),resolve(e,t,n,{schema:r}){if(Nt(e))return r.getPossibleTypes(e)}},enumValues:{type:new Pt(new M(In)),args:{includeDeprecated:{type:pn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Et(e)){let n=e.getValues();return t?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new Pt(new M(Fn)),args:{includeDeprecated:{type:pn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Dt(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:Nn,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:pn,resolve:e=>{if(Dt(e))return e.isOneOf}}})}),Pn=new Ut({name:`__Field`,description:`Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.`,fields:()=>({name:{type:new M(fn),resolve:e=>e.name},description:{type:fn,resolve:e=>e.description},args:{type:new M(new Pt(new M(Fn))),args:{includeDeprecated:{type:pn,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new M(Nn),resolve:e=>e.type},isDeprecated:{type:new M(pn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:fn,resolve:e=>e.deprecationReason}})}),Fn=new Ut({name:`__InputValue`,description:`Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.`,fields:()=>({name:{type:new M(fn),resolve:e=>e.name},description:{type:fn,resolve:e=>e.description},type:{type:new M(Nn),resolve:e=>e.type},defaultValue:{type:fn,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let{type:t,defaultValue:n}=e,r=On(n,t);return r?ht(r):null}},isDeprecated:{type:new M(pn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:fn,resolve:e=>e.deprecationReason}})}),In=new Ut({name:`__EnumValue`,description:`One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.`,fields:()=>({name:{type:new M(fn),resolve:e=>e.name},description:{type:fn,resolve:e=>e.description},isDeprecated:{type:new M(pn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:fn,resolve:e=>e.deprecationReason}})});var Ln;(function(e){e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.LIST=`LIST`,e.NON_NULL=`NON_NULL`})(Ln||={});const Rn=new en({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ln.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:Ln.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ln.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ln.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ln.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ln.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ln.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ln.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),zn={name:`__schema`,type:new M(An),description:`Access the current type schema of this server.`,args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Bn={name:`__type`,type:Nn,description:`Request the type information of a single type.`,args:[{name:`name`,description:void 0,type:new M(fn),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Vn={name:`__typename`,type:new M(fn),description:`The name of the current Object type at runtime.`,args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Hn=Object.freeze([An,jn,Mn,Nn,Pn,Fn,In,Rn]);function Un(e){return Hn.some(({name:t})=>e.name===t)}function Wn(e){return He(e,Kn)}function Gn(e){if(!Wn(e))throw Error(`Expected ${E(e)} to be a GraphQL schema.`);return e}var Kn=class{constructor(e){this.__validationErrors=e.assumeValid===!0?[]:void 0,m(e)||p(!1,`Must provide configuration object.`),!e.types||Array.isArray(e.types)||p(!1,`"types" must be Array if provided but got: ${E(e.types)}.`),!e.directives||Array.isArray(e.directives)||p(!1,`"directives" must be Array if provided but got: ${E(e.directives)}.`),this.description=e.description,this.extensions=ot(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Tn;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),qn(n,t);this._queryType!=null&&qn(this._queryType,t),this._mutationType!=null&&qn(this._mutationType,t),this._subscriptionType!=null&&qn(this._subscriptionType,t);for(let e of this._directives)if(vn(e))for(let n of e.args)qn(n.type,t);qn(An,t),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(t||p(!1,`One of the provided types for building the Schema is missing a name.`),this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,A(e)){for(let t of e.getInterfaces())if(A(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(k(e)){for(let t of e.getInterfaces())if(A(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}}get[Symbol.toStringTag](){return`GraphQLSchema`}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ce.QUERY:return this.getQueryType();case ce.MUTATION:return this.getMutationType();case ce.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return Tt(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(n===void 0){if(n=Object.create(null),Tt(e))for(let t of e.getTypes())n[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)n[e.name]=!0;for(let e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return n[t.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};function qn(e,t){let n=zt(e);if(!t.has(n)){if(t.add(n),Tt(n))for(let e of n.getTypes())qn(e,t);else if(k(n)||A(n)){for(let e of n.getInterfaces())qn(e,t);for(let e of Object.values(n.getFields())){qn(e.type,t);for(let n of e.args)qn(n.type,t)}}else if(Dt(n))for(let e of Object.values(n.getFields()))qn(e.type,t)}return t}function Jn(e){if(Gn(e),e.__validationErrors)return e.__validationErrors;let t=new Xn(e);Zn(t),$n(t),tr(t);let n=t.getErrors();return e.__validationErrors=n,n}function Yn(e){let t=Jn(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
51
-
52
- `))}var Xn=class{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new b(e,{nodes:n}))}getErrors(){return this._errors}};function Zn(e){let t=e.schema,n=t.getQueryType();n?k(n)||e.reportError(`Query root type must be Object type, it cannot be ${E(n)}.`,Qn(t,ce.QUERY)??n.astNode):e.reportError(`Query root type must be provided.`,t.astNode);let r=t.getMutationType();r&&!k(r)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${E(r)}.`,Qn(t,ce.MUTATION)??r.astNode);let i=t.getSubscriptionType();i&&!k(i)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${E(i)}.`,Qn(t,ce.SUBSCRIPTION)??i.astNode)}function Qn(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function $n(e){for(let t of e.schema.getDirectives()){if(!vn(t)){e.reportError(`Expected directive but got: ${E(t)}.`,t?.astNode);continue}er(e,t),t.locations.length===0&&e.reportError(`Directive @${t.name} must include 1 or more locations.`,t.astNode);for(let n of t.args)er(e,n),kt(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${E(n.type)}.`,n.astNode),Xt(n)&&n.deprecationReason!=null&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[pr(n.astNode),n.astNode?.type])}}function er(e,t){t.name.startsWith(`__`)&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function tr(e){let t=ur(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!Rt(r)){e.reportError(`Expected GraphQL named type but got: ${E(r)}.`,r.astNode);continue}Un(r)||er(e,r),k(r)||A(r)?(nr(e,r),rr(e,r)):Tt(r)?or(e,r):Et(r)?sr(e,r):Dt(r)&&(cr(e,r),t(r))}}function nr(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){er(e,r),!At(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${E(r.type)}.`,r.astNode?.type);for(let n of r.args){let i=n.name;er(e,n),!kt(n.type)&&e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${E(n.type)}.`,n.astNode?.type),Xt(n)&&n.deprecationReason!=null&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[pr(n.astNode),n.astNode?.type])}}}function rr(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!A(r)){e.reportError(`Type ${E(t)} must only implement Interface types, it cannot implement ${E(r)}.`,dr(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,dr(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,dr(t,r));continue}n[r.name]=!0,ar(e,t,r),ir(e,t,r)}}function ir(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let a=i.name,o=r[a];if(!o){e.reportError(`Interface field ${n.name}.${a} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}cn(e.schema,o.type,i.type)||e.reportError(`Interface field ${n.name}.${a} expects type ${E(i.type)} but ${t.name}.${a} is type ${E(o.type)}.`,[i.astNode?.type,o.astNode?.type]);for(let r of i.args){let i=r.name,s=o.args.find(e=>e.name===i);if(!s){e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expected but ${t.name}.${a} does not provide it.`,[r.astNode,o.astNode]);continue}sn(r.type,s.type)||e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expects type ${E(r.type)} but ${t.name}.${a}(${i}:) is type ${E(s.type)}.`,[r.astNode?.type,s.astNode?.type])}for(let r of o.args){let o=r.name;!i.args.find(e=>e.name===o)&&Xt(r)&&e.reportError(`Object field ${t.name}.${a} includes required argument ${o} that is missing from the Interface field ${n.name}.${a}.`,[r.astNode,i.astNode])}}}function ar(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...dr(n,i),...dr(t,n)])}function or(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,fr(t,i.name));continue}r[i.name]=!0,k(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${E(i)}.`,fr(t,String(i)))}}function sr(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let t of n)er(e,t)}function cr(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)er(e,r),!kt(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${E(r.type)}.`,r.astNode?.type),on(r)&&r.deprecationReason!=null&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[pr(r.astNode),r.astNode?.type]),t.isOneOf&&lr(t,r,e)}function lr(e,t,n){j(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function ur(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let t of o)if(j(t.type)&&Dt(t.type.ofType)){let a=t.type.ofType,o=r[a.name];if(n.push(t),o===void 0)i(a);else{let t=n.slice(o),r=t.map(e=>e.name).join(`.`);e.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[a.name]=void 0}}function dr(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function fr(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function pr(e){return e?.directives?.find(e=>e.name.value===Sn.name)}function mr(e,t){switch(t.kind){case C.LIST_TYPE:{let n=mr(e,t.type);return n&&new Pt(n)}case C.NON_NULL_TYPE:{let n=mr(e,t.type);return n&&new M(n)}case C.NAMED_TYPE:return e.getType(t.name.value)}}var hr=class{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??gr,t&&(kt(t)&&this._inputTypeStack.push(t),Mt(t)&&this._parentTypeStack.push(t),At(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return`TypeInfo`}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case C.SELECTION_SET:{let e=zt(this.getType());this._parentTypeStack.push(Mt(e)?e:void 0);break}case C.FIELD:{let n=this.getParentType(),r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(At(i)?i:void 0);break}case C.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case C.OPERATION_DEFINITION:{let n=t.getRootType(e.operation);this._typeStack.push(k(n)?n:void 0);break}case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:{let n=e.typeCondition,r=n?mr(t,n):zt(this.getType());this._typeStack.push(At(r)?r:void 0);break}case C.VARIABLE_DEFINITION:{let n=mr(t,e.type);this._inputTypeStack.push(kt(n)?n:void 0);break}case C.ARGUMENT:{let t,n,r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(kt(n)?n:void 0);break}case C.LIST:{let e=Lt(this.getInputType()),t=Ot(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(kt(t)?t:void 0);break}case C.OBJECT_FIELD:{let t=zt(this.getInputType()),n,r;Dt(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(kt(n)?n:void 0);break}case C.ENUM:{let t=zt(this.getInputType()),n;Et(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}default:}}leave(e){switch(e.kind){case C.SELECTION_SET:this._parentTypeStack.pop();break;case C.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case C.DIRECTIVE:this._directive=null;break;case C.OPERATION_DEFINITION:case C.INLINE_FRAGMENT:case C.FRAGMENT_DEFINITION:this._typeStack.pop();break;case C.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case C.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.LIST:case C.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case C.ENUM:this._enumValue=null;break;default:}}};function gr(e,t,n){let r=n.name.value;if(r===zn.name&&e.getQueryType()===t)return zn;if(r===Bn.name&&e.getQueryType()===t)return Bn;if(r===Vn.name&&Mt(t))return Vn;if(k(t)||A(t))return t.getFields()[r]}function _r(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=mt(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),se(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=mt(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}function vr(e){return yr(e)||br(e)||Sr(e)}function yr(e){return e.kind===C.OPERATION_DEFINITION||e.kind===C.FRAGMENT_DEFINITION}function br(e){return e.kind===C.SCHEMA_DEFINITION||xr(e)||e.kind===C.DIRECTIVE_DEFINITION}function xr(e){return e.kind===C.SCALAR_TYPE_DEFINITION||e.kind===C.OBJECT_TYPE_DEFINITION||e.kind===C.INTERFACE_TYPE_DEFINITION||e.kind===C.UNION_TYPE_DEFINITION||e.kind===C.ENUM_TYPE_DEFINITION||e.kind===C.INPUT_OBJECT_TYPE_DEFINITION}function Sr(e){return e.kind===C.SCHEMA_EXTENSION||Cr(e)}function Cr(e){return e.kind===C.SCALAR_TYPE_EXTENSION||e.kind===C.OBJECT_TYPE_EXTENSION||e.kind===C.INTERFACE_TYPE_EXTENSION||e.kind===C.UNION_TYPE_EXTENSION||e.kind===C.ENUM_TYPE_EXTENSION||e.kind===C.INPUT_OBJECT_TYPE_EXTENSION}function wr(e){return{Document(t){for(let n of t.definitions)if(!yr(n)){let t=n.kind===C.SCHEMA_DEFINITION||n.kind===C.SCHEMA_EXTENSION?`schema`:`"`+n.name.value+`"`;e.reportError(new b(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}function Tr(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),i=t.name.value,a=Ye(`to use an inline fragment on`,Er(r,n,i));a===``&&(a=Ye(Dr(n,i))),e.reportError(new b(`Cannot query field "${i}" on type "${n.name}".`+a,{nodes:t}))}}}}function Er(e,t,n){if(!Nt(t))return[];let r=new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(let e of a.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{let r=i[n.name]-i[t.name];return r===0?A(t)&&e.isSubType(t,n)?-1:A(n)&&e.isSubType(n,t)?1:et(t.name,n.name):r}).map(e=>e.name)}function Dr(e,t){return k(e)||A(e)?rt(t,Object.keys(e.getFields())):[]}function Or(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let t=mr(e.getSchema(),n);if(t&&!Mt(t)){let t=ht(n);e.reportError(new b(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){let n=mr(e.getSchema(),t.typeCondition);if(n&&!Mt(n)){let n=ht(t.typeCondition);e.reportError(new b(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}function kr(e){return{...Ar(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let n=t.name.value,a=rt(n,r.args.map(e=>e.name));e.reportError(new b(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+Ye(a),{nodes:t}))}}}}function Ar(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Tn;for(let e of r)t[e.name]=e.args.map(e=>e.name);let i=e.getDocument().definitions;for(let e of i)if(e.kind===C.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){let r=n.name.value,i=t[r];if(n.arguments&&i)for(let t of n.arguments){let n=t.name.value;if(!i.includes(n)){let a=rt(n,i);e.reportError(new b(`Unknown argument "${n}" on directive "@${r}".`+Ye(a),{nodes:t}))}}return!1}}}function jr(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Tn;for(let e of r)t[e.name]=e.locations;let i=e.getDocument().definitions;for(let e of i)e.kind===C.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,a,o){let s=n.name.value,c=t[s];if(!c){e.reportError(new b(`Unknown directive "@${s}".`,{nodes:n}));return}let l=Mr(o);l&&!c.includes(l)&&e.reportError(new b(`Directive "@${s}" may not be used on ${l}.`,{nodes:n}))}}}function Mr(e){let t=e[e.length-1];switch(`kind`in t||h(!1),t.kind){case C.OPERATION_DEFINITION:return Nr(t.operation);case C.FIELD:return S.FIELD;case C.FRAGMENT_SPREAD:return S.FRAGMENT_SPREAD;case C.INLINE_FRAGMENT:return S.INLINE_FRAGMENT;case C.FRAGMENT_DEFINITION:return S.FRAGMENT_DEFINITION;case C.VARIABLE_DEFINITION:return S.VARIABLE_DEFINITION;case C.SCHEMA_DEFINITION:case C.SCHEMA_EXTENSION:return S.SCHEMA;case C.SCALAR_TYPE_DEFINITION:case C.SCALAR_TYPE_EXTENSION:return S.SCALAR;case C.OBJECT_TYPE_DEFINITION:case C.OBJECT_TYPE_EXTENSION:return S.OBJECT;case C.FIELD_DEFINITION:return S.FIELD_DEFINITION;case C.INTERFACE_TYPE_DEFINITION:case C.INTERFACE_TYPE_EXTENSION:return S.INTERFACE;case C.UNION_TYPE_DEFINITION:case C.UNION_TYPE_EXTENSION:return S.UNION;case C.ENUM_TYPE_DEFINITION:case C.ENUM_TYPE_EXTENSION:return S.ENUM;case C.ENUM_VALUE_DEFINITION:return S.ENUM_VALUE;case C.INPUT_OBJECT_TYPE_DEFINITION:case C.INPUT_OBJECT_TYPE_EXTENSION:return S.INPUT_OBJECT;case C.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return`kind`in t||h(!1),t.kind===C.INPUT_OBJECT_TYPE_DEFINITION?S.INPUT_FIELD_DEFINITION:S.ARGUMENT_DEFINITION}default:h(!1,`Unexpected kind: `+E(t.kind))}}function Nr(e){switch(e){case ce.QUERY:return S.QUERY;case ce.MUTATION:return S.MUTATION;case ce.SUBSCRIPTION:return S.SUBSCRIPTION}}function Pr(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new b(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function Fr(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)xr(t)&&(r[t.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,a,o,s,c){let l=t.name.value;if(!n[l]&&!r[l]){let n=c[2]??o,r=n!=null&&Lr(n);if(r&&Ir.includes(l))return;let a=rt(l,r?Ir.concat(i):i);e.reportError(new b(`Unknown type "${l}".`+Ye(a),{nodes:t}))}}}}const Ir=[...hn,...Hn].map(e=>e.name);function Lr(e){return`kind`in e&&(br(e)||Sr(e))}function Rr(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===C.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new b(`This anonymous operation must be the only defined operation.`,{nodes:n}))}}}function zr(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(t){if(n){e.reportError(new b(`Cannot define a new schema within a schema extension.`,{nodes:t}));return}r>0&&e.reportError(new b(`Must provide only one schema definition.`,{nodes:t})),++r}}}function Br(e){function t(n,r=Object.create(null),i=0){if(n.kind===C.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===C.FIELD&&(n.name.value===`fields`||n.name.value===`interfaces`||n.name.value===`possibleTypes`||n.name.value===`inputFields`)&&(i++,i>=3))return!0;if(`selectionSet`in n&&n.selectionSet){for(let e of n.selectionSet.selections)if(t(e,r,i))return!0}return!1}return{Field(n){if((n.name.value===`__schema`||n.name.value===`__type`)&&t(n))return e.reportError(new b(`Maximum introspection depth exceeded`,{nodes:[n]})),!1}}}function Vr(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return i(e),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let s=e.getFragmentSpreads(a.selectionSet);if(s.length!==0){r[o]=n.length;for(let t of s){let a=t.name.value,o=r[a];if(n.push(t),o===void 0){let t=e.getFragment(a);t&&i(t)}else{let t=n.slice(o),r=t.slice(0,-1).map(e=>`"`+e.name.value+`"`).join(`, `);e.reportError(new b(`Cannot spread fragment "${a}" within itself`+(r===``?`.`:` via ${r}.`),{nodes:t}))}n.pop()}r[o]=void 0}}}function Hr(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let r=i.name.value;t[r]!==!0&&e.reportError(new b(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function Ur(e){let t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){let r=Object.create(null);for(let n of t)for(let t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(let t of n){let n=t.name.value;r[n]!==!0&&e.reportError(new b(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}function Wr(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:e}of i)r[e.name.value]=!0;for(let i of t){let t=i.variable.name.value;r[t]!==!0&&e.reportError(new b(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function Gr(e){switch(e.kind){case C.OBJECT:return{...e,fields:Kr(e.fields)};case C.LIST:return{...e,values:e.values.map(Gr)};case C.INT:case C.FLOAT:case C.STRING:case C.BOOLEAN:case C.NULL:case C.ENUM:case C.VARIABLE:return e}}function Kr(e){return e.map(e=>({...e,value:Gr(e.value)})).sort((e,t)=>et(e.name.value,t.name.value))}function qr(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+qr(t)).join(` and `):e}function Jr(e){let t=new li,n=new ui,r=new Map;return{SelectionSet(i){let a=Yr(e,r,t,n,e.getParentType(),i);for(let[[t,n],r,i]of a){let a=qr(n);e.reportError(new b(`Fields "${t}" conflict because ${a}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function Yr(e,t,n,r,i,a){let o=[],[s,c]=ai(e,t,i,a);if($r(e,o,t,n,r,s),c.length!==0)for(let i=0;i<c.length;i++){Xr(e,o,t,n,r,!1,s,c[i]);for(let a=i+1;a<c.length;a++)Zr(e,o,t,n,r,!1,c[i],c[a])}return o}function Xr(e,t,n,r,i,a,o,s){if(r.has(o,s,a))return;r.add(o,s,a);let c=e.getFragment(s);if(!c)return;let[l,u]=oi(e,n,c);if(o!==l){ei(e,t,n,r,i,a,o,l);for(let s of u)Xr(e,t,n,r,i,a,o,s)}}function Zr(e,t,n,r,i,a,o,s){if(o===s||i.has(o,s,a))return;i.add(o,s,a);let c=e.getFragment(o),l=e.getFragment(s);if(!c||!l)return;let[u,d]=oi(e,n,c),[f,p]=oi(e,n,l);ei(e,t,n,r,i,a,u,f);for(let s of p)Zr(e,t,n,r,i,a,o,s);for(let o of d)Zr(e,t,n,r,i,a,o,s)}function Qr(e,t,n,r,i,a,o,s,c){let l=[],[u,d]=ai(e,t,a,o),[f,p]=ai(e,t,s,c);ei(e,l,t,n,r,i,u,f);for(let a of p)Xr(e,l,t,n,r,i,u,a);for(let a of d)Xr(e,l,t,n,r,i,f,a);for(let a of d)for(let o of p)Zr(e,l,t,n,r,i,a,o);return l}function $r(e,t,n,r,i,a){for(let[o,s]of Object.entries(a))if(s.length>1)for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=ti(e,n,r,i,!1,o,s[a],s[c]);l&&t.push(l)}}function ei(e,t,n,r,i,a,o,s){for(let[c,l]of Object.entries(o)){let o=s[c];if(o)for(let s of l)for(let l of o){let o=ti(e,n,r,i,a,c,s,l);o&&t.push(o)}}}function ti(e,t,n,r,i,a,o,s){let[c,l,u]=o,[d,f,p]=s,m=i||c!==d&&k(c)&&k(d);if(!m){let e=l.name.value,t=f.name.value;if(e!==t)return[[a,`"${e}" and "${t}" are different fields`],[l],[f]];if(!ni(l,f))return[[a,`they have differing arguments`],[l],[f]]}let h=u?.type,g=p?.type;if(h&&g&&ii(h,g))return[[a,`they return conflicting types "${E(h)}" and "${E(g)}"`],[l],[f]];let _=l.selectionSet,ee=f.selectionSet;if(_&&ee)return ci(Qr(e,t,n,r,m,zt(h),_,zt(g),ee),a,l,f)}function ni(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{let t=e.value,n=i.get(e.name.value);return n===void 0?!1:ri(t)===ri(n)})}function ri(e){return ht(Gr(e))}function ii(e,t){return Ot(e)?Ot(t)?ii(e.ofType,t.ofType):!0:Ot(t)?!0:j(e)?j(t)?ii(e.ofType,t.ofType):!0:j(t)?!0:jt(e)||jt(t)?e!==t:!1}function ai(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);si(e,n,r,a,o);let s=[a,Object.keys(o)];return t.set(r,s),s}function oi(e,t,n){return t.get(n.selectionSet)||ai(e,t,mr(e.getSchema(),n.typeCondition),n.selectionSet)}function si(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case C.FIELD:{let e=a.name.value,n;(k(t)||A(t))&&(n=t.getFields()[e]);let i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case C.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case C.INLINE_FRAGMENT:{let n=a.typeCondition;si(e,n?mr(e.getSchema(),n):t,a.selectionSet,r,i);break}}}function ci(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}var li=class{constructor(){this._data=new Map}has(e,t,n){let r=this._data.get(e)?.get(t);return r===void 0?!1:n?!0:n===r}add(e,t,n){let r=this._data.get(e);r===void 0?this._data.set(e,new Map([[t,n]])):r.set(t,n)}},ui=class{constructor(){this._orderedPairSet=new li}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}};function di(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(Mt(n)&&Mt(r)&&!ln(e.getSchema(),n,r)){let i=E(r),a=E(n);e.reportError(new b(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=fi(e,n),i=e.getParentType();if(r&&i&&!ln(e.getSchema(),r,i)){let a=E(i),o=E(r);e.reportError(new b(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function fi(e,t){let n=e.getFragment(t);if(n){let t=mr(e.getSchema(),n.typeCondition);if(Mt(t))return t}}function pi(e){let t=e.getSchema(),n=Object.create(null);for(let t of e.getDocument().definitions)xr(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){let i=r.name.value,a=n[i],o=t?.getType(i),s;if(a?s=mi[a.kind]:o&&(s=hi(o)),s){if(s!==r.kind){let t=gi(r.kind);e.reportError(new b(`Cannot extend non-${t} type "${i}".`,{nodes:a?[a,r]:r}))}}else{let a=rt(i,Object.keys({...n,...t?.getTypeMap()}));e.reportError(new b(`Cannot extend type "${i}" because it is not defined.`+Ye(a),{nodes:r.name}))}}}const mi={[C.SCALAR_TYPE_DEFINITION]:C.SCALAR_TYPE_EXTENSION,[C.OBJECT_TYPE_DEFINITION]:C.OBJECT_TYPE_EXTENSION,[C.INTERFACE_TYPE_DEFINITION]:C.INTERFACE_TYPE_EXTENSION,[C.UNION_TYPE_DEFINITION]:C.UNION_TYPE_EXTENSION,[C.ENUM_TYPE_DEFINITION]:C.ENUM_TYPE_EXTENSION,[C.INPUT_OBJECT_TYPE_DEFINITION]:C.INPUT_OBJECT_TYPE_EXTENSION};function hi(e){if(wt(e))return C.SCALAR_TYPE_EXTENSION;if(k(e))return C.OBJECT_TYPE_EXTENSION;if(A(e))return C.INTERFACE_TYPE_EXTENSION;if(Tt(e))return C.UNION_TYPE_EXTENSION;if(Et(e))return C.ENUM_TYPE_EXTENSION;if(Dt(e))return C.INPUT_OBJECT_TYPE_EXTENSION;h(!1,`Unexpected type: `+E(e))}function gi(e){switch(e){case C.SCALAR_TYPE_EXTENSION:return`scalar`;case C.OBJECT_TYPE_EXTENSION:return`object`;case C.INTERFACE_TYPE_EXTENSION:return`interface`;case C.UNION_TYPE_EXTENSION:return`union`;case C.ENUM_TYPE_EXTENSION:return`enum`;case C.INPUT_OBJECT_TYPE_EXTENSION:return`input object`;default:h(!1,`Unexpected kind: `+E(e))}}function _i(e){return{...vi(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map(e=>e.name.value));for(let i of n.args)if(!r.has(i.name)&&Xt(i)){let r=E(i.type);e.reportError(new b(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}function vi(e){let t=Object.create(null),n=e.getSchema()?.getDirectives()??Tn;for(let e of n)t[e.name]=Ze(e.args.filter(Xt),e=>e.name);let r=e.getDocument().definitions;for(let e of r)if(e.kind===C.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=Ze(n.filter(yi),e=>e.name.value)}return{Directive:{leave(n){let r=n.name.value,i=t[r];if(i){let t=n.arguments??[],a=new Set(t.map(e=>e.name.value));for(let[t,o]of Object.entries(i))if(!a.has(t)){let i=Ct(o.type)?E(o.type):ht(o.type);e.reportError(new b(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function yi(e){return e.type.kind===C.NON_NULL_TYPE&&e.defaultValue==null}function bi(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(jt(zt(n))){if(r){let i=t.name.value,a=E(n);e.reportError(new b(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let r=t.name.value,i=E(n);e.reportError(new b(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let r=t.name.value,i=E(n);e.reportError(new b(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}}}}function xi(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}function Si(e,t,n){return{prev:e,key:t,typename:n}}function Ci(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function wi(e,t,n=Ti){return Ei(e,t,n,void 0)}function Ti(e,t,n){let r=`Invalid value `+E(t);throw e.length>0&&(r+=` at "value${xi(e)}"`),n.message=r+`: `+n.message,n}function Ei(e,t,n,r){if(j(t)){if(e!=null)return Ei(e,t.ofType,n,r);n(Ci(r),e,new b(`Expected non-nullable type "${E(t)}" not to be null.`));return}if(e==null)return null;if(Ot(t)){let i=t.ofType;return Dn(e)?Array.from(e,(e,t)=>{let a=Si(r,t,void 0);return Ei(e,i,n,a)}):[Ei(e,i,n,r)]}if(Dt(t)){if(!m(e)||Array.isArray(e)){n(Ci(r),e,new b(`Expected type "${t.name}" to be an object.`));return}let i={},a=t.getFields();for(let o of Object.values(a)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(j(o.type)){let t=E(o.type);n(Ci(r),e,new b(`Field "${o.name}" of required type "${t}" was not provided.`))}continue}i[o.name]=Ei(a,o.type,n,Si(r,o.name,t.name))}for(let i of Object.keys(e))if(!a[i]){let a=rt(i,Object.keys(t.getFields()));n(Ci(r),e,new b(`Field "${i}" is not defined by type "${t.name}".`+Ye(a)))}if(t.isOneOf){let a=Object.keys(i);a.length!==1&&n(Ci(r),e,new b(`Exactly one key must be specified for OneOf type "${t.name}".`));let o=a[0],s=i[o];s===null&&n(Ci(r).concat(o),s,new b(`Field "${o}" must be non-null.`))}return i}if(jt(t)){let i;try{i=t.parseValue(e)}catch(i){i instanceof b?n(Ci(r),e,i):n(Ci(r),e,new b(`Expected type "${t.name}". `+i.message,{originalError:i}));return}return i===void 0&&n(Ci(r),e,new b(`Expected type "${t.name}".`)),i}h(!1,`Unexpected input type: `+E(t))}function Di(e,t,n){if(e){if(e.kind===C.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&j(t)?void 0:i}if(j(t))return e.kind===C.NULL?void 0:Di(e,t.ofType,n);if(e.kind===C.NULL)return null;if(Ot(t)){let r=t.ofType;if(e.kind===C.LIST){let t=[];for(let i of e.values)if(Oi(i,n)){if(j(r))return;t.push(null)}else{let e=Di(i,r,n);if(e===void 0)return;t.push(e)}return t}let i=Di(e,r,n);return i===void 0?void 0:[i]}if(Dt(t)){if(e.kind!==C.OBJECT)return;let r=Object.create(null),i=Ze(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||Oi(t.value,n)){if(e.defaultValue!==void 0)r[e.name]=e.defaultValue;else if(j(e.type))return;continue}let a=Di(t.value,e.type,n);if(a===void 0)return;r[e.name]=a}if(t.isOneOf){let e=Object.keys(r);if(e.length!==1||r[e[0]]===null)return}return r}if(jt(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}h(!1,`Unexpected input type: `+E(t))}}function Oi(e,t){return e.kind===C.VARIABLE&&(t==null||t[e.name.value]===void 0)}function ki(e,t,n){let r={},i=Ze(t.arguments??[],e=>e.name.value);for(let a of e.args){let e=a.name,o=a.type,s=i[e];if(!s){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(j(o))throw new b(`Argument "${e}" of required type "${E(o)}" was not provided.`,{nodes:t});continue}let c=s.value,l=c.kind===C.NULL;if(c.kind===C.VARIABLE){let t=c.name.value;if(n==null||!ji(n,t)){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(j(o))throw new b(`Argument "${e}" of required type "${E(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}l=n[t]==null}if(l&&j(o))throw new b(`Argument "${e}" of non-null type "${E(o)}" must not be null.`,{nodes:c});let u=Di(c,o,n);if(u===void 0)throw new b(`Argument "${e}" has invalid value ${ht(c)}.`,{nodes:c});r[e]=u}return r}function Ai(e,t,n){let r=t.directives?.find(t=>t.name.value===e.name);if(r)return ki(e,r,n)}function ji(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Mi(e,t,n,r,i){let a=new Map;return Ni(e,t,n,r,i,a,new Set),a}function Ni(e,t,n,r,i,a,o){for(let s of i.selections)switch(s.kind){case C.FIELD:{if(!Pi(n,s))continue;let e=Ii(s),t=a.get(e);t===void 0?a.set(e,[s]):t.push(s);break}case C.INLINE_FRAGMENT:if(!Pi(n,s)||!Fi(e,s,r))continue;Ni(e,t,n,r,s.selectionSet,a,o);break;case C.FRAGMENT_SPREAD:{let i=s.name.value;if(o.has(i)||!Pi(n,s))continue;o.add(i);let c=t[i];if(!c||!Fi(e,c,r))continue;Ni(e,t,n,r,c.selectionSet,a,o);break}}}function Pi(e,t){return Ai(xn,t,e)?.if===!0?!1:Ai(bn,t,e)?.if!==!1}function Fi(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=mr(e,r);return i===n?!0:Nt(i)?e.isSubType(i,n):!1}function Ii(e){return e.alias?e.alias.value:e.name.value}function Li(e){return{OperationDefinition(t){if(t.operation===`subscription`){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===C.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let c=Mi(n,s,a,r,t.selectionSet);if(c.size>1){let t=[...c.values()].slice(1).flat();e.reportError(new b(i==null?`Anonymous Subscription must select only one top level field.`:`Subscription "${i}" must select only one top level field.`,{nodes:t}))}for(let t of c.values())t[0].name.value.startsWith(`__`)&&e.reportError(new b(i==null?`Anonymous Subscription must not select an introspection top level field.`:`Subscription "${i}" must not select an introspection top level field.`,{nodes:t}))}}}}}function Ri(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}function zi(e){return{DirectiveDefinition(e){let t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){let t=e.name.value,r=e.fields??[];for(let e of r){let r=e.name.value,i=e.arguments??[];n(`${t}.${r}`,i)}return!1}function n(t,n){let r=Ri(n,e=>e.name.value);for(let[n,i]of r)i.length>1&&e.reportError(new b(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function Bi(e){return{Field:t,Directive:t};function t(t){let n=Ri(t.arguments??[],e=>e.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new b(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}function Vi(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new b(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new b(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}function Hi(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Tn;for(let e of r)t[e.name]=!e.isRepeatable;let i=e.getDocument().definitions;for(let e of i)e.kind===C.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);let a=Object.create(null),o=Object.create(null);return{enter(n){if(!(`directives`in n)||!n.directives)return;let r;if(n.kind===C.SCHEMA_DEFINITION||n.kind===C.SCHEMA_EXTENSION)r=a;else if(xr(n)||Cr(n)){let e=n.name.value;r=o[e],r===void 0&&(o[e]=r=Object.create(null))}else r=Object.create(null);for(let i of n.directives){let n=i.name.value;t[n]&&(r[n]?e.reportError(new b(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function Ui(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.values??[],o=r[i];for(let t of a){let r=t.name.value,a=n[i];Et(a)&&a.getValue(r)?e.reportError(new b(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new b(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function Wi(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.fields??[],o=r[i];for(let t of a){let r=t.name.value;Gi(n[i],r)?e.reportError(new b(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new b(`Field "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function Gi(e,t){return k(e)||A(e)||Dt(e)?e.getFields()[t]!=null:!1}function Ki(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new b(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}function qi(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let e=t.pop();e||h(!1),n=e}},ObjectField(t){let r=t.name.value;n[r]?e.reportError(new b(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}function Ji(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new b(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function Yi(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){let i=t.operationTypes??[];for(let t of i){let i=t.operation,a=n[i];r[i]?e.reportError(new b(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new b(`There can be only one ${i} type in schema.`,{nodes:[a,t]})):n[i]=t}return!1}}function Xi(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;if(n!=null&&n.getType(i)){e.reportError(new b(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}return t[i]?e.reportError(new b(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}function Zi(e){return{OperationDefinition(t){let n=Ri(t.variableDefinitions??[],e=>e.variable.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new b(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}}function Qi(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!Ot(Lt(e.getParentInputType())))return $i(e,t),!1},ObjectValue(n){let r=zt(e.getInputType());if(!Dt(r))return $i(e,n),!1;let i=Ze(n.fields,e=>e.name.value);for(let t of Object.values(r.getFields()))if(!i[t.name]&&on(t)){let i=E(t.type);e.reportError(new b(`Field "${r.name}.${t.name}" of required type "${i}" was not provided.`,{nodes:n}))}r.isOneOf&&ea(e,n,r,i,t)},ObjectField(t){let n=zt(e.getParentInputType());if(!e.getInputType()&&Dt(n)){let r=rt(t.name.value,Object.keys(n.getFields()));e.reportError(new b(`Field "${t.name.value}" is not defined by type "${n.name}".`+Ye(r),{nodes:t}))}},NullValue(t){let n=e.getInputType();j(n)&&e.reportError(new b(`Expected value of type "${E(n)}", found ${ht(t)}.`,{nodes:t}))},EnumValue:t=>$i(e,t),IntValue:t=>$i(e,t),FloatValue:t=>$i(e,t),StringValue:t=>$i(e,t),BooleanValue:t=>$i(e,t)}}function $i(e,t){let n=e.getInputType();if(!n)return;let r=zt(n);if(!jt(r)){let r=E(n);e.reportError(new b(`Expected value of type "${r}", found ${ht(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let r=E(n);e.reportError(new b(`Expected value of type "${r}", found ${ht(t)}.`,{nodes:t}))}}catch(r){let i=E(n);r instanceof b?e.reportError(r):e.reportError(new b(`Expected value of type "${i}", found ${ht(t)}; `+r.message,{nodes:t,originalError:r}))}}function ea(e,t,n,r,i){let a=Object.keys(r);if(a.length!==1){e.reportError(new b(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let o=r[a[0]]?.value,s=!o||o.kind===C.NULL,c=o?.kind===C.VARIABLE;if(s){e.reportError(new b(`Field "${n.name}.${a[0]}" must be non-null.`,{nodes:[t]}));return}if(c){let r=o.name.value;i[r].type.kind!==C.NON_NULL_TYPE&&e.reportError(new b(`Variable "${r}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}function ta(e){return{VariableDefinition(t){let n=mr(e.getSchema(),t.type);if(n!==void 0&&!kt(n)){let n=t.variable.name.value,r=ht(t.type);e.reportError(new b(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function na(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:n,type:i,defaultValue:a,parentType:o}of r){let r=n.name.value,s=t[r];if(s&&i){let t=e.getSchema(),c=mr(t,s.type);if(c&&!ra(t,c,s.defaultValue,i,a)){let t=E(c),a=E(i);e.reportError(new b(`Variable "$${r}" of type "${t}" used in position expecting type "${a}".`,{nodes:[s,n]}))}Dt(o)&&o.isOneOf&&It(c)&&e.reportError(new b(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function ra(e,t,n,r,i){if(j(r)&&!j(t)){if(!(n!=null&&n.kind!==C.NULL)&&i===void 0)return!1;let a=r.ofType;return cn(e,t,a)}return cn(e,t,r)}const ia=Object.freeze([Br]),aa=Object.freeze([wr,Ji,Rr,Li,Fr,Or,ta,bi,Tr,Ki,Pr,Ur,di,Vr,Zi,Hr,Wr,jr,Hi,kr,Bi,Qi,_i,na,Jr,qi,...ia]),oa=Object.freeze([zr,Yi,Xi,Ui,Wi,zi,Vi,Fr,jr,Hi,pi,Ar,Bi,qi,vi]);var sa=class{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return`ASTValidationContext`}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let e of this.getDocument().definitions)e.kind===C.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;for(;r=n.pop();)for(let e of r.selections)e.kind===C.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=Object.create(null),r=[e.selectionSet],i;for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(n[i]!==!0){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}},ca=class extends sa{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return`SDLValidationContext`}getSchema(){return this._schema}},la=class extends sa{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return`ValidationContext`}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new hr(this._schema);ft(e,_r(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};function ua(e,t,n=aa,r,i=new hr(e)){let a=r?.maxErrors??100;t||p(!1,`Must provide document.`),Yn(e);let o=Object.freeze({}),s=[],c=new la(e,t,i,e=>{if(s.length>=a)throw s.push(new b(`Too many validation errors, error limit reached. Validation aborted.`)),o;s.push(e)}),l=pt(n.map(e=>e(c)));try{ft(t,_r(i,l))}catch(e){if(e!==o)throw e}return s}function da(e,t,n=oa){let r=[],i=new ca(e,t,e=>{r.push(e)});return ft(e,pt(n.map(e=>e(i)))),r}function fa(e){let t=da(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(`
53
-
54
- `))}function pa(e){return e instanceof Error?e:new ma(e)}var ma=class extends Error{constructor(e){super(`Unexpected error value: `+E(e)),this.name=`NonErrorThrown`,this.thrownValue=e}};function ha(e,t,n){let r=pa(e);return ga(r)?r:new b(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function ga(e){return Array.isArray(e.path)}const _a=function(e,t,n,r){if(m(e)||typeof e==`function`){let i=e[r.fieldName];return typeof i==`function`?e[r.fieldName](t,n,r):i}};function va(e,t){let n=null;for(let r of e.definitions)if(r.kind===C.OPERATION_DEFINITION){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}function ya(e,t,n){let r=[],i=Object.create(null),a=[],o,s=[];for(let e of t.definitions)if(e.kind===C.SCHEMA_DEFINITION)o=e;else if(e.kind===C.SCHEMA_EXTENSION)s.push(e);else if(xr(e))r.push(e);else if(Cr(e)){let t=e.name.value,n=i[t];i[t]=n?n.concat([e]):[e]}else e.kind===C.DIRECTIVE_DEFINITION&&a.push(e);if(Object.keys(i).length===0&&r.length===0&&a.length===0&&s.length===0&&o==null)return e;let c=Object.create(null);for(let t of e.types)c[t.name]=p(t);for(let e of r){let t=e.name.value;c[t]=ba[t]??ue(e)}let l={query:e.query&&d(e.query),mutation:e.mutation&&d(e.mutation),subscription:e.subscription&&d(e.subscription),...o&&ne([o]),...ne(s)};return{description:o?.description?.value,...l,types:Object.values(c),directives:[...e.directives.map(f),...a.map(ie)],extensions:Object.create(null),astNode:o??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(s),assumeValid:n?.assumeValid??!1};function u(e){return Ot(e)?new Pt(u(e.ofType)):j(e)?new M(u(e.ofType)):d(e)}function d(e){return c[e.name]}function f(e){let t=e.toConfig();return new yn({...t,args:$e(t.args,b)})}function p(e){if(Un(e)||gn(e))return e;if(wt(e))return _(e);if(k(e))return ee(e);if(A(e))return v(e);if(Tt(e))return y(e);if(Et(e))return g(e);if(Dt(e))return m(e);h(!1,`Unexpected type: `+E(e))}function m(e){let t=e.toConfig(),n=i[t.name]??[];return new rn({...t,fields:()=>({...$e(t.fields,e=>({...e,type:u(e.type)})),...se(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function g(e){let t=e.toConfig(),n=i[e.name]??[];return new en({...t,values:{...t.values,...ce(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}function _(e){let t=e.toConfig(),n=i[t.name]??[],r=t.specifiedByURL;for(let e of n)r=Sa(e)??r;return new Ht({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}function ee(e){let t=e.toConfig(),n=i[t.name]??[];return new Ut({...t,interfaces:()=>[...e.getInterfaces().map(d),...S(n)],fields:()=>({...$e(t.fields,te),...ae(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function v(e){let t=e.toConfig(),n=i[t.name]??[];return new Zt({...t,interfaces:()=>[...e.getInterfaces().map(d),...S(n)],fields:()=>({...$e(t.fields,te),...ae(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function y(e){let t=e.toConfig(),n=i[t.name]??[];return new Qt({...t,types:()=>[...e.getTypes().map(d),...le(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}function te(e){return{...e,type:u(e.type),args:e.args&&$e(e.args,b)}}function b(e){return{...e,type:u(e.type)}}function ne(e){let t={};for(let n of e){let e=n.operationTypes??[];for(let n of e)t[n.operation]=x(n.type)}return t}function x(e){let t=e.name.value,n=ba[t]??c[t];if(n===void 0)throw Error(`Unknown type: "${t}".`);return n}function re(e){return e.kind===C.LIST_TYPE?new Pt(re(e.type)):e.kind===C.NON_NULL_TYPE?new M(re(e.type)):x(e)}function ie(e){return new yn({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:oe(e.arguments),astNode:e})}function ae(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e)t[n.name.value]={type:re(n.type),description:n.description?.value,args:oe(n.arguments),deprecationReason:xa(n),astNode:n}}return t}function oe(e){let t=e??[],n=Object.create(null);for(let e of t){let t=re(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Di(e.defaultValue,t),deprecationReason:xa(e),astNode:e}}return n}function se(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e){let e=re(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Di(n.defaultValue,e),deprecationReason:xa(n),astNode:n}}}return t}function ce(e){let t=Object.create(null);for(let n of e){let e=n.values??[];for(let n of e)t[n.name.value]={description:n.description?.value,deprecationReason:xa(n),astNode:n}}return t}function S(e){return e.flatMap(e=>e.interfaces?.map(x)??[])}function le(e){return e.flatMap(e=>e.types?.map(x)??[])}function ue(e){let t=e.name.value,n=i[t]??[];switch(e.kind){case C.OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new Ut({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>ae(r),astNode:e,extensionASTNodes:n})}case C.INTERFACE_TYPE_DEFINITION:{let r=[e,...n];return new Zt({name:t,description:e.description?.value,interfaces:()=>S(r),fields:()=>ae(r),astNode:e,extensionASTNodes:n})}case C.ENUM_TYPE_DEFINITION:{let r=[e,...n];return new en({name:t,description:e.description?.value,values:ce(r),astNode:e,extensionASTNodes:n})}case C.UNION_TYPE_DEFINITION:{let r=[e,...n];return new Qt({name:t,description:e.description?.value,types:()=>le(r),astNode:e,extensionASTNodes:n})}case C.SCALAR_TYPE_DEFINITION:return new Ht({name:t,description:e.description?.value,specifiedByURL:Sa(e),astNode:e,extensionASTNodes:n});case C.INPUT_OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new rn({name:t,description:e.description?.value,fields:()=>se(r),astNode:e,extensionASTNodes:n,isOneOf:Ca(e)})}}}}const ba=Ze([...hn,...Hn],e=>e.name);function xa(e){return Ai(Sn,e)?.reason}function Sa(e){return Ai(Cn,e)?.url}function Ca(e){return!!Ai(wn,e)}function wa(e,t){e!=null&&e.kind===C.DOCUMENT||p(!1,`Must provide valid Document AST.`),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&fa(e);let n=ya({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(n.astNode==null)for(let e of n.types)switch(e.name){case`Query`:n.query=e;break;case`Mutation`:n.mutation=e;break;case`Subscription`:n.subscription=e;break}let r=[...n.directives,...Tn.filter(e=>n.directives.every(t=>t.name!==e.name))];return new Kn({...n,directives:r})}function Ta(e,t){return wa(Ge(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables}),{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}const Ea=e=>Array.isArray(e)?e:e?[e]:[];function Da(e,t){return String(e)<String(t)?-1:+(String(e)>String(t))}function Oa(e){let t;return`alias`in e&&(t=e.alias?.value),t==null&&`name`in e&&(t=e.name?.value),t??=e.kind,t}function ka(e,t,n){let r=Oa(e),i=Oa(t);return typeof n==`function`?n(r,i):Da(r,i)}function Aa(e){return e!=null}function ja(e){return Ma(e,[])}function Ma(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return Pa(e,t);default:return String(e)}}function Na(e){return(e.name=`GraphQLError`)?e.toString():`${e.name}: ${e.message};\n ${e.stack}`}function Pa(e,t){if(e===null)return`null`;if(e instanceof Error)return e.name===`AggregateError`?Na(e)+`
55
- `+La(e.errors,t):Na(e);if(t.includes(e))return`[Circular]`;let n=[...t,e];if(Fa(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:Ma(t,n)}else if(Array.isArray(e))return La(e,n);return Ia(e,n)}function Fa(e){return typeof e.toJSON==`function`}function Ia(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>3?`[`+Ra(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+Ma(n,t)).join(`, `)+` }`}function La(e,t){if(e.length===0)return`[]`;if(t.length>3)return`[Array]`;let n=e.length,r=[];for(let i=0;i<n;++i)r.push(Ma(e[i],t));return`[`+r.join(`, `)+`]`}function Ra(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}const za=[`message`,`locations`,`path`,`nodes`,`source`,`positions`,`originalError`,`name`,`stack`,`extensions`];function Ba(e){return typeof e==`object`&&!!e&&Object.keys(e).every(e=>za.includes(e))}function N(e,t){return t?.originalError&&!(t.originalError instanceof Error)&&Ba(t.originalError)&&(t.originalError=N(t.originalError.message,t.originalError)),f.major>=17?new b(e,t):new b(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions)}const Va=Symbol.for(`@whatwg-node/promise-helpers/FakePromise`);function Ha(e){return e?.then!=null}function Ua(e){let t=e;return t&&t.then&&t.catch&&t.finally}function P(e,t,n,r){let i=Wa().then(e).then(t,n);return r&&(i=i.finally(r)),eo(i)}function Wa(e){return e&&Ua(e)?e:Ha(e)?{then:(t,n)=>Wa(e.then(t,n)),catch:t=>Wa(e.then(e=>e,t)),finally:t=>Wa(t?$a(e,t):e),[Symbol.toStringTag]:`Promise`}:{then(t){if(t)try{return Wa(t(e))}catch(e){return qa(e)}return this},catch(){return this},finally(t){if(t)try{return Wa(t()).then(()=>e,()=>e)}catch(e){return qa(e)}return this},[Symbol.toStringTag]:`Promise`,__fakePromiseValue:e,[Va]:`resolved`}}function Ga(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise(function(n,r){e=n,t=r}),get resolve(){return e},get reject(){return t}}}function Ka(e,t,n){if(e?.length===0)return;let r=e[Symbol.iterator](),i=0;function a(){let{done:e,value:o}=r.next();if(e)return;let s=!1;function c(){s=!0}return P(function(){return t(o,c,i++)},function(e){if(e&&n?.push(e),!s)return a()})}return a()}function qa(e){return{then(t,n){if(n)try{return Wa(n(e))}catch(e){return qa(e)}return this},catch(t){if(t)try{return Wa(t(e))}catch(e){return qa(e)}return this},finally(e){if(e)try{e()}catch(e){return qa(e)}return this},__fakeRejectError:e,[Symbol.toStringTag]:`Promise`,[Va]:`rejected`}}function Ja(e,t,n){return P(()=>e,t,n)}function Ya(e,t,n,r){Symbol.asyncIterator in e&&(e=e[Symbol.asyncIterator]());let i,a,o;if(r){let e;o=t=>(e||=P(r,()=>t,()=>t),e)}typeof e.return==`function`&&(i=e.return,a=t=>{let n=()=>{throw t};return i.call(e).then(n,n)});function s(e){return e.done?o?o(e):e:P(()=>e.value,e=>P(()=>t(e),Xa,a))}let c;if(n){let e,t=n;c=n=>(e||=P(()=>n,e=>P(()=>t(e),Xa,a)),e)}return{next(){return e.next().then(s,c)},return(){let t=i?i.call(e).then(s,c):Wa({value:void 0,done:!0});return o?t.then(o):t},throw(t){return typeof e.throw==`function`?e.throw(t).then(s,c):a?a(t):qa(t)},[Symbol.asyncIterator](){return this}}}function Xa(e){return{value:e,done:!1}}function Za(e){return e?.[Va]===`resolved`}function Qa(e){return e?.[Va]===`rejected`}function $a(e,t){return`finally`in e?e.finally(t):e.then(e=>{let n=t();return Ha(n)?n.then(()=>e):e},e=>{let n=t();if(Ha(n))return n.then(()=>{throw e});throw e})}function eo(e){if(Za(e))return e.__fakePromiseValue;if(Qa(e))throw e.__fakeRejectError;return e}function to(e){return typeof e==`object`&&!!e&&Symbol.iterator in e}function no(e){return typeof e==`object`&&!!e}function ro(e,t,n){let r=n;for(let n of e)r=P(()=>r,e=>t(e,n));return r}function io(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ao(e,t,n={}){let r={},i=(t.arguments??[]).reduce((e,t)=>({...e,[t.name.value]:t}),{});for(let{name:a,type:o,defaultValue:s}of e.args){let e=i[a];if(!e){if(s!==void 0)r[a]=s;else if(j(o))throw N(`Argument "${a}" of required type "${ja(o)}" was not provided.`,{nodes:[t]});continue}let c=e.value,l=c.kind===C.NULL;if(c.kind===C.VARIABLE){let e=c.name.value;if(n==null||!io(n,e)){if(s!==void 0)r[a]=s;else if(j(o))throw N(`Argument "${a}" of required type "${ja(o)}" was provided the variable "$${e}" which was not provided a runtime value.`,{nodes:[c]});continue}l=n[e]==null}if(l&&j(o))throw N(`Argument "${a}" of non-null type "${ja(o)}" must not be null.`,{nodes:[c]});let u=Di(c,o,n);if(u===void 0)throw N(`Argument "${a}" has invalid value ${ht(c)}.`,{nodes:[c]});r[a]=u}return r}function oo(e){let t=new WeakMap;return function(n){let r=t.get(n);if(r===void 0){let r=e(n);return t.set(n,r),r}return r}}function so(e){let t=new WeakMap;return function(n,r,i){let a=t.get(n);if(!a){a=new WeakMap,t.set(n,a);let o=new WeakMap;a.set(r,o);let s=e(n,r,i);return o.set(i,s),s}let o=a.get(r);if(!o){o=new WeakMap,a.set(r,o);let t=e(n,r,i);return o.set(i,t),t}let s=o.get(i);if(s===void 0){let t=e(n,r,i);return o.set(i,t),t}return s}}function co(e){let t=new WeakMap;return function(n,r,i,a){let o=t.get(n);if(!o){o=new WeakMap,t.set(n,o);let s=new WeakMap;o.set(r,s);let c=new WeakMap;s.set(i,c);let l=e(n,r,i,a);return c.set(a,l),l}let s=o.get(r);if(!s){s=new WeakMap,o.set(r,s);let t=new WeakMap;s.set(i,t);let c=e(n,r,i,a);return t.set(a,c),c}let c=s.get(i);if(!c){let t=new WeakMap;s.set(i,t);let o=e(n,r,i,a);return t.set(a,o),o}let l=c.get(a);if(l===void 0){let t=e(n,r,i,a);return c.set(a,t),t}return l}}function lo(e){let t=new WeakMap;return function(n,r,i,a,o){let s=t.get(n);if(!s){s=new WeakMap,t.set(n,s);let c=new WeakMap;s.set(r,c);let l=new WeakMap;c.set(i,l);let u=new WeakMap;l.set(a,u);let d=e(n,r,i,a,o);return u.set(o,d),d}let c=s.get(r);if(!c){c=new WeakMap,s.set(r,c);let t=new WeakMap;c.set(i,t);let l=new WeakMap;t.set(a,l);let u=e(n,r,i,a,o);return l.set(o,u),u}let l=c.get(i);if(!l){l=new WeakMap,c.set(i,l);let t=new WeakMap;l.set(a,t);let s=e(n,r,i,a,o);return t.set(o,s),s}let u=l.get(a);if(!u){u=new WeakMap,l.set(a,u);let t=e(n,r,i,a,o);return u.set(o,t),t}let d=u.get(o);if(d===void 0){let t=e(n,r,i,a,o);return u.set(o,t),t}return d}}function uo(e,t,n=[`directives`]){let r={};if(e.extensions){let t=e.extensions;for(let e of n)t=t?.[e];if(t!=null)for(let e in t){let n=t[e],i=e;if(Array.isArray(n))for(let e of n){let t=r[i];t||(t=[],r[i]=t),t.push(e)}else{let e=r[i];e||(e=[],r[i]=e),e.push(n)}}}let i=oo(e=>JSON.stringify(e)),a=[];e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes);for(let e of a)if(e.directives?.length)for(let n of e.directives){let e=n.name.value,o=r[e];o||(o=[],r[e]=o);let s=t?.getDirective(e),c={};if(s&&(c=ao(s,n)),n.arguments)for(let e of n.arguments){let t=e.name.value;if(c[t]==null){let n=s?.args.find(e=>e.name===t);n&&(c[t]=Di(e.value,n.type))}c[t]??(c[t]=bt(e.value))}if(a.length>0&&o.length>0){let e=i(c);if(o.some(t=>i(t)===e))continue}o.push(c)}return r}function fo(e,t=[`directives`]){let n=uo(e,void 0,t);return Object.entries(n).map(([e,t])=>t?.map(t=>({name:e,args:t}))).flat(1/0).filter(Boolean)}function po(e,t,n,r=[`directives`]){return uo(t,e,r)[n]}function mo(e){if(j(e)){let t=mo(e.ofType);if(t.kind===C.NON_NULL_TYPE)throw Error(`Invalid type node ${ja(e)}. Inner type of non-null type cannot be a non-null type.`);return{kind:C.NON_NULL_TYPE,type:t}}else if(Ot(e))return{kind:C.LIST_TYPE,type:mo(e.ofType)};return{kind:C.NAMED_TYPE,name:{kind:C.NAME,value:e.name}}}function ho(e){if(e===null)return{kind:C.NULL};if(e===void 0)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=ho(n);e!=null&&t.push(e)}return{kind:C.LIST,values:t}}if(typeof e==`object`){if(e?.toJSON)return ho(e.toJSON());let t=[];for(let n in e){let r=e[n],i=ho(r);i&&t.push({kind:C.OBJECT_FIELD,name:{kind:C.NAME,value:n},value:i})}return{kind:C.OBJECT,fields:t}}if(typeof e==`boolean`)return{kind:C.BOOLEAN,value:e};if(typeof e==`bigint`)return{kind:C.INT,value:String(e)};if(typeof e==`number`&&isFinite(e)){let t=String(e);return go.test(t)?{kind:C.INT,value:t}:{kind:C.FLOAT,value:t}}if(typeof e==`string`)return{kind:C.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}const go=/^-?(?:0|[1-9][0-9]*)$/;function _o(e,t){if(j(t)){let n=_o(e,t.ofType);return n?.kind===C.NULL?null:n}if(e===null)return{kind:C.NULL};if(e===void 0)return null;if(Ot(t)){let n=t.ofType;if(to(e)){let t=[];for(let r of e){let e=_o(r,n);e!=null&&t.push(e)}return{kind:C.LIST,values:t}}return _o(e,n)}if(Dt(t)){if(!no(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=_o(e[r.name],r.type);t&&n.push({kind:C.OBJECT_FIELD,name:{kind:C.NAME,value:r.name},value:t})}return{kind:C.OBJECT,fields:n}}if(jt(t)){let n=t.serialize(e);return n==null?null:Et(t)?{kind:C.ENUM,value:n}:t.name===`ID`&&typeof n==`string`&&vo.test(n)?{kind:C.INT,value:n}:ho(n)}console.assert(!1,`Unexpected input type: `+ja(t))}const vo=/^-?(?:0|[1-9][0-9]*)$/;function yo(e){if(e.astNode?.description)return{...e.astNode.description,block:!0};if(e.description)return{kind:C.STRING,value:e.description,block:!0}}function bo(e,t,n){let r=xo(e).get(t);if(r==null)throw N(`Schema is not configured to execute ${t} operation.`,{nodes:n});return r}const xo=oo(function(e){let t=new Map,n=e.getQueryType();n&&t.set(`query`,n);let r=e.getMutationType();r&&t.set(`mutation`,r);let i=e.getSubscriptionType();return i&&t.set(`subscription`,i),t});function So(e,t={}){let n=t.pathToDirectivesInExtensions,r=e.getTypeMap(),i=Co(e,n),a=i==null?[]:[i],o=e.getDirectives();for(let t of o)En(t)||a.push(wo(t,e,n));for(let t in r){let i=r[t],o=gn(i),s=Un(i);if(!(o||s))if(k(i))a.push(Do(i,e,n));else if(A(i))a.push(Oo(i,e,n));else if(Tt(i))a.push(ko(i,e,n));else if(Dt(i))a.push(Ao(i,e,n));else if(Et(i))a.push(jo(i,e,n));else if(wt(i))a.push(Mo(i,e,n));else throw Error(`Unknown type ${i}.`)}return{kind:C.DOCUMENT,definitions:a}}function Co(e,t){let n=new Map([[`query`,void 0],[`mutation`,void 0],[`subscription`,void 0]]),r=[];if(e.astNode!=null&&r.push(e.astNode),e.extensionASTNodes!=null)for(let t of e.extensionASTNodes)r.push(t);for(let e of r)if(e.operationTypes)for(let t of e.operationTypes)n.set(t.operation,t);let i=xo(e);for(let[e,t]of n){let r=i.get(e);if(r!=null){let i=mo(r);t==null?n.set(e,{kind:C.OPERATION_TYPE_DEFINITION,operation:e,type:i}):t.type=i}}let a=[...n.values()].filter(Aa),o=To(e,e,t);if(!a.length&&!o.length)return null;let s={kind:a==null?C.SCHEMA_EXTENSION:C.SCHEMA_DEFINITION,operationTypes:a,directives:o},c=yo(e);return c&&(s.description=c),s}function wo(e,t,n){return{kind:C.DIRECTIVE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},arguments:e.args?.map(e=>Eo(e,t,n)),repeatable:e.isRepeatable,locations:e.locations?.map(e=>({kind:C.NAME,value:e}))||[]}}function To(e,t,n){let r=[],i=fo(e,n),a;i!=null&&(a=Ro(t,i));let o=null,s=null,c=null;return a!=null&&(r=a.filter(e=>Tn.every(t=>t.name!==e.name.value)),o=a.find(e=>e.name.value===`deprecated`),s=a.find(e=>e.name.value===`specifiedBy`),c=a.find(e=>e.name.value===`oneOf`)),e.deprecationReason!=null&&o==null&&(o=Io(e.deprecationReason)),(e.specifiedByUrl!=null||e.specifiedByURL!=null&&s==null)&&(s=Lo(`specifiedBy`,{url:e.specifiedByUrl||e.specifiedByURL})),e.isOneOf&&c==null&&(c=Lo(`oneOf`)),o!=null&&r.push(o),s!=null&&r.push(s),c!=null&&r.push(c),r}function Eo(e,t,n){return{kind:C.INPUT_VALUE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},type:mo(e.type),defaultValue:e.defaultValue===void 0?void 0:_o(e.defaultValue,e.type)??void 0,directives:To(e,t,n)}}function Do(e,t,n){return{kind:C.OBJECT_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>No(e,t,n)),interfaces:Object.values(e.getInterfaces()).map(e=>mo(e)),directives:To(e,t,n)}}function Oo(e,t,n){let r={kind:C.INTERFACE_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>No(e,t,n)),directives:To(e,t,n)};return`getInterfaces`in e&&(r.interfaces=Object.values(e.getInterfaces()).map(e=>mo(e))),r}function ko(e,t,n){return{kind:C.UNION_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},directives:To(e,t,n),types:e.getTypes().map(e=>mo(e))}}function Ao(e,t,n){return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>Po(e,t,n)),directives:To(e,t,n)}}function jo(e,t,n){return{kind:C.ENUM_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},values:Object.values(e.getValues()).map(e=>Fo(e,t,n)),directives:To(e,t,n)}}function Mo(e,t,n){let r=Ro(t,fo(e,n)),i=e.specifiedByUrl||e.specifiedByURL;if(i&&!r.some(e=>e.name.value===`specifiedBy`)){let e={url:i};r.push(Lo(`specifiedBy`,e))}return{kind:C.SCALAR_TYPE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},directives:r}}function No(e,t,n){return{kind:C.FIELD_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},arguments:e.args.map(e=>Eo(e,t,n)),type:mo(e.type),directives:To(e,t,n)}}function Po(e,t,n){return{kind:C.INPUT_VALUE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},type:mo(e.type),directives:To(e,t,n),defaultValue:_o(e.defaultValue,e.type)??void 0}}function Fo(e,t,n){return{kind:C.ENUM_VALUE_DEFINITION,description:yo(e),name:{kind:C.NAME,value:e.name},directives:To(e,t,n)}}function Io(e){return Lo(`deprecated`,{reason:e},Sn)}function Lo(e,t,n){let r=[];for(let e in t){let i=t[e],a;if(n!=null){let t=n.args.find(t=>t.name===e);t&&(a=_o(i,t.type))}a??=ho(i),a!=null&&r.push({kind:C.ARGUMENT,name:{kind:C.NAME,value:e},value:a})}return{kind:C.DIRECTIVE,name:{kind:C.NAME,value:e},arguments:r}}function Ro(e,t){let n=[];for(let{name:r,args:i}of t){let t=e?.getDirective(r);n.push(Lo(r,i,t))}return n}let zo={};function Bo(){zo={}}function Vo(e){let t=e.name?.value;if(t!=null)switch(Ho(e,t),e.kind){case`EnumTypeDefinition`:if(e.values)for(let n of e.values)Ho(n,t,n.name.value);break;case`ObjectTypeDefinition`:case`InputObjectTypeDefinition`:case`InterfaceTypeDefinition`:if(e.fields){for(let n of e.fields)if(Ho(n,t,n.name.value),$o(n)&&n.arguments)for(let e of n.arguments)Ho(e,t,n.name.value,e.name.value)}break}}function Ho(e,t,n,r){let i=es(e);if(typeof i!=`string`||i.length===0)return;let a=[t];n&&(a.push(n),r&&a.push(r));let o=a.join(`.`);zo[o]||(zo[o]=[]),zo[o].push(i)}function Uo(e){return`
56
- # `+e.replace(/\n/g,`
57
- # `)}function F(e,t){return e?e.filter(e=>e).join(t||``):``}function Wo(e){return e?.some(e=>e.includes(`
58
- `))??!1}function Go(e){return(t,n,r,i,a)=>{let o=[],s=i.reduce((e,t)=>([`fields`,`arguments`,`values`].includes(t)&&e.name&&o.push(e.name.value),e[t]),a[0]),c=[...o,s?.name?.value].filter(Boolean).join(`.`),l=[];return t.kind.includes(`Definition`)&&zo[c]&&l.push(...zo[c]),F([...l.map(Uo),t.description,e(t,n,r,i,a)],`
59
- `)}}function Ko(e){return e&&` ${e.replace(/\n/g,`
60
- `)}`}function qo(e){return e&&e.length!==0?`{\n${Ko(F(e,`
61
- `))}\n}`:``}function Jo(e,t,n){return t?e+t+(n||``):``}function Yo(e,t=!1){let n=e.replace(/\\/g,`\\\\`).replace(/"""/g,`\\"""`);return(e[0]===` `||e[0]===` `)&&e.indexOf(`
62
- `)===-1?`"""${n.replace(/"$/,`"
63
- `)}"""`:`"""\n${t?n:Ko(n)}\n"""`}const Xo={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>F(e.definitions,`
64
-
65
- `)},OperationDefinition:{leave:e=>{let t=Jo(`(`,F(e.variableDefinitions,`, `),`)`);return F([e.operation,F([e.name,t]),F(e.directives,` `)],` `)+` `+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+`: `+t+Jo(` = `,n)+Jo(` `,F(r,` `))},SelectionSet:{leave:({selections:e})=>qo(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=Jo(``,e,`: `)+t,o=a+Jo(`(`,F(n,`, `),`)`);return o.length>80&&(o=a+Jo(`(
66
- `,Ko(F(n,`
67
- `)),`
68
- )`)),F([o,F(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+Jo(` `,F(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>F([`...`,Jo(`on `,e),F(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Jo(`(`,F(n,`, `),`)`)} on ${t} ${Jo(``,F(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Yo(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+F(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+F(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+Jo(`(`,F(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>F([`schema`,F(e,` `),qo(t)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>F([`scalar`,e,F(t,` `)],` `)},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>F([`type`,e,Jo(`implements `,F(t,` & `)),F(n,` `),qo(r)],` `)},FieldDefinition:{leave:({name:e,arguments:t,type:n,directives:r})=>e+(Wo(t)?Jo(`(
69
- `,Ko(F(t,`
70
- `)),`
71
- )`):Jo(`(`,F(t,`, `),`)`))+`: `+n+Jo(` `,F(r,` `))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:n,directives:r})=>F([e+`: `+t,Jo(`= `,n),F(r,` `)],` `)},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:n,fields:r})=>F([`interface`,e,Jo(`implements `,F(t,` & `)),F(n,` `),qo(r)],` `)},UnionTypeDefinition:{leave:({name:e,directives:t,types:n})=>F([`union`,e,F(t,` `),Jo(`= `,F(n,` | `))],` `)},EnumTypeDefinition:{leave:({name:e,directives:t,values:n})=>F([`enum`,e,F(t,` `),qo(n)],` `)},EnumValueDefinition:{leave:({name:e,directives:t})=>F([e,F(t,` `)],` `)},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:n})=>F([`input`,e,F(t,` `),qo(n)],` `)},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:n,locations:r})=>`directive @`+e+(Wo(t)?Jo(`(
72
- `,Ko(F(t,`
73
- `)),`
74
- )`):Jo(`(`,F(t,`, `),`)`))+(n?` repeatable`:``)+` on `+F(r,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>F([`extend schema`,F(e,` `),qo(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>F([`extend scalar`,e,F(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>F([`extend type`,e,Jo(`implements `,F(t,` & `)),F(n,` `),qo(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>F([`extend interface`,e,Jo(`implements `,F(t,` & `)),F(n,` `),qo(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>F([`extend union`,e,F(t,` `),Jo(`= `,F(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>F([`extend enum`,e,F(t,` `),qo(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>F([`extend input`,e,F(t,` `),qo(n)],` `)}},Zo=Object.keys(Xo).reduce((e,t)=>({...e,[t]:{leave:Go(Xo[t].leave)}}),{});function Qo(e){return ft(e,Zo)}function $o(e){return e.kind===`FieldDefinition`}function es(e){let t=ts(e);if(t!==void 0)return ns(`\n${t}`)}function ts(e){let t=e.loc;if(!t)return;let n=[],r=t.startToken.prev;for(;r!=null&&r.kind===w.COMMENT&&r.next!=null&&r.prev!=null&&r.line+1===r.next.line&&r.line!==r.prev.line;){let e=String(r.value);n.push(e),r=r.prev}return n.length>0?n.reverse().join(`
75
- `):void 0}function ns(e){let t=e.split(/\r\n|[\n\r]/g),n=rs(t);if(n!==0)for(let e=1;e<t.length;e++)t[e]=t[e].slice(n);for(;t.length>0&&as(t[0]);)t.shift();for(;t.length>0&&as(t[t.length-1]);)t.pop();return t.join(`
76
- `)}function rs(e){let t=null;for(let n=1;n<e.length;n++){let r=e[n],i=is(r);if(i!==r.length&&(t===null||i<t)&&(t=i,t===0))break}return t===null?0:t}function is(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return t}function as(e){return is(e)===e.length}var I;(function(e){e.TYPE=`MapperKind.TYPE`,e.SCALAR_TYPE=`MapperKind.SCALAR_TYPE`,e.ENUM_TYPE=`MapperKind.ENUM_TYPE`,e.COMPOSITE_TYPE=`MapperKind.COMPOSITE_TYPE`,e.OBJECT_TYPE=`MapperKind.OBJECT_TYPE`,e.INPUT_OBJECT_TYPE=`MapperKind.INPUT_OBJECT_TYPE`,e.ABSTRACT_TYPE=`MapperKind.ABSTRACT_TYPE`,e.UNION_TYPE=`MapperKind.UNION_TYPE`,e.INTERFACE_TYPE=`MapperKind.INTERFACE_TYPE`,e.ROOT_OBJECT=`MapperKind.ROOT_OBJECT`,e.QUERY=`MapperKind.QUERY`,e.MUTATION=`MapperKind.MUTATION`,e.SUBSCRIPTION=`MapperKind.SUBSCRIPTION`,e.DIRECTIVE=`MapperKind.DIRECTIVE`,e.FIELD=`MapperKind.FIELD`,e.COMPOSITE_FIELD=`MapperKind.COMPOSITE_FIELD`,e.OBJECT_FIELD=`MapperKind.OBJECT_FIELD`,e.ROOT_FIELD=`MapperKind.ROOT_FIELD`,e.QUERY_ROOT_FIELD=`MapperKind.QUERY_ROOT_FIELD`,e.MUTATION_ROOT_FIELD=`MapperKind.MUTATION_ROOT_FIELD`,e.SUBSCRIPTION_ROOT_FIELD=`MapperKind.SUBSCRIPTION_ROOT_FIELD`,e.INTERFACE_FIELD=`MapperKind.INTERFACE_FIELD`,e.INPUT_OBJECT_FIELD=`MapperKind.INPUT_OBJECT_FIELD`,e.ARGUMENT=`MapperKind.ARGUMENT`,e.ENUM_VALUE=`MapperKind.ENUM_VALUE`})(I||={});function os(e,t){if(t){let n=e[t.name];if(k(n))return n}}function ss(e){if(`getFields`in e){let t=e.getFields();for(let e in t)return t[e].name===`_fake`}return!1}function cs(e){switch(e.name){case un.name:return un;case dn.name:return dn;case fn.name:return fn;case pn.name:return pn;case mn.name:return mn;default:return e}}function ls(e,t){let n=Object.create(null);for(let t in e)n[t]=e[t];let r=Object.create(null);for(let e in n){let t=n[e];if(t==null||e.startsWith(`__`))continue;let i=t.name;if(!i.startsWith(`__`)){if(r[i]!=null){console.warn(`Duplicate schema type name ${i} found; keeping the existing one found in the schema`);continue}r[i]=t}}for(let e in r)r[e]=o(r[e]);return{typeMap:r,directives:t.map(e=>i(e))};function i(e){if(En(e))return e;let t=e.toConfig();return t.args=a(t.args),new yn(t)}function a(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&(r.type=i,t[n]=r)}return t}function o(e){if(k(e)){let t=e.toConfig();return new Ut({...t,fields:()=>s(t.fields),interfaces:()=>l(t.interfaces)})}else if(A(e)){let t=e.toConfig(),n={...t,fields:()=>s(t.fields)};return`interfaces`in n&&(n.interfaces=()=>l(t.interfaces)),new Zt(n)}else if(Tt(e)){let t=e.toConfig();return new Qt({...t,types:()=>l(t.types)})}else if(Dt(e)){let t=e.toConfig();return new rn({...t,fields:()=>c(t.fields)})}else if(Et(e))return new en(e.toConfig());else if(wt(e))return gn(e)?e:new Ht(e.toConfig());throw Error(`Unexpected schema type: ${e}`)}function s(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&r.args&&(r.type=i,r.args=a(r.args),t[n]=r)}return t}function c(e){let t={};for(let n in e){let r=e[n],i=u(r.type);i!=null&&(r.type=i,t[n]=r)}return t}function l(e){let t=[];for(let n of e){let e=u(n);e!=null&&t.push(e)}return t}function u(e){if(Ot(e)){let t=u(e.ofType);return t==null?null:new Pt(t)}else if(j(e)){let t=u(e.ofType);return t==null?null:new M(t)}else if(Rt(e)){let t=n[e.name];return t===void 0&&(t=ss(e)?cs(e):o(e),r[t.name]=n[e.name]=t),t==null?null:r[t.name]}return null}}function us(e,t,n=null,r=null){if(t==null)return t;let i=Lt(e);if(jt(i))return n==null?t:n(i,t);if(Ot(i))return Ea(t).map(e=>us(i.ofType,e,n,r));if(Dt(i)){let e=i.getFields(),a={};for(let i in t){let o=e[i];o!=null&&(a[i]=us(o.type,t[i],n,r))}return r==null?a:r(i,a)}}function ds(e,t){return us(e,t,(e,t)=>{try{return e.serialize(t)}catch{return t}})}function fs(e,t){return us(e,t,(e,t)=>{try{return e.parseValue(t)}catch{return t}})}function ps(e,t={}){let n=ys(vs(ms(gs(hs(ms(gs(e.getTypeMap(),e,ds),e,t,e=>jt(e)),e,t),e,fs),e,t,e=>!jt(e)),e,t),e,t),{typeMap:r,directives:i}=ls(n,bs(e.getDirectives(),e,t));return new Kn({...e.toConfig(),query:os(r,os(n,e.getQueryType())),mutation:os(r,os(n,e.getMutationType())),subscription:os(r,os(n,e.getSubscriptionType())),types:Object.values(r),directives:i})}function ms(e,t,n,r=()=>!0){let i={};for(let a in e)if(!a.startsWith(`__`)){let o=e[a];if(o==null||!r(o)){i[a]=o;continue}let s=Ss(t,n,a);if(s==null){i[a]=o;continue}let c=s(o,t);if(c===void 0){i[a]=o;continue}i[a]=c}return i}function hs(e,t,n){let r=Ds(n);return r?ms(e,t,{[I.ENUM_TYPE]:e=>{let n=e.toConfig(),i=n.values,a={};for(let n in i){let o=i[n],s=r(o,e.name,t,n);if(s===void 0)a[n]=o;else if(Array.isArray(s)){let[e,t]=s;a[e]=t===void 0?o:t}else s!==null&&(a[n]=s)}return Os(new en({...n,values:a}))}},e=>Et(e)):e}function gs(e,t,n){let r=ys(e,t,{[I.ARGUMENT]:t=>{if(t.defaultValue===void 0)return t;let r=_s(e,t.type);if(r!=null)return{...t,defaultValue:n(r,t.defaultValue)}}});return vs(r,t,{[I.INPUT_OBJECT_FIELD]:e=>{if(e.defaultValue===void 0)return e;let t=_s(r,e.type);if(t!=null)return{...e,defaultValue:n(t,e.defaultValue)}}})}function _s(e,t){if(Ot(t)){let n=_s(e,t.ofType);return n==null?null:new Pt(n)}else if(j(t)){let n=_s(e,t.ofType);return n==null?null:new M(n)}else if(Rt(t))return e[t.name]??null;return null}function vs(e,t,n){let r={};for(let i in e)if(!i.startsWith(`__`)){let a=e[i];if(!k(a)&&!A(a)&&!Dt(a)){r[i]=a;continue}let o=ws(t,n,i);if(o==null){r[i]=a;continue}let s=a.toConfig(),c=s.fields,l={};for(let e in c){let n=c[e],r=o(n,e,i,t);if(r===void 0)l[e]=n;else if(Array.isArray(r)){let[e,t]=r;t.astNode!=null&&(t.astNode={...t.astNode,name:{...t.astNode.name,value:e}}),l[e]=t===void 0?n:t}else r!==null&&(l[e]=r)}k(a)?r[i]=Os(new Ut({...s,fields:l})):A(a)?r[i]=Os(new Zt({...s,fields:l})):r[i]=Os(new rn({...s,fields:l}))}return r}function ys(e,t,n){let r={};for(let i in e)if(!i.startsWith(`__`)){let a=e[i];if(!k(a)&&!A(a)){r[i]=a;continue}let o=Ts(n);if(o==null){r[i]=a;continue}let s=a.toConfig(),c=s.fields,l={};for(let e in c){let n=c[e],r=n.args;if(r==null){l[e]=n;continue}let a=Object.keys(r);if(!a.length){l[e]=n;continue}let s={};for(let n of a){let a=r[n],c=o(a,e,i,t);if(c===void 0)s[n]=a;else if(Array.isArray(c)){let[e,t]=c;s[e]=t}else c!==null&&(s[n]=c)}l[e]={...n,args:s}}k(a)?r[i]=new Ut({...s,fields:l}):A(a)?r[i]=new Zt({...s,fields:l}):r[i]=new rn({...s,fields:l})}return r}function bs(e,t,n){let r=Es(n);if(r==null)return e.slice();let i=[];for(let n of e){let e=r(n,t);e===void 0?i.push(n):e!==null&&i.push(e)}return i}function xs(e,t){let n=e.getType(t),r=[I.TYPE];return k(n)?(r.push(I.COMPOSITE_TYPE,I.OBJECT_TYPE),t===e.getQueryType()?.name?r.push(I.ROOT_OBJECT,I.QUERY):t===e.getMutationType()?.name?r.push(I.ROOT_OBJECT,I.MUTATION):t===e.getSubscriptionType()?.name&&r.push(I.ROOT_OBJECT,I.SUBSCRIPTION)):Dt(n)?r.push(I.INPUT_OBJECT_TYPE):A(n)?r.push(I.COMPOSITE_TYPE,I.ABSTRACT_TYPE,I.INTERFACE_TYPE):Tt(n)?r.push(I.COMPOSITE_TYPE,I.ABSTRACT_TYPE,I.UNION_TYPE):Et(n)?r.push(I.ENUM_TYPE):wt(n)&&r.push(I.SCALAR_TYPE),r}function Ss(e,t,n){let r=xs(e,n),i,a=[...r];for(;!i&&a.length>0;)i=t[a.pop()];return i??null}function Cs(e,t){let n=e.getType(t),r=[I.FIELD];return k(n)?(r.push(I.COMPOSITE_FIELD,I.OBJECT_FIELD),t===e.getQueryType()?.name?r.push(I.ROOT_FIELD,I.QUERY_ROOT_FIELD):t===e.getMutationType()?.name?r.push(I.ROOT_FIELD,I.MUTATION_ROOT_FIELD):t===e.getSubscriptionType()?.name&&r.push(I.ROOT_FIELD,I.SUBSCRIPTION_ROOT_FIELD)):A(n)?r.push(I.COMPOSITE_FIELD,I.INTERFACE_FIELD):Dt(n)&&r.push(I.INPUT_OBJECT_FIELD),r}function ws(e,t,n){let r=Cs(e,n),i,a=[...r];for(;!i&&a.length>0;)i=t[a.pop()];return i??null}function Ts(e){return e[I.ARGUMENT]??null}function Es(e){return e[I.DIRECTIVE]??null}function Ds(e){return e[I.ENUM_VALUE]??null}function Os(e){if(k(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:C.OBJECT_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:C.OBJECT_TYPE_EXTENSION,fields:void 0}))),new Ut(t)}else if(A(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:C.INTERFACE_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:C.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new Zt(t)}else if(Dt(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.fields){let r=t.fields[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,kind:C.INPUT_OBJECT_TYPE_DEFINITION,fields:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:C.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new rn(t)}else if(Et(e)){let t=e.toConfig();if(t.astNode!=null){let e=[];for(let n in t.values){let r=t.values[n];r.astNode!=null&&e.push(r.astNode)}t.astNode={...t.astNode,values:e}}return t.extensionASTNodes!=null&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,values:void 0}))),new en(t)}else return e}function ks(e){return As(e.getTypeMap(),e.getDirectives()),e}function As(e,t){let n=Object.create(null);for(let t in e){let r=e[t];if(r==null||t.startsWith(`__`))continue;let i=r.name;if(!i.startsWith(`__`)){if(n[i]!=null){console.warn(`Duplicate schema type name ${i} found; keeping the existing one found in the schema`);continue}n[i]=r}}for(let t in n)e[t]=n[t];for(let e of t)e.args=e.args.filter(e=>(e.type=c(e.type),e.type!==null));for(let t in e){let i=e[t];!t.startsWith(`__`)&&t in n&&i!=null&&r(i)}for(let t in e)!t.startsWith(`__`)&&!(t in n)&&delete e[t];function r(e){if(k(e)){i(e),a(e);return}else if(A(e)){i(e),`getInterfaces`in e&&a(e);return}else if(Tt(e)){s(e);return}else if(Dt(e)){o(e);return}else if(jt(e))return;throw Error(`Unexpected schema type: ${e}`)}function i(e){let t=e.getFields();for(let[e,n]of Object.entries(t))n.args.map(e=>(e.type=c(e.type),e.type===null?null:e)).filter(Boolean),n.type=c(n.type),n.type===null&&delete t[e]}function a(e){if(`getInterfaces`in e){let t=e.getInterfaces();t.push(...t.splice(0).map(e=>c(e)).filter(Boolean))}}function o(e){let t=e.getFields();for(let[e,n]of Object.entries(t))n.type=c(n.type),n.type===null&&delete t[e]}function s(e){let t=e.getTypes();t.push(...t.splice(0).map(e=>c(e)).filter(Boolean))}function c(t){if(Ot(t)){let e=c(t.ofType);return e==null?null:new Pt(e)}else if(j(t)){let e=c(t.ofType);return e==null?null:new M(e)}else if(Rt(t)){let n=e[t.name];if(n&&t!==n)return n}return t}}function js(e,t){let n=e.getTypeMap();for(let e in n){let r=n[e];if(!zt(r).name.startsWith(`__`)&&k(r)){let n=r.getFields();for(let r in n){let i=n[r];t(i,e,r)}}}}function Ms(e,t){let n=e.getTypeMap();for(let e in n){let r=n[e];if(!zt(r).name.startsWith(`__`)){if(k(r)){let e=r.getFields();for(let n in e){let r=e[n];for(let e of r.args)e.defaultValue=t(e.type,e.defaultValue)}}else if(Dt(r)){let e=r.getFields();for(let n in e){let r=e[n];r.defaultValue=t(r.type,r.defaultValue)}}}}}function Ns(e,t=!1,n=!1,r=!1){let i,a=!0,o=e.every(e=>{if(Array.isArray(e)){if(i===void 0)return i=e.length,!0;if(i===e.length)return!0}else a=!1;return!1});if(r&&o)return Array(i).fill(null).map((i,a)=>Ns(e.map(e=>e[a]),t,n,r));if(a)return e.flat(1);let s,c;t&&(c=e.find(e=>Ps(e)),s??={},c&&Object.setPrototypeOf(s,Object.create(Object.getPrototypeOf(c))));for(let i of e)if(Ps(i)){if(c){let e=Object.getPrototypeOf(s),t=Object.getPrototypeOf(i);if(t)for(let n of Object.getOwnPropertyNames(t)){let r=Object.getOwnPropertyDescriptor(t,n);Aa(r)&&Object.defineProperty(e,n,r)}}for(let e in i)s??={},e in s?s[e]=Ns([s[e],i[e]],t,n,r):s[e]=i[e]}else s=Array.isArray(i)&&Array.isArray(s)?Ns([s,i],t,n,r):i;return s}function Ps(e){return e&&typeof e==`object`&&!Array.isArray(e)}var Fs=class extends Map{get[Symbol.toStringTag](){return`AccumulatorMap`}add(e,t){let n=this.get(e);n===void 0?this.set(e,[t]):n.push(t)}};const Is=new yn({name:`defer`,description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[S.FRAGMENT_SPREAD,S.INLINE_FRAGMENT],args:{if:{type:new M(pn),description:`Deferred when true or undefined.`,defaultValue:!0},label:{type:fn,description:`Unique name`}}}),Ls=new yn({name:`stream`,description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[S.FIELD],args:{if:{type:new M(pn),description:`Stream when true or undefined.`,defaultValue:!0},label:{type:fn,description:`Unique name`},initialCount:{defaultValue:0,type:un,description:`Number of items to return immediately`}}});function Rs(e,t,n,r,i,a,o,s){for(let c of i.selections)switch(c.kind){case C.FIELD:if(!Bs(n,c))continue;a.add(Hs(c),c);break;case C.INLINE_FRAGMENT:{if(!Bs(n,c)||!Vs(e,c,r))continue;let i=Us(n,c);if(i){let a=new Fs;Rs(e,t,n,r,c.selectionSet,a,o,s),o.push({label:i.label,fields:a})}else Rs(e,t,n,r,c.selectionSet,a,o,s);break}case C.FRAGMENT_SPREAD:{let i=c.name.value;if(!Bs(n,c))continue;let l=Us(n,c);if(s.has(i)&&!l)continue;let u=t[i];if(!u||!Vs(e,u,r))continue;if(l||s.add(i),l){let i=new Fs;Rs(e,t,n,r,u.selectionSet,i,o,s),o.push({label:l.label,fields:i})}else Rs(e,t,n,r,u.selectionSet,a,o,s);break}}}function zs(e,t,n,r,i){let a=new Fs,o=[];return Rs(e,t,n,r,i,a,o,new Set),{fields:a,patches:o}}function Bs(e,t){return!(Ai(xn,t,e)?.if===!0||Ai(bn,t,e)?.if===!1)}function Vs(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=mr(e,r);return i===n?!0:Nt(i)?e.getPossibleTypes(i).includes(n):!1}function Hs(e){return e.alias?e.alias.value:e.name.value}function Us(e,t){let n=Ai(Is,t,e);if(n&&n.if!==!1)return{label:typeof n.label==`string`?n.label:void 0}}const Ws=lo(function(e,t,n,r,i){let a=new Fs,o=new Set,s=[],c={fields:a,patches:s};for(let c of i)c.selectionSet&&Rs(e,t,n,r,c.selectionSet,a,s,o);return c});function Gs(e){return e?.[Symbol.asyncIterator]!=null}function Ks(e){return e&&typeof e==`object`&&`kind`in e&&e.kind===C.DOCUMENT}function qs(e,t,n){return{prev:e,key:t,typename:n}}function Js(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Ys(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}function Xs(e,t,n){if(typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t))for(n=0;n<t.length;n++)e[n]=Xs(e[n],t[n]);else for(n in t){if(n===`__proto__`||n===`constructor`||n===`prototype`)break;e[n]=Xs(e[n],t[n])}return e}return t}function Zs(e,t,n){t.split&&(t=t.split(`.`));for(var r=0,i=t.length,a=e,o,s;r<i&&(s=``+t[r++],!(s===`__proto__`||s===`constructor`||s===`prototype`));)a=a[s]=r===i?Xs(a[s],n):typeof(o=a[s])==typeof t?o:t[r]*0!=0||~(``+t[r]).indexOf(`.`)?{}:[]}function Qs({incrementalResult:e,executionResult:t}){let n=[`data`,...e.path??[]];if(e.items)for(let r of e.items)Zs(t,n,r),n[n.length-1]++;e.data&&Zs(t,n,e.data),e.errors&&(t.errors=t.errors||[],t.errors.push(...e.errors)),e.extensions&&Zs(t,`extensions`,e.extensions),e.incremental&&e.incremental.forEach(e=>{Qs({incrementalResult:e,executionResult:t})})}const $s={red:`\x1B[31m`,yellow:`\x1B[33m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,reset:`\x1B[0m`},ec=$s.yellow+`WARN`+$s.reset,tc=$s.cyan+`INFO`+$s.reset,nc=$s.red+`ERR`+$s.reset,rc=$s.magenta+`DEBUG`+$s.reset,ic={debug:0,info:1,warn:2,error:3,silent:4},ac=()=>{},oc=e=>(...t)=>console.log(e,...t),sc=console.debug?(...e)=>console.debug(rc,...e):oc(rc),cc=console.info?(...e)=>console.info(tc,...e):oc(tc),lc=console.warn?(...e)=>console.warn(ec,...e):oc(ec),uc=console.error?(...e)=>console.error(nc,...e):oc(nc),dc=(e={}.DEBUG===`1`?`debug`:`info`)=>{let t=ic[e];return{debug:t>ic.debug?ac:sc,info:t>ic.info?ac:cc,warn:t>ic.warn?ac:lc,error:t>ic.error?ac:uc}};var fc=`<!doctype html><html lang=en><head><meta charset=utf-8><title>__TITLE__</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><link crossorigin rel=stylesheet href=https://unpkg.com/@graphql-yoga/graphiql@4.4.1/dist/graphiql.css></head><body id=body class=no-focus-outline><noscript>You need to enable JavaScript to run this app.</noscript><div id=root></div><script>self.MonacoEnvironment=function(o){return{globalAPI:!1,getWorkerUrl:function(r,n){var t=o[n];if(t.includes("://")){var e=String(window.location),i=e.substr(0,e.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(t.substring(0,i.length)!==i){var a=new Blob(["/*"+n+'*/importScripts("'+t+'");'],{type:"application/javascript"});return URL.createObjectURL(a)}}return t}}}({editorWorkerService:"https://unpkg.com/@graphql-yoga/graphiql@4.4.1/dist/monacoeditorwork/editor.worker.bundle.js",json:"https://unpkg.com/@graphql-yoga/graphiql@4.4.1/dist/monacoeditorwork/json.worker.bundle.js",graphql:"https://unpkg.com/@graphql-yoga/graphiql@4.4.1/dist/monacoeditorwork/graphql.worker..bundle.js"})<\/script><script type=module>import{renderYogaGraphiQL}from"https://unpkg.com/@graphql-yoga/graphiql@4.4.1/dist/yoga-graphiql.es.js";renderYogaGraphiQL(root,__OPTS__)<\/script></body></html>`;function pc({headers:e,method:t}){return t===`GET`&&!!e?.get(`accept`)?.includes(`text/html`)}const mc=e=>fc.replace(`__TITLE__`,e?.title||`Yoga GraphiQL`).replace(`__OPTS__`,JSON.stringify(e??{}));function hc(e){let t=e.logger??console,n;n=typeof e?.options==`function`?e?.options:typeof e?.options==`object`?()=>e?.options:e?.options===!1?()=>!1:()=>({});let r=e?.render??mc,i,a=({URLPattern:t})=>(i||=new t({pathname:e.graphqlEndpoint}),i);return{onRequest({request:i,serverContext:o,fetchAPI:s,endResponse:c,url:l}){if(pc(i)&&(i.url.endsWith(e.graphqlEndpoint)||i.url.endsWith(`${e.graphqlEndpoint}/`)||l.pathname===e.graphqlEndpoint||l.pathname===`${e.graphqlEndpoint}/`||a(s).test(l)))return t.debug(`Rendering GraphiQL`),P(()=>n(i,o),e=>{if(e)return P(()=>r({...e===!0?{}:e}),e=>{c(new s.Response(e,{headers:{"Content-Type":`text/html`},status:200}))})})}}}const gc=e=>{if(e==null)return{};if(Wn(e))return{onPluginInit({setSchema:t}){t(e)}};if(`then`in e){let t;return{onRequestParse(){return{onRequestParseDone(){if(!t)return P(()=>e,e=>{t=e})}}},onEnveloped({setSchema:e}){if(!t)throw Error(`You provide a promise of a schema but it hasn't been resolved yet. Make sure you use this plugin with GraphQL Yoga.`);e(t)}}}let t=new WeakMap;return{onRequestParse({request:n,serverContext:r}){return{onRequestParseDone(){return P(()=>e({...r,request:n}),e=>{t.set(n,e)})}}},onEnveloped({setSchema:e,context:n}){if(n?.request==null)throw Error(`Request object is not available in the context. Make sure you use this plugin with GraphQL Yoga.`);let r=t.get(n.request);if(r==null)throw Error(`No schema found for this request. Make sure you use this plugin with GraphQL Yoga.`);e(r)}}};function _c(e,t={}){let{requireResolversForArgs:n,requireResolversForNonScalar:r,requireResolversForAllFields:i}=t;if(i&&(n||r))throw TypeError(`requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.`);js(e,(e,t,a)=>{i&&vc(`requireResolversForAllFields`,i,e,t,a),n&&e.args.length>0&&vc(`requireResolversForArgs`,n,e,t,a),r!==`ignore`&&!wt(zt(e.type))&&vc(`requireResolversForNonScalar`,r,e,t,a)})}function vc(e,t,n,r,i){if(!n.resolve){let n=`Resolver missing for "${r}.${i}".
77
- To disable this validator, use:
78
- resolverValidationOptions: {
79
- ${e}: 'ignore'
80
- }`;if(t===`error`)throw Error(n);t===`warn`&&console.warn(n);return}if(typeof n.resolve!=`function`)throw Error(`Resolver "${r}.${i}" must be a function`)}function yc(e,t){ps(e,{[I.ABSTRACT_TYPE]:e=>{if(!e.resolveType){let n=`Type "${e.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if(t===`error`)throw Error(n);t===`warn`&&console.warn(n)}}})}function bc(e,t){let n={},r=e.getTypeMap();for(let e in r){let i=r[e];if(`getInterfaces`in i){n[e]={};for(let r of i.getInterfaces())if(t[r.name])for(let i in t[r.name])(i===`__isTypeOf`||!i.startsWith(`__`))&&(n[e][i]=t[r.name][i]);let r=t[e];n[e]={...n[e],...r}}else{let r=t[e];r!=null&&(n[e]=r)}}return n}function xc({schema:e,resolvers:t,defaultFieldResolver:n,resolverValidationOptions:r={},inheritResolversFromInterfaces:i=!1,updateResolversInPlace:a=!1}){let{requireResolversToMatchSchema:o=`error`,requireResolversForResolveType:s}=r,c=i?bc(e,t):t;for(let t in c){let n=c[t];if(typeof n!=`object`)throw Error(`"${t}" defined in resolvers, but has invalid value "${n}". The resolver's value must be of type object.`);let r=e.getType(t);if(r==null){let e=`"${t}" defined in resolvers, but not in schema`;if(o&&o!==`error`){o===`warn`&&console.warn(e);continue}throw Error(e)}else if(gn(r))for(let e in n)e.startsWith(`__`)?r[e.substring(2)]=n[e]:r[e]=n[e];else if(Et(r)){let e=r.getValues();for(let t in n)if(!t.startsWith(`__`)&&!e.some(e=>e.name===t)&&o&&o!==`ignore`){let e=`${r.name}.${t} was defined in resolvers, but not present within ${r.name}`;if(o===`error`)throw Error(e);console.warn(e)}}else if(Tt(r)){for(let e in n)if(!e.startsWith(`__`)&&o&&o!==`ignore`){let t=`${r.name}.${e} was defined in resolvers, but ${r.name} is not an object or interface type`;if(o===`error`)throw Error(t);console.warn(t)}}else if(k(r)||A(r)){for(let e in n)if(!e.startsWith(`__`))if(r.getFields()[e]==null){if(o&&o!==`ignore`){let n=`${t}.${e} defined in resolvers, but not in schema`;if(o===`error`)throw Error(n);console.error(n)}}else{let r=n[e];if(typeof r!=`function`&&typeof r!=`object`)throw Error(`Resolver ${t}.${e} must be object or function`)}}}return e=a?Sc(e,c,n):Cc(e,c,n),s&&s!==`ignore`&&yc(e,s),e}function Sc(e,t,n){let r=e.getTypeMap();for(let n in t){let i=e.getType(n),a=t[n];if(wt(i))for(let e in a)e.startsWith(`__`)?i[e.substring(2)]=a[e]:e===`astNode`&&i.astNode!=null?i.astNode={...i.astNode,description:a?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(a?.astNode?.directives??[])}:e===`extensionASTNodes`&&i.extensionASTNodes!=null?i.extensionASTNodes=i.extensionASTNodes.concat(a?.extensionASTNodes??[]):e===`extensions`&&i.extensions!=null&&a.extensions!=null?i.extensions=Object.assign(Object.create(null),i.extensions,a.extensions):i[e]=a[e];else if(Et(i)){let e=i.toConfig(),t=e.values;for(let n in a)n.startsWith(`__`)?e[n.substring(2)]=a[n]:n===`astNode`&&e.astNode!=null?e.astNode={...e.astNode,description:a?.astNode?.description??e.astNode.description,directives:(e.astNode.directives??[]).concat(a?.astNode?.directives??[])}:n===`extensionASTNodes`&&e.extensionASTNodes!=null?e.extensionASTNodes=e.extensionASTNodes.concat(a?.extensionASTNodes??[]):n===`extensions`&&i.extensions!=null&&a.extensions!=null?i.extensions=Object.assign(Object.create(null),i.extensions,a.extensions):t[n]&&(t[n].value=a[n]);r[n]=new en(e)}else if(Tt(i))for(let e in a)e.startsWith(`__`)&&(i[e.substring(2)]=a[e]);else if(k(i)||A(i))for(let e in a){if(e.startsWith(`__`)){i[e.substring(2)]=a[e];continue}let t=i.getFields()[e];if(t!=null){let n=a[e];typeof n==`function`?t.resolve=n.bind(a):wc(t,n)}}}return Ms(e,ds),ks(e),Ms(e,fs),n!=null&&js(e,e=>{e.resolve||=n}),e}function Cc(e,t,n){return e=ps(e,{[I.SCALAR_TYPE]:e=>{let n=e.toConfig(),r=t[e.name];if(!gn(e)&&r!=null){for(let t in r)t.startsWith(`__`)?n[t.substring(2)]=r[t]:t===`astNode`&&n.astNode!=null?n.astNode={...n.astNode,description:r?.astNode?.description??n.astNode.description,directives:(n.astNode.directives??[]).concat(r?.astNode?.directives??[])}:t===`extensionASTNodes`&&n.extensionASTNodes!=null?n.extensionASTNodes=n.extensionASTNodes.concat(r?.extensionASTNodes??[]):t===`extensions`&&n.extensions!=null&&r.extensions!=null?n.extensions=Object.assign(Object.create(null),e.extensions,r.extensions):n[t]=r[t];return new Ht(n)}},[I.ENUM_TYPE]:e=>{let n=t[e.name],r=e.toConfig(),i=r.values;if(n!=null){for(let t in n)t.startsWith(`__`)?r[t.substring(2)]=n[t]:t===`astNode`&&r.astNode!=null?r.astNode={...r.astNode,description:n?.astNode?.description??r.astNode.description,directives:(r.astNode.directives??[]).concat(n?.astNode?.directives??[])}:t===`extensionASTNodes`&&r.extensionASTNodes!=null?r.extensionASTNodes=r.extensionASTNodes.concat(n?.extensionASTNodes??[]):t===`extensions`&&r.extensions!=null&&n.extensions!=null?r.extensions=Object.assign(Object.create(null),e.extensions,n.extensions):i[t]&&(i[t].value=n[t]);return new en(r)}},[I.UNION_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__resolveType&&(t.resolveType=n.__resolveType),new Qt(t)}},[I.OBJECT_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__isTypeOf&&(t.isTypeOf=n.__isTypeOf),new Ut(t)}},[I.INTERFACE_TYPE]:e=>{let n=t[e.name];if(n!=null){let t=e.toConfig();return n.__resolveType&&(t.resolveType=n.__resolveType),new Zt(t)}},[I.COMPOSITE_FIELD]:(e,n,r)=>{let i=t[r];if(i!=null){let t=i[n];if(t!=null){let n={...e};return typeof t==`function`?n.resolve=t.bind(i):wc(n,t),n}}}}),n!=null&&(e=ps(e,{[I.OBJECT_FIELD]:e=>({...e,resolve:e.resolve==null?n:e.resolve})})),e}function wc(e,t){for(let n in t)e[n]=t[n]}function Tc(e,t){if(!e||Array.isArray(e)&&e.length===0)return{};if(!Array.isArray(e))return e;if(e.length===1)return e[0]||{};let n=[];for(let t of e)Array.isArray(t)&&(t=Tc(t)),typeof t==`object`&&t&&n.push(t);let r=Ns(n,!0);if(t?.exclusions)for(let e of t.exclusions){let[t,n]=e.split(`.`);[`__proto__`,`constructor`,`prototype`].includes(t)||[`__proto__`,`constructor`,`prototype`].includes(n)||(!n||n===`*`?delete r[t]:r[t]&&delete r[t][n])}return r}function Ec(e,t,n){let r=Dc([...t,...e].filter(Aa),n);return n&&n.sort&&r.sort(ka),r}function Dc(e,t){return e.reduce((e,n)=>{let r=e.findIndex(e=>e.name.value===n.name.value);return r===-1?e.concat([n]):(t?.reverseArguments||(e[r]=n),e)},[])}function Oc(e,t,n){return!!(t?.[e.name.value]?.repeatable??n?.has(e.name.value))}function kc(e,t){return t.some(({value:t})=>t===e.value)}function Ac(e,t){let n=[];for(let r of[...t,...e]){let e=n.findIndex(e=>e.name.value===r.name.value);if(e===-1)n.push(r);else{let t=n[e];if(t.value.kind===`ListValue`){let e=t.value.values,n=r.value.values;t.value={...t.value,values:Ic(e,n,(e,t)=>{let n=e.value;return!n||!t.some(e=>e.value===n)})}}else t.value=r.value}}return n}const jc=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case C.LIST:return e.values.length===t.values.length&&e.values.every(e=>t.values.find(t=>jc(e,t)));case C.VARIABLE:case C.NULL:return!0;case C.OBJECT:return e.fields.length===t.fields.length&&e.fields.every(e=>t.fields.find(t=>e.name.value===t.name.value&&jc(e.value,t.value)));default:return e.value===t.value}return!1},Mc=(e,t)=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&jc(e.value,t.value),Nc=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every(e=>t.arguments?.find(t=>Mc(e,t)))));function Pc(e=[],t=[],n,r){let i=n&&n.reverseDirectives,a=i?e:t,o=i?t:e,s=[];for(let e of[...a,...o])if(Oc(e,r,n?.repeatableLinkImports))s.find(t=>Nc(e,t))||s.push(e);else{let t=s.findIndex(t=>t.name.value===e.name.value);if(t===-1)s.push(e);else{let n=Ac(e.arguments??[],s[t].arguments??[]);s[t]={...s[t],arguments:n.length===0?void 0:n}}}return s}function Fc(e,t){return t?{...e,arguments:Ic(t.arguments||[],e.arguments||[],(e,t)=>!kc(e.name,t.map(e=>e.name))),locations:[...t.locations,...e.locations.filter(e=>!kc(e,t.locations))]}:e}function Ic(e,t,n){return e.concat(t.filter(t=>n(t,e)))}function Lc(e,t,n,r){if(n?.consistentEnumMerge){let n=[];e&&n.push(...e),e=t,t=n}let i=new Map;if(e)for(let t of e)i.set(t.name.value,t);if(t)for(let e of t){let t=e.name.value;if(i.has(t)){let n=i.get(t);n.description=e.description||n.description,n.directives=Pc(e.directives,n.directives,r)}else i.set(t,e)}let a=[...i.values()];return n&&n.sort&&a.sort(ka),a}function Rc(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`EnumTypeDefinition`||t.kind===`EnumTypeDefinition`?`EnumTypeDefinition`:`EnumTypeExtension`,loc:e.loc,directives:Pc(e.directives,t.directives,n,r),values:Lc(e.values,t.values,n)}:n?.convertExtensions?{...e,kind:C.ENUM_TYPE_DEFINITION}:e}function zc(e){return typeof e==`string`}function Bc(e){return e instanceof Ue}function Vc(e){let t=e;for(;t.kind===C.LIST_TYPE||t.kind===`NonNullType`;)t=t.type;return t}function Hc(e){return e.kind!==C.NAMED_TYPE}function Uc(e){return e.kind===C.LIST_TYPE}function Wc(e){return e.kind===C.NON_NULL_TYPE}function Gc(e){return Uc(e)?`[${Gc(e.type)}]`:Wc(e)?`${Gc(e.type)}!`:e.name.value}var Kc;(function(e){e[e.A_SMALLER_THAN_B=-1]=`A_SMALLER_THAN_B`,e[e.A_EQUALS_B=0]=`A_EQUALS_B`,e[e.A_GREATER_THAN_B=1]=`A_GREATER_THAN_B`})(Kc||={});function qc(e,t){return e==null&&t==null?Kc.A_EQUALS_B:e==null?Kc.A_SMALLER_THAN_B:t==null?Kc.A_GREATER_THAN_B:e<t?Kc.A_SMALLER_THAN_B:e>t?Kc.A_GREATER_THAN_B:Kc.A_EQUALS_B}function Jc(e,t){let n=e.findIndex(e=>e.name.value===t.name.value);return[n>-1?e[n]:null,n]}function Yc(e,t,n,r,i){let a=[];if(n!=null&&a.push(...n),t!=null)for(let n of t){let[t,o]=Jc(a,n);if(t&&!r?.ignoreFieldConflicts){let s=r?.onFieldTypeConflict&&r.onFieldTypeConflict(t,n,e,r?.throwOnConflict)||Xc(e,t,n,r?.throwOnConflict);s.arguments=Ec(n.arguments||[],t.arguments||[],r),s.directives=Pc(n.directives,t.directives,r,i),s.description=n.description||t.description,a[o]=s}else a.push(n)}if(r&&r.sort&&a.sort(ka),r&&r.exclusions){let t=r.exclusions;return a.filter(n=>!t.includes(`${e.name.value}.${n.name.value}`))}return a}function Xc(e,t,n,r=!1){let i=Gc(t.type),a=Gc(n.type);if(i!==a){let o=Vc(t.type),s=Vc(n.type);if(o.name.value!==s.name.value)throw Error(`Field "${n.name.value}" already defined with a different type. Declared as "${o.name.value}", but you tried to override with "${s.name.value}"`);if(!Zc(t.type,n.type,!r))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${i}' to '${a}'`)}return Wc(n.type)&&!Wc(t.type)&&(t.type=n.type),t}function Zc(e,t,n=!1){return!Hc(e)&&!Hc(t)?e.toString()===t.toString():Wc(t)?Zc(Wc(e)?e.type:e,t.type):Wc(e)?Zc(t,e,n):Uc(e)?Uc(t)&&Zc(e.type,t.type)||Wc(t)&&Zc(e,t.type):!1}function Qc(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`InputObjectTypeDefinition`||t.kind===`InputObjectTypeDefinition`?`InputObjectTypeDefinition`:`InputObjectTypeExtension`,loc:e.loc,fields:Yc(e,e.fields,t.fields,n),directives:Pc(e.directives,t.directives,n,r)}}catch(t){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:C.INPUT_OBJECT_TYPE_DEFINITION}:e}function $c(e,t){return!!e.find(e=>e.name.value===t.name.value)}function el(e=[],t=[],n={}){let r=[...t,...e.filter(e=>!$c(t,e))];return n&&n.sort&&r.sort(ka),r}function tl(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`InterfaceTypeDefinition`||t.kind===`InterfaceTypeDefinition`?`InterfaceTypeDefinition`:`InterfaceTypeExtension`,loc:e.loc,fields:Yc(e,e.fields,t.fields,n,r),directives:Pc(e.directives,t.directives,n,r),interfaces:e.interfaces?el(e.interfaces,t.interfaces,n):void 0}}catch(t){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:C.INTERFACE_TYPE_DEFINITION}:e}function nl(e,t,n,r){return t?{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`ScalarTypeDefinition`||t.kind===`ScalarTypeDefinition`?`ScalarTypeDefinition`:`ScalarTypeExtension`,loc:e.loc,directives:Pc(e.directives,t.directives,n,r)}:n?.convertExtensions?{...e,kind:C.SCALAR_TYPE_DEFINITION}:e}const rl={query:`Query`,mutation:`Mutation`,subscription:`Subscription`};function il(e=[],t=[]){let n=[];for(let r in rl){let i=e.find(e=>e.operation===r)||t.find(e=>e.operation===r);i&&n.push(i)}return n}function al(e,t,n,r){return t?{kind:e.kind===C.SCHEMA_DEFINITION||t.kind===C.SCHEMA_DEFINITION?C.SCHEMA_DEFINITION:C.SCHEMA_EXTENSION,description:e.description||t.description,directives:Pc(e.directives,t.directives,n,r),operationTypes:il(e.operationTypes,t.operationTypes)}:n?.convertExtensions?{...e,kind:C.SCHEMA_DEFINITION}:e}function ol(e,t,n,r){if(t)try{return{name:e.name,description:e.description||t.description,kind:n?.convertExtensions||e.kind===`ObjectTypeDefinition`||t.kind===`ObjectTypeDefinition`?`ObjectTypeDefinition`:`ObjectTypeExtension`,loc:e.loc,fields:Yc(e,e.fields,t.fields,n,r),directives:Pc(e.directives,t.directives,n,r),interfaces:el(e.interfaces,t.interfaces,n)}}catch(t){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${t.message}`)}return n?.convertExtensions?{...e,kind:C.OBJECT_TYPE_DEFINITION}:e}function sl(e,t,n,r){return t?{name:e.name,description:e.description||t.description,directives:Pc(e.directives,t.directives,n,r),kind:n?.convertExtensions||e.kind===`UnionTypeDefinition`||t.kind===`UnionTypeDefinition`?C.UNION_TYPE_DEFINITION:C.UNION_TYPE_EXTENSION,loc:e.loc,types:el(e.types,t.types,n)}:n?.convertExtensions?{...e,kind:C.UNION_TYPE_DEFINITION}:e}const cl=`SCHEMA_DEF_SYMBOL`;function ll(e){return`name`in e}function ul(e,t,n={}){let r=n;for(let i of e)if(ll(i)){let e=i.name?.value;if(t?.commentDescriptions&&Vo(i),e==null)continue;if(t?.exclusions?.includes(e+`.*`)||t?.exclusions?.includes(e))delete r[e];else switch(i.kind){case C.OBJECT_TYPE_DEFINITION:case C.OBJECT_TYPE_EXTENSION:r[e]=ol(i,r[e],t,n);break;case C.ENUM_TYPE_DEFINITION:case C.ENUM_TYPE_EXTENSION:r[e]=Rc(i,r[e],t,n);break;case C.UNION_TYPE_DEFINITION:case C.UNION_TYPE_EXTENSION:r[e]=sl(i,r[e],t,n);break;case C.SCALAR_TYPE_DEFINITION:case C.SCALAR_TYPE_EXTENSION:r[e]=nl(i,r[e],t,n);break;case C.INPUT_OBJECT_TYPE_DEFINITION:case C.INPUT_OBJECT_TYPE_EXTENSION:r[e]=Qc(i,r[e],t,n);break;case C.INTERFACE_TYPE_DEFINITION:case C.INTERFACE_TYPE_EXTENSION:r[e]=tl(i,r[e],t,n);break;case C.DIRECTIVE_DEFINITION:r[e]&&e in{}&&(dl(r[e])||(r[e]=void 0)),r[e]=Fc(i,r[e]);break}}else(i.kind===C.SCHEMA_DEFINITION||i.kind===C.SCHEMA_EXTENSION)&&(r[cl]=al(i,r[cl],t));return r}function dl(e){return typeof e==`object`&&!!e&&`kind`in e&&typeof e.kind==`string`}function fl(e){return e.as??e.url.name}function pl(e){let t=fl(e);return t&&`@${t}`}function ml(e,t){if(e.url.name&&t===`@${e.url.name}`)return pl(e).substring(1);let n=e.imports.find(e=>e.name===t),r=n?.as??n?.name??hl(fl(e),t);return r.startsWith(`@`)?r.substring(1):r}function hl(e,t){return e?.length?t.startsWith(`@`)?`@${e}__${t.substring(1)}`:`${e}__${t}`:t}function gl(e){let t=[];for(let n of e.definitions)if(n.kind===C.SCHEMA_EXTENSION||n.kind===C.SCHEMA_DEFINITION){let e=(n.directives?.filter(e=>e.name.value===`link`))?.map(e=>_l(e.arguments??[])).filter(e=>e!==void 0)??[];t=t.concat(e);let r=(n.directives?.filter(({name:e})=>e.value===`core`))?.map(e=>vl(e.arguments??[])).filter(e=>e!==void 0);r&&(t=t.concat(...r))}return t}function _l(e){let t,n=[],r;for(let i of e)switch(i.name.value){case`url`:i.value.kind===C.STRING&&(t=xl(i.value.value));break;case`import`:n=yl(i.value);break;case`as`:i.value.kind===C.STRING&&(r=i.value.value??void 0);break;default:}if(t!==void 0)return{url:t,as:r,imports:n}}function vl(e){let t=e.find(({name:e,value:t})=>e.value===`feature`&&t.kind===C.STRING);if(t)return{url:xl(t.value.value),imports:[]}}function yl(e){return e.kind===C.LIST?e.values.map(e=>{let t;if(e.kind===C.STRING)t={name:e.value};else if(e.kind===C.OBJECT){let n=``,r;for(let t of e.fields)t.name.value===`name`?t.value.kind===C.STRING&&(n=t.value.value):t.name.value===`as`&&t.value.kind===C.STRING&&(r=t.value.value);t={name:n,as:r}}return t}).filter(e=>e!==void 0):[]}const bl=/v(\d{1,3})\.(\d{1,4})/i;function xl(e){let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean),r=n[n.length-1];if(r){if(bl.test(r)){let e=n[n.length-2];return{identity:t.origin+(e?`/${n.slice(0,n.length-1).join(`/`)}`:``),name:e??null,version:r}}return{identity:`${t.origin}/${n.join(`/`)}`,name:r,version:null}}return{identity:t.origin,name:null,version:null}}function Sl(e,t){Bo();let n={kind:C.DOCUMENT,definitions:wl(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})},r;return r=t?.commentDescriptions?Qo(n):n,Bo(),r}function Cl(e,t,n=[],r=[],i=new Set,a=new Set){let o=e=>{a.add(e)};if(e&&!i.has(e))if(i.add(e),typeof e==`function`)Cl(e(),t,n,r,i,a);else if(Array.isArray(e))for(let o of e)Cl(o,t,n,r,i,a);else if(Wn(e))Cl(So(e,t).definitions,t,n,r,i,a);else if(zc(e)||Bc(e))Cl(Ge(e,t).definitions,t,n,r,i,a);else if(typeof e==`object`&&vr(e)){let t=gl({definitions:[e],kind:C.DOCUMENT}),i=t.find(e=>e.url.identity===`https://specs.apollo.dev/federation`);i&&(o(ml(i,`@composeDirective`)),o(ml(i,`@key`)));let a=t.find(e=>e.url.identity===`https://specs.apollo.dev/link`);a&&o(ml(a,`@link`)),e.kind===C.DIRECTIVE_DEFINITION?n.push(e):r.push(e)}else if(Ks(e))Cl(e.definitions,t,n,r,i,a);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof e}`);return{allDirectives:n,allNodes:r,repeatableLinkImports:a}}function wl(e,t){Bo();let{allDirectives:n,allNodes:r,repeatableLinkImports:i}=Cl(e,t),a=ul(n,t);t.repeatableLinkImports=i;let o=ul(r,t,a);if(t?.useSchemaDefinition){let e=o.SCHEMA_DEF_SYMBOL||{kind:C.SCHEMA_DEFINITION,operationTypes:[]},t=e.operationTypes;for(let e in rl)if(!t.find(t=>t.operation===e)){let n=o[rl[e]];n!=null&&n.name!=null&&t.push({kind:C.OPERATION_TYPE_DEFINITION,type:{kind:C.NAMED_TYPE,name:n.name},operation:e})}e?.operationTypes?.length!=null&&e.operationTypes.length>0&&(o[cl]=e)}t?.forceSchemaDefinition&&!o.SCHEMA_DEF_SYMBOL?.operationTypes?.length&&(o[cl]={kind:C.SCHEMA_DEFINITION,operationTypes:[{kind:C.OPERATION_TYPE_DEFINITION,operation:`query`,type:{kind:C.NAMED_TYPE,name:{kind:C.NAME,value:`Query`}}}]});let s=Object.values(o);if(t?.sort){let e=typeof t.sort==`function`?t.sort:qc;s.sort((t,n)=>e(t.name?.value,n.name?.value))}return s}function Tl(e,t){if(!(!e||!t||t===e.extensions)){if(!e.extensions){e.extensions=t;return}e.extensions=Ns([e.extensions,t],!1,!0)}}function El(e,t){Tl(e,t.schemaExtensions);for(let[n,r]of Object.entries(t.types||{})){let t=e.getType(n);if(t){if(Tl(t,r.extensions),r.type===`object`||r.type===`interface`)for(let[e,n]of Object.entries(r.fields)){let r=t.getFields()[e];if(r){Tl(r,n.extensions);for(let[e,t]of Object.entries(n.arguments))Tl(r.args.find(t=>t.name===e),t)}}else if(r.type===`input`)for(let[e,n]of Object.entries(r.fields)){let r=t.getFields()[e];Tl(r,n.extensions)}else if(r.type===`enum`)for(let[e,n]of Object.entries(r.values))Tl(t.getValue(e),n)}}return e}function Dl({typeDefs:e,resolvers:t={},resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:i=!1,schemaExtensions:a,defaultFieldResolver:o,...s}){if(typeof n!=`object`)throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error(`Must provide typeDefs`);let c;if(c=Wn(e)?e:s?.commentDescriptions?Ta(Sl(e,{...s,commentDescriptions:!0}),s):wa(Sl(e,s),s),c=xc({schema:c,resolvers:Tc(t),resolverValidationOptions:n,inheritResolversFromInterfaces:r,updateResolversInPlace:i,defaultFieldResolver:o}),Object.keys(n).length>0&&_c(c,n),a)for(let e of Ea(a))El(c,e);return c}function Ol(e){return Dl(e)}function kl(e,t){let n={...t,...e};for(let r of Object.keys(n))r in e&&r in t&&(n[r]=(n,i)=>e[r](n,()=>t[r](n,i)));return n}const Al=e=>({fn(t,n){return t?(...r)=>{let i;return t(e,()=>{i=n(...r)}),i}:n},asyncFn(t,n){return t?(...r)=>{let i;return P(()=>t(e,()=>(i=n(...r),Ha(i)?i.then(()=>void 0):void 0)),()=>i)}:n}}),jl=new WeakMap;function Ml(e,t){let n=jl.get(e);return!n&&t&&(n=t(e),jl.set(e,n)),n}function Nl(e){return e.length===1?e[0]:{schema:e[0],document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],fieldResolver:e[6],subscribeFieldResolver:e[7]}}const Pl=e=>((...t)=>e(Nl(t)));function Fl(e){return e.length===1?e[0]:{schema:e[0],document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],fieldResolver:e[6],typeResolver:e[7]}}const Il=e=>((...t)=>e(Fl(t)));function Ll(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}function Rl(e,t){if(Ll(e.result))return{onNext:t};t({args:e.args,result:e.result,setResult:e.setResult})}function zl(e,t){let n;function r(){return n||=e[Symbol.asyncIterator](),n}let i=!1;return{[Symbol.asyncIterator](){return this},next(){return r().next().then(e=>(e.done&&i===!1&&(i=!0,t()),e))},return(){let e=r().return?.();return i===!1&&(i=!0,t()),e||Wa({done:!0,value:void 0})},throw(e){let t=r().throw?.();if(t)return t;throw e},[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)](){return Wa()}}}function Bl(e,t){let n;function r(){return n||=e[Symbol.asyncIterator](),n}return{[Symbol.asyncIterator](){return this},next(){return r().next().catch(e=>(t(e),{done:!0,value:void 0}))},return(){return r().return?.()||Wa({done:!0,value:void 0})},throw(e){let t=r().throw?.();if(t)return t;throw e},[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)](){return Wa()}}}function Vl(e){throw Error(`No \`${e}\` function found! Register it using "useEngine" plugin.`)}function Hl({plugins:e}){let t=null,n=!1,r=()=>Vl(`parse`),i=()=>Vl(`validate`),a=()=>Vl(`execute`),o=()=>Vl(`subscribe`),s,c=(r,i=-1)=>{if(t!==r&&(t=r,n))for(let[n,r]of e.entries())n!==i&&r.onSchemaChange&&r.onSchemaChange({schema:t,replaceSchema:e=>{c(e,n)}})},l=[];for(let t=0;t<e.length;t++){let n=e[t],r=[];n.onPluginInit?.({plugins:e,addPlugin:e=>{r.push(e)},setSchema:e=>c(e,t),registerContextErrorHandler:e=>l.push(e)}),r.length&&e.splice(t+1,0,...r)}let u={init:[],parse:[],validate:[],subscribe:[],execute:[],context:[]};for(let{onContextBuilding:t,onExecute:n,onParse:r,onSubscribe:i,onValidate:a,onEnveloped:o,instrumentation:c}of e)o&&u.init.push(o),t&&u.context.push(t),n&&u.execute.push(n),r&&u.parse.push(r),i&&u.subscribe.push(i),a&&u.validate.push(a),c&&(s=s?kl(s,c):c);let d=e=>{for(let[t,n]of u.init.entries())n({context:e,extendContext:t=>{e&&Object.assign(e,t)},setSchema:e=>c(e,t)})},f=u.parse.length?e=>(t,n)=>{let i=null,a=r,o=e,s=[];for(let e of u.parse){let r=e({context:o,extendContext:e=>{Object.assign(o,e)},params:{source:t,options:n},parseFn:a,setParseFn:e=>{a=e},setParsedDocument:e=>{i=e}});r&&s.push(r)}if(i===null)try{i=a(t,n)}catch(e){i=e}for(let e of s)e({context:o,extendContext:e=>{Object.assign(o,e)},replaceParseResult:e=>{i=e},result:i});if(i===null)throw Error(`Failed to parse document.`);if(i instanceof Error)throw i;return jl.set(i,t.toString()),i}:()=>r,p=u.validate.length?e=>(t,n,r,a,o)=>{let s=r?[...r]:void 0,c=i,l=null,d=e,f=[];for(let e of u.validate){let r=e({context:d,extendContext:e=>{Object.assign(d,e)},params:{schema:t,documentAST:n,rules:s,typeInfo:a,options:o},validateFn:c,addValidationRule:e=>{s||=[],s.push(e)},setValidationFn:e=>{c=e},setResult:e=>{l=e}});r&&f.push(r)}if(l||=c(t,n,s,a,o),!l)return;let p=l.length===0;for(let e of f)e({valid:p,result:l,context:d,extendContext:e=>{Object.assign(d,e)},setResult:e=>{l=e}});return l}:()=>i,m=u.context.length?e=>t=>{let n=[],r=e;t&&Object.assign(r,t);let i=!1;return P(()=>Ka(u.context,(e,t)=>e({context:r,extendContext:e=>{Object.assign(r,e)},breakContextBuilding:()=>{i=!0,t()}}),n),()=>i?r:P(()=>Ka(n,e=>e({context:r,extendContext(e){Object.assign(r,e)}})),()=>r),e=>{let t=e;for(let e of l)e({context:r,error:t,setError:e=>{t=e}});throw t})}:e=>t=>(t&&Object.assign(e,t),e),h=u.subscribe.length?Pl(e=>{let t=o,n=[],r=e.contextValue||{},i;return P(()=>Ka(u.subscribe,(n,a)=>n({subscribeFn:t,setSubscribeFn:e=>{t=e},context:r,extendContext:e=>{Object.assign(r,e)},args:e,setResultAndStopExecution:e=>{i=e,a()}}),n),()=>{let r=[],a=[];for(let{onSubscribeResult:e,onSubscribeError:t}of n)e&&r.push(e),t&&a.push(t);return P(()=>i||t(e),t=>{let n=[],i=[];for(let a of r){let r=a({args:e,result:t,setResult:e=>{t=e}});r&&(r.onNext&&n.push(r.onNext),r.onEnd&&i.push(r.onEnd))}return n.length&&Ll(t)&&(t=Ya(t,t=>P(()=>Ka(n,n=>n({args:e,result:t,setResult:e=>t=e})),()=>t))),i.length&&Ll(t)&&(t=zl(t,()=>{for(let e of i)e()})),a.length&&Ll(t)&&(t=Bl(t,e=>{let t=e;for(let e of a)e({error:t,setError:e=>{t=e}});throw t})),t})})}):Pl(o),g=u.execute.length?Il(e=>{let t=a,n,r=[],i=[],o=e.contextValue||{};return P(()=>Ka(u.execute,(r,i)=>r({executeFn:t,setExecuteFn:e=>{t=e},setResultAndStopExecution:e=>{n=e,i()},context:o,extendContext:e=>{if(typeof e==`object`)Object.assign(o,e);else throw Error(`Invalid context extension provided! Expected "object", got: "${JSON.stringify(e)}" (${typeof e})`)},args:e}),r),()=>P(()=>n||t({...e,contextValue:o}),t=>P(()=>Ka(r,n=>n.onExecuteDone?.({args:e,result:t,setResult:e=>{t=e}}),i),()=>{let n=[],r=[];for(let{onNext:e,onEnd:t}of i)e&&n.push(e),t&&r.push(t);return n.length&&Ll(t)&&(t=Ya(t,t=>P(()=>Ka(n,n=>n({args:e,result:t,setResult:e=>{t=e}})),()=>t))),r.length&&Ll(t)&&(t=zl(t,()=>{for(let e of r)e()})),t})))}):Il(a);if(n=!0,t)for(let[n,r]of e.entries())r.onSchemaChange?.({schema:t,replaceSchema:e=>c(e,n)});return{getCurrentSchema(){return t},init:d,parse:f,validate:p,execute:g,subscribe:h,contextFactory:m,instrumentation:s}}function Ul(e){return e!=null}function Wl(e){let t=e.plugins.filter(Ul),n=Hl({plugins:t}),r=n.instrumentation,i=(e={})=>{let t=Al({context:e}),i=n;return t.fn(r?.init,n.init)(e),{parse:t.fn(r?.parse,i.parse(e)),validate:t.fn(r?.validate,i.validate(e)),contextFactory:t.fn(r?.context,i.contextFactory(e)),execute:t.asyncFn(r?.execute,i.execute),subscribe:t.asyncFn(r?.subscribe,i.subscribe),schema:i.getCurrentSchema()}};return i._plugins=t,i}function Gl(e){return e instanceof Error&&e.name===`GraphQLError`}function Kl(e){return Gl(e)?e.originalError==null?!0:Kl(e.originalError):!1}function ql(e,t,n){let r=Error(e);if(r.name=`GraphQLError`,n){let e=t instanceof Error?{message:t.message,stack:t.stack}:{message:String(t)};Object.defineProperty(r,"extensions",{get(){return e}})}return Object.defineProperty(r,"toJSON",{value(){return{message:r.message,extensions:r.extensions}}}),r}const Jl=(e=>(t,n)=>Kl(t)?t:ql(n,t,e))(!1),Yl=(e,t)=>({result:n,setResult:r})=>{n.errors!=null&&r({...n,errors:n.errors.map(n=>e(n,t))})};function Xl(e){let t=e?.maskError??Jl,n=e?.errorMessage||`Unexpected error.`,r=Yl(t,n);return{onPluginInit(e){e.registerContextErrorHandler(({error:e,setError:r})=>{r(t(e,n))})},onExecute(){return{onExecuteDone(e){return Rl(e,r)}}},onSubscribe(){return{onSubscribeResult(e){return Rl(e,r)},onSubscribeError({error:e,setError:r}){r(t(e,n))}}}}}const Zl=e=>({result:t,args:n})=>{t.errors?.length&&e({errors:t.errors,context:n,phase:`execution`})},Ql=e=>{let t=Zl(e);return{onParse(){return function({result:t,context:n}){t instanceof Error&&e({errors:[t],context:n,phase:`parse`})}},onValidate(){return function({valid:t,result:n,context:r}){t===!1&&n.length>0&&e({errors:n,context:r,phase:`validate`})}},onPluginInit(t){t.registerContextErrorHandler(({error:n})=>{Gl(n)?e({errors:[n],context:t,phase:`context`}):e({errors:[Error(n)],context:t,phase:`context`})})},onExecute(){return{onExecuteDone(e){return Rl(e,t)}}},onSubscribe(){return{onSubscribeResult(e){return Rl(e,t)}}}}},$l=e=>({onContextBuilding({context:t,extendContext:n}){return P(()=>e(t),e=>n(e))}}),eu=e=>({onExecute:({setExecuteFn:t})=>{e.execute&&t(e.execute)},onParse:({setParseFn:t})=>{e.parse&&t(e.parse)},onValidate:({setValidationFn:t,addValidationRule:n})=>{e.validate&&t(e.validate),e.specifiedRules?.map(n)},onSubscribe:({setSubscribeFn:t})=>{e.subscribe&&t(e.subscribe)}});var tu=class extends Error{error;suppressed;constructor(e,t,n){super(n),this.error=e,this.suppressed=t,this.name=`SuppressedError`,Error.captureStackTrace(this,this.constructor)}};const nu={get dispose(){return Symbol.dispose||Symbol.for(`dispose`)},get asyncDispose(){return Symbol.asyncDispose||Symbol.for(`asyncDispose`)}};function ru(e){return e?.[nu.dispose]!=null}function iu(e){return e?.[nu.asyncDispose]!=null}const au=globalThis.SuppressedError||tu;var ou=class e{callbacks=[];get disposed(){return this.callbacks.length===0}use(e){return iu(e)?this.callbacks.push(()=>e[nu.asyncDispose]()):ru(e)&&this.callbacks.push(()=>e[nu.dispose]()),e}adopt(e,t){return t&&this.callbacks.push(()=>t(e)),e}defer(e){e&&this.callbacks.push(e)}move(){let t=new e;return t.callbacks=this.callbacks,this.callbacks=[],t}disposeAsync(){return this[nu.asyncDispose]()}_error;_iterateCallbacks(){let e=this.callbacks.pop();if(e)return P(e,()=>this._iterateCallbacks(),e=>(this._error=this._error?new au(e,this._error):e,this._iterateCallbacks()))}[nu.asyncDispose](){let e=this._iterateCallbacks();if(e?.then)return e.then(()=>{if(this._error){let e=this._error;throw this._error=void 0,e}});if(this._error){let e=this._error;throw this._error=void 0,e}}[Symbol.toStringTag]=`AsyncDisposableStack`};globalThis.SuppressedError,nu.dispose,globalThis.DisposableStack;const su=globalThis.AsyncDisposableStack||ou;globalThis.SuppressedError;function cu(e){if(e instanceof Error)return e;if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`){let t;`cause`in e&&(t={cause:e.cause});let n=Error(e.message,t);return`stack`in e&&typeof e.stack==`string`&&(n.stack=e.stack),`name`in e&&typeof e.name==`string`&&(n.name=e.name),n}return Error(String(e))}function lu(e){let t=e[Symbol.asyncIterator](),n,r,i=!1;async function a(){if(i)return{value:void 0,done:!0};try{if(!n){if(r)return await r,await a();let e;r=new Promise(t=>{e=t});let o=await t.next();return o.done?(i=!0,await a()):(n=o.value[Symbol.asyncIterator](),r=void 0,e(),await a())}let e=n,o=await n.next();return o.done?(n===e&&(n=void 0),await a()):o}catch(e){throw i=!0,e}}return{next:a,async return(){return i=!0,await Promise.all([n?.return?.(),t.return?.()]),{value:void 0,done:!0}},async throw(e){throw i=!0,await Promise.all([n?.throw?.(e),t.throw?.(e)]),e},[Symbol.asyncIterator](){return this},async[nu.asyncDispose](){i=!0,await Promise.all([n?.[nu.asyncDispose]?.(),t?.[nu.asyncDispose]?.()])}}}function uu(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}function du(e,t,n){t?.throwIfAborted();let r=Object.create(null),i=[];for(let t in e){let n=P(()=>e[t],e=>{r[t]=e});Ha(n)&&i.push(n)}if(!i.length)return r;let a=i.length===1?i[0]:Promise.all(i);return n?Promise.race([n,a]).then(()=>r):a.then(()=>r)}function fu(e,t,n,r){let i=[],a=r?.maxErrors;try{let r=pu(e,t,n,e=>{if(a!=null&&i.length>=a)throw N(`Too many errors processing variables, error limit reached. Execution aborted.`);i.push(e)});if(i.length===0)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function pu(e,t,n,r){let i={};for(let a of t){let t=a.variable.name.value,o=mr(e,a.type);if(!kt(o)){r(N(`Variable "$${t}" expected value of type "${ht(a.type)}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!io(n,t)){a.defaultValue?i[t]=Di(a.defaultValue,o):j(o)&&r(N(`Variable "$${t}" of required type "${ja(o)}" was not provided.`,{nodes:a}));continue}let s=n[t];if(s===null&&j(o)){r(N(`Variable "$${t}" of non-null type "${ja(o)}" must not be null.`,{nodes:a}));continue}i[t]=wi(s,o,(e,n,i)=>{let o=`Variable "$${t}" got invalid value `+ja(n);e.length>0&&(o+=` at "${t}${Ys(e)}"`),r(N(o+`; `+i.message,{nodes:a,originalError:i}))})}return i}const mu=so((e,t,n)=>Ws(e.schema,e.fragments,e.variableValues,t,n));function hu(e){let t=yu(e);return`schema`in t?gu(t):{errors:t.map(e=>(Object.defineProperty(e,"extensions",{value:{...e.extensions,http:{...e.extensions?.http||{},status:400}}}),e))}}function gu(e){return e.signal?.throwIfAborted(),P(()=>xu(e),t=>{let n=_u(t,e.errors);return e.subsequentPayloads.size>0?{initialResult:{...n,hasNext:!0},subsequentResults:td(e)}:n},t=>(e.signal?.throwIfAborted(),t.errors?e.errors.push(...t.errors):e.errors.push(t),_u(null,e.errors)))}function _u(e,t){return t.length===0?{data:e}:{errors:t,data:e}}const vu=oo(function(e){let t=Object.create(null);for(let n of e.definitions)n.kind===C.FRAGMENT_DEFINITION&&(t[n.name.value]=n);return t});function yu(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c,subscribeFieldResolver:l,signal:u}=e;u?.throwIfAborted(),Yn(t);let d=vu(n),f;for(let e of n.definitions)switch(e.kind){case C.OPERATION_DEFINITION:if(o==null){if(f!==void 0)return[N(`Must provide operation name if query contains multiple operations.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})];f=e}else e.name?.value===o&&(f=e);break;default:}if(f==null)return o==null?[N(`Must provide an operation.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})]:[N(`Unknown operation named "${o}".`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`}})];let p=fu(t,f.variableDefinitions??[],a??{},{maxErrors:50});if(p.errors)return p.errors;u?.throwIfAborted();let m,h;if(u){let e=new Set,t=Ga();h=t.promise;let n=()=>{t.reject(u.reason),u.removeEventListener(`abort`,n)};u.addEventListener(`abort`,n,{once:!0}),h.catch(()=>{for(let t of e)t();e.clear()}),m=t=>{e.add(t)}}return{schema:t,fragments:d,rootValue:r,contextValue:i,operation:f,variableValues:p.coerced,fieldResolver:s??zu,typeResolver:c??Ru,subscribeFieldResolver:l??zu,subsequentPayloads:new Set,errors:[],signal:u,onSignalAbort:m,signalPromise:h}}function bu(e,t){return{...e,rootValue:t,subsequentPayloads:new Set,errors:[]}}function xu(e){let{operation:t,schema:n,fragments:r,variableValues:i,rootValue:a}=e,o=bo(n,t.operation,[t]);o??N(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let{fields:s,patches:c}=zs(n,r,i,o,t.selectionSet),l;l=t.operation===`mutation`?Su(e,o,a,void 0,s):Cu(e,o,a,void 0,s);for(let t of c){let{label:n,fields:r}=t;Yu(e,o,a,r,n,void 0)}return l}function Su(e,t,n,r,i){return ro(i,(i,[a,o])=>{let s=qs(r,a,t.name);return e.signal?.throwIfAborted(),P(()=>wu(e,t,n,o,s),e=>(e===void 0||(i[a]=e),i))},Object.create(null))}function Cu(e,t,n,r,i,a){let o=Object.create(null),s=!1;try{for(let[c,l]of i){e.signal?.throwIfAborted();let i=wu(e,t,n,l,qs(r,c,t.name),a);i!==void 0&&(o[c]=i,Ha(i)&&(s=!0))}}catch(t){if(t!==e.signal?.reason&&s)return P(()=>du(o,e.signal),()=>{throw t},()=>{throw t});throw t}return s?du(o,e.signal,e.signalPromise):o}function wu(e,t,n,r,i,a){let o=a?.errors??e.errors,s=ad(e.schema,t,r[0]);if(!s)return;let c=s.type,l=s.resolve??e.fieldResolver,u=Tu(e,s,r,t,i);try{e.signal?.throwIfAborted();let t=ao(s,r[0],e.variableValues),d=e.contextValue,f=l(n,t,d,u),p;return p=Ha(f)?f.then(t=>Du(e,c,r,u,i,t,a)):Du(e,c,r,u,i,f,a),Ha(p)?p.then(void 0,t=>{if(t instanceof AggregateError){let n;for(let s of t.errors)s=cu(s),n=Eu(ha(s,r,Js(i)),c,o),$u(e,i,a);return n}t=cu(t);let n=Eu(ha(t,r,Js(i)),c,o);return $u(e,i,a),n}):p}catch(t){if(t instanceof AggregateError){let n;for(let s of t.errors)s=cu(s),n=Eu(ha(s,r,Js(i)),c,o),$u(e,i,a);return n}let n=Eu(ha(cu(t),r,Js(i)),c,o);return $u(e,i,a),n}}function Tu(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues,signal:e.signal}}function Eu(e,t,n){if(j(t)||e.extensions?.CRITICAL_ERROR)throw e;return n.push(e),null}function Du(e,t,n,r,i,a,o){if(a instanceof Error)throw a;if(j(t)){let s=Du(e,t.ofType,n,r,i,a,o);if(s===null)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return s}if(a==null)return null;if(Ot(t))return Au(e,t,n,r,i,a,o);if(jt(t))return Mu(t,a);if(Nt(t))return Nu(e,t,n,r,i,a,o);if(k(t))return Fu(e,t,n,r,i,a,o);console.assert(!1,`Cannot complete value of unexpected output type: `+ja(t))}function Ou(e,t,n){if(typeof n.key==`number`)return;let r=Ai(Ls,t[0],e.variableValues);if(r&&r.if!==!1)return uu(typeof r.initialCount==`number`,`initialCount must be a number`),uu(r.initialCount>=0,`initialCount must be a positive integer`),{initialCount:r.initialCount,label:typeof r.label==`string`?r.label:void 0}}async function ku(e,t,n,r,i,a,o){e.signal?.throwIfAborted(),a.return&&e.onSignalAbort?.(()=>{a.return?.()});let s=o?.errors??e.errors,c=Ou(e,n,i),l=!1,u=[],d=0;for(;;){if(c&&typeof c.initialCount==`number`&&d>=c.initialCount){Qu(d,a,e,n,r,t,i,c.label,o);break}let f=qs(i,d,void 0),p;try{if(p=await a.next(),p.done)break}catch(e){let r=ha(cu(e),n,Js(f));u.push(Eu(r,t,s));break}ju(p.value,u,s,e,t,n,r,f,o)&&(l=!0),d+=1}return l?Promise.all(u):u}function Au(e,t,n,r,i,a,o){let s=t.ofType,c=o?.errors??e.errors;if(Gs(a))return ku(e,s,n,r,i,a[Symbol.asyncIterator](),o);if(!to(a))throw N(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let l=Ou(e,n,i),u=!1,d=o,f=[],p=0;for(let t of a){let a=qs(i,p,void 0);if(l&&typeof l.initialCount==`number`&&p>=l.initialCount){d=Xu(i,a,t,e,n,r,s,l.label,d),p++;continue}ju(t,f,c,e,s,n,r,a,o)&&(u=!0),p++}return u?Promise.all(f):f}function ju(e,t,n,r,i,a,o,s,c){try{let l;if(l=Ha(e)?e.then(e=>Du(r,i,a,o,s,e,c)):Du(r,i,a,o,s,e,c),Ha(l))return t.push(l.then(void 0,e=>{e=cu(e);let t=Eu(ha(e,a,Js(s)),i,n);return $u(r,s,c),t})),!0;t.push(l)}catch(e){let o=Eu(ha(cu(e),a,Js(s)),i,n);$u(r,s,c),t.push(o)}return!1}function Mu(e,t){let n;try{n=e.serialize(t)}catch(e){throw e instanceof b?Error(e.message):e}if(n==null)throw Error(`Expected \`${ja(e)}.serialize(${ja(t)})\` to return non-nullable value, returned: ${ja(n)}`);return n}function Nu(e,t,n,r,i,a,o){let s=t.resolveType??e.typeResolver,c=e.contextValue,l=s(a,c,r,t);return Ha(l)?l.then(s=>Fu(e,Pu(s,e,t,n,r,a),n,r,i,a,o)):Fu(e,Pu(l,e,t,n,r,a),n,r,i,a,o)}function Pu(e,t,n,r,i,a){if(e==null)throw N(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,{nodes:r});if(k(e)){if(f.major>=16)throw N(`Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.`);e=e.name}if(typeof e!=`string`)throw N(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${ja(a)}, received "${ja(e)}".`);let o=t.schema.getType(e);if(o==null)throw N(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!k(o))throw N(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw N(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Fu(e,t,n,r,i,a,o){if(t.isTypeOf){let s=t.isTypeOf(a,e.contextValue,r);if(Ha(s))return s.then(r=>{if(!r)throw Iu(t,a,n);return Lu(e,t,n,i,a,o)});if(!s)throw Iu(t,a,n)}return Lu(e,t,n,i,a,o)}function Iu(e,t,n){return N(`Expected value of type "${e.name}" but got: ${ja(t)}.`,{nodes:n})}function Lu(e,t,n,r,i,a){let{fields:o,patches:s}=mu(e,t,n),c=Cu(e,t,i,r,o,a);for(let n of s){let{label:o,fields:s}=n;Yu(e,t,i,s,o,r,a)}return c}const Ru=function(e,t,n,r){if(no(e)&&typeof e.__typename==`string`)return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let r=0;r<i.length;r++){let o=i[r];if(o.isTypeOf){let i=o.isTypeOf(e,t,n);if(Ha(i))a[r]=i;else if(i)return o.name}}if(a.length)return Promise.all(a).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},zu=function(e,t,n,r){if(no(e)||typeof e==`function`){let i=e[r.fieldName];return typeof i==`function`?e[r.fieldName](t,n,r):i}};function Bu(e){let t=yu(e);if(!(`schema`in t)){for(let e of t){let t=e.extensions||={},n=t.http||={};n.status=400,e.extensions.code=`BAD_USER_INPUT`}return{errors:t}}let n=Ku(t);return Ha(n)?n.then(e=>Wu(t,e)):Wu(t,n)}function Vu(e){return e?.initialResult}function Hu(e){let t=e.subsequentResults,n=!1,r=!1;return{[Symbol.asyncIterator](){return this},next(){return r?Wa({value:void 0,done:r}):n?t.next():(n=!0,Wa({value:e.initialResult,done:r}))},return(){return r=!0,t.return()},throw(e){return r=!0,t.throw(e)},[nu.asyncDispose](){return r=!0,t?.[nu.asyncDispose]?.()}}}async function*Uu(e){`initialResult`in e?yield*Hu(e):yield e}function Wu(e,t){return Gs(t)?lu(Ya(t,t=>P(()=>gu(bu(e,t)),Uu),t=>{throw t instanceof AggregateError?AggregateError(t.errors.map(t=>Gu(t,e.operation)),t.message):Gu(t,e.operation)})):t}function Gu(e,t){return N(e.message,{originalError:e,nodes:[t]})}function Ku(e){try{let t=qu(e);return Ha(t)?t.then(void 0,e=>({errors:[e]})):t}catch(e){return{errors:[e]}}}function qu(e){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw N(`Schema is not configured to execute subscription operation.`,{nodes:r});let{fields:s}=zs(t,n,i,o,r.selectionSet),[c,l]=[...s.entries()][0],u=l[0].name.value,d=ad(t,o,l[0]);if(!d)throw N(`The subscription field "${u}" is not defined.`,{nodes:l});let f=qs(void 0,c,o.name),p=Tu(e,d,l,o,f);try{let t=ao(d,l[0],i),n=e.contextValue,r=(d.subscribe??e.subscribeFieldResolver)(a,t,n,p);return Ha(r)?r.then(t=>Ju(t,e.signal,e.onSignalAbort)).then(void 0,e=>{throw ha(e,l,Js(f))}):Ju(r,e.signal,e.onSignalAbort)}catch(e){throw ha(e,l,Js(f))}}function Ju(e,t,n){if(t?.throwIfAborted(),e instanceof Error)throw e;if(!Gs(e))throw N(`Subscription field must return Async Iterable. Received: ${ja(e)}.`);return n?{[Symbol.asyncIterator](){let t=e[Symbol.asyncIterator]();return t.return&&n?.(()=>{t.return?.()}),t}}:e}function Yu(e,t,n,r,i,a,o){let s=new nd({label:i,path:a,parentContext:o,exeContext:e}),c;try{c=Cu(e,t,n,a,r,s),Ha(c)&&(c=c.then(null,e=>(s.errors.push(e),null)))}catch(e){s.errors.push(e),c=null}s.addData(c)}function Xu(e,t,n,r,i,a,o,s,c){let l=new rd({label:s,path:t,parentContext:c,exeContext:r}),u;try{try{u=Ha(n)?n.then(e=>Du(r,o,i,a,t,e,l)):Du(r,o,i,a,t,n,l),Ha(u)&&(u=u.then(void 0,e=>{e=cu(e);let n=Eu(ha(e,i,Js(t)),o,l.errors);return $u(r,t,l),n}))}catch(e){u=Eu(ha(cu(e),i,Js(t)),o,l.errors),$u(r,t,l)}}catch(t){return l.errors.push(t),$u(r,e,l),l.addItems(null),l}let d;return d=Ha(u)?u.then(e=>[e],t=>(l.errors.push(t),$u(r,e,l),null)):[u],l.addItems(d),l}async function Zu(e,t,n,r,i,a,o){let s;try{let{value:t,done:n}=await e.next();if(n)return a.setIsCompletedIterator(),{done:n,value:void 0};s=t}catch(e){return{done:!0,value:Eu(ha(cu(e),n,Js(o)),i,a.errors)}}let c;try{return c=Du(t,i,n,r,o,s,a),Ha(c)&&(c=c.then(void 0,e=>{let r=Eu(ha(e,n,Js(o)),i,a.errors);return $u(t,o,a),r})),{done:!1,value:c}}catch(e){let r=Eu(ha(e,n,Js(o)),i,a.errors);return $u(t,o,a),{done:!1,value:r}}}async function Qu(e,t,n,r,i,a,o,s,c){let l=e,u=c??void 0;for(;;){let e=qs(o,l,void 0),c=new rd({label:s,path:e,parentContext:u,iterator:t,exeContext:n}),d;try{d=await Zu(t,n,r,i,a,c,e)}catch(e){c.errors.push(e),$u(n,o,c),c.addItems(null),t?.return&&t.return().catch(()=>{});return}let{done:f,value:p}=d,m;if(m=Ha(p)?p.then(e=>[e],e=>(c.errors.push(e),$u(n,o,c),null)):[p],c.addItems(m),f)break;u=c,l++}}function $u(e,t,n){let r=Js(t);e.subsequentPayloads.forEach(t=>{if(t!==n){for(let e=0;e<r.length;e++)if(t.path[e]!==r[e])return;id(t)&&t.iterator?.return&&t.iterator.return().catch(()=>{}),e.subsequentPayloads.delete(t)}})}function ed(e){let t=[];for(let n of e.subsequentPayloads){let r={};if(n.isCompleted){if(e.subsequentPayloads.delete(n),id(n)){let e=n.items;if(n.isCompletedIterator)continue;r.items=e}else r.data=n.data??null;r.path=n.path,n.label&&(r.label=n.label),n.errors.length>0&&(r.errors=n.errors),t.push(r)}}return t}function td(e){let t=!1;async function n(){if(t)return{value:void 0,done:!0};let r=Array.from(e.subsequentPayloads).map(e=>e.promise);if(e.signalPromise?await Promise.race([e.signalPromise,...r]):await Promise.race(r),t)return{value:void 0,done:!0};let i=ed(e),a=e.subsequentPayloads.size>0;return!i.length&&a?n():(a||(t=!0),{value:i.length?{incremental:i,hasNext:a}:{hasNext:a},done:!1})}function r(){let t=[];return e.subsequentPayloads.forEach(e=>{id(e)&&e.iterator?.return&&t.push(e.iterator.return())}),Promise.all(t)}return{[Symbol.asyncIterator](){return this},next:n,async return(){return await r(),t=!0,{value:void 0,done:!0}},async throw(e){throw await r(),t=!0,e},async[nu.asyncDispose](){await r(),t=!0}}}var nd=class{type;errors;label;path;promise;data;parentContext;isCompleted;_exeContext;_resolve;constructor(e){this.type=`defer`,this.label=e.label,this.path=Js(e.path),this.parentContext=e.parentContext,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=!1,this.data=null,this.promise=new Promise(e=>{this._resolve=t=>{e(t)}}).then(e=>{this.data=e,this.isCompleted=!0})}addData(e){let t=this.parentContext?.promise;if(t){this._resolve?.(t.then(()=>e));return}this._resolve?.(e)}},rd=class{type;errors;label;path;items;promise;parentContext;iterator;isCompletedIterator;isCompleted;_exeContext;_resolve;constructor(e){this.type=`stream`,this.items=null,this.label=e.label,this.path=Js(e.path),this.parentContext=e.parentContext,this.iterator=e.iterator,this.errors=[],this._exeContext=e.exeContext,this._exeContext.subsequentPayloads.add(this),this.isCompleted=!1,this.items=null,this.promise=new Promise(e=>{this._resolve=t=>{e(t)}}).then(e=>{this.items=e,this.isCompleted=!0})}addItems(e){let t=this.parentContext?.promise;if(t){this._resolve?.(t.then(()=>e));return}this._resolve?.(e)}setIsCompletedIterator(){this.isCompletedIterator=!0}};function id(e){return e.type===`stream`}function ad(e,t,n){let r=n.name.value;return r===zn.name&&e.getQueryType()===t?zn:r===Bn.name&&e.getQueryType()===t?Bn:r===Vn.name?Vn:t.getFields()[r]}function od(e){let t=va(e.document,e.operationName);if(t==null)throw Error(`Must provide an operation.`);return t.operation===`subscription`?Bu(e):P(()=>hu(e),e=>Vu(e)?Hu(e):e)}var sd=s(((e,t)=>{t.exports.fetch=globalThis.fetch,t.exports.Headers=globalThis.Headers,t.exports.Request=globalThis.Request,t.exports.Response=globalThis.Response,t.exports.FormData=globalThis.FormData,t.exports.ReadableStream=globalThis.ReadableStream,t.exports.WritableStream=globalThis.WritableStream,t.exports.TransformStream=globalThis.TransformStream,t.exports.CompressionStream=globalThis.CompressionStream,t.exports.DecompressionStream=globalThis.DecompressionStream,t.exports.TextDecoderStream=globalThis.TextDecoderStream,t.exports.TextEncoderStream=globalThis.TextEncoderStream,t.exports.Blob=globalThis.Blob,t.exports.File=globalThis.File,t.exports.crypto=globalThis.crypto,t.exports.btoa=globalThis.btoa,t.exports.TextEncoder=globalThis.TextEncoder,t.exports.TextDecoder=globalThis.TextDecoder,t.exports.URLPattern=globalThis.URLPattern,t.exports.URL=globalThis.URL,t.exports.URLSearchParams=globalThis.URLSearchParams,t.exports.createFetch=()=>globalThis}));function cd(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}function ld(e){return e.socket?.localPort?e.socket?.localPort:(e.headers?.[`:authority`]||e.headers?.host)?.split(`:`)?.[1]||80}function ud(e){if(e.headers?.[`:authority`])return e.headers?.[`:authority`];if(e.headers?.host)return e.headers?.host;let t=ld(e);if(e.hostname)return e.hostname+`:`+t;let n=e.socket?.localAddress;return n&&!n?.includes(`::`)&&!n?.includes(`ffff`)?`${n}:${t}`:`localhost`}function dd(e){let t=ud(e);return`${e.protocol||(e.socket?.encrypted?`https`:`http`)}://${t}${e.originalUrl||e.url||`/graphql`}`}function fd(e){let t=e[Symbol.toStringTag];return!!(typeof e==`string`||t===`Uint8Array`||t===`Blob`||t===`FormData`||t===`URLSearchParams`||cd(e))}function pd(e,t,n,r){let i=e.raw||e.req||e,a=dd(i);if(e.query){let n=new t.URL(a);for(let t in e.query)n.searchParams.set(t,e.query[t]);a=n.toString()}let o=e.headers;if(e.headers?.[`:method`]){o={};for(let t in e.headers)t.startsWith(`:`)||(o[t]=e.headers[t])}let s=r?Id():new AbortController;if(n?.once){let e=()=>{s.signal.aborted||(Object.defineProperty(i,"aborted",{value:!0}),s.abort(n.errored??void 0))};n.once(`error`,e),n.once(`close`,e),n.once(`finish`,()=>{n.removeListener(`close`,e)})}if(e.method===`GET`||e.method===`HEAD`)return new t.Request(a,{method:e.method,headers:o,signal:s.signal});let c=e.body;if(c!=null&&Object.keys(c).length>0){if(fd(c))return new t.Request(a,{method:e.method||`GET`,headers:o,body:c,signal:s.signal});let n=new t.Request(a,{method:e.method||`GET`,headers:o,signal:s.signal});return n.headers.get(`content-type`)?.includes(`json`)||n.headers.set(`content-type`,`application/json; charset=utf-8`),new Proxy(n,{get:(e,t,n)=>{switch(t){case`json`:return()=>Wa(c);case`text`:return()=>Wa(JSON.stringify(c));default:return globalThis.Bun?Reflect.get(e,t):Reflect.get(e,t,n)}}})}return new t.Request(a,{method:e.method,headers:o,signal:s.signal,body:i,duplex:`half`})}function md(e){return e.read!=null}function hd(e){return md(e)}function gd(e){return e!=null&&e.setHeader!=null&&e.end!=null&&e.once!=null&&e.write!=null}function _d(e){return e!=null&&e.getReader!=null}function vd(e){return e!=null&&e.request!=null&&e.respondWith!=null}function yd(e){e?.socket?.setTimeout?.(0),e?.socket?.setNoDelay?.(!0),e?.socket?.setKeepAlive?.(!0)}function bd(e){e.end(null,null,null)}function xd(e,t){let n=!1,r=()=>{n=!0};e.once(`error`,r),e.once(`close`,r),e.once(`finish`,()=>{e.removeListener(`close`,r),e.removeListener(`error`,r)});let i=t[Symbol.asyncIterator](),a=()=>i.next().then(({done:t,value:r})=>{if(!(n||t))return P(()=>Sd(r,e),()=>n?bd(e):a())});return a()}function Sd(e,t){if(!t.write(e))return new Promise(e=>t.once(`drain`,e))}function Cd(e,t,n,r){if(t.closed||t.destroyed||t.writableEnded)return;if(!e){t.statusCode=404,bd(t);return}if(r&&e.headers?.headersInit&&!Array.isArray(e.headers.headersInit)&&!e.headers.headersInit.get&&!e.headers._map&&!e.headers._setCookies?.length)t.writeHead(e.status,e.statusText,e.headers.headersInit);else{if(t.setHeaders)t.setHeaders(e.headers);else{let n=!1;e.headers.forEach((r,i)=>{if(i===`set-cookie`){if(n)return;n=!0;let r=e.headers.getSetCookie?.();if(r){t.setHeader(`set-cookie`,r);return}}t.setHeader(i,r)})}t.writeHead(e.status,e.statusText)}if(e.bodyType===`String`)return P(()=>Sd(e.bodyInit,t),()=>bd(t));let i=e._buffer;if(i)return P(()=>Sd(i,t),()=>bd(t));let a=e.body;if(a==null){bd(t);return}if(a[Symbol.toStringTag]===`Uint8Array`)return P(()=>Sd(a,t),()=>bd(t));if(yd(n),md(a)){t.once(`close`,()=>{a.destroy()}),a.pipe(t,{end:!0});return}if(_d(a))return wd(n,t,a);if(cd(a))return xd(t,a)}function wd(e,t,n){let r=n.getReader();e?.once?.(`error`,e=>{r.cancel(e)});function i(){return r.read().then(({done:e,value:n})=>e?bd(t):P(()=>Sd(n,t),i))}return i()}function Td(e){return typeof e==`object`&&!!e&&(`body`in e||`cache`in e||`credentials`in e||`headers`in e||`integrity`in e||`keepalive`in e||`method`in e||`mode`in e||`redirect`in e||`referrer`in e||`referrerPolicy`in e||`signal`in e||`window`in e)}function Ed(...e){let[t,...n]=e.filter(e=>typeof e==`object`&&!!e);return n.forEach(e=>{let n=Object.getOwnPropertyNames(e).reduce((t,n)=>(Object.getOwnPropertyDescriptor(e,n)&&(t[n]=Object.getOwnPropertyDescriptor(e,n)),t),{});Object.getOwnPropertySymbols(e).forEach(t=>{let r=Object.getOwnPropertyDescriptor(e,t);r?.enumerable&&(n[t]=r)}),Object.defineProperties(t,n)}),t}function Dd(e,t){return new t(e.stack||e.message||e.toString(),{status:e.status||500})}function Od(e,t){return e==null?t==null?{}:{waitUntil:t}:Ed(Object.create(e),{waitUntil:t},e)}function kd(e,t){if(t?.aborted)throw t.reason;if(Ha(e)&&t){let n=Ga();function r(){n.reject(t.reason)}return t.addEventListener(`abort`,r,{once:!0}),e.then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)}).finally(()=>{t.removeEventListener(`abort`,r)}),n.promise}return e}const Ad=[`SIGINT`,`exit`,`SIGTERM`],jd=new Set;let Md=!1;function Nd(){if(!Md){Md=!0;for(let e of Ad)globalThis.process.once(e,function(){return Promise.allSettled([...jd].map(e=>!e.disposed&&e.disposeAsync()))})}}function Pd(e){globalThis.process&&(Nd(),jd.has(e)||(jd.add(e),e.defer(()=>{jd.delete(e)})))}var Fd=class extends EventTarget{aborted=!1;_onabort=null;_reason;constructor(){super();let e=globalThis.process?.getBuiltinModule?.(`node:events`);e?.kMaxEventTargetListeners&&(this[e.kMaxEventTargetListeners]=0)}throwIfAborted(){if(this._nativeCtrl?.signal?.throwIfAborted)return this._nativeCtrl.signal.throwIfAborted();if(this.aborted)throw this._reason}_nativeCtrl;ensureNativeCtrl(){if(!this._nativeCtrl){let e=this.aborted;this._nativeCtrl=new AbortController,e&&this._nativeCtrl.abort(this._reason)}return this._nativeCtrl}abort(e){if(this._nativeCtrl?.abort)return this._nativeCtrl?.abort(e);this._reason=e||new DOMException(`This operation was aborted`,`AbortError`),this.aborted=!0,this.dispatchEvent(new Event(`abort`))}get signal(){return this._nativeCtrl?.signal?this._nativeCtrl.signal:this}get reason(){return this._nativeCtrl?.signal?this._nativeCtrl.signal.reason:this._reason}get onabort(){return this._onabort,this._onabort}set onabort(e){if(this._nativeCtrl?.signal){this._nativeCtrl.signal.onabort=e;return}this._onabort&&this.removeEventListener(`abort`,this._onabort),this._onabort=e,e&&this.addEventListener(`abort`,e)}};function Id(){return globalThis.Bun||globalThis.Deno?new AbortController:new Proxy(new Fd,{get(e,t,n){if(t.toString().includes(`kDependantSignals`)){let n=e.ensureNativeCtrl();return Reflect.get(n.signal,t,n.signal)}return Reflect.get(e,t,n)},set(e,t,n,r){if(t.toString().includes(`kDependantSignals`)){let r=e.ensureNativeCtrl();return Reflect.set(r.signal,t,n,r.signal)}return Reflect.set(e,t,n,r)},getPrototypeOf(){return AbortSignal.prototype}})}function Ld(e){return!!e.onData}function Rd({req:e,res:t,fetchAPI:n,controller:r}){let i=e.getMethod(),a,o=[],s=[e=>{o.push(e)}],c=e=>{for(let t of s)t(e)},l=!1,u=[()=>{l=!0}],d=()=>{for(let e of u)e()};t.onData(function(e,t){c(Buffer.from(Buffer.from(e,0,e.byteLength))),t&&d()});let f;if(i!==`get`&&i!==`head`){a=`half`,r.signal.addEventListener(`abort`,()=>{d()},{once:!0});let e;f=()=>(e||=new n.ReadableStream({start(e){for(let t of o)e.enqueue(t);if(l){e.close();return}s.push(t=>{e.enqueue(t)}),u.push(()=>{if(r.signal.reason){e.error(r.signal.reason);return}e.desiredSize&&e.close()})}}),e)}let p=new n.Headers;e.forEach((e,t)=>{p.append(e,t)});let m=`http://localhost${e.getUrl()}`,h=e.getQuery();h&&(m+=`?${h}`);let g;function _(){return f?l?v():f():null}let ee=new n.Request(m,{method:i,headers:p,get body(){return _()},signal:r.signal,duplex:a});function v(){return g||=o.length===1?o[0]:Buffer.concat(o),g}function y(){return l?Wa(v()):new Promise((e,t)=>{try{u.push(()=>{e(v())})}catch(e){t(e)}})}return Object.defineProperties(ee,{body:{get(){return _()},configurable:!0,enumerable:!0},json:{value(){return y().then(e=>e.toString(`utf8`)).then(e=>JSON.parse(e))},configurable:!0,enumerable:!0},text:{value(){return y().then(e=>e.toString(`utf8`))},configurable:!0,enumerable:!0},arrayBuffer:{value(){return y()},configurable:!0,enumerable:!0}}),ee}function zd(e,t){return new t.WritableStream({write(t){e.cork(()=>{e.write(t)})},close(){e.cork(()=>{e.end()})}})}function Bd(e,t,n,r){if(!t){e.writeStatus(`404 Not Found`),e.end();return}let i=t._buffer,a=t.bodyType===`String`?t.bodyInit:void 0;if(!n.signal.aborted&&(e.cork(()=>{e.writeStatus(`${t.status} ${t.statusText}`);for(let[n,r]of t.headers)if(n!==`content-length`){if(n===`set-cookie`){let r=t.headers.getSetCookie?.();if(r){for(let t of r)e.writeHeader(n,t);continue}}e.writeHeader(n,r)}a?e.end(a):i?e.end(i):t.body||e.end()}),!(a||i||!t.body)))return n.signal.addEventListener(`abort`,()=>{t.body?.locked||t.body?.cancel(n.signal.reason)},{once:!0}),t.body.pipeTo(zd(e,r),{signal:n.signal}).catch(e=>{if(!n.signal.aborted)throw e})}var Vd=u(sd(),1);function Hd(e){try{return!!e?.request}catch{return!1}}const Ud={};function Wd(e,t){let n=t?.__useSingleWriteHead==null?!0:t.__useSingleWriteHead,r={...Vd,...t?.fetchAPI},i=t?.__useCustomAbortCtrl==null?r.Request!==globalThis.Request:t.__useCustomAbortCtrl,a=typeof e==`function`?e:e.handle,o=[],s=[],c,l=new Set,u;function d(){return u||(u=new su,t?.disposeOnProcessTerminate&&Pd(u),u.defer(()=>{if(l.size>0)return Promise.allSettled(l).then(()=>{l.clear()},()=>{l.clear()})})),u}function f(e){Ha(e)&&(d(),l.add(e),e.then(()=>{l.delete(e)},t=>{console.error(`Unexpected error while waiting: ${t.message||t}`),l.delete(e)}))}if(t?.plugins!=null)for(let e of t.plugins){e.instrumentation&&(c=c?kl(c,e.instrumentation):e.instrumentation),e.onRequest&&o.push(e.onRequest),e.onResponse&&s.push(e.onResponse);let t=e[nu.dispose];t&&d().defer(t);let n=e[nu.asyncDispose];n&&d().defer(n),e.onDispose&&d().defer(e.onDispose)}let p=o.length>0||s.length>0?function(e,t){let n=a,i;if(o.length===0)return u();let c=e.parsedUrl||new Proxy(Ud,{get(t,n,i){return c=new r.URL(e.url,`http://localhost`),Reflect.get(c,n,c)}});function l(n){return s.length===0?n:P(()=>Ka(s,i=>i({request:e,response:n,serverContext:t,setResponse(e){n=e},fetchAPI:r})),()=>n)}function u(){return i?l(i):P(()=>n(e,t),l)}return P(()=>Ka(o,(a,o)=>a({request:e,setRequest(t){e=t},serverContext:t,fetchAPI:r,url:c,requestHandler:n,setRequestHandler(e){n=e},endResponse(e){i=e,e&&o()}})),u)}:a;if(c?.request){let e=p;p=(t,n)=>Al({request:t}).asyncFn(c.request,e)(t,n)}function m(e,...t){let n=t.length>1?Ed(...t):t[0]||{};n.waitUntil||=f;let a=pd(e,r,void 0,i);return p(a,n)}function h(e,t,...n){let a=t.raw||t,o=n.length>1?Ed(...n):n[0]||{};o.waitUntil||=f;let s=pd(e,r,a,i);return p(s,o)}function g(e,t,...i){let a={req:e,res:t,waitUntil:f};return eo(Wa().then(()=>h(e,t,a,...i)).catch(e=>Dd(e,r.Response)).then(r=>Cd(r,t,e,n)).catch(e=>console.error(`Unexpected error while handling request: ${e.message||e}`)))}function _(e,t,...n){let a={res:e,req:t,waitUntil:f},o=n.filter(e=>e!=null).length>0?Ed(a,...n):a,s=i?Id():new AbortController,c=e.end.bind(e),l=!1;e.end=function(e){return l=!0,c(e)},e.onAborted.bind(e)(function(){s.abort()}),e.onAborted=function(e){s.signal.addEventListener(`abort`,e,{once:!0})};let u=Rd({req:t,res:e,fetchAPI:r,controller:s});return P(()=>P(()=>p(u,o),e=>e,e=>Dd(e,r.Response)),t=>{if(!s.signal.aborted&&!l)return P(()=>Bd(e,t,s,r),e=>e,e=>{console.error(`Unexpected error while handling request: ${e.message||e}`)})})}function ee(e,...t){if(!e.respondWith||!e.request)throw TypeError(`Expected FetchEvent, got ${e}`);let n=t.filter(e=>e!=null),r=n.length>0?Ed({},e,...n):Od(e),i=p(e.request,r);e.respondWith(i)}function v(e,...t){let n=t.filter(e=>e!=null),r=n.length>1?Ed({},...n):Od(n[0],n[0]==null||n[0].waitUntil==null?f:void 0);return p(e,r)}let y=(e,...t)=>{if(typeof e==`string`||`href`in e){let[n,...i]=t;if(Td(n)){let t=v(new r.Request(e,n),...i),a=n.signal;return a?kd(t,a):t}return v(new r.Request(e),...t)}return kd(v(e,...t),e.signal)},te=(e,...t)=>{let[n,...r]=t;if(hd(e)){if(!gd(n))throw TypeError(`Expected ServerResponse, got ${n}`);return g(e,n,...r)}if(Ld(e))return _(e,n,...r);if(gd(n))throw TypeError(`Got Node response without Node request`);return Hd(e)?vd(e)?ee(e,...t):v(e.request,e,...t):y(e,...t)},b={handleRequest:v,fetch:y,handleNodeRequest:m,handleNodeRequestAndResponse:h,requestListener:g,handleEvent:ee,handleUWS:_,handle:te,get disposableStack(){return d()},[nu.asyncDispose](){return u&&!u.disposed?u.disposeAsync():Wa()},dispose(){return u&&!u.disposed?u.disposeAsync():Wa()},waitUntil:f},ne=new Proxy(te,{has:(t,n)=>n in b||n in te||e&&n in e,get:(t,n)=>{if(globalThis.Deno||n===Symbol.asyncDispose||n===Symbol.dispose){let e=Reflect.get(b,n,b);if(e)return e}let r=b[n];if(r)return r.bind?r.bind(b):r;let i=te[n];if(i)return i.bind?i.bind(te):i;if(e){let t=e[n];if(t)return t.bind?function(...t){let r=e[n](...t);return r===e?ne:r}:t}},apply(e,t,n){return te(...n)}});return ne}function Gd(e,t){let n=e.headers.get(`origin`);if(t===!1||n==null)return null;let r={};if(t.origin==null||t.origin.length===0||t.origin.includes(`*`)?(r[`Access-Control-Allow-Origin`]=n,r.Vary=`Origin`):typeof t.origin==`string`?r[`Access-Control-Allow-Origin`]=t.origin:Array.isArray(t.origin)&&(t.origin.length===1?r[`Access-Control-Allow-Origin`]=t.origin[0]:t.origin.includes(n)?(r[`Access-Control-Allow-Origin`]=n,r.Vary=`Origin`):r[`Access-Control-Allow-Origin`]=`null`),t.methods?.length)r[`Access-Control-Allow-Methods`]=t.methods.join(`, `);else{let t=e.headers.get(`access-control-request-method`);t&&(r[`Access-Control-Allow-Methods`]=t)}if(t.allowedHeaders?.length)r[`Access-Control-Allow-Headers`]=t.allowedHeaders.join(`, `);else{let t=e.headers.get(`access-control-request-headers`);t&&(r[`Access-Control-Allow-Headers`]=t,r.Vary?r.Vary+=`, Access-Control-Request-Headers`:r.Vary=`Access-Control-Request-Headers`)}return t.credentials==null?r[`Access-Control-Allow-Origin`]!==`*`&&(r[`Access-Control-Allow-Credentials`]=`true`):t.credentials===!0&&(r[`Access-Control-Allow-Credentials`]=`true`),t.exposedHeaders&&(r[`Access-Control-Expose-Headers`]=t.exposedHeaders.join(`, `)),t.maxAge&&(r[`Access-Control-Max-Age`]=t.maxAge.toString()),r}function Kd(e,t,n){return P(()=>t(e,n),t=>Gd(e,t))}function qd(e){let t=()=>({});if(e!=null)if(typeof e==`function`)t=e;else if(typeof e==`object`){let n={...e};t=()=>n}else e===!1&&(t=()=>!1);return{onRequest({request:e,fetchAPI:t,endResponse:n}){e.method.toUpperCase()===`OPTIONS`&&n(new t.Response(null,{status:204,headers:{"Content-Length":`0`}}))},onResponse({request:e,serverContext:n,response:r}){return P(()=>Kd(e,t,n),e=>{if(e!=null)for(let t in e)r.headers.set(t,e[t])})}}}function Jd(e){return typeof e==`object`&&!!e&&`errors`in e}function Yd(e){return e!=null&&typeof e.toString==`function`}function Xd(e){return e instanceof b}function Zd(e){return e instanceof b?e.originalError==null?!0:Zd(e.originalError):!1}function Qd(e){return typeof e==`object`&&e?.constructor?.name===`DOMException`&&(e.name===`AbortError`||e.name===`TimeoutError`)}function $d(e,t,n){let r=new Set;if(Jd(e))for(let i of e.errors){let e=$d(i,t,n);for(let t of e)r.add(t)}else if(Qd(e))n.debug(`Request aborted`);else if(t){let i=t.maskError(e,t.errorMessage,t.isDev);i!==e&&n.error(e),r.add(Xd(i)?i:N(i.message,{originalError:i}))}else Xd(e)?r.add(e):e instanceof Error?r.add(N(e.message,{originalError:e})):typeof e==`string`?r.add(N(e,{extensions:{code:`INTERNAL_SERVER_ERROR`,unexpected:!0}})):Yd(e)?r.add(N(e.toString(),{extensions:{code:`INTERNAL_SERVER_ERROR`,unexpected:!0}})):(n.error(e),r.add(N(`Unexpected error.`,{extensions:{http:{unexpected:!0}}})));return Array.from(r)}function ef(e,t={},n=!1){let r,i=!1;if(`extensions`in e&&e.extensions?.http&&(e.extensions.http.headers&&Object.assign(t,e.extensions.http.headers),e.extensions.http.status&&(r=e.extensions.http.status)),`errors`in e&&e.errors?.length)for(let a of e.errors)if(a.extensions?.http){if(a.extensions.http.headers&&Object.assign(t,a.extensions.http.headers),n&&a.extensions.http.spec)continue;a.extensions.http.status&&(!r||a.extensions.http.status>r)&&(r=a.extensions.http.status)}else(!Zd(a)||a.extensions?.unexpected)&&(i=!0);else r||=200;return r||=i&&!(`data`in e)?500:200,{status:r,headers:t}}function tf(e){return Array.isArray(e)&&e.length>0&&e.some(Xd)}function nf(e){let t=e.get(`operationName`)||void 0,n=e.get(`query`)||void 0,r=e.get(`variables`)||void 0,i=e.get(`extensions`)||void 0;return{operationName:t,query:n,variables:r?JSON.parse(r):void 0,extensions:i?JSON.parse(i):void 0}}function rf(e){return nf(new Vd.URLSearchParams(e))}function af(e,t){let n=e.headers.get(`content-type`);return n=n?.split(`,`)[0]||null,n===t||!!n?.startsWith(`${t};`)}function of(e){return e.method===`GET`}function sf(e){return nf(new Vd.URLSearchParams(e.url.substring(e.url.indexOf(`?`)+1)))}function cf(e){return e.method===`POST`&&af(e,`application/x-www-form-urlencoded`)}function lf(e){return e.text().then(rf)}function uf(e){return e.method===`POST`&&af(e,`application/graphql`)}function df(e){return e.text().then(e=>({query:e}))}function ff(e){return e.method===`POST`&&(af(e,`application/json`)||af(e,`application/graphql+json`))}function pf(e){return P(()=>e.json(),e=>{if(e==null)throw N(`POST body is expected to be object but received ${e}`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});let t=typeof e;if(t!==`object`)throw N(`POST body is expected to be object but received ${t}`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});return e},e=>{if(e instanceof b)throw e;let t={http:{spec:!0,status:400},code:`BAD_REQUEST`};throw e instanceof Error&&(t.originalError={name:e.name,message:e.message}),N(`POST body sent invalid JSON.`,{extensions:t})})}function mf(e,t,n){t.split&&(t=t.split(`.`));for(var r=0,i=t.length,a=e,o,s;r<i&&(s=``+t[r++],!(s===`__proto__`||s===`constructor`||s===`prototype`));)a=a[s]=r===i?n:typeof(o=a[s])==typeof t?o:t[r]*0!=0||~(``+t[r]).indexOf(`.`)?{}:[]}function hf(e){return e.method===`POST`&&af(e,`multipart/form-data`)}function gf(e){return P(()=>e.formData(),e=>{let t=e.get(`operations`);if(!t)throw N(`Missing multipart form field "operations"`);if(typeof t!=`string`)throw N(`Multipart form field "operations" must be a string`);let n;try{n=JSON.parse(t)}catch{throw N(`Multipart form field "operations" must be a valid JSON string`)}let r=e.get(`map`);if(r!=null){if(typeof r!=`string`)throw N(`Multipart form field "map" must be a string`);let t;try{t=JSON.parse(r)}catch{throw N(`Multipart form field "map" must be a valid JSON string`)}for(let r in t){let i=e.get(r),a=t[r];for(let e of a)mf(n,e,i)}}return n},e=>{throw e instanceof Error&&e.message.startsWith(`File size limit exceeded: `)?N(e.message,{extensions:{http:{status:413}}}):e})}const _f=new Set([`query`,`variables`,`operationName`,`extensions`]);function vf(e,t){if(typeof e!=`object`||!e)throw N(`Invalid "params" in the request body`,{extensions:{http:{spec:!0,status:400},code:`BAD_REQUEST`}});for(let n in e)if(e[n]!=null&&!_f.has(n)){if(t?.includes(n))continue;throw N(`Unexpected parameter "${n}" in the request body.`,{extensions:{http:{status:400},code:`BAD_REQUEST`}})}}function yf(e,t){if(!Sf(e))throw N(`Expected params to be an object but given ${xf(e)}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});if(vf(e,t),e.query==null)throw N(`Must provide query string.`,{extensions:{http:{spec:!0,status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let n=xf(e.query);if(n!==`string`)throw N(`Expected "query" param to be a string, but given ${n}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let r=xf(e.variables);if(![`object`,`null`,`undefined`].includes(r))throw N(`Expected "variables" param to be empty or an object, but given ${r}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});let i=xf(e.extensions);if(![`object`,`null`,`undefined`].includes(i))throw N(`Expected "extensions" param to be empty or an object, but given ${i}.`,{extensions:{http:{status:400,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}});return e}function bf(e){return{onParams({params:t}){yf(t,e)}}}function xf(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function Sf(e){return xf(e)===`object`}function Cf(e){return e===`GET`||e===`POST`}function wf(){return{onRequestParse({request:e}){if(!Cf(e.method))throw N(`GraphQL only supports GET and POST requests.`,{extensions:{http:{status:405,headers:{Allow:`GET, POST`}},code:`BAD_REQUEST`}})}}}function Tf(){return{onValidate(){return({valid:e,result:t})=>{if(!e)for(let e of t)e.extensions||={},e.extensions.code||=`GRAPHQL_VALIDATION_FAILED`,e.extensions.http||={},e.extensions.http.spec=e.extensions.http.spec==null?!0:e.extensions.http.spec,e.extensions.http.status||=400}}}}function Ef(e){return{onRequestParse(){return{onRequestParseDone({requestParserResult:t}){if(Array.isArray(t)){if(!e)throw N(`Batching is not supported.`,{extensions:{http:{status:400},code:`BAD_REQUEST`}});if(t.length>e)throw N(`Batching is limited to ${e} operations per request.`,{extensions:{http:{status:413},code:`BAD_REQUEST`}})}}}}}}function Df(e,t,n){let r=t?va(t,n)??void 0:void 0;if(!r)throw N(`Could not determine what operation to execute.`,{extensions:{code:`OPERATION_RESOLUTION_FAILURE`,http:{status:400}}});if(r.operation===`mutation`&&e===`GET`)throw N(`Can only perform a mutation operation from a POST request.`,{extensions:{http:{status:405,headers:{Allow:`POST`}},code:`BAD_REQUEST`}})}function Of(){return{onParse(){return({result:e,context:{request:t,params:{operationName:n}={}}})=>{if(t)if(e instanceof Error){if(e instanceof b){let t=e.extensions||={};t.code||=`GRAPHQL_PARSE_FAILED`;let n=t.http||={};n.spec||=!0,n.status||=400}}else Df(t.method,e,n)}}}}function kf({id:e=Date.now().toString(),logger:t=console,endpoint:n=`/health`}={}){return{onRequest({endResponse:r,fetchAPI:i,request:a}){a.url.endsWith(n)&&(t.debug(`Responding Health Check`),r(new i.Response(null,{status:200,headers:{"x-yoga-id":e}})))}}}const Af=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,jf=new Set,Mf=typeof process==`object`&&process?process:{},Nf=(e,t,n,r)=>{typeof Mf.emitWarning==`function`?Mf.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let Pf=globalThis.AbortController,Ff=globalThis.AbortSignal;if(Pf===void 0){Ff=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},Pf=class{constructor(){t()}signal=new Ff;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=Mf.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,Nf("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}const If=e=>!jf.has(e),Lf=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rf=e=>Lf(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?zf:null:null;var zf=class extends Array{constructor(e){super(e),this.fill(0)}},Bf=class e{heap;length;static#e=!1;static create(t){let n=Rf(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Vf=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,memoMethod:_,noDeleteOnFetchRejection:ee,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:te,ignoreFetchAbort:b}=t;if(n!==0&&!Lf(n))throw TypeError(`max option must be a nonnegative integer`);let ne=n?Rf(n):Array;if(!ne)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(_!==void 0&&typeof _!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=_,g!==void 0&&typeof g!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=g,this.#x=!!g,this.#c=new Map,this.#l=Array(n).fill(void 0),this.#u=Array(n).fill(void 0),this.#d=new ne(n),this.#f=new ne(n),this.#p=0,this.#m=0,this.#h=Bf.create(n),this.#o=0,this.#s=0,typeof l==`function`&&(this.#n=l),typeof u==`function`?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!ee,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!te,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(this.#t!==0&&!Lf(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!Lf(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Lf(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Lf(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;If(t)&&(jf.add(t),Nf(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new zf(this.#e),t=new zf(this.#e);this.#y=e,this.#v=t,this.#E=(n,r,i=Af.now())=>{if(t[n]=r===0?0:i,e[n]=r,r!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(n)&&this.#B(this.#l[n],`expire`)},r+1);e.unref&&e.unref()}},this.#w=n=>{t[n]=e[n]===0?0:Af.now()},this.#T=(i,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;i.ttl=o,i.start=s,i.now=n||r(),i.remainingTTL=o-(i.now-s)}};let n=0,r=()=>{let e=Af.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#c.get(i);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((n||r())-s)},this.#D=i=>{let a=t[i],o=e[i];return!!o&&!!a&&(n||r())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};#D=()=>!1;#O(){let e=new zf(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!Lf(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Lf(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let n=this.#u[t],r=this.#L(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#y&&this.#v){let e=this.#y[t],n=this.#v[t];e&&n&&(i.ttl=e-(Af.now()-n),i.start=Date.now())}return this.#_&&(i.size=this.#_[t]),i}dump(){let e=[];for(let t of this.#M({allowStale:!0})){let n=this.#l[t],r=this.#u[t],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#y&&this.#v){a.ttl=this.#y[t];let e=Af.now()-this.#v[t];a.start=Math.floor(Date.now()-e)}this.#_&&(a.size=this.#_[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=Af.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let a=new Pf,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason);let l=f;return this.#u[t]===f&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)),u=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=f;if(this.#u[t]===f&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):o||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},d=(t,r)=>{let o=this.#i?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=p,p}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof Pf}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let ee={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},v=this.#c.get(e);if(v===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,v,ee,m);return t.__returned=t}else{let t=this.#u[v];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(v);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(v),r&&this.#w(v),g&&this.#T(g,v),t;let a=this.#I(e,v,ee,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}else a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}};function Hf({max:e=1024,ttl:t=36e5}={}){return new Vf({max:e,ttl:t})}function Uf({documentCache:e=Hf(),errorCache:t=Hf(),validationCache:n=!0}){let r=Hf();return{onParse({params:n,setParsedDocument:r}){let i=n.source.toString(),a=e.get(i);if(a){r(a);return}let o=t.get(i);if(o)throw o;return({result:n})=>{n!=null&&(n instanceof Error?t.set(i,n):e.set(i,n))}},onValidate({params:{schema:e,documentAST:t,rules:i},setResult:a}){if(e!=null&&n!==!1){let n=i?.map(e=>e.name).join(`,`)||``,o=r.get(n);o||(o=new WeakMap,r.set(n,o));let s=o.get(e);s||(s=new WeakMap,o.set(e,s));let c=s.get(t);if(c){a(c);return}return({result:e})=>{e!=null&&s?.set(t,e)}}}}}const Wf=()=>!0;function Gf(e){let t=e.match||Wf;return{onRequestParse({request:n,setRequestParser:r}){t(n)&&r(e.parse)}}}function Kf(e){let t=(e.headers.get(`accept`)||`*/*`).replace(/\s/g,``).toLowerCase().split(`,`),n=[];for(let e of t){let[t,...r]=e.split(`;`);t!==void 0&&(r?.find(e=>e.includes(`charset=`))||`charset=utf-8`)===`charset=utf-8`&&n.push(t)}return n.reverse()}function qf(e,t){let[n,r]=e.split(`/`),[i,a]=t.split(`/`);return(i===`*`||i===n)&&(a===`*`||a===r)}function Jf(e){if(Array.isArray(e))return`[${e.map(e=>{let t=Yf(e);return(e.stringify||JSON.stringify)(t)}).join(`,`)}]`;let t=Yf(e);return(e.stringify||JSON.stringify)(t)}function Yf(e){if(e.errors?.length||e.extensions?.http){let t={...e};if(t.errors&&=t.errors.map(Xf),t.extensions){let{http:n,...r}=e.extensions;t.extensions=Object.keys(r).length?r:void 0}return t}return e}function Xf(e){if(Xd(e)){let{http:t,unexpected:n,...r}=(`toJSON`in e&&typeof e.toJSON==`function`?e.toJSON():Object(e)).extensions||{};return N(e.message,{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:Xf(e.originalError||void 0),extensions:Object.keys(r).length?r:void 0})}return e}function Zf(e,t){let n=ef(e,{Connection:`keep-alive`,"Content-Type":`multipart/mixed; boundary="-"`,"Transfer-Encoding":`chunked`}),r,i=new t.TextEncoder,a=new t.ReadableStream({start(t){if(Ll(e))r=e[Symbol.asyncIterator]();else{let t=!1;r={next:()=>t?Wa({done:!0,value:null}):(t=!0,Wa({done:!1,value:e}))}}t.enqueue(i.encode(`\r
81
- `)),t.enqueue(i.encode(`---`))},pull(e){return P(()=>r.next(),({done:t,value:n})=>{if(n!=null){e.enqueue(i.encode(`\r
82
- `)),e.enqueue(i.encode(`Content-Type: application/json; charset=utf-8`)),e.enqueue(i.encode(`\r
83
- `));let t=Jf(n),r=i.encode(t);e.enqueue(i.encode(`Content-Length: `+r.byteLength)),e.enqueue(i.encode(`\r
84
- `)),e.enqueue(i.encode(`\r
85
- `)),e.enqueue(r),e.enqueue(i.encode(`\r
86
- `)),e.enqueue(i.encode(`---`))}t&&(e.enqueue(i.encode(`--\r
87
- `)),e.close())},t=>{e.error(t)})},cancel(e){if(r.return)return P(()=>r.return?.(e),()=>{})}});return new t.Response(a,n)}function Qf(e,t,n){if(Gs(e))return new t.Response(null,{status:406,statusText:`Not Acceptable`,headers:{accept:`application/json; charset=utf-8, application/graphql-response+json; charset=utf-8`}});let r=ef(e,{"Content-Type":n+`; charset=utf-8`},n===`application/json`&&!Array.isArray(e)&&tf(e.errors)&&e.errors.some(e=>!e.extensions?.originalError||Xd(e.extensions.originalError))),i=Jf(e);return new t.Response(i,r)}function $f(){return function(e,t){let n=ef(e,{"Content-Type":`text/event-stream`,Connection:`keep-alive`,"Cache-Control":`no-cache`,"Content-Encoding":`none`},!0),r,i,a=new t.TextEncoder,o=new t.ReadableStream({start(t){if(t.enqueue(a.encode(`:
88
-
89
- `)),i=setInterval(()=>{if(!t.desiredSize){clearInterval(i);return}t.enqueue(a.encode(`:
90
-
91
- `))},12e3),Ll(e))r=e[Symbol.asyncIterator]();else{let t=!1;r={next:()=>t?Wa({done:!0,value:null}):(t=!0,Wa({done:!1,value:e}))}}},pull(e){return P(()=>r.next(),t=>{if(t.value!=null){e.enqueue(a.encode(`event: next
92
- `));let n=Jf(t.value);e.enqueue(a.encode(`data: ${n}\n\n`))}t.done&&(e.enqueue(a.encode(`event: complete
93
- `)),e.enqueue(a.encode(`data:
94
-
95
- `)),clearInterval(i),e.close())},t=>{e.error(t)})},cancel(e){if(clearInterval(i),r.return)return P(()=>r.return?.(e),()=>{})}});return new t.Response(o,n)}}const ep={mediaTypes:[`multipart/mixed`],asyncIterables:!0,processResult:Zf};function tp(){return{mediaTypes:[`text/event-stream`],asyncIterables:!0,processResult:$f()}}const np={mediaTypes:[`application/graphql-response+json`,`application/json`],asyncIterables:!1,processResult:Qf};function rp(){let e=new WeakMap,t=tp(),n=[t,ep,np],r=[t,np];return{onSubscribe({args:{contextValue:t}}){t.request&&e.set(t.request,!0)},onResultProcess({request:t,result:i,acceptableMediaTypes:a,setResultProcessor:o}){let s=e.get(t)?r:n,c=Kf(t),l=Ll(i);for(let e of s)for(let t of c)if(!(l&&!e.asyncIterables))for(let n of e.mediaTypes)a.push(n),qf(n,t)&&o(e.processResult,n)}}}var ip=`<!doctype html><html lang=en><head><meta charset=utf-8><title>Welcome to GraphQL Yoga</title><link rel=icon href=https://raw.githubusercontent.com/graphql-hive/graphql-yoga/refs/heads/main/website/src/app/favicon.ico><style>body,html{padding:0;margin:0;height:100%;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Fira Sans','Droid Sans','Helvetica Neue',sans-serif;color:#fff;background-color:#000}main>section.hero{display:flex;height:90vh;justify-content:center;align-items:center;flex-direction:column}.logo{display:flex;align-items:center}.buttons{margin-top:24px}h1{font-size:80px}h2{color:#888;max-width:50%;margin-top:0;text-align:center}a{color:#fff;text-decoration:none;margin-left:10px;margin-right:10px;font-weight:700;transition:color .3s ease;padding:4px;overflow:visible}a.graphiql:hover{color:rgba(255,0,255,.7)}a.docs:hover{color:rgba(28,200,238,.7)}a.tutorial:hover{color:rgba(125,85,245,.7)}svg{margin-right:24px}.not-what-your-looking-for{margin-top:5vh}.not-what-your-looking-for>*{margin-left:auto;margin-right:auto}.not-what-your-looking-for>p{text-align:center}.not-what-your-looking-for>h2{color:#464646}.not-what-your-looking-for>p{max-width:600px;line-height:1.3em}.not-what-your-looking-for>pre{max-width:300px}</style></head><body id=body><main><section class=hero><div class=logo><div><svg xmlns=http://www.w3.org/2000/svg viewBox="-0.41 0.445 472.812 499.811" height=150><defs><linearGradient id=paint0_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint1_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint2_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint3_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint4_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><linearGradient id=paint5_linear_1677_11483 x1=16 y1=14 x2=87.2132 y2=44.5982 gradientUnits=userSpaceOnUse><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter0_f_1677_11483 x=23 y=-25 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter1_f_1677_11483 x=-24 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><linearGradient id=paint6_linear_1677_11483 x1=30 y1=28 x2=66.1645 y2=44.4363 gradientUnits=userSpaceOnUse gradientTransform="matrix(8.139854, 0, 0, 8.139854, -130.346407, -113.25101)"><stop stop-color=#7433FF /><stop offset=1 stop-color=#FFA3FD /></linearGradient><filter id=filter2_f_1677_11483 x=-12 y=-44 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter><filter id=filter3_f_1677_11483 x=13 y=19 width=100 height=100 filterUnits=userSpaceOnUse color-interpolation-filters=sRGB><feFlood flood-opacity=0 result=BackgroundImageFix /><feBlend mode=normal in=SourceGraphic in2=BackgroundImageFix result=shape /><feGaussianBlur stdDeviation=12 result=effect1_foregroundBlur_1677_11483 /></filter></defs><mask id=mask0_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=16 y=14 width=58 height=62><path d="M21 25.3501C21.7279 25.3501 22.4195 25.5056 23.0433 25.7853L42.1439 14.8C43.0439 14.3 44.1439 14 45.1439 14C46.2439 14 47.2439 14.3 48.1439 14.8L64.5439 24.3C63.3439 25.1 62.4439 26.3 61.8439 27.7L45.9438 18.5C45.6439 18.3 45.344 18.3 45.0441 18.3C44.7441 18.3 44.4439 18.4 44.1439 18.5L25.8225 29.0251C25.9382 29.4471 26 29.8914 26 30.3501C26 33.1115 23.7614 35.3501 21 35.3501C18.2386 35.3501 16 33.1115 16 30.3501C16 27.5887 18.2386 25.3501 21 25.3501Z" fill=url(#paint3_linear_1677_11483) /><path d="M67.2438 35.0329C65.3487 34.3219 64 32.4934 64 30.35C64 27.5886 66.2386 25.35 69 25.35C71.7614 25.35 74 27.5886 74 30.35C74 32.1825 73.0142 33.7848 71.5439 34.6554V55.2C71.5439 57.4 70.3439 59.4 68.5439 60.5L52.1439 69.9C52.1439 68.4 51.6438 66.9 50.7438 65.8L66.3439 56.8C66.9439 56.5 67.2438 55.9 67.2438 55.2V35.0329Z" fill=url(#paint4_linear_1677_11483) /><path d="M49.8439 69.1055C49.9458 69.5034 50 69.9204 50 70.3501C50 73.1115 47.7614 75.3501 45 75.3501C42.5102 75.3501 40.4454 73.5302 40.0633 71.1481L21.8439 60.6C19.9439 59.5 18.8439 57.5 18.8439 55.3V36.8C19.5439 37 20.3439 37.2 21.0439 37.2C21.7439 37.2 22.4439 37.1 23.0439 36.9V55.3C23.0439 56 23.4438 56.6 23.9438 56.9L41.3263 66.9583C42.2398 65.9694 43.5476 65.3501 45 65.3501C47.3291 65.3501 49.2862 66.9426 49.8419 69.0981L49.8436 69.0997L49.8439 69.1055Z" fill=url(#paint5_linear_1677_11483) /></mask><mask id=mask1_1677_11483 style=mask-type:alpha maskUnits=userSpaceOnUse x=30 y=28 width=30 height=30><path fill-rule=evenodd clip-rule=evenodd d="M49.3945 32.3945C49.3945 34.7088 47.5796 38.5469 45 38.5469C42.4271 38.5469 40.6055 34.7112 40.6055 32.3945C40.6055 29.9714 42.5769 28 45 28C47.4231 28 49.3945 29.9714 49.3945 32.3945ZM35.332 49.0433V48.2148C35.332 42.8117 37.8535 41.0004 39.8796 39.545L39.8801 39.5447C40.3928 39.1767 40.8604 38.8404 41.2488 38.4742C42.3293 39.6642 43.626 40.3047 45 40.3047C46.3752 40.3047 47.6725 39.6642 48.7529 38.4754C49.1408 38.841 49.6078 39.1773 50.1199 39.5447L50.1204 39.545C52.1465 41.0004 54.668 42.8117 54.668 48.2148V49.0433L53.8406 49.092C49.9848 49.3185 46.8646 46.9002 45 43.5777C43.1159 46.935 39.9847 49.318 36.1594 49.092L35.332 49.0433ZM58.1463 51.0747L58.1463 51.0746C57.0179 50.891 50.0128 49.7507 45.0007 55.693C40.0116 49.7553 33.1965 50.8592 31.9095 51.0677L31.9095 51.0677C31.7906 51.087 31.7189 51.0986 31.7002 51.0963C31.7005 51.0969 31.7011 51.1045 31.7023 51.1187C31.726 51.4003 31.9682 54.2745 34.0566 56.2422L30 58H60L55.8956 56.2422C57.8537 54.4764 58.1396 52.2685 58.2508 51.4092V51.4091C58.2697 51.2628 58.2836 51.1556 58.2998 51.0963C58.2881 51.0977 58.2356 51.0892 58.1463 51.0747ZM40.4836 50.104C42.3956 49.3212 43.6746 48.1737 45 46.61C46.332 48.1841 47.6159 49.3259 49.5164 50.104C49.5356 50.1425 49.5557 50.1805 49.5756 50.2182C49.5793 50.2253 49.583 50.2323 49.5867 50.2393C48.0911 50.8127 46.4264 51.825 45.0047 53.1444C43.5906 51.8221 41.9673 50.8196 40.4256 50.2153C40.4455 50.1784 40.4648 50.1415 40.4836 50.104Z" fill=black /></mask><path d="M 40.59 93.095 C 46.517 93.095 52.14 94.365 57.22 96.635 L 212.7 7.22 C 220.025 3.149 228.978 0.706 237.12 0.706 C 246.073 0.706 254.213 3.149 261.54 7.22 L 395.032 84.547 C 385.264 91.059 377.939 100.827 373.055 112.224 L 243.631 37.338 C 241.19 35.71 238.747 35.71 236.305 35.71 C 233.863 35.71 231.42 36.523 228.978 37.338 L 79.84 123.009 C 80.786 126.443 81.29 130.058 81.29 133.793 C 81.29 156.269 63.065 174.493 40.59 174.493 C 18.116 174.493 -0.109 156.269 -0.109 133.793 C -0.109 111.32 18.116 93.095 40.59 93.095 Z" fill=url(#paint0_linear_1677_11483) /><path d="M 417.01 171.913 C 401.585 166.126 390.603 151.238 390.603 133.793 C 390.603 111.32 408.83 93.095 431.303 93.095 C 453.777 93.095 472.001 111.32 472.001 133.793 C 472.001 148.706 463.976 161.755 452.011 168.835 L 452.011 336.07 C 452.011 353.977 442.243 370.258 427.591 379.21 L 294.098 455.726 C 294.098 443.516 290.029 431.306 282.703 422.353 L 409.683 349.093 C 414.568 346.651 417.01 341.767 417.01 336.07 L 417.01 171.913 Z" fill=url(#paint1_linear_1677_11483) /><path d="M 275.376 449.253 C 276.206 452.495 276.646 455.889 276.646 459.389 C 276.646 481.863 258.422 500.087 235.947 500.087 C 215.679 500.087 198.87 485.272 195.761 465.883 L 47.46 380.025 C 31.995 371.071 23.041 354.792 23.041 336.884 L 23.041 186.296 C 28.738 187.923 35.25 189.553 40.948 189.553 C 46.646 189.553 52.345 188.738 57.228 187.111 L 57.228 336.884 C 57.228 342.582 60.485 347.465 64.554 349.908 L 206.042 431.777 C 213.481 423.728 224.127 418.689 235.947 418.689 C 254.905 418.689 270.833 431.656 275.36 449.196 L 275.376 449.214 L 275.376 449.253 Z" fill=url(#paint2_linear_1677_11483) /><g mask=url(#mask0_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter0_f_1677_11483)><circle cx=73 cy=25 r=26 fill=#ED2E7E /></g><g filter=url(#filter1_f_1677_11483)><circle cx=26 cy=69 r=26 fill=#1CC8EE /></g></g><path fill-rule=evenodd clip-rule=evenodd d="M 271.713 150.431 C 271.713 169.275 256.948 200.517 235.947 200.517 C 215.003 200.517 200.172 169.292 200.172 150.431 C 200.172 130.708 216.225 114.666 235.947 114.666 C 255.67 114.666 271.713 130.708 271.713 150.431 Z M 157.251 285.952 L 157.251 279.212 C 157.251 235.233 177.771 220.485 194.27 208.641 C 198.447 205.644 202.247 202.901 205.414 199.923 C 214.204 209.608 224.763 214.826 235.947 214.826 C 247.138 214.826 257.697 209.608 266.496 199.931 C 269.653 202.911 273.456 205.644 277.622 208.641 C 294.114 220.485 314.642 235.233 314.642 279.212 L 314.642 285.952 L 307.912 286.351 C 276.525 288.191 251.128 268.509 235.947 241.468 C 220.611 268.795 195.126 288.191 163.981 286.351 L 157.251 285.952 Z M 342.953 302.492 C 333.771 300.994 276.751 291.715 235.955 340.082 C 195.345 291.749 139.865 300.734 129.389 302.436 C 128.428 302.59 127.841 302.688 127.687 302.665 C 127.687 302.673 127.695 302.729 127.702 302.85 C 127.897 305.138 129.867 328.532 146.872 344.55 L 113.849 358.862 L 358.044 358.862 L 324.639 344.55 C 340.576 330.177 342.905 312.202 343.807 305.212 C 343.962 304.022 344.077 303.153 344.206 302.665 C 344.108 302.68 343.686 302.606 342.953 302.492 Z M 199.188 294.59 C 214.751 288.215 225.161 278.879 235.947 266.15 C 246.788 278.96 257.241 288.255 272.707 294.59 C 272.869 294.898 273.031 295.207 273.196 295.518 C 273.219 295.574 273.252 295.631 273.285 295.688 C 261.107 300.361 247.555 308.598 235.989 319.334 C 224.477 308.573 211.258 300.417 198.715 295.493 C 198.87 295.191 199.033 294.891 199.188 294.59 Z" fill=url(#paint6_linear_1677_11483) /><g mask=url(#mask1_1677_11483) transform="matrix(8.139854, 0, 0, 8.139854, -130.346375, -113.251038)"><g filter=url(#filter2_f_1677_11483)><circle cx=38 cy=6 r=26 fill=#ED2E7E /></g><g filter=url(#filter3_f_1677_11483)><circle cx=63 cy=69 r=26 fill=#1CC8EE /></g></g></svg></div><h1>GraphQL Yoga</h1><p>Version: 5.15.2</p></div><h2>The batteries-included cross-platform GraphQL Server.</h2><div class=buttons><a href=https://www.the-guild.dev/graphql/yoga-server/docs class=docs>Read the Docs</a> <a href=https://www.the-guild.dev/graphql/yoga-server/tutorial/basic class=tutorial>Start the Tutorial </a><a href=__GRAPHIQL_LINK__ class=graphiql>Visit GraphiQL</a></div></section><section class=not-what-your-looking-for><h2>Not the page you are looking for? 👀</h2><p>This page is shown be default whenever a 404 is hit.<br>You can disable this by behavior via the <code>landingPage</code> option.</p><pre>
96
- <code>
97
- import { createYoga } from 'graphql-yoga';
98
-
99
- const yoga = createYoga({
100
- landingPage: false
101
- })
102
- </code>
103
- </pre><p>If you expected this page to be the GraphQL route, you need to configure Yoga. Currently, the GraphQL route is configured to be on <code>__GRAPHIQL_LINK__</code>.</p><pre>
104
- <code>
105
- import { createYoga } from 'graphql-yoga';
106
-
107
- const yoga = createYoga({
108
- graphqlEndpoint: '__REQUEST_PATH__',
109
- })
110
- </code>
111
- </pre></section></main></body></html>`;const ap=function(e){return new e.fetchAPI.Response(ip.replace(/__GRAPHIQL_LINK__/g,e.graphqlEndpoint).replace(/__REQUEST_PATH__/g,e.url.pathname),{status:200,statusText:`OK`,headers:{"Content-Type":`text/html`}})};function op(e){let t;function n({URLPattern:n}){return t||=new n({pathname:e.graphqlEndpoint}),t}let r=e.landingPageRenderer||ap;return{onRequest({request:t,fetchAPI:i,endResponse:a,url:o}){if(!t.url.endsWith(e.graphqlEndpoint)&&!t.url.endsWith(`${e.graphqlEndpoint}/`)&&o.pathname!==e.graphqlEndpoint&&o.pathname!==`${e.graphqlEndpoint}/`&&!n(i).test(o)){if(e.showLandingPage===!0&&t.method===`GET`&&t.headers?.get(`accept`)?.includes(`text/html`)){let s=r({request:t,fetchAPI:i,url:o,graphqlEndpoint:e.graphqlEndpoint,get urlPattern(){return n(i)}});if(Ha(s))return s.then(a);a(s);return}a(new i.Response(``,{status:404,statusText:`Not Found`}))}}}}function sp({request:e,result:t,fetchAPI:n,onResultProcessHooks:r,serverContext:i}){let a,o=[],s=`*/*`;return P(()=>Ka(r,n=>n({request:e,acceptableMediaTypes:o,result:t,setResult(e){t=e},resultProcessor:a,setResultProcessor(e,t){a=e,s=t},serverContext:i})),()=>a?a(t,n,s):new n.Response(null,{status:406,statusText:`Not Acceptable`,headers:{accept:o.join(`; charset=utf-8, `)}}))}function cp({params:e,enveloped:t}){let n=t.parse(e.query),r=t.validate(t.schema,n);return r.length>0?{errors:r}:P(()=>t.contextFactory(),r=>{let i={schema:t.schema,document:n,contextValue:r,variableValues:e.variables,operationName:e.operationName};return(va(n,e.operationName)?.operation===`subscription`?t.subscribe:t.execute)(i)})}function lp(e){return Xd(e)?e.toJSON():e instanceof Error?{message:e.message,stack:e.stack,cause:e.cause}:e}const up=(e,t,n=!1)=>{if(Zd(e))return e;let r={code:`INTERNAL_SERVER_ERROR`,unexpected:!0},i={extensions:r};return Xd(e)?(i.nodes=e.nodes,i.source=e.source,i.positions=e.positions,i.path=e.path,n&&e.originalError&&(r.originalError=lp(e.originalError)),e.extensions?.http&&(r.http=e.extensions.http)):n&&(r.originalError=lp(e)),N(t,i)};var dp=class{getEnveloped;logger;graphqlEndpoint;fetchAPI;plugins;instrumentation;onRequestParseHooks;onParamsHooks;onExecutionResultHooks;onResultProcessHooks;maskedErrorsOpts;id;version=`5.15.2`;constructor(e){if(this.id=e?.id??`yoga`,this.fetchAPI={...Vd},e?.fetchAPI)for(let t in e.fetchAPI)e.fetchAPI[t]&&(this.fetchAPI[t]=e.fetchAPI[t]);let t=e?.logging==null?!0:e.logging;this.logger=typeof t==`boolean`?t===!0?dc():dc(`silent`):typeof t==`string`?dc(t):t;let n=typeof e?.maskedErrors==`object`&&e.maskedErrors.maskError||up,r=new WeakSet;this.maskedErrorsOpts=e?.maskedErrors===!1?null:{errorMessage:`Unexpected error.`,...typeof e?.maskedErrors==`object`?e.maskedErrors:{},maskError:(e,t)=>{if(r.has(e))return e;let i=n(e,t,this.maskedErrorsOpts?.isDev);return i!==e&&this.logger.error(e),r.add(i),i}};let i=this.maskedErrorsOpts==null?null:this.maskedErrorsOpts,a=0;e?.batching&&(a=typeof e.batching==`boolean`?10:e.batching.limit??10),this.graphqlEndpoint=e?.graphqlEndpoint||`/graphql`;let o=this.graphqlEndpoint;this.plugins=[eu({parse:Ge,validate:ua,execute:od,subscribe:od,specifiedRules:aa}),!!e?.schema&&gc(e.schema),e?.context!=null&&$l(t=>e?.context?typeof e.context==`function`?e.context(t):e.context:{}),kf({id:this.id,logger:this.logger,endpoint:e?.healthCheckEndpoint}),e?.cors!==!1&&qd(e?.cors),e?.graphiql!==!1&&hc({graphqlEndpoint:o,options:e?.graphiql,render:e?.renderGraphiQL,logger:this.logger}),Gf({match:of,parse:sf}),Gf({match:ff,parse:pf}),e?.multipart!==!1&&Gf({match:hf,parse:gf}),Gf({match:uf,parse:df}),Gf({match:cf,parse:lf}),rp(),...e?.plugins??[],{onPluginInit({addPlugin:t}){e?.parserAndValidationCache!==!1&&t(Uf(!e?.parserAndValidationCache||e?.parserAndValidationCache===!0?{}:e?.parserAndValidationCache)),t(Ef(a)),t(bf(e?.extraParamNames));let n=!!(e?.landingPage??!0);t(op({graphqlEndpoint:o,showLandingPage:n,landingPageRenderer:typeof e?.landingPage==`function`?e.landingPage:void 0})),t(wf()),t(Of()),i&&(t({onSubscribe(){return{onSubscribeError({error:e}){if(Qd(e))throw e}}}}),t(Xl(i))),t(Tf())}}],this.getEnveloped=Wl({plugins:this.plugins}),this.plugins=this.getEnveloped._plugins,this.onRequestParseHooks=[],this.onParamsHooks=[],this.onExecutionResultHooks=[],this.onResultProcessHooks=[];for(let e of this.plugins)e&&(e.onYogaInit&&e.onYogaInit({yoga:this}),e.onRequestParse&&this.onRequestParseHooks.push(e.onRequestParse),e.onParams&&this.onParamsHooks.push(e.onParams),e.onExecutionResult&&this.onExecutionResultHooks.push(e.onExecutionResult),e.onResultProcess&&this.onResultProcessHooks.push(e.onResultProcess),e.instrumentation&&(this.instrumentation=this.instrumentation?kl(this.instrumentation,e.instrumentation):e.instrumentation))}handleParams=({request:e,context:t,params:n})=>{let r=t.request===e?{params:n}:{request:e,params:n};Object.assign(t,r);let i=this.getEnveloped(t);return this.logger.debug(`Processing GraphQL Parameters`),P(()=>P(()=>cp({params:n,enveloped:i}),e=>(this.logger.debug(`Processing GraphQL Parameters done.`),e),e=>({errors:$d(e,this.maskedErrorsOpts,this.logger)})),e=>(Ll(e)&&(e=Ya(e,e=>e,e=>{if(e.name===`AbortError`)throw this.logger.debug(`Request aborted`),e;return{errors:$d(e,this.maskedErrorsOpts,this.logger)}})),e))};getResultForParams=({params:e,request:t},n)=>{let r,i=this.handleParams;return P(()=>Ka(this.onParamsHooks,a=>a({params:e,request:t,setParams(t){e=t},paramsHandler:i,setParamsHandler(e){i=e},setResult(e){r=e},fetchAPI:this.fetchAPI,context:n})),()=>P(()=>r||i({request:t,params:e,context:n}),e=>P(()=>Ka(this.onExecutionResultHooks,r=>r({result:e,setResult(t){e=t},request:t,context:n})),()=>e)))};parseRequest=(e,t)=>{let n=new Proxy({},{get:(t,r,i)=>(n=new this.fetchAPI.URL(e.url,`http://localhost`),Reflect.get(n,r,n))}),r,i=[];return P(()=>Ka(this.onRequestParseHooks,i=>P(()=>i({request:e,url:n,requestParser:r,serverContext:t,setRequestParser(e){r=e}}),e=>e?.onRequestParseDone),i),()=>(this.logger.debug(`Parsing request to extract GraphQL parameters`),r?P(()=>r(e),e=>P(()=>Ka(i,t=>t({requestParserResult:e,setRequestParserResult(t){e=t}})),()=>({requestParserResult:e}))):{response:new this.fetchAPI.Response(null,{status:415,statusText:`Unsupported Media Type`})}))};handle=(e,t)=>{let n=this.instrumentation&&Al({request:e}),r=this.instrumentation?.requestParse?n.asyncFn(this.instrumentation?.requestParse,this.parseRequest):this.parseRequest;return eo(Wa().then(()=>r(e,t)).then(({response:r,requestParserResult:i})=>{if(r)return r;let a=this.instrumentation?.operation?(e,t)=>Al({context:t,request:e.request}).asyncFn(this.instrumentation?.operation,this.getResultForParams)(e,t):this.getResultForParams;return P(()=>Array.isArray(i)?Promise.all(i.map(n=>a({params:n,request:e},Object.create(t)))):a({params:i,request:e},t),r=>(this.instrumentation?.resultProcess?n.asyncFn(this.instrumentation.resultProcess,sp):sp)({request:e,result:r,fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:t}))}).catch(n=>sp({request:e,result:{errors:$d(n,this.maskedErrorsOpts,this.logger)},fetchAPI:this.fetchAPI,onResultProcessHooks:this.onResultProcessHooks,serverContext:t})))}};function fp(e){let t=new dp(e);return Wd(t,{fetchAPI:t.fetchAPI,plugins:t.plugins,disposeOnProcessTerminate:e.disposeOnProcessTerminate})}function pp(){return{onExecute({args:e}){e.signal=e.contextValue?.request?.signal??void 0},onSubscribe({args:e}){e.signal=e.contextValue?.request?.signal??void 0}}}function mp(e){let t=Object.create(null);return{Directive(n){if(n.name.value===Is.name||n.name.value===Ls.name){let r=n.arguments?.find(e=>e.name.value===`label`)?.value;if(!r)return;r.kind===C.STRING?t[r.value]?e.reportError(N(`Defer/Stream directive label argument must be unique.`,{nodes:[t[r.value],n]})):t[r.value]=n:e.reportError(N(`Directive "${n.name.value}"'s label argument must be a static string.`,{nodes:n}))}}}}function hp(e){return{Directive(t){let n=e.getSchema().getMutationType(),r=e.getSchema().getSubscriptionType(),i=e.getParentType();i&&t.name.value===Is.name&&(n&&i===n&&e.reportError(N(`Defer directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(N(`Defer directive cannot be used on root subscription type "${i.name}".`,{nodes:t}))),i&&t.name.value===Ls.name&&(n&&i===n&&e.reportError(N(`Stream directive cannot be used on root mutation type "${i.name}".`,{nodes:t})),r&&i===r&&e.reportError(N(`Stream directive cannot be used on root subscription type "${i.name}".`,{nodes:t})))}}}function gp(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(vp(i)&&vp(a)){let o=0;do++n,o=o*10+i-_p,i=e.charCodeAt(n);while(vp(i)&&o>0);let s=0;do++r,s=s*10+a-_p,a=t.charCodeAt(r);while(vp(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}const _p=48;function vp(e){return!Number.isNaN(e)&&48<=e&&e<=57}function yp(e){switch(e.kind){case C.OBJECT:return{...e,fields:bp(e.fields)};case C.LIST:return{...e,values:e.values.map(yp)};case C.INT:case C.FLOAT:case C.STRING:case C.BOOLEAN:case C.NULL:case C.ENUM:case C.VARIABLE:return e}}function bp(e){return e.map(e=>({...e,value:yp(e.value)})).sort((e,t)=>gp(e.name.value,t.name.value))}function xp(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+xp(t)).join(` and `):e}function Sp(e){let t=new Rp,n=new Map;return{SelectionSet(r){let i=Cp(e,n,t,e.getParentType(),r);for(let[[t,n],r,a]of i){let i=xp(n);e.reportError(N(`Fields "${t}" conflict because ${i}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(a)}))}}}}function Cp(e,t,n,r,i){let a=[],[o,s]=Pp(e,t,r,i);if(Dp(e,a,t,n,o),s.length!==0)for(let r=0;r<s.length;r++){wp(e,a,t,n,!1,o,s[r]);for(let i=r+1;i<s.length;i++)Tp(e,a,t,n,!1,s[r],s[i])}return a}function wp(e,t,n,r,i,a,o){let s=e.getFragment(o);if(!s)return;let[c,l]=Fp(e,n,s);if(a!==c){Op(e,t,n,r,i,a,c);for(let s of l)r.has(s,o,i)||(r.add(s,o,i),wp(e,t,n,r,i,a,s))}}function Tp(e,t,n,r,i,a,o){if(a===o||r.has(a,o,i))return;r.add(a,o,i);let s=e.getFragment(a),c=e.getFragment(o);if(!s||!c)return;let[l,u]=Fp(e,n,s),[d,f]=Fp(e,n,c);Op(e,t,n,r,i,l,d);for(let o of f)Tp(e,t,n,r,i,a,o);for(let a of u)Tp(e,t,n,r,i,a,o)}function Ep(e,t,n,r,i,a,o,s){let c=[],[l,u]=Pp(e,t,i,a),[d,f]=Pp(e,t,o,s);Op(e,c,t,n,r,l,d);for(let i of f)wp(e,c,t,n,r,l,i);for(let i of u)wp(e,c,t,n,r,d,i);for(let i of u)for(let a of f)Tp(e,c,t,n,r,i,a);return c}function Dp(e,t,n,r,i){for(let[a,o]of Object.entries(i))if(o.length>1)for(let i=0;i<o.length;i++)for(let s=i+1;s<o.length;s++){let c=kp(e,n,r,!1,a,o[i],o[s]);c&&t.push(c)}}function Op(e,t,n,r,i,a,o){for(let[s,c]of Object.entries(a)){let a=o[s];if(a)for(let o of c)for(let c of a){let a=kp(e,n,r,i,s,o,c);a&&t.push(a)}}}function kp(e,t,n,r,i,a,o){let[s,c,l]=a,[u,d,f]=o,p=r||s!==u&&k(s)&&k(u);if(!p){let e=c.name.value,t=d.name.value;if(e!==t)return[[i,`"${e}" and "${t}" are different fields`],[c],[d]];if(Ap(c)!==Ap(d))return[[i,`they have differing arguments`],[c],[d]]}if(!Mp(c.directives??[],d.directives??[]))return[[i,`they have differing stream directives`],[c],[d]];let m=l?.type,h=f?.type;if(m&&h&&Np(m,h))return[[i,`they return conflicting types "${ja(m)}" and "${ja(h)}"`],[c],[d]];let g=c.selectionSet,_=d.selectionSet;if(g&&_)return Lp(Ep(e,t,n,p,zt(m),g,zt(h),_),i,c,d)}function Ap(e){let t=e.arguments??[];return ht(yp({kind:C.OBJECT,fields:t.map(e=>({kind:C.OBJECT_FIELD,name:e.name,value:e.value}))}))}function jp(e){return e.find(e=>e.name.value===`stream`)}function Mp(e,t){let n=jp(e),r=jp(t);return!n&&!r?!0:n&&r?Ap(n)===Ap(r):!1}function Np(e,t){return Ot(e)?Ot(t)?Np(e.ofType,t.ofType):!0:Ot(t)?!0:j(e)?j(t)?Np(e.ofType,t.ofType):!0:j(t)?!0:jt(e)||jt(t)?e!==t:!1}function Pp(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=new Set;Ip(e,n,r,a,o);let s=[a,[...o]];return t.set(r,s),s}function Fp(e,t,n){return t.get(n.selectionSet)||Pp(e,t,mr(e.getSchema(),n.typeCondition),n.selectionSet)}function Ip(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case C.FIELD:{let e=a.name.value,n;(k(t)||A(t))&&(n=t.getFields()[e]);let i=a.alias?a.alias.value:e;r[i]||=[],r[i].push([t,a,n]);break}case C.FRAGMENT_SPREAD:i.add(a.name.value);break;case C.INLINE_FRAGMENT:{let n=a.typeCondition;Ip(e,n?mr(e.getSchema(),n):t,a.selectionSet,r,i);break}}}function Lp(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}var Rp=class{_data;constructor(){this._data=new Map}has(e,t,n){let[r,i]=e<t?[e,t]:[t,e],a=this._data.get(r)?.get(i);return a===void 0?!1:n?!0:n===a}add(e,t,n){let[r,i]=e<t?[e,t]:[t,e],a=this._data.get(r);a===void 0?this._data.set(r,new Map([[i,n]])):a.set(i,n)}};function zp(e){return{Directive(t){let n=e.getFieldDef(),r=e.getParentType();n&&r&&t.name.value===Ls.name&&!(Ot(n.type)||Ft(n.type)&&Ot(n.type.ofType))&&e.reportError(N(`Stream directive cannot be used on non-list field "${n.name}" on type "${r.name}".`,{nodes:t}))}}}function Bp(){return{onSchemaChange:({schema:e,replaceSchema:t})=>{let n=[];e.getDirective(`defer`)??n.push(Is),e.getDirective(`stream`)??n.push(Ls),n.length&&t(new Kn({...e.toConfig(),directives:[...e.getDirectives(),...n]}))},onValidate:({params:e,addValidationRule:t})=>{e.rules||=[],e.rules=e.rules.filter(e=>e.name!==`OverlappingFieldsCanBeMergedRule`),t(Sp),t(mp),t(hp),t(zp)}}}var Vp=Object.defineProperty,Hp=(e,t)=>{let n={};for(var r in e)Vp(n,r,{get:e[r],enumerable:!0});return t||Vp(n,Symbol.toStringTag,{value:`Module`}),n},Up=`__OSRA_KEY__`,Wp=`__OSRA_DEFAULT_KEY__`,Gp=`__OSRA_BOX__`,Kp=()=>globalThis.browser??globalThis.chrome,qp=()=>Kp()?.runtime,Jp=(e,t)=>pm(e)&&e.__OSRA_KEY__===t,Yp=(e,t)=>{if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}},Xp=({listener:e,transport:t,remoteName:n,key:r=Wp,origin:i=`*`,unregisterSignal:a})=>{if(a?.aborted)return;let o=jm(t)?t.receive:t;if(typeof o==`function`){let t=o((t,i)=>{a?.aborted||Jp(t,r)&&(n&&t.name!==n||e(t,i))});typeof t==`function`&&Yp(a,t);return}if(_m(o)||vm(o)||bm(o)||xm(o)){let t=(t,i)=>{let o=(t,a)=>{Jp(t,r)&&(n&&t.name!==n||e(t,{port:i,sender:a}))};t.addListener(o),Yp(a,()=>t.removeListener(o))};if(_m(o))t(o.onMessage);else if(bm(o)){let e=e=>t(e.onMessage,e);o.addListener(e),Yp(a,()=>o.removeListener(e))}else xm(o)?t(o):t(o.onMessage);return}let s=dm(o)?o.port:o,c=i!==`*`&&Sm(o),l=t=>{let a=t.data;if(typeof a==`string`)try{a=JSON.parse(a)}catch{return}Jp(a,r)&&(n&&a.name!==n||c&&t.origin&&t.origin!==i||e(a,{receiveTransport:o,source:t.source,origin:t.origin}))};s.addEventListener(`message`,l),s instanceof MessagePort&&s.start(),Yp(a,()=>s.removeEventListener(`message`,l))},Zp=new WeakSet,Qp=e=>String(e?.message??e).includes(`disconnected port`),$p=(e,t,n=`*`,r=[])=>{let i=jm(e)?e.emit:e;if(typeof i==`function`)i(t,r);else if(Sm(i))i.postMessage(t,n,r);else if(vm(i)){if(Zp.has(i))return;try{i.postMessage(t)}catch(e){if(!Qp(e))throw e;Zp.add(i)}}else if(_m(i))i.sendMessage(t)?.catch?.(e=>{if(!String(e?.message).includes(`Receiving end does not exist`))throw e});else if(om(i)){let e=JSON.stringify(t);i.readyState===WebSocket.CONNECTING?i.addEventListener(`open`,()=>i.send(e),{once:!0}):i.send(e)}else dm(i)?i.port.postMessage(t,r):i.postMessage(t,r)},em=globalThis.Float16Array,tm={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float16Array:em,Float32Array,Float64Array,BigInt64Array,BigUint64Array},nm=Object.values(tm),rm=e=>{let t=e.constructor.name;if(t in tm)return t;for(let[t,n]of Object.entries(tm))if(n&&e instanceof n)return t;throw Error(`Unknown typed array type`)},im=e=>{let t=tm[e];if(!t)throw Error(`Unknown typed array type`);return t},am=e=>mm(e,nm),om=e=>e instanceof WebSocket,sm=e=>!!globalThis.ServiceWorkerContainer&&e instanceof ServiceWorkerContainer,cm=e=>!!globalThis.ServiceWorker&&e instanceof ServiceWorker,lm=e=>!!globalThis.Worker&&e instanceof Worker,um=e=>{let t=globalThis.DedicatedWorkerGlobalScope;return!!t&&e instanceof t},dm=e=>!!globalThis.SharedWorker&&e instanceof SharedWorker,fm=e=>e instanceof MessagePort,pm=e=>!!e&&typeof e==`object`&&`__OSRA_KEY__`in e&&!!e.__OSRA_KEY__,mm=(e,t)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;for(let n of t)if(n&&e instanceof n)return!0;return!1},hm=e=>mm(e,[globalThis.SharedArrayBuffer]),gm=e=>mm(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),_m=e=>{let t=qp();return t?e===t:!1},vm=(e,t=!1)=>!e||typeof e!=`object`||Sm(e)||!(`name`in e)||!(`disconnect`in e)||!(`postMessage`in e)?!1:t?`sender`in e&&`onMessage`in e&&`onDisconnect`in e:!0,ym=e=>!!e&&typeof e==`object`&&!Sm(e)&&`addListener`in e&&`hasListener`in e&&`removeListener`in e,bm=e=>{let t=qp();return t?e===t.onConnect||e===t.onConnectExternal:!1},xm=e=>ym(e),Sm=e=>{if(!e||typeof e!=`object`)return!1;try{return`window`in e&&e.window===e}catch{try{return`closed`in e&&typeof e.closed==`boolean`&&`close`in e&&typeof e.close==`function`}catch{return!1}}},Cm=e=>om(e)||vm(e)||_m(e),wm=e=>om(e)||vm(e)||bm(e)||xm(e)||_m(e),Tm=e=>!!e&&typeof e==`object`&&!Sm(e)&&`isJson`in e&&e.isJson===!0||Cm(e)||wm(e),Em=e=>Sm(e)||Cm(e)||cm(e)||lm(e)||um(e)||dm(e)||fm(e)||km(e),Dm=e=>Sm(e)||wm(e)||sm(e)||lm(e)||um(e)||dm(e)||fm(e)||Am(e),Om=e=>{if(!e||typeof e!=`object`||Sm(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},km=e=>!Om(e)||!(`emit`in e)?!1:Em(e.emit)||typeof e.emit==`function`,Am=e=>!Om(e)||!(`receive`in e)?!1:Dm(e.receive)||typeof e.receive==`function`,jm=e=>km(e)||Am(e),Mm=()=>globalThis.Buffer,Nm=32768,Pm=e=>{let t=e.toBase64;if(typeof t==`function`)return t.call(e);let n=Mm();if(n)return n.from(e).toString(`base64`);let r=``;for(let t=0;t<e.length;t+=Nm)r+=String.fromCharCode(...e.subarray(t,t+Nm));return btoa(r)},Fm=e=>{let t=Uint8Array.fromBase64;if(typeof t==`function`)return t(e);let n=Mm();if(n)return new Uint8Array(n.from(e,`base64`));let r=atob(e),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i},Im={[Gp]:`revivable`},Lm=e=>!!e&&typeof e==`object`&&`__OSRA_BOX__`in e&&e.__OSRA_BOX__===`revivable`,Rm=(e,t)=>Tm(t.transport)?{base64Buffer:Pm(new Uint8Array(e))}:{arrayBuffer:e},zm=e=>`arrayBuffer`in e?e.arrayBuffer:Fm(e.base64Buffer).buffer,Bm=Hp({box:()=>Um,isType:()=>Hm,objectsOnly:()=>!0,revive:()=>Wm,type:()=>Vm}),Vm=`arrayBuffer`,Hm=e=>e instanceof ArrayBuffer,Um=(e,t)=>({...Im,type:Vm,...Rm(e,t)}),Wm=(e,t)=>zm(e),Gm=Hp({box:()=>Jm,isType:()=>qm,objectsOnly:()=>!0,revive:()=>Ym,type:()=>Km}),Km=`date`,qm=e=>e instanceof Date,Jm=(e,t)=>({...Im,type:Km,ISOString:e.toISOString()}),Ym=(e,t)=>new Date(e.ISOString),Xm=Hp({box:()=>$m,isType:()=>Qm,objectsOnly:()=>!0,revive:()=>eh,type:()=>Zm}),Zm=`headers`,Qm=e=>e instanceof Headers,$m=(e,t)=>({...Im,type:Zm,entries:[...e.entries()]}),eh=(e,t)=>new Headers(e.entries),th=Hp({box:()=>ah,isType:()=>ih,objectsOnly:()=>!0,revive:()=>oh,type:()=>nh}),nh=`error`,rh={Error,TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError},ih=e=>e instanceof Error,ah=(e,t)=>{let n=`cause`in e&&e.cause!==void 0,r=typeof AggregateError<`u`&&e instanceof AggregateError,i=typeof DOMException<`u`&&e instanceof DOMException;return{...Im,type:nh,name:e.name,message:e.message,stack:e.stack||e.toString(),...n?{cause:wv(e.cause,t)}:{},...r?{errors:wv(e.errors,t)}:{},...i?{isDOMException:!0}:{}}},oh=(e,t)=>{let n=e.cause===void 0?void 0:Ev(e.cause,t),r=n===void 0?void 0:{cause:n};if(e.isDOMException&&typeof DOMException<`u`){let t=new DOMException(e.message,e.name);if(e.stack)try{Object.defineProperty(t,"stack",{value:e.stack,configurable:!0})}catch{}return t}let i;if(e.errors!==void 0&&typeof AggregateError<`u`)i=AggregateError(Ev(e.errors,t),e.message,r);else{let t=rh[e.name]??Error;i=r===void 0?new t(e.message):new t(e.message,r)}return e.name&&i.name!==e.name&&(i.name=e.name),e.stack&&(i.stack=e.stack),i},sh=Hp({box:()=>uh,isType:()=>lh,objectsOnly:()=>!0,revive:()=>dh,type:()=>ch}),ch=`typedArray`,lh=am,uh=(e,t)=>{let n=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return{...Im,type:ch,typedArrayType:rm(e),...Rm(n,t)}},dh=(e,t)=>new(im(e.typedArrayType))(zm(e)),fh=new WeakMap,ph=new WeakSet,mh=(e,t)=>{if(ph.has(e))return t(),()=>{};let n=fh.get(e);return n||fh.set(e,n=new Set),n.add(t),()=>n.delete(t)},hh=e=>ph.has(e),gh=e=>{if(ph.has(e))return;ph.add(e);let t=fh.get(e);if(t){fh.delete(e);for(let e of t)try{e()}catch{}}},_h=Hp({box:()=>kh,forceTransfer:()=>Eh,isInTransfer:()=>Th,isType:()=>Oh,objectsOnly:()=>!0,outsideTransfer:()=>Dh,revive:()=>Ah,transfer:()=>Ch,type:()=>vh}),vh=`transfer`,yh=Symbol.for(`osra.transfer`),bh=e=>typeof e==`object`&&!!e,xh=e=>bh(e)&&yh in e&&e[yh]===!0,Sh=e=>bh(e)?ArrayBuffer.isView(e)?!0:mm(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.Request,globalThis.Response,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.VideoFrame,globalThis.AudioData]):!1,Ch=e=>Sh(e)?{[yh]:!0,value:e}:e,wh=0,Th=()=>wh>0,Eh=e=>bh(e)&&!xh(e)?{[yh]:!0,value:e}:e,Dh=e=>{let t=wh;wh=0;try{return e()}finally{wh=t}},Oh=e=>xh(e),kh=(e,t)=>{wh++;try{return{...Im,type:vh,inner:wv(e.value,t),degraded:Tm(t.transport)}}finally{wh--}},Ah=(e,t)=>Ev(e.inner,t),jh=e=>mm(e,[globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.OffscreenCanvas,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Mh=e=>Lm(e)&&e.type===`transfer`,Nh=e=>{let t=[],n=new WeakSet,r=(e,i)=>{if(!(!e||typeof e!=`object`)&&!n.has(e)&&(n.add(e),!hm(e))){if(Mh(e)){r(e.inner,i||!e.degraded);return}if(jh(e)){t.push(e);return}if(gm(e)){i&&t.push(e);return}if(ArrayBuffer.isView(e)){i&&e instanceof DataView&&!hm(e.buffer)&&!n.has(e.buffer)&&(n.add(e.buffer),t.push(e.buffer));return}if(Array.isArray(e)){for(let t of e)r(t,i);return}for(let t of Object.values(e))r(t,i)}};return r(e,!1),t},Ph=class{_listeners=new Map;addEventListener(e,t,n){if(!t)return;let r=this._listeners.get(e);r||(r=new Map,this._listeners.set(e,r)),r.has(t)||r.set(t,typeof n==`object`&&!!n?.once)}removeEventListener(e,t,n){t&&this._listeners.get(e)?.delete(t)}_peer;_queue=[];_started=!1;_closed=!1;_onClose;_onmessage=null;get onmessage(){return this._onmessage}set onmessage(e){this._onmessage=e,e!==null&&this.start()}onmessageerror=null;dispatchEvent(e){e.type===`message`?this._onmessage?.call(this,e):e.type===`messageerror`&&this.onmessageerror?.call(this,e);let t=this._listeners.get(e.type);if(t)for(let[n,r]of[...t])r&&t.delete(n),typeof n==`function`?n.call(this,e):n.handleEvent(e);return!0}postMessage(e,t){let n=this._peer;!n||n._closed||queueMicrotask(()=>{if(n._closed)return;let t=new MessageEvent(`message`,{data:e});n._started?n.dispatchEvent(t):n._queue.push(t)})}start(){if(!this._started){this._started=!0;for(let e of this._queue.splice(0))this.dispatchEvent(e)}}close(){if(this._closed)return;this._closed=!0,this._queue.length=0,this._onClose?.();let e=this._peer;e&&!e._closed&&queueMicrotask(()=>{e._closed||e.dispatchEvent(new Event(`close`))})}},Fh=class{port1;port2;constructor(){let e=new Ph,t=new Ph;e._peer=t,t._peer=e,this.port1=e,this.port2=t}},Ih=new FinalizationRegistry(e=>{try{e()}catch{}}),Lh=(e,t)=>{let n={};return Ih.register(e,t,n),()=>Ih.unregister(n)},Rh=Hp({box:()=>og,createRevivableChannel:()=>dg,init:()=>Xh,isType:()=>Zh,markPortsShipped:()=>lg,objectsOnly:()=>!0,postPreBoxed:()=>ig,revive:()=>sg,type:()=>zh}),zh=`messagePort`,Bh=2048,Vh=128,Hh=1024,Uh=new WeakMap,Wh=e=>{let t=Uh.get(e);if(!t)throw Error(`osra message-port: connection state missing; did init() run?`);return t},Gh=(e,t)=>{let n=e.ports.get(t);return n||(n={nextSeq:0,buffer:new Map,outSeq:0},e.ports.set(t,n),e.pendingPorts++),n},Kh=(e,t)=>{let n=e.ports.get(t);if(n&&!n.handler&&e.pendingPorts--,e.ports.delete(t),e.tombstones.size>=Vh){let t=e.tombstones.values().next().value;t!==void 0&&e.tombstones.delete(t)}e.tombstones.add(t)},qh=e=>{if(e.handler)for(let t=e.buffer.get(e.nextSeq);t!==void 0;t=e.buffer.get(e.nextSeq))e.buffer.delete(e.nextSeq),e.nextSeq++,e.handler(t)},Jh=(e,t)=>Gh(Wh(e),t).outSeq++,Yh=(e,t,n)=>{let r=Wh(e);if(r.tombstones.has(t)){setTimeout(()=>n({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t}));return}let i=Gh(r,t);i.handler||r.pendingPorts--,i.handler=n,qh(i)},Xh=e=>{let t={ports:new Map,tombstones:new Set,pendingPorts:0};Uh.set(e,t),e.eventTarget.addEventListener(`message`,({detail:n})=>{if(n.type!==`message`&&n.type!==`message-port-close`||t.tombstones.has(n.portId))return;let r=t.ports.get(n.portId);if(n.seq===void 0){r?.handler?.(n);return}if(!r){if(t.pendingPorts>=Hh)return;r=Gh(t,n.portId)}if(!(n.seq<r.nextSeq)){if(r.buffer.size>=Bh&&!(n.seq===r.nextSeq&&r.handler)){r.buffer.clear(),Kh(t,n.portId),r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n.portId});return}r.buffer.set(n.seq,n),qh(r)}}),mh(e,()=>{for(let[n,r]of[...t.ports])r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n});t.ports.clear(),t.tombstones.clear(),t.pendingPorts=0})},Zh=e=>e instanceof MessagePort||e instanceof Ph,Qh=(e,t)=>{try{let n=Wh(e).ports.get(t);e.sendMessage({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t,seq:n?n.outSeq++:0})}catch{}},$h=(e,t,n)=>{if(n){e.postMessage(t);return}let r=Nh(t);e.postMessage(t,r),lg(r)},eg=(e,t,n,r)=>{let i;try{i=Ev(e,t)}catch(e){r(),globalThis.reportError?.(e);return}n(i)},tg=(e,t,n)=>()=>{let r=e.deref();r&&Qh(r,n);let i=t.deref();i&&Kh(i,n)},ng=new WeakSet,rg=e=>e!==null&&(typeof e==`object`||typeof e==`function`),ig=(e,t,n)=>{rg(t)&&ng.add(t),e.postMessage(t,n??[])},ag=(e,t)=>rg(e)&&ng.delete(e)?e:Dh(()=>wv(e,t)),og=(e,t,n)=>{let r=e instanceof Ph;if(!r&&!Tm(t.transport))return{...Im,type:zh,port:e,...n?.autoBox?{autoBox:!0}:{}};let i=Wh(t),a=e,o=globalThis.crypto.randomUUID(),s=new WeakRef(a),c=new WeakRef(t),l=new WeakRef(i),u=!1,d=()=>{if(u)return;u=!0;let e=l.deref();e&&Kh(e,o),m?.();let t=s.deref();t?.removeEventListener(`message`,p),t instanceof Ph&&(t._onClose=void 0)},f=e=>{if(e.type===`message-port-close`){d(),a.dispatchEvent(new Event(`close`)),a.close();return}eg(e.data,t,e=>$h(a,e,!1),()=>{})};function p({data:e}){t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:ag(e,t),portId:o,seq:Jh(t,o)})}let m=Lh(a,tg(c,l,o));return a.addEventListener(`message`,p),a.start(),a instanceof Ph&&(a._onClose=()=>{u||(Qh(t,o),d())}),Yh(t,o,f),{...Im,type:zh,portId:o,synthetic:r}},sg=(e,t)=>`port`in e?(lg([e.port]),e.autoBox?ug(e.port,t):e.port):fg(e.portId,t,e.synthetic),cg=new WeakMap,lg=e=>{for(let t of e){let e=cg.get(t);if(e){cg.delete(t),e.shipped=!0;for(let t of e.pending.splice(0))t()}}},ug=(e,t,n)=>{let r=new EventTarget,i=({data:e})=>{eg(e,t,e=>r.dispatchEvent(new MessageEvent(`message`,{data:e})),()=>r.dispatchEvent(new Event(`messageerror`)))},a=()=>{r.dispatchEvent(new Event(`messageerror`))},o=()=>{r.dispatchEvent(new Event(`close`))};e.addEventListener(`message`,i),e.addEventListener(`messageerror`,a),e.addEventListener(`close`,o),r.postMessage=(r,i)=>{let a=Dh(()=>wv(r,t)),o=Nh(a),s=Array.isArray(i)?i:[],c=s.length?[...o,...s]:o,l=()=>{e.postMessage(a,c),lg(c)};if(n&&!n.shipped){n.pending.push(l);return}l()},r.start=()=>e.start();let s=()=>{e.removeEventListener(`message`,i),e.removeEventListener(`messageerror`,a),e.removeEventListener(`close`,o),e.close()};return r.close=()=>{if(n&&!n.shipped){n.pending.push(s);return}s()},r},dg=e=>{if(Tm(e.transport)){let{port1:t,port2:n}=new Fh;return{localPort:t,boxedRemote:og(n,e)}}let{port1:t,port2:n}=new MessageChannel,r={shipped:!1,pending:[]};return cg.set(n,r),{localPort:ug(t,e,r),boxedRemote:og(n,e,{autoBox:!0})}},fg=(e,t,n)=>{let r=Wh(t),{port1:i,port2:a}=n?new Fh:new MessageChannel,o=new WeakRef(i),s=new WeakRef(a),c=!1,l=!1;i instanceof Ph||i.addEventListener(`close`,e=>{l&&e.stopImmediatePropagation()});let u=()=>{if(c)return;c=!0,Kh(r,e);let t=s.deref();t?.removeEventListener(`message`,f),t?.close(),p?.()},d=e=>{if(e.type===`message-port-close`){u();let e=o.deref();e?.dispatchEvent(new Event(`close`)),l=!0,e?.close();return}if(!o.deref()){u();return}let r=s.deref();r&&eg(e.data,t,e=>$h(r,e,n),()=>o.deref()?.dispatchEvent(new Event(`messageerror`)))},f=({data:n})=>{t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:ag(n,t),portId:e,seq:Jh(t,e)})},p=Lh(i,()=>{Qh(t,e),u()});return i instanceof Ph&&(i._onClose=()=>{c||(Qh(t,e),u())}),a.addEventListener(`message`,f),a.start(),Yh(t,e,d),i},pg=Hp({box:()=>vg,isType:()=>_g,objectsOnly:()=>!0,revive:()=>yg,type:()=>mg}),mg=`promise`,hg=e=>e instanceof Promise,gg=new Set,_g=e=>e instanceof Promise,vg=(e,t)=>{if(!hg(e))throw TypeError(`Expected Promise`);let{localPort:n,boxedRemote:r}=dg(t),i=e=>{n.postMessage(e),n.close()};return e.then(e=>i({type:`resolve`,data:e})).catch(e=>i({type:`reject`,error:e})),{...Im,type:mg,port:r}},yg=(e,t)=>{let n=sg(e.port,t);gg.add(n);let r=`portId`in e.port;return new Promise((e,i)=>{let a,o=()=>{n.close(),gg.delete(n),a?.()};if(r&&hh(t)){i(Error(`osra: connection closed`)),o();return}a=r?mh(t,()=>{i(Error(`osra: connection closed`)),o()}):void 0,n.addEventListener(`message`,({data:t})=>{t.type===`resolve`?e(t.data):i(t.error),o()},{once:!0}),n.start()})},bg=Hp({box:()=>Tg,isType:()=>wg,objectsOnly:()=>!0,revive:()=>Eg,type:()=>xg}),xg=`function`,Sg=new Set,Cg=e=>{e instanceof ReadableStream?e.locked||e.cancel(Error(`osra: connection closed`)).catch(()=>{}):typeof WritableStream<`u`&&e instanceof WritableStream&&(e.locked||e.abort(Error(`osra: connection closed`)).catch(()=>{}))},wg=e=>typeof e==`function`,Tg=(e,t)=>{let{port1:n,port2:r}=new Fh;return n.addEventListener(`message`,({data:n})=>{let[r,i]=n;(async()=>{let n;try{n={type:`return`,value:await e(...i)}}catch(e){n={type:`throw`,error:e}}if(hh(t)){n.type===`return`&&Cg(n.value);try{r.close()}catch{}return}let a=(()=>{try{return wv(n,t)}catch(e){return wv({type:`throw`,error:e},t)}})();ig(r,a),queueMicrotask(()=>{try{r.close()}catch{}})})()}),n.start(),{...Im,type:xg,port:og(r,t)}},Eg=(e,t)=>{let n=sg(e.port,t);return((...e)=>new Promise((r,i)=>{if(hh(t)){i(Error(`osra: connection closed`));return}let{port1:a,port2:o}=new Fh;Sg.add(a);let s,c=()=>{a.close(),Sg.delete(a),s?.()};s=mh(t,()=>{i(Error(`osra: connection closed`)),c()}),a.addEventListener(`message`,({data:e})=>{let t=e;t.type===`return`?r(t.value):i(t.error),c()},{once:!0}),a.start();let l=Dh(()=>wv([o,e],t));ig(n,l)}))},Dg=Hp({MAX_CREDIT_WINDOW:()=>64,box:()=>Ng,isType:()=>kg,objectsOnly:()=>!0,revive:()=>Lg,type:()=>Og}),Og=`readableStream`,kg=e=>e instanceof ReadableStream,Ag=2,jg=8,Mg=4*1024*1024,Ng=(e,t)=>{let{localPort:n,boxedRemote:r}=dg(t),i=e.getReader(),a=Th(),o=0,s=!1,c=!1,l=e=>{c=!0;try{n.postMessage(e)}catch{}n.close()},u=async()=>{if(!(s||c)){for(s=!0;o>0;){let e;try{e=await i.read()}catch(e){c||l({type:`error`,error:e});return}if(c)return;if(e.done){l({type:`end`});return}o--;let t=a?Eh(e.value):e.value;try{n.postMessage({type:`chunk`,value:t})}catch(e){l({type:`error`,error:e}),i.cancel(e).catch(()=>{});return}}s=!1}};return n.addEventListener(`message`,({data:e})=>{e instanceof Promise||!(`type`in e)||(e.type===`pull`?n.postMessage(i.read()):e.type===`credit`?(o+=e.n,u()):e.type===`cancel`&&(c=!0,i.cancel(e.reason).catch(()=>{}),n.close()))}),n.addEventListener(`close`,()=>{c||(c=!0,i.cancel(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...Im,type:Og,credit:!0,port:r}},Pg=e=>ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:typeof e==`string`?e.length*2:typeof Blob<`u`&&e instanceof Blob?e.size:void 0,Fg=e=>{let t=!1,n=0,r,i=[],a=!1,o=!1,s,c,l=()=>r===void 0?jg:Math.max(Ag,Math.min(64,Math.floor(Mg/r))),u=()=>{let t=l(),r=n+i.length;if(r>t/2)return;let a=t-r;n+=a,e.postMessage({type:`credit`,n:a})},d=()=>{t=!0,queueMicrotask(()=>e.close())},f=e=>{if(o=!0,s=e,!c||i.length)return;let t=c;c=void 0,d(),t.reject(e)};return new ReadableStream({start:()=>{e.addEventListener(`message`,({data:o})=>{if(!(o instanceof Promise||!(`type`in o))){if(o.type===`chunk`){if(t)return;if(n<=0){i.length=0,f(Error(`osra: stream exceeded its credit window`)),queueMicrotask(()=>e.close());return}n--;let a=Pg(o.value);if(a!==void 0&&(r=r===void 0?a:r*.875+a*.125),c){let e=c;c=void 0,e.controller.enqueue(o.value),e.resolve()}else i.push(o.value)}else if(o.type===`end`){if(t||(a=!0,!c||i.length))return;let e=c;c=void 0,d(),e.controller.close(),e.resolve()}else if(o.type===`error`){if(t)return;f(o.error)}}}),e.addEventListener(`messageerror`,()=>{t||f(Error(`osra: a chunk failed to deserialize on this platform`))}),e.addEventListener(`close`,()=>{t||a||o||f(Error(`osra: connection closed`))},{once:!0})},pull:e=>{if(!t){if(i.length){e.enqueue(i.shift()),!a&&!o&&u();return}if(o)return d(),Promise.reject(s);if(a){d(),e.close();return}return u(),new Promise((t,n)=>{c={controller:e,resolve:t,reject:n}})}},cancel:n=>{t=!0,i.length=0;let r=c;c=void 0,r?.resolve(),e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},Ig=e=>{let t=!1;return new ReadableStream({start:n=>{e.addEventListener(`messageerror`,()=>{if(!t){t=!0;try{n.error(Error(`osra: a chunk failed to deserialize on this platform`))}catch{}queueMicrotask(()=>e.close())}}),e.addEventListener(`close`,()=>{if(!t){t=!0;try{n.error(Error(`osra: connection closed`))}catch{}}},{once:!0})},pull:n=>new Promise((r,i)=>{e.addEventListener(`message`,({data:a})=>{a instanceof Promise&&a.then(i=>{i.done?(t=!0,n.close(),e.postMessage({type:`cancel`}),queueMicrotask(()=>e.close())):n.enqueue(i.value),r()}).catch(e=>{t=!0,i(e)})},{once:!0}),e.postMessage({type:`pull`})}),cancel:n=>{t=!0,e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},Lg=(e,t)=>{let n=sg(e.port,t);return n.start(),e.credit?Fg(n):Ig(n)},Rg=Hp({box:()=>Vg,isType:()=>Bg,objectsOnly:()=>!0,revive:()=>Hg,type:()=>zg}),zg=`writableStream`,Bg=e=>e instanceof WritableStream,Vg=(e,t)=>{let{localPort:n,boxedRemote:r}=dg(t),i=e.getWriter(),a=!1,o=(e,t)=>e.then(()=>n.postMessage({type:`ack`})).catch(e=>n.postMessage({type:`err`,error:e?.message??String(e)})).then(()=>{t&&(a=!0,queueMicrotask(()=>n.close()))});return n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`write`?o(i.write(e.chunk),!1):e.type===`close`?o(i.close(),!0):e.type===`abort`&&o(i.abort(e.reason),!0))}),n.addEventListener(`messageerror`,()=>{n.postMessage({type:`err`,error:`osra: a chunk failed to deserialize on this platform`})}),n.addEventListener(`close`,()=>{a||(a=!0,i.abort(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...Im,type:zg,port:r,...Th()?{transferChunks:!0}:{}}},Hg=(e,t)=>{let n=sg(e.port,t);n.start();let r=new Set,i=!1;n.addEventListener(`close`,()=>{i=!0;let e=Error(`osra: connection closed`);for(let t of[...r])t(e);r.clear()},{once:!0});let a=Promise.resolve(),o=e=>{let t=a.then(()=>new Promise((t,a)=>{if(i){a(Error(`osra: connection closed`));return}let o=e=>{r.delete(a),e()};r.add(a),n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`ack`?o(t):e.type===`err`&&o(()=>a(Error(e.error))))},{once:!0}),n.postMessage(e)}));return a=t.catch(()=>{}),t},s=e.transferChunks===!0;return new WritableStream({write:e=>o({type:`write`,chunk:s?Eh(e):e}),close:()=>o({type:`close`}),abort:e=>o({type:`abort`,reason:e})})},Ug=Hp({box:()=>qg,isType:()=>Gg,objectsOnly:()=>!0,revive:()=>Jg,type:()=>Wg}),Wg=`abortSignal`,Gg=e=>e instanceof AbortSignal,Kg=new WeakMap,qg=(e,t)=>{if(e.aborted)return{...Im,type:Wg,aborted:!0,reason:wv(e.reason,t)};let{localPort:n,boxedRemote:r}=dg(t),i=()=>{n.postMessage({type:`abort`,reason:e.reason}),n.close(),a()},a=mh(t,()=>{e.removeEventListener(`abort`,i),n.close()});return e.addEventListener(`abort`,i,{once:!0}),{...Im,type:Wg,aborted:!1,reason:void 0,port:r}},Jg=(e,t)=>{let n=new AbortController;if(e.aborted||e.port===void 0)return n.abort(Ev(e.reason,t)),n.signal;let r=sg(e.port,t);return Kg.set(n.signal,r),r.start(),r.addEventListener(`message`,({data:e})=>{e.type===`abort`&&(n.abort(Ev(e.reason,t)),Kg.delete(n.signal),r.close())}),n.signal},Yg=Hp({box:()=>Qg,isType:()=>Zg,objectsOnly:()=>!0,revive:()=>$g,type:()=>Xg}),Xg=`response`,Zg=e=>e instanceof Response,Qg=(e,t)=>({...Im,type:Xg,status:e.status,statusText:e.statusText,headers:$m(e.headers,t),body:e.body?Ng(e.body,t):null,url:e.url,redirected:e.redirected}),$g=(e,t)=>{if(e.status===0)return Response.error();let n=eh(e.headers,t),r=e.body?Lg(e.body,t):null,i=e.status===101||e.status===204||e.status===205||e.status===304;r&&i&&r.cancel().catch(()=>{});let a=new Response(i?null:r,{status:e.status,statusText:e.statusText,headers:n});return e.url&&Object.defineProperty(a,"url",{value:e.url,configurable:!0}),e.redirected&&Object.defineProperty(a,"redirected",{value:!0,configurable:!0}),a},e_=Hp({box:()=>r_,isType:()=>n_,objectsOnly:()=>!0,revive:()=>i_,type:()=>t_}),t_=`request`,n_=e=>e instanceof Request,r_=(e,t)=>({...Im,type:t_,method:e.method,url:e.url,headers:$m(e.headers,t),body:e.body?Ng(e.body,t):null,credentials:e.credentials,cache:e.cache,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:qg(e.signal,t)}),i_=(e,t)=>{let n=eh(e.headers,t),r={method:e.method,headers:n,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:Jg(e.signal,t)};return e.mode!==`navigate`&&(r.mode=e.mode),e.body&&(r.body=Lg(e.body,t),r.duplex=`half`),new Request(e.url,r)},a_=Hp({box:()=>__,boxByReference:()=>v_,identity:()=>d_,isType:()=>m_,objectsOnly:()=>!0,revive:()=>y_,type:()=>o_}),o_=`identity`,s_=e=>e!==null&&(typeof e==`object`||typeof e==`function`),c_=e=>{if(e===null)return!1;let t=typeof e;return t===`object`||t===`function`?!0:t===`symbol`?Symbol.keyFor(e)===void 0:!1},l_=new WeakMap,u_=e=>{let t=l_.get(e);if(t!==void 0)return t;let n=globalThis.crypto.randomUUID();return l_.set(e,n),n},d_=e=>(s_(e)&&u_(e),e),f_=new WeakMap,p_=e=>{let t=f_.get(e);if(t)return t;let n=new Map,r={idToLocal:n,pins:new Map,aliasIds:new WeakMap,disposeRegistry:new FinalizationRegistry(t=>{if(n.delete(t),!hh(e))try{e.sendMessage({type:`identity-dispose`,remoteUuid:e.remoteUuid,id:t})}catch{}})};return f_.set(e,r),e.eventTarget.addEventListener(`message`,({detail:e})=>{e?.type===`identity-dispose`&&(r.pins.delete(e.id),r.idToLocal.delete(e.id))}),mh(e,()=>{r.pins.clear(),r.idToLocal.clear()}),r},m_=e=>s_(e)&&l_.has(e),h_=(e,t)=>{let n=t.aliasIds.get(e);if(n!==void 0)return n;let r=u_(e),i=t.idToLocal.get(r);if(i===void 0||i.deref()===e)return r;let a=globalThis.crypto.randomUUID();return t.aliasIds.set(e,a),a},g_=(e,t,n)=>{let r=h_(e,n);if(n.idToLocal.has(r))return{...Im,type:o_,id:r};let i=t();return n.idToLocal.set(r,new WeakRef(e)),n.disposeRegistry.register(e,r,e),vv(()=>{},()=>{n.idToLocal.delete(r),n.disposeRegistry.unregister(e)}),{...Im,type:o_,id:r,inner:i}},__=(e,t)=>{let n=p_(t),r=()=>Tv(e,t,o_);return c_(e)?g_(e,r,n):{...Im,type:o_,id:globalThis.crypto.randomUUID(),inner:r()}},v_=(e,t,n)=>g_(e,()=>t,p_(n)),y_=(e,t)=>{let n=p_(t);if(n.pins.has(e.id))return n.pins.get(e.id);let r=n.idToLocal.get(e.id)?.deref();if(r!==void 0)return r;if(!(`inner`in e)||e.inner===void 0){try{t.sendMessage({type:`identity-dispose`,remoteUuid:t.remoteUuid,id:e.id})}catch{}throw Error(`osra identity: received id=${e.id} with no inner payload and nothing local to resolve it to`)}let i=Ev(e.inner,t);return n.pins.set(e.id,i),c_(i)&&(l_.has(i)||l_.set(i,e.id),n.idToLocal.set(e.id,new WeakRef(i))),i},b_=Hp({box:()=>S_,isType:()=>x_,objectsOnly:()=>!0,revive:()=>C_,type:()=>`map`}),x_=e=>e instanceof Map,S_=(e,t)=>({...Im,type:`map`,entries:Array.from(e,([e,n])=>[wv(e,t),wv(n,t)])}),C_=(e,t)=>new Map(e.entries.map(([e,n])=>[Ev(e,t),Ev(n,t)])),w_=Hp({box:()=>E_,isType:()=>T_,objectsOnly:()=>!0,revive:()=>D_,type:()=>`set`}),T_=e=>e instanceof Set,E_=(e,t)=>({...Im,type:`set`,values:Array.from(e,e=>wv(e,t))}),D_=(e,t)=>new Set(e.values.map(e=>Ev(e,t))),O_=Hp({box:()=>j_,isType:()=>A_,revive:()=>M_,type:()=>k_}),k_=`bigint`,A_=e=>typeof e==`bigint`,j_=(e,t)=>({...Im,type:k_,value:e.toString()}),M_=(e,t)=>BigInt(e.value),N_=Hp({box:()=>I_,isType:()=>F_,objectsOnly:()=>!0,revive:()=>L_,type:()=>P_}),P_=`event`,F_=e=>e instanceof Event,I_=(e,t)=>({...Im,type:P_,eventType:e.type,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,...e instanceof CustomEvent?{detail:wv(e.detail,t)}:{}}),L_=(e,t)=>{let n={bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed};return`detail`in e?new CustomEvent(e.eventType,{...n,detail:Ev(e.detail,t)}):new Event(e.eventType,n)},R_=Hp({box:()=>V_,isType:()=>B_,objectsOnly:()=>!0,revive:()=>G_,type:()=>z_}),z_=`eventTarget`,B_=e=>e instanceof EventTarget,V_=(e,t)=>{let n=[],r=e=>typeof e==`boolean`?e:!!e?.capture;return{...Im,type:z_,addListener:Tg((t,i,a)=>{n.push({eventType:t,listener:i,capture:r(a)}),e.addEventListener(t,i,a)},t),removeListener:Tg((t,i,a)=>{let o=r(a),s=n.findIndex(e=>e.eventType===t&&e.listener===i&&e.capture===o);s!==-1&&n.splice(s,1),e.removeEventListener(t,i,a)},t),removeAllListeners:Tg(()=>{for(let{eventType:t,listener:r,capture:i}of n.splice(0))e.removeEventListener(t,r,{capture:i})},t)}},H_=new WeakMap,U_=e=>{if(typeof e==`function`)return e;let t=H_.get(e);return t||H_.set(e,t=t=>e.handleEvent(t)),t},W_=(e,t,n,r)=>e.find(e=>e.eventType===t&&e.listener===n&&e.capture===r),G_=(e,t)=>{let n=Eg(e.addListener,t),r=Eg(e.removeListener,t),i=Eg(e.removeAllListeners,t),a=new EventTarget,o=[],s=e=>{let t=o.indexOf(e);t!==-1&&o.splice(t,1)};return Object.defineProperty(a,"addEventListener",{value:(e,t,r)=>{if(t===null)return;let i=U_(t),a=typeof r==`boolean`?r:!!r?.capture;if(W_(o,e,i,a))return;let c=typeof r==`object`&&r?.once?e=>(s(l),i(e)):i,l={eventType:e,listener:i,capture:a,wire:c};o.push(l),(typeof r==`object`?r?.signal:void 0)?.addEventListener(`abort`,()=>s(l),{once:!0}),n(e,d_(c),r).catch(()=>{})}}),Object.defineProperty(a,"removeEventListener",{value:(e,t,n)=>{if(t===null)return;let i=U_(t),a=typeof n==`boolean`?n:!!n?.capture,c=W_(o,e,i,a);c&&(s(c),r(e,d_(c.wire),{capture:a}).catch(()=>{}))}}),Lh(a,()=>{i().catch(()=>{})}),a},K_=Hp({box:()=>Y_,isType:()=>J_,revive:()=>X_,type:()=>q_}),q_=`symbol`,J_=e=>typeof e==`symbol`,Y_=(e,t)=>{let n=Symbol.keyFor(e);return n===void 0?v_(e,{...Im,type:q_,description:e.description},t):{...Im,type:q_,registryKey:n}},X_=(e,t)=>`registryKey`in e?Symbol.for(e.registryKey):Symbol(e.description),Z_=Hp({box:()=>ev,isType:()=>$_,objectsOnly:()=>!0,revive:()=>tv,type:()=>Q_}),Q_=`asyncIterator`,$_=e=>!e||typeof e!=`object`||typeof ReadableStream<`u`&&e instanceof ReadableStream?!1:typeof e[Symbol.asyncIterator]==`function`,ev=(e,t)=>{let n=e[Symbol.asyncIterator]();return{...Im,type:Q_,next:Tg((e=>n.next(e)),t),return:Tg((e=>n.return?.(e)??Promise.resolve({done:!0,value:e})),t),throw:Tg((e=>n.throw?.(e)??Promise.reject(e)),t)}},tv=(e,t)=>{let n=Eg(e.next,t),r=Eg(e.return,t),i=Eg(e.throw,t),a={next:(...e)=>n(...e),return:e=>r(e),throw:e=>i(e),[Symbol.asyncIterator]:()=>a};return a},nv=[globalThis.File,globalThis.FileList,globalThis.RegExp,globalThis.DataView,globalThis.ImageData,globalThis.FormData,globalThis.DOMException,globalThis.DOMMatrix,globalThis.DOMMatrixReadOnly,globalThis.DOMPoint,globalThis.DOMPointReadOnly,globalThis.DOMQuad,globalThis.DOMRect,globalThis.DOMRectReadOnly,globalThis.CryptoKey,globalThis.FileSystemHandle,globalThis.FileSystemFileHandle,globalThis.FileSystemDirectoryHandle,globalThis.RTCCertificate],rv=[globalThis.CropTarget,globalThis.EncodedAudioChunk,globalThis.EncodedVideoChunk,globalThis.FencedFrameConfig,globalThis.GPUCompilationInfo,globalThis.GPUCompilationMessage,globalThis.GPUPipelineError,globalThis.RTCEncodedAudioFrame,globalThis.RTCEncodedVideoFrame,globalThis.WebTransportError],iv={type:`clonable`,capableOnly:!0,objectsOnly:!0,isType:e=>mm(e,nv)||mm(e,rv),box:(e,t)=>e,revive:(e,t)=>e},av=[globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.WritableStream,globalThis.TransformStream,globalThis.MediaStreamTrack,globalThis.RTCDataChannel],ov=[globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MIDIAccess,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream],sv={type:`transferable`,capableOnly:!0,objectsOnly:!0,isType:e=>mm(e,av)||mm(e,ov),box:(e,t)=>e,revive:(e,t)=>e},cv={type:`blob`,capableOnly:!0,objectsOnly:!0,isType:e=>typeof Blob<`u`&&e instanceof Blob,box:(e,t)=>{if(Tm(t.transport))throw TypeError(`osra: Blob is only supported on structured-clone transports, send an ArrayBuffer or Uint8Array instead`);return e},revive:(e,t)=>e},lv=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},uv=[_h,a_,Bm,Gm,Xm,th,sh,pg,bg,Rh,Dg,Rg,Ug,Yg,e_,b_,w_,O_,K_,N_,Z_,{type:`nonFiniteNumber`,isType:e=>typeof e==`number`&&!Number.isFinite(e),box:(e,t)=>Tm(t.transport)?{...Im,type:`nonFiniteNumber`,value:String(e)}:e,revive:(e,t)=>Number(e.value)},{type:`undefined`,isType:e=>e===void 0,box:(e,t)=>Tm(t.transport)?{...Im,type:`undefined`}:e,revive:(e,t)=>void 0},iv,sv,cv,R_,{type:`unclonable`,objectsOnly:!0,isType:e=>{if(typeof e!=`object`||!e||Array.isArray(e)||lv(e))return!1;try{return structuredClone(e),!1}catch{return!0}},box:(e,t)=>({...Im,type:`unclonable`}),revive:(e,t)=>({})}],dv=(e,t)=>t.find(t=>t.type===e.type),fv=e=>!!e&&typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype,pv=(e,t)=>Array.isArray(e)?e.map(e=>t(e)):fv(e)?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])):e,mv=new WeakSet,hv=new WeakSet,gv=0,_v=[],vv=(e,t)=>{if(gv===0){e();return}_v.push({commit:e,rollback:t})},yv=e=>{let t=_v;_v=[];for(let n of t)try{e?n.rollback():n.commit()}catch{}},bv=e=>e!==null&&(typeof e==`object`||typeof e==`function`),xv=new WeakMap,Sv=e=>{let t=xv.get(e);if(t)return t;let n=e.filter(e=>!e.objectsOnly);return xv.set(e,n),n},Cv=(e,t,n)=>{let r=(e===null||typeof e!=`object`&&typeof e!=`function`?Sv(t.revivableModules):t.revivableModules).find(t=>t.type!==n&&t.isType(e));return r?r.box(e,t):pv(e,e=>wv(e,t))},wv=(e,t)=>{if(Lm(e))return e;let n=bv(e);if(n){if(mv.has(e))throw TypeError(`osra: cannot serialize a circular structure - break the cycle or send the container by reference`);mv.add(e)}gv++;let r=!0;try{let n=Cv(e,t);return r=!1,n}finally{n&&mv.delete(e),gv--,gv===0&&yv(r)}},Tv=(e,t,n)=>Cv(e,t,n),Ev=(e,t)=>{let n=bv(e);if(n){if(hv.has(e))throw TypeError(`osra: cannot revive a circular structure`);hv.add(e)}try{if(Lm(e)){let n=dv(e,t.revivableModules);if(n)return n.revive(e,t)}return pv(e,e=>Ev(e,t))}finally{n&&hv.delete(e)}},Dv=Hp({init:()=>Av,startBidirectionalConnection:()=>kv,type:()=>Ov}),Ov=`bidirectional`,kv=({transport:e,value:t,remoteUuid:n,eventTarget:r,send:i,revivableModules:a})=>{let o={transport:e,remoteUuid:n,sendMessage:i,eventTarget:r,revivableModules:a};for(let e of a)e.init?.(o);let{promise:s,resolve:c}=Promise.withResolvers();return r.addEventListener(`message`,function e({detail:t}){t.type===`init`&&(c(t.data),r.removeEventListener(`message`,e))}),i({type:`init`,remoteUuid:n,data:wv(t,o)}),{revivableContext:o,remoteValue:s.then(e=>Ev(e,o))}},Av=e=>{if(!(Em(e.transport)&&Dm(e.transport)))return;if(e.protocolEventTarget.addEventListener(`message`,({detail:{message:t,peer:n}})=>{if(t.type===`announce`){if(!t.remoteUuid){e.sendMessage({type:`announce`,remoteUuid:t.uuid});return}if(t.remoteUuid!==e.getUuid()||e.connectionContexts.has(t.uuid))return;e.sendMessage({type:`announce`,remoteUuid:t.uuid});let r=e.createConnectionEventTarget(),i={...n(),abort:()=>e.abortConnection(t.uuid)},a;try{let n=e.valueFor(i);if(e.claimPendingAbort(t.uuid)){e.sendMessage({type:`close`,remoteUuid:t.uuid});return}a=kv({transport:e.transport,value:n,remoteUuid:t.uuid,eventTarget:r,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t.uuid}),e.rejectRemoteValue(n);return}let o={type:`bidirectional`,eventTarget:r,connection:a};e.connectionContexts.set(t.uuid,o),o.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}if(t.type===`close`){if(t.remoteUuid!==e.getUuid())return;let n=e.connectionContexts.get(t.uuid);if(!n)return;e.connectionContexts.delete(t.uuid),gh(n.connection.revivableContext),e.rejectRemoteValue(Error(`osra: peer closed the connection`));return}if(t.remoteUuid!==e.getUuid())return;let r=e.connectionContexts.get(t.uuid);r&&r.eventTarget.dispatchEvent(new CustomEvent(`message`,{detail:t}))}),e.presetRemoteUuid!==void 0){let t=e.presetRemoteUuid,n=e.createConnectionEventTarget(),r,i;try{i={abort:()=>e.abortConnection(t)};let a=e.valueFor(i);if(e.claimPendingAbort(t)){e.sendMessage({type:`close`,remoteUuid:t});return}r=kv({transport:e.transport,value:a,remoteUuid:e.presetRemoteUuid,eventTarget:n,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t}),e.rejectRemoteValue(n);return}let a={type:`bidirectional`,eventTarget:n,connection:r};e.connectionContexts.set(e.presetRemoteUuid,a),a.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}let t=50,n,r=()=>{if(!(e.unregisterSignal?.aborted||e.connectionContexts.size>0)){try{e.sendMessage({type:`announce`},`*`)}catch{}n=setTimeout(r,t),t=Math.min(t*2,1e3)}};e.unregisterSignal?.addEventListener(`abort`,()=>clearTimeout(n),{once:!0}),r()},jv=()=>new EventTarget,Mv=e=>{let t=jm(e),n=t?e.emit:e,r=t?e.receive:e;return{isJson:t&&`isJson`in e&&e.isJson!==void 0?e.isJson:n!==void 0&&Tm(n)||r!==void 0&&Tm(r),...n===void 0?{}:{emit:n},...r===void 0?{}:{receive:r}}},Nv=e=>e?e(uv):uv,Pv=32,Fv=()=>{let e=[],t=new Set,n=!1,r=()=>({value:void 0,done:!0});return{push:r=>{if(!n){if(t.size===0){e.push(r),e.length>Pv&&e.shift();return}for(let e of t){let t=e.wake;if(t){e.wake=void 0,t({value:r,done:!1});continue}e.buffered.push(r)}}},close:()=>{n=!0;for(let e of t){let t=e.wake;e.wake=void 0,t?.(r())}},iterate:()=>{let i={buffered:[...e]};t.add(i);let a=!1;return{[Symbol.asyncIterator](){return this},next:()=>{if(a)return Promise.resolve(r());let e=i.buffered.shift();return e?Promise.resolve({value:e,done:!1}):n?Promise.resolve(r()):new Promise(e=>{i.wake=e})},return:()=>{a=!0,t.delete(i);let e=i.wake;return i.wake=void 0,e?.(r()),Promise.resolve(r())}}}}},Iv=(e,t,n)=>{let r=e.then(n);r.catch(()=>{});let i=()=>{let e=t.iterate();return{[Symbol.asyncIterator](){return this},next:()=>e.next().then(e=>e.done?{value:void 0,done:!0}:{value:n(e.value),done:!1}),return:()=>e.return?.()??Promise.resolve({value:void 0,done:!0})}};return Object.assign(r,{[Symbol.asyncIterator]:i})},Lv=Symbol.for(`osra.context`),Rv=e=>typeof e==`object`&&!!e&&Lv in e,zv=[Dv],Bv=(e,{transport:t,name:n,remoteName:r,key:i=Wp,origin:a=`*`,unregisterSignal:o,revivableModules:s,uuid:c,remoteUuid:l,connection:u=({value:e})=>e})=>{let d=u,f=Mv(t);if(!(Em(f)&&Dm(f))){let e=Fv();e.close();let t=Promise.reject(Error(`osra: transport must be able to both emit and receive to establish a connection; pass a bidirectional platform transport or a custom { emit, receive } pair`));return t.catch(()=>{}),Iv(t,e,d)}let p=Nv(s),m=new Map,h=new Set,g=Fv(),{promise:_,resolve:ee,reject:v}=Promise.withResolvers();_.catch(()=>{});let y=c??globalThis.crypto.randomUUID(),te=(e,t=a)=>{let r={[Up]:i,name:n,uuid:y,...e},o=Nh(r);$p(f,r,t,o),lg(o)},b=(e,t)=>{o?.aborted||te(e,t)},ne=jv(),x={transport:f,valueFor:t=>Rv(e)?e[Lv](t):e,revivableModules:p,connectionContexts:m,getUuid:()=>y,presetRemoteUuid:l,sendMessage:b,protocolEventTarget:ne,rejectRemoteValue:v,abortConnection:e=>{let t=m.get(e);if(!t){h.add(e);return}m.delete(e),te({type:`close`,remoteUuid:e}),gh(t.connection.revivableContext),v(Error(`osra: connection aborted`))},claimPendingAbort:e=>h.delete(e),addConnection:(e,t)=>{let n={value:t,context:e};ee(n),g.push(n)},createConnectionEventTarget:jv,unregisterSignal:o};if(Xp({listener:(e,t)=>{e.uuid!==y&&ne.dispatchEvent(new CustomEvent(`message`,{detail:{message:e,peer:()=>({...t.origin?{origin:t.origin}:{},...t.source?{source:t.source}:{},...t.port?{port:t.port}:{},...t.sender?{sender:t.sender}:{}})}}))},transport:f,remoteName:r,key:i,origin:a,unregisterSignal:o}),o?.aborted)return v(o.reason),g.close(),Iv(_,g,d);o?.addEventListener(`abort`,()=>{for(let[e,t]of m)te({type:`close`,remoteUuid:e}),gh(t.connection.revivableContext);m.clear(),g.close(),v(o.reason)},{once:!0});for(let e of zv)e.init(x);return Iv(_,g,d)},Vv=(e,t)=>Bv(e,t);const Hv={kind:`Document`,definitions:[{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`Episode`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Stable unique identifier that persists across URI changes and source additions`,block:!0},name:{kind:`Name`,value:`_id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Uri consists of the `origin` and `id` fields in the format `origin:id`",block:!0},name:{kind:`Name`,value:`uri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"String that is used to target a specific origin, e.g `google` or `yt` for youtube",block:!0},name:{kind:`Name`,value:`origin`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An id that references a specific resource within the origin space`,block:!0},name:{kind:`Name`,value:`id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An url to the media resource`,block:!0},name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Uri to the media resource`,block:!0},name:{kind:`Name`,value:`mediaUri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Every other row this episode is related to. See `MediaHandle` for why the relation is explicit.",block:!0},name:{kind:`Name`,value:`handles`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeHandle`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`titles`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeTitle`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeShortDescriptionInput`}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeShortDescription`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeDescriptionInput`}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeDescription`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`releaseDate`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`relativeNumber`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`absoluteNumber`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`thumbnails`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeThumbnail`}}}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`URL for an embeddable player iframe`,block:!0},name:{kind:`Name`,value:`embedUrl`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`seasonNumber`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`episodeNumber`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`absoluteEpisodeNumber`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Runtime in minutes`,block:!0},name:{kind:`Name`,value:`runtime`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeTitle`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`title`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeShortDescriptionInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`type`},type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeDescriptionContentType`}},defaultValue:{kind:`EnumValue`,value:`TEXT`},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`count`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeShortDescription`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`shortDescription`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`EpisodeDescriptionContentType`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`HTML`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`TEXT`},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeDescriptionInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`type`},type:{kind:`NamedType`,name:{kind:`Name`,value:`EpisodeDescriptionContentType`}},defaultValue:{kind:`EnumValue`,value:`TEXT`},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`count`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeDescription`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`description`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`EpisodeThumbnail`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`height`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`width`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Average #hex color of cover image`,block:!0},name:{kind:`Name`,value:`color`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:"One edge out of an episode. Shares `MediaHandleRelation` with media on purpose: the two questions are\nthe same question, and a second enum with the same two values would drift.",block:!0},name:{kind:`Name`,value:`EpisodeHandle`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The related row. Carries its own uri, origin, id and url.`,block:!0},name:{kind:`Name`,value:`node`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`What this edge asserts. Only SAME_AS unions clusters.`,block:!0},name:{kind:`Name`,value:`relation`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaHandleRelation`}}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`MediaType`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`TV`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A televised run of very short episodes. Its own member rather than a TV with a small \`episodeCount\`,
112
- because AniList publishes the distinction and a viewer filtering for shorts is asking for exactly it.
113
-
114
- ONLY ANILIST EVER EMITS IT, and AniList loses \`type\` to jikan, which scores 0.9 against 0.8 and
115
- spells the same show TV. So a short jikan also carries profiles as TV in the aggregate and answers a
116
- TV filter rather than a TV_SHORT one. That is a known subset, not a bug to work around here: making
117
- it exact means changing which source wins \`type\`, and that precedence is what keeps a stale dump from
118
- overwriting a live catalogue (store/aggregate.ts:203, sources/offline/normalize.ts:19-31).
119
-
120
- INVISIBLE TO THE MERGE, and that takes real code rather than an omission. \`mergeType\` in
121
- store/fuzzy-merge.ts folds it back to TV before a cluster is profiled, because every gate in that
122
- file was calibrated on a corpus where AniList's shorts arrived spelled TV. Reading the new member
123
- there would move two profiles at once on a cluster AniList alone types, and an empty work-kind set
124
- disables the companion-content veto outright.`,block:!0},name:{kind:`Name`,value:`TV_SHORT`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`MOVIE`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`ANIME`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Special episodes that have been included in DVD/Blu-ray releases, picture dramas, pilots, etc`,block:!0},name:{kind:`Name`,value:`SPECIAL`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`(Original Video Animation) Anime that have been released directly on
125
- DVD/Blu-ray without originally going through a theatrical release or
126
- television broadcast`,block:!0},name:{kind:`Name`,value:`OVA`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`(Original Net Animation) Anime that have been originally released online or are only available through streaming services.`,block:!0},name:{kind:`Name`,value:`ONA`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Live action media such as movies or TV show`,block:!0},name:{kind:`Name`,value:`LIVE_ACTION`},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`MediaStatus`},directives:[],values:[{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Has completed and is no longer being released`,block:!0},name:{kind:`Name`,value:`FINISHED`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Currently releasing`,block:!0},name:{kind:`Name`,value:`RELEASING`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`To be released at a later date`,block:!0},name:{kind:`Name`,value:`NOT_YET_RELEASED`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Ended before the work could be finished`,block:!0},name:{kind:`Name`,value:`CANCELLED`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Is currently paused from releasing and will resume at a later date`,block:!0},name:{kind:`Name`,value:`HIATUS`},directives:[]}]},{kind:`EnumTypeDefinition`,description:{kind:`StringValue`,value:`The broadcast season a run aired in.
127
-
128
- Named by the SOURCE, never derived from \`startDate\` here. Seven extractors coerce a bare year into
129
- January 1 and two answer YYYY-MM-01 for a month-only date (see \`namesADay\` in sources/season.ts), so
130
- deriving a season from a start date would file every year-only row under WINTER.`,block:!0},name:{kind:`Name`,value:`MediaSeason`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`WINTER`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`SPRING`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`SUMMER`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`FALL`},directives:[]}]},{kind:`EnumTypeDefinition`,description:{kind:`StringValue`,value:`Broad content category. A media can belong to several (e.g. an anime film is ANIME + MOVIE).`,block:!0},name:{kind:`Name`,value:`MediaCategory`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`ANIME`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`An episodic series (TV / live-action / web).`,block:!0},name:{kind:`Name`,value:`SERIES`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`MOVIE`},directives:[]}]},{kind:`EnumTypeDefinition`,description:{kind:`StringValue`,value:`What a handle asserts about the media carrying it. STRUCTURAL only: identity and containment.
131
-
132
- Narrative relations between different works (prequel, sequel, adaptation, side story) are a SEPARATE
133
- axis and will get their own \`MediaRelation\` enum on their own field. They are deliberately not mixed:
134
- PREQUEL says nothing about whether two rows are the same media, and SAME_AS says nothing about story
135
- order. One enum spanning both would mean neither.`,block:!0},name:{kind:`Name`,value:`MediaHandleRelation`},directives:[],values:[{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The handle names THIS run. The only relation that unions clusters, in \`upsertMedia\`, and the union
136
- has NO INVERSE: once two media are welded they stay welded for the session.
137
-
138
- Minting this for an id that names a SHOW is the single most expensive mistake available here. It
139
- merged three Mushoku Tensei seasons, four Demon Slayer films and fifteen Dragon Ball Z films, each
140
- time because one id was the only thing a source could offer and the only relation was this one.`,block:!0},name:{kind:`Name`,value:`SAME_AS`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`This media is one PART of what the handle names: a run of that show, a film published under that
141
- series, a season of that title.
142
-
143
- It carries the handle's url WITHOUT claiming to be it, so a show-level id is worth keeping instead
144
- of being dropped. It never unions, so no number of these can weld two runs together. What it costs
145
- is that nothing may read episodes, titles, covers or any other metadata across it: the thing on the
146
- other end is a bigger thing, and its episode list is every run's at once.`,block:!0},name:{kind:`Name`,value:`PART_OF`},directives:[]}]},{kind:`EnumTypeDefinition`,description:{kind:`StringValue`,value:`Which kind of thing a row names, and so which identity space its SAME_AS claims union in.
147
-
148
- Sameness is only ever asserted within one scope. A claim that crosses scopes is read as PART_OF,
149
- whatever the producer asked for: a run is part of its show, never the same thing as it.`,block:!0},name:{kind:`Name`,value:`MediaScope`},directives:[],values:[{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`One broadcast run: a cour, a film. The unit this store aggregates and the unit a card shows.`,block:!0},name:{kind:`Name`,value:`RUN`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A show, a series, a franchise page: something several runs are part of.`,block:!0},name:{kind:`Name`,value:`CONTAINER`},directives:[]}]},{kind:`EnumTypeDefinition`,description:{kind:`StringValue`,value:`How one work relates to another as a STORY. The other axis, and never mixed with \`MediaHandleRelation\`.
150
-
151
- That enum answers "are these the same thing", this one answers "how does this story connect to that
152
- one", and the schema has kept them apart deliberately since the handle enum was written: PREQUEL says
153
- nothing about sameness and SAME_AS says nothing about story order. Nothing here may ever union a
154
- cluster. A sequel is a DIFFERENT work, and treating one as the same row is the mistake that merged
155
- three Mushoku Tensei seasons when it was made with SAME_AS.
156
-
157
- The values are AniList's set (\`relationType(version: 2)\`), which is the widest of the vocabularies in
158
- play and the one MyAnimeList's own relation names map into without inventing anything. Confirmed
159
- against live data 2026-09-08: anilist 108465 answers SOURCE, ALTERNATIVE and SEQUEL.`,block:!0},name:{kind:`Name`,value:`MediaRelation`},directives:[],values:[{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`This work adapts the other, which is usually the manga or novel it came from.`,block:!0},name:{kind:`Name`,value:`ADAPTATION`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The other work comes first in the story.`,block:!0},name:{kind:`Name`,value:`PREQUEL`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The other work comes after.`,block:!0},name:{kind:`Name`,value:`SEQUEL`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The other work is the parent story this one hangs off.`,block:!0},name:{kind:`Name`,value:`PARENT`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A story beside the main one rather than before or after it.`,block:!0},name:{kind:`Name`,value:`SIDE_STORY`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The other work follows a character out of this one.`,block:!0},name:{kind:`Name`,value:`CHARACTER`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A recap or digest of the other work.`,block:!0},name:{kind:`Name`,value:`SUMMARY`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A different telling of the same story.`,block:!0},name:{kind:`Name`,value:`ALTERNATIVE`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`A work spun out of this one, sharing a world rather than a plot.`,block:!0},name:{kind:`Name`,value:`SPIN_OFF`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`The material this work was adapted FROM. The inverse of ADAPTATION.`,block:!0},name:{kind:`Name`,value:`SOURCE`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Several works collected into one release.`,block:!0},name:{kind:`Name`,value:`COMPILATION`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`This work contains the other.`,block:!0},name:{kind:`Name`,value:`CONTAINS`},directives:[]},{kind:`EnumValueDefinition`,description:{kind:`StringValue`,value:`Related, in a way the source did not name.`,block:!0},name:{kind:`Name`,value:`OTHER`},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:`One narrative edge out of a media: what it relates to, and how.
160
-
161
- The node is a SNAPSHOT and not necessarily a row this store has ever fetched. A franchise runs to
162
- dozens of entries and resolving each before anything could render would make one modal cost dozens of
163
- requests, so the edge carries what a card and a graph node need (uri, titles, format, status, cover,
164
- episode count, start date) and nothing else is promised. Opening one navigates to its uri, and the
165
- store fills that row in properly at that point.
166
-
167
- Same shape as \`MediaHandle\` on purpose, so the same components render both.`,block:!0},name:{kind:`Name`,value:`MediaRelationEdge`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`What this edge claims about the story. Never about identity.`,block:!0},name:{kind:`Name`,value:`relation`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaRelation`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The related work, as much of it as the naming source supplied.`,block:!0},name:{kind:`Name`,value:`node`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"What KIND of work the other end is, in the naming source's own words: `TV`, `MOVIE`, `MANGA`,\n`NOVEL`, `ONE_SHOT`.\n\nA string, and on the EDGE rather than on the node, for one reason: `MediaType` is anime formats\nonly, and a franchise's relations are mostly NOT anime. The novel a show adapts is the single most\nuseful relation there is and it cannot be spelled in that enum. Widening `MediaType` to hold it\nwould reach `mergeType` in store/fuzzy-merge.ts and every filter built on it, to carry something\nonly ever displayed; the enum's own comment records what moving it costs.\n\nDISPLAY ONLY. Nothing may branch on it.",block:!0},name:{kind:`Name`,value:`format`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:`One work in a franchise graph, thin enough that a whole series fits in one payload.`,block:!0},name:{kind:`Name`,value:`MediaFranchiseNode`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`What a click navigates to. Also the id the edges below join on.`,block:!0},name:{kind:`Name`,value:`uri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`titles`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaTitle`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`covers`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaCover`}}}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"The naming source's own word for the kind of work. Display only, as on `MediaRelationEdge`.",block:!0},name:{kind:`Name`,value:`format`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`status`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaStatus`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`episodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`startDate`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:"One arrow in a franchise graph, joining two `MediaFranchiseNode` uris.",block:!0},name:{kind:`Name`,value:`MediaFranchiseEdge`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`from`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`to`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`relation`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaRelation`}}},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:`Every work in one series, and how they connect: the whole graph rather than one media's own edges.
168
-
169
- WHY IT IS NOT JUST \`relations\` WALKED. Following every edge leaks out of the franchise entirely. A
170
- crossover promotional short relates BY CHARACTER to each series taking part, so two hops out of
171
- \`That Time I Got Reincarnated as a Slime\` reaches Attack on Titan, Fire Force, Chihayafuru and seven
172
- other unrelated shows. Measured 2026-09-08 against live AniList: following every edge reached 36
173
- works of which 10 were off-franchise, while following only the STORY edges reached 21 works and none.
174
-
175
- So CHARACTER and OTHER are reported as relations and never TRAVERSED. They answer "who appears in
176
- this" and "these are connected somehow", neither of which is "this is the same series".`,block:!0},name:{kind:`Name`,value:`MediaFranchise`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`nodes`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaFranchiseNode`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`edges`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaFranchiseEdge`}}}}},directives:[]}]},{kind:`ObjectTypeDefinition`,description:{kind:`StringValue`,value:`One edge out of a media: which row, and what the edge claims about it.`,block:!0},name:{kind:`Name`,value:`MediaHandle`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The related row. Carries its own uri, origin, id and url.`,block:!0},name:{kind:`Name`,value:`node`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`What this edge asserts. Only SAME_AS unions clusters.`,block:!0},name:{kind:`Name`,value:`relation`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaHandleRelation`}}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`Media`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Stable unique identifier that persists across URI changes and source additions`,block:!0},name:{kind:`Name`,value:`_id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Uri consists of the `origin` and `id` fields in the format `origin:id`",block:!0},name:{kind:`Name`,value:`uri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"String that is used to target a specific origin, e.g `google` or `yt` for youtube",block:!0},name:{kind:`Name`,value:`origin`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An id that references a specific resource within the origin space`,block:!0},name:{kind:`Name`,value:`id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An url to the media resource`,block:!0},name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Every other row this media is related to, and what each relation actually claims.
177
-
178
- Was \`[Media!]!\`, a bare list, which forced one relation on everything: a handle either asserted
179
- sameness or did not exist. That is why a source holding only a show-level id had to choose between
180
- lying and staying silent, and why \`worker/store/db.ts\` had to special-case IMDb out of the graph
181
- entirely rather than carry its link.`,block:!0},name:{kind:`Name`,value:`handles`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaHandle`}}}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Every work this one is related to as a STORY: prequels, sequels, the novel it adapts, side stories.\n\nSeparate from `handles`, which is about identity. See `MediaRelation`. Empty rather than null when a\nsource named none, which is most of them: only AniList supplies these today.",block:!0},name:{kind:`Name`,value:`relations`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaRelationEdge`}}}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The whole series this work belongs to, as a graph. Null where no source could supply one, which is
182
- most of them. NULLABLE deliberately: a non-null list that a source omits nulls the media carrying
183
- it, taking the rest of the payload with it.`,block:!0},name:{kind:`Name`,value:`franchise`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaFranchise`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Which identity space this row lives in. An absent value reads as RUN.`,block:!0},name:{kind:`Name`,value:`scope`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaScope`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`titles`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaTitle`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`type`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaType`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Broad categories this media belongs to (anime / series / movie); can be several.`,block:!0},name:{kind:`Name`,value:`categories`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaCategory`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`status`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaStatus`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescription`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionInput`}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescription`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`trailers`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaTrailer`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`covers`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaCover`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`banners`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaBanner`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`averageScore`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`popularity`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`startDate`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`endDate`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`isAdult`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`episodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The soonest episode a source has scheduled that has not aired yet, or null.
184
-
185
- Derived from AniList's airing schedule, which was already fetched for \`startDate\`, so it costs no
186
- request. Null means "nobody scheduled anything ahead of now", which covers a finished run and a
187
- source that publishes no schedule alike: it is not a promise that the run has ended.`,block:!0},name:{kind:`Name`,value:`nextAiringEpisode`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaAiringEpisode`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The broadcast season this run aired in, as the source named it.`,block:!0},name:{kind:`Name`,value:`season`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaSeason`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The calendar year \`season\` belongs to.
188
-
189
- Separate from \`startDate\` because it survives a coerced date: a source that only knows the year
190
- still files the run under the right season when another source names one, and a January premiere
191
- stays in the WINTER of its own year rather than the FALL of the year before.`,block:!0},name:{kind:`Name`,value:`seasonYear`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Broad content descriptors, deduplicated across the cluster, richest source first.
192
-
193
- Free-form strings rather than an enum because no two catalogues agree on a fixed set, and an enum
194
- would have to drop every value it had not anticipated. Supplied by AniList and jikan; the bundled
195
- offline catalogue publishes none, so a genre filter cannot be answered during an upstream outage.`,block:!0},name:{kind:`Name`,value:`genres`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Finer-grained descriptors than \`genres\`, from AniList's own tag vocabulary.
196
-
197
- Kept apart from genres rather than merged into one list because AniList publishes them separately
198
- and its own browse UI groups them separately, so a merged list could not reproduce either. Tags
199
- AniList marks as a spoiler are dropped at the source and never reach here.`,block:!0},name:{kind:`Name`,value:`tags`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`episodes`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}}}}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaTitle`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`title`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`MediaShortDescriptionInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`type`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionContentType`}},defaultValue:{kind:`EnumValue`,value:`TEXT`},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`count`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaShortDescription`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`shortDescription`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`MediaDescriptionContentType`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`HTML`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`TEXT`},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`MediaDescriptionInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`type`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionContentType`}},defaultValue:{kind:`EnumValue`,value:`TEXT`},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`count`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaDescription`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`description`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaTrailer`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Uri consists of the `origin` and `id` fields in the format `origin:id`",block:!0},name:{kind:`Name`,value:`uri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"String that is used to target a specific origin, e.g `google` or `yt` for youtube",block:!0},name:{kind:`Name`,value:`origin`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An id that references a specific resource within the origin space`,block:!0},name:{kind:`Name`,value:`id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An url to the media resource`,block:!0},name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`thumbnail`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaAiringEpisode`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Which episode of the run this is, as the source numbers it.`,block:!0},name:{kind:`Name`,value:`episodeNumber`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`When it airs.`,block:!0},name:{kind:`Name`,value:`airingAt`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaCover`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`height`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`width`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Average #hex color of cover image`,block:!0},name:{kind:`Name`,value:`color`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaBanner`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`language`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`height`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`width`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Average #hex color of cover image`,block:!0},name:{kind:`Name`,value:`color`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`score`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Float`}},directives:[]}]},{kind:`InputObjectTypeDefinition`,description:{kind:`StringValue`,value:`What the app asked for at the TOP of the call, so a source can tell a detail view from a listing.
200
-
201
- THE WORKER WRITES THIS. Every field is regenerated from the worker's own registry at each source's
202
- boundary before the arguments are coerced, so a value supplied by a caller is replaced rather than
203
- trusted, and only \`token\` is ever read off the wire. Nullable because the app's own documents send
204
- none: they are validated by the app-level server before the fan-out that stamps them runs.`,block:!0},name:{kind:`Name`,value:`RequestContext`},directives:[],fields:[{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Identifies THIS hop to the worker. The only field read back off the wire.`,block:!0},name:{kind:`Name`,value:`token`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Stable for the whole call tree, so a source may memoize per root rather than per hop.`,block:!0},name:{kind:`Name`,value:`rootId`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}}},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`operation`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`RootOperation`}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`The origins already on the stack, nearest last. A source seeing itself here is in a cycle.`,block:!0},name:{kind:`Name`,value:`chain`},type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`RootOperation`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`MEDIA`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`MEDIA_PAGE`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`SIMILAR_MEDIA`},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`MediaInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`uri`},type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`context`},type:{kind:`NamedType`,name:{kind:`Name`,value:`RequestContext`}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`MediaSort`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`POPULARITY`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`POPULARITY_DESC`},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`MediaPageInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`context`},type:{kind:`NamedType`,name:{kind:`Name`,value:`RequestContext`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by media IDs`,block:!0},name:{kind:`Name`,value:`nodes`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by search terms`,block:!0},name:{kind:`Name`,value:`search`},type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by the media's current release status`,block:!0},name:{kind:`Name`,value:`status`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaStatus`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by category (anime / series / movie); media matching ANY of these are kept.`,block:!0},name:{kind:`Name`,value:`categories`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaCategory`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:"Filter by format; media whose `type` is ANY of these are kept. A media with no type is dropped.",block:!0},name:{kind:`Name`,value:`formats`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaType`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by broadcast season. Pair it with \`seasonYear\` to name one season rather than every WINTER.
205
-
206
- A source that can answer a season directly is asked for THIS one instead of the clock's; a source
207
- that cannot answers nothing rather than answering the current season, which would look like a
208
- result set and be the wrong year.`,block:!0},name:{kind:`Name`,value:`season`},type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaSeason`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:"Filter by the year of `season`.",block:!0},name:{kind:`Name`,value:`seasonYear`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by genre; media carrying ALL of these are kept, compared case-insensitively.`,block:!0},name:{kind:`Name`,value:`genres`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by tag; media carrying ALL of these are kept, compared case-insensitively.`,block:!0},name:{kind:`Name`,value:`tags`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`sorts`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaSort`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by the start date of the media`,block:!0},name:{kind:`Name`,value:`startDate`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Filter by the end date of the media`,block:!0},name:{kind:`Name`,value:`endDate`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Cursor from where to start`,block:!0},name:{kind:`Name`,value:`at`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`How many pages before the cursor to return`,block:!0},name:{kind:`Name`,value:`before`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`How many pages after the cursor to return`,block:!0},name:{kind:`Name`,value:`after`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`MediaPage`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`firstPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`previousPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`currentPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The first page`,block:!0},name:{kind:`Name`,value:`nextPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The last page cursor`,block:!0},name:{kind:`Name`,value:`lastPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items on the current page`,block:!0},name:{kind:`Name`,value:`currentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The total number of items. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`totalNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items before the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`beforeCurrentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items after the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`afterCurrentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The media page nodes`,block:!0},name:{kind:`Name`,value:`nodes`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}}}}},directives:[]}]},{kind:`InputObjectTypeDefinition`,description:{kind:`StringValue`,value:`The run a caller is looking for, described by EVIDENCE about its own run and never by a season number.
209
-
210
- Stub models a broadcast run; every catalogue models a show with seasons hanging off it, and no two
211
- catalogues number those seasons the same way. Netflix folds two cours into one season (its season 2 of
212
- Mushoku Tensei is 25 episodes over anime's 13 and 12), JustWatch numbers by its own list, anime metadata
213
- says "Season 2 Part 2". Two numberings in one id space collide: on 2026-09-05 anime season 1 (11
214
- episodes, no ordinal in its title) took \`nf:80987039-3\` by episode count while season 3 took the same id
215
- by its ordinal, and \`graph.link\` has no inverse. So a caller holding a show-level id says what it knows
216
- about ITS run and the owning origin answers with the one run of that show the evidence establishes, or
217
- with null.
218
-
219
- What counts as established is decided in ONE place, \`sources/similar.ts\`, and every answering source
220
- goes through it: a season premiere within 45 days of a day-precise start, episode titles covering most
221
- of a season, an ordinal every title agrees on with an episode count the season does not exceed, the
222
- one season dated our year holding no more than our count, or the first season holding our episodes. A
223
- season holding MORE episodes than the run is a fold of several runs and is never the answer, and a
224
- season whose length is unknown cannot be shown not to be one. Anything ambiguous is null.
225
-
226
- The rules decide WHICH season of the show and never WHICH show: \`showId\` settles that, and it came off
227
- a PART_OF edge whose container cluster a listing's fuzzy title pass may have unioned, so an answer is
228
- only as right as that union.`,block:!0},name:{kind:`Name`,value:`SimilarMediaInput`},directives:[],fields:[{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`The show's id in the ANSWERING origin's own space: a Crunchyroll series id, a Netflix title id, a JustWatch node objectId.`,block:!0},name:{kind:`Name`,value:`showId`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:"When our run started. A date naming a DAY is matched within 45 days; a bare year (`YYYY-01-01`) vetoes a season dated another year and, with an episode count on both sides, names the one season dated ours.",block:!0},name:{kind:`Name`,value:`startDate`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Date`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`Every title the caller knows for its run. Read for the season ordinals they agree on, never for the franchise: the show id already settles that.`,block:!0},name:{kind:`Name`,value:`titles`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`How many episodes our run has. A season holding more is a fold of several runs and is refused.`,block:!0},name:{kind:`Name`,value:`episodeCount`},type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`InputValueDefinition`,description:{kind:`StringValue`,value:`The titles of our run's episodes, when the caller has them. A season most of whose episode titles we carry is ours; one sharing none is not, whatever its number.`,block:!0},name:{kind:`Name`,value:`episodeTitles`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`context`},type:{kind:`NamedType`,name:{kind:`Name`,value:`RequestContext`}},directives:[]}]},{name:{kind:`Name`,value:`Subscription`},kind:`ObjectTypeDefinition`,fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`media`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}},directives:[]}],type:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPage`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The one run of \`showId\` that is the caller's run by the evidence given, or null.
229
-
230
- The answer is a RUN at the answering origin and carries no handle naming another run: the CALLER
231
- decides what to claim about it. Null is the expected answer and never an error: no such show, no
232
- evidence that settles it, or evidence fitting two seasons. Answering with the SHOW here, or with a
233
- season the evidence merely fails to contradict, recreates the weld the caller asked in order to avoid.`,block:!0},name:{kind:`Name`,value:`similarMedia`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`SimilarMediaInput`}}},directives:[]}],type:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`origin`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginInput`}}},directives:[]}],type:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`input`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}},directives:[]}],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPage`}}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`_empty`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]}],directives:[],interfaces:[]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`Origin`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An id to references the origin`,block:!0},name:{kind:`Name`,value:`id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An url to the origin`,block:!0},name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The name of the origin`,block:!0},name:{kind:`Name`,value:`name`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The origin's icon`,block:!0},name:{kind:`Name`,value:`icon`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The origin's color`,block:!0},name:{kind:`Name`,value:`color`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`If the origin is an api only origin`,block:!0},name:{kind:`Name`,value:`isApiOnly`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}}},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`OriginInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`id`},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`OriginFilter`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`IS_API_ONLY`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`IS_NOT_API_ONLY`},directives:[]}]},{kind:`InputObjectTypeDefinition`,name:{kind:`Name`,value:`OriginPageInput`},directives:[],fields:[{kind:`InputValueDefinition`,name:{kind:`Name`,value:`ids`},type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`ID`}}}}},directives:[]},{kind:`InputValueDefinition`,name:{kind:`Name`,value:`filters`},type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginFilter`}}}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`OriginPage`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`firstPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`previousPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The current page`,block:!0},name:{kind:`Name`,value:`currentPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The first page`,block:!0},name:{kind:`Name`,value:`nextPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The last page cursor`,block:!0},name:{kind:`Name`,value:`lastPageCursor`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Id`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items on the current page`,block:!0},name:{kind:`Name`,value:`currentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The total number of items. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`totalNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items before the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`beforeCurrentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`Total number of items after the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic`,block:!0},name:{kind:`Name`,value:`afterCurrentPageNodeCount`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Int`}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`The media page nodes`,block:!0},name:{kind:`Name`,value:`nodes`},arguments:[],type:{kind:`NonNullType`,type:{kind:`ListType`,type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}}}}},directives:[]}]},{kind:`EnumTypeDefinition`,name:{kind:`Name`,value:`PlaybackSourceType`},directives:[],values:[{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`IFRAME`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`CUSTOM`},directives:[]},{kind:`EnumValueDefinition`,name:{kind:`Name`,value:`OTHER`},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`PlaybackSource`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"Uri consists of the `origin` and `id` fields in the format `origin:id`",block:!0},name:{kind:`Name`,value:`uri`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:"String that is used to target a specific origin, e.g `google` or `yt` for youtube",block:!0},name:{kind:`Name`,value:`origin`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An id that references a specific resource within the origin space`,block:!0},name:{kind:`Name`,value:`id`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`An url to the media resource`,block:!0},name:{kind:`Name`,value:`url`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`type`},arguments:[],type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`PlaybackSourceType`}}},directives:[]},{kind:`FieldDefinition`,description:{kind:`StringValue`,value:`JSON data for custom players`,block:!0},name:{kind:`Name`,value:`data`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`JSON`}},directives:[]},{kind:`FieldDefinition`,name:{kind:`Name`,value:`Episode`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},directives:[]}]},{kind:`ScalarTypeDefinition`,name:{kind:`Name`,value:`JSON`},directives:[]},{kind:`ScalarTypeDefinition`,name:{kind:`Name`,value:`Id`},directives:[]},{kind:`ScalarTypeDefinition`,name:{kind:`Name`,value:`Date`},directives:[]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`Query`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`_empty`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]}]},{kind:`ObjectTypeDefinition`,name:{kind:`Name`,value:`Mutation`},interfaces:[],directives:[],fields:[{kind:`FieldDefinition`,name:{kind:`Name`,value:`_empty`},arguments:[],type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}},directives:[]}]},{kind:`SchemaDefinition`,directives:[],operationTypes:[{kind:`OperationTypeDefinition`,operation:`query`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Query`}}},{kind:`OperationTypeDefinition`,operation:`mutation`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Mutation`}}},{kind:`OperationTypeDefinition`,operation:`subscription`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Subscription`}}}]}]};var Uv=`scalar JSON
234
- scalar Id
235
- scalar Date
236
-
237
- type Query {
238
- _empty: String
239
- }
240
-
241
- type Mutation {
242
- _empty: String
243
- }
244
-
245
- type Subscription {
246
- _empty: String
247
- }
248
-
249
- schema {
250
- query: Query
251
- mutation: Mutation
252
- subscription: Subscription
253
- }
254
- `,Wv=`
255
- enum MediaType {
256
- TV
257
- """
258
- A televised run of very short episodes. Its own member rather than a TV with a small \`episodeCount\`,
259
- because AniList publishes the distinction and a viewer filtering for shorts is asking for exactly it.
260
-
261
- ONLY ANILIST EVER EMITS IT, and AniList loses \`type\` to jikan, which scores 0.9 against 0.8 and
262
- spells the same show TV. So a short jikan also carries profiles as TV in the aggregate and answers a
263
- TV filter rather than a TV_SHORT one. That is a known subset, not a bug to work around here: making
264
- it exact means changing which source wins \`type\`, and that precedence is what keeps a stale dump from
265
- overwriting a live catalogue (store/aggregate.ts:203, sources/offline/normalize.ts:19-31).
266
-
267
- INVISIBLE TO THE MERGE, and that takes real code rather than an omission. \`mergeType\` in
268
- store/fuzzy-merge.ts folds it back to TV before a cluster is profiled, because every gate in that
269
- file was calibrated on a corpus where AniList's shorts arrived spelled TV. Reading the new member
270
- there would move two profiles at once on a cluster AniList alone types, and an empty work-kind set
271
- disables the companion-content veto outright.
272
- """
273
- TV_SHORT
274
- MOVIE
275
- ANIME
276
- """Special episodes that have been included in DVD/Blu-ray releases, picture dramas, pilots, etc"""
277
- SPECIAL
278
- """(Original Video Animation) Anime that have been released directly on
279
- DVD/Blu-ray without originally going through a theatrical release or
280
- television broadcast"""
281
- OVA
282
- """(Original Net Animation) Anime that have been originally released online or are only available through streaming services."""
283
- ONA
284
- """Live action media such as movies or TV show"""
285
- LIVE_ACTION
286
- }
287
-
288
- enum MediaStatus {
289
- """Has completed and is no longer being released"""
290
- FINISHED
291
- """Currently releasing"""
292
- RELEASING
293
- """To be released at a later date"""
294
- NOT_YET_RELEASED
295
- """Ended before the work could be finished"""
296
- CANCELLED
297
- """Is currently paused from releasing and will resume at a later date"""
298
- HIATUS
299
- }
300
-
301
- """
302
- The broadcast season a run aired in.
303
-
304
- Named by the SOURCE, never derived from \`startDate\` here. Seven extractors coerce a bare year into
305
- January 1 and two answer YYYY-MM-01 for a month-only date (see \`namesADay\` in sources/season.ts), so
306
- deriving a season from a start date would file every year-only row under WINTER.
307
- """
308
- enum MediaSeason {
309
- WINTER
310
- SPRING
311
- SUMMER
312
- FALL
313
- }
314
-
315
- """Broad content category. A media can belong to several (e.g. an anime film is ANIME + MOVIE)."""
316
- enum MediaCategory {
317
- ANIME
318
- """An episodic series (TV / live-action / web)."""
319
- SERIES
320
- MOVIE
321
- }
322
-
323
- """
324
- What a handle asserts about the media carrying it. STRUCTURAL only: identity and containment.
325
-
326
- Narrative relations between different works (prequel, sequel, adaptation, side story) are a SEPARATE
327
- axis and will get their own \`MediaRelation\` enum on their own field. They are deliberately not mixed:
328
- PREQUEL says nothing about whether two rows are the same media, and SAME_AS says nothing about story
329
- order. One enum spanning both would mean neither.
330
- """
331
- enum MediaHandleRelation {
332
- """
333
- The handle names THIS run. The only relation that unions clusters, in \`upsertMedia\`, and the union
334
- has NO INVERSE: once two media are welded they stay welded for the session.
335
-
336
- Minting this for an id that names a SHOW is the single most expensive mistake available here. It
337
- merged three Mushoku Tensei seasons, four Demon Slayer films and fifteen Dragon Ball Z films, each
338
- time because one id was the only thing a source could offer and the only relation was this one.
339
- """
340
- SAME_AS
341
- """
342
- This media is one PART of what the handle names: a run of that show, a film published under that
343
- series, a season of that title.
344
-
345
- It carries the handle's url WITHOUT claiming to be it, so a show-level id is worth keeping instead
346
- of being dropped. It never unions, so no number of these can weld two runs together. What it costs
347
- is that nothing may read episodes, titles, covers or any other metadata across it: the thing on the
348
- other end is a bigger thing, and its episode list is every run's at once.
349
- """
350
- PART_OF
351
- }
352
-
353
- """
354
- Which kind of thing a row names, and so which identity space its SAME_AS claims union in.
355
-
356
- Sameness is only ever asserted within one scope. A claim that crosses scopes is read as PART_OF,
357
- whatever the producer asked for: a run is part of its show, never the same thing as it.
358
- """
359
- enum MediaScope {
360
- """One broadcast run: a cour, a film. The unit this store aggregates and the unit a card shows."""
361
- RUN
362
- """A show, a series, a franchise page: something several runs are part of."""
363
- CONTAINER
364
- }
365
-
366
- """
367
- How one work relates to another as a STORY. The other axis, and never mixed with \`MediaHandleRelation\`.
368
-
369
- That enum answers "are these the same thing", this one answers "how does this story connect to that
370
- one", and the schema has kept them apart deliberately since the handle enum was written: PREQUEL says
371
- nothing about sameness and SAME_AS says nothing about story order. Nothing here may ever union a
372
- cluster. A sequel is a DIFFERENT work, and treating one as the same row is the mistake that merged
373
- three Mushoku Tensei seasons when it was made with SAME_AS.
374
-
375
- The values are AniList's set (\`relationType(version: 2)\`), which is the widest of the vocabularies in
376
- play and the one MyAnimeList's own relation names map into without inventing anything. Confirmed
377
- against live data 2026-09-08: anilist 108465 answers SOURCE, ALTERNATIVE and SEQUEL.
378
- """
379
- enum MediaRelation {
380
- """This work adapts the other, which is usually the manga or novel it came from."""
381
- ADAPTATION
382
- """The other work comes first in the story."""
383
- PREQUEL
384
- """The other work comes after."""
385
- SEQUEL
386
- """The other work is the parent story this one hangs off."""
387
- PARENT
388
- """A story beside the main one rather than before or after it."""
389
- SIDE_STORY
390
- """The other work follows a character out of this one."""
391
- CHARACTER
392
- """A recap or digest of the other work."""
393
- SUMMARY
394
- """A different telling of the same story."""
395
- ALTERNATIVE
396
- """A work spun out of this one, sharing a world rather than a plot."""
397
- SPIN_OFF
398
- """The material this work was adapted FROM. The inverse of ADAPTATION."""
399
- SOURCE
400
- """Several works collected into one release."""
401
- COMPILATION
402
- """This work contains the other."""
403
- CONTAINS
404
- """Related, in a way the source did not name."""
405
- OTHER
406
- }
407
-
408
- """
409
- One narrative edge out of a media: what it relates to, and how.
410
-
411
- The node is a SNAPSHOT and not necessarily a row this store has ever fetched. A franchise runs to
412
- dozens of entries and resolving each before anything could render would make one modal cost dozens of
413
- requests, so the edge carries what a card and a graph node need (uri, titles, format, status, cover,
414
- episode count, start date) and nothing else is promised. Opening one navigates to its uri, and the
415
- store fills that row in properly at that point.
416
-
417
- Same shape as \`MediaHandle\` on purpose, so the same components render both.
418
- """
419
- type MediaRelationEdge {
420
- """What this edge claims about the story. Never about identity."""
421
- relation: MediaRelation!
422
- """The related work, as much of it as the naming source supplied."""
423
- node: Media!
424
- """
425
- What KIND of work the other end is, in the naming source's own words: \`TV\`, \`MOVIE\`, \`MANGA\`,
426
- \`NOVEL\`, \`ONE_SHOT\`.
427
-
428
- A string, and on the EDGE rather than on the node, for one reason: \`MediaType\` is anime formats
429
- only, and a franchise's relations are mostly NOT anime. The novel a show adapts is the single most
430
- useful relation there is and it cannot be spelled in that enum. Widening \`MediaType\` to hold it
431
- would reach \`mergeType\` in store/fuzzy-merge.ts and every filter built on it, to carry something
432
- only ever displayed; the enum's own comment records what moving it costs.
433
-
434
- DISPLAY ONLY. Nothing may branch on it.
435
- """
436
- format: String
437
- }
438
-
439
- """
440
- One work in a franchise graph, thin enough that a whole series fits in one payload.
441
- """
442
- type MediaFranchiseNode {
443
- """What a click navigates to. Also the id the edges below join on."""
444
- uri: String!
445
- titles: [MediaTitle!]!
446
- covers: [MediaCover!]!
447
- """The naming source's own word for the kind of work. Display only, as on \`MediaRelationEdge\`."""
448
- format: String
449
- status: MediaStatus
450
- episodeCount: Int
451
- startDate: Date
452
- }
453
-
454
- """One arrow in a franchise graph, joining two \`MediaFranchiseNode\` uris."""
455
- type MediaFranchiseEdge {
456
- from: String!
457
- to: String!
458
- relation: MediaRelation!
459
- }
460
-
461
- """
462
- Every work in one series, and how they connect: the whole graph rather than one media's own edges.
463
-
464
- WHY IT IS NOT JUST \`relations\` WALKED. Following every edge leaks out of the franchise entirely. A
465
- crossover promotional short relates BY CHARACTER to each series taking part, so two hops out of
466
- \`That Time I Got Reincarnated as a Slime\` reaches Attack on Titan, Fire Force, Chihayafuru and seven
467
- other unrelated shows. Measured 2026-09-08 against live AniList: following every edge reached 36
468
- works of which 10 were off-franchise, while following only the STORY edges reached 21 works and none.
469
-
470
- So CHARACTER and OTHER are reported as relations and never TRAVERSED. They answer "who appears in
471
- this" and "these are connected somehow", neither of which is "this is the same series".
472
- """
473
- type MediaFranchise {
474
- nodes: [MediaFranchiseNode!]!
475
- edges: [MediaFranchiseEdge!]!
476
- }
477
-
478
- """One edge out of a media: which row, and what the edge claims about it."""
479
- type MediaHandle {
480
- """The related row. Carries its own uri, origin, id and url."""
481
- node: Media!
482
- """What this edge asserts. Only SAME_AS unions clusters."""
483
- relation: MediaHandleRelation!
484
- }
485
-
486
- type Media {
487
- """Stable unique identifier that persists across URI changes and source additions"""
488
- _id: String!
489
- """Uri consists of the \`origin\` and \`id\` fields in the format \`origin:id\`"""
490
- uri: String!
491
- """String that is used to target a specific origin, e.g \`google\` or \`yt\` for youtube"""
492
- origin: String!
493
- """An id that references a specific resource within the origin space"""
494
- id: String!
495
- """An url to the media resource"""
496
- url: String
497
- """
498
- Every other row this media is related to, and what each relation actually claims.
499
-
500
- Was \`[Media!]!\`, a bare list, which forced one relation on everything: a handle either asserted
501
- sameness or did not exist. That is why a source holding only a show-level id had to choose between
502
- lying and staying silent, and why \`worker/store/db.ts\` had to special-case IMDb out of the graph
503
- entirely rather than carry its link.
504
- """
505
- handles: [MediaHandle!]!
506
- """
507
- Every work this one is related to as a STORY: prequels, sequels, the novel it adapts, side stories.
508
-
509
- Separate from \`handles\`, which is about identity. See \`MediaRelation\`. Empty rather than null when a
510
- source named none, which is most of them: only AniList supplies these today.
511
- """
512
- relations: [MediaRelationEdge!]!
513
- """
514
- The whole series this work belongs to, as a graph. Null where no source could supply one, which is
515
- most of them. NULLABLE deliberately: a non-null list that a source omits nulls the media carrying
516
- it, taking the rest of the payload with it.
517
- """
518
- franchise: MediaFranchise
519
- """Which identity space this row lives in. An absent value reads as RUN."""
520
- scope: MediaScope
521
- score: Float
522
- titles: [MediaTitle!]!
523
- type: MediaType
524
- """Broad categories this media belongs to (anime / series / movie); can be several."""
525
- categories: [MediaCategory!]!
526
- status: MediaStatus
527
- shortDescriptions(input: MediaShortDescriptionInput): [MediaShortDescription!]!
528
- descriptions(input: MediaDescriptionInput): [MediaDescription!]!
529
- trailers: [MediaTrailer!]!
530
- covers: [MediaCover!]!
531
- banners: [MediaBanner!]!
532
- averageScore: Int
533
- popularity: Int
534
- startDate: Date
535
- endDate: Date
536
- isAdult: Boolean
537
- episodeCount: Int
538
- """
539
- The soonest episode a source has scheduled that has not aired yet, or null.
540
-
541
- Derived from AniList's airing schedule, which was already fetched for \`startDate\`, so it costs no
542
- request. Null means "nobody scheduled anything ahead of now", which covers a finished run and a
543
- source that publishes no schedule alike: it is not a promise that the run has ended.
544
- """
545
- nextAiringEpisode: MediaAiringEpisode
546
- """The broadcast season this run aired in, as the source named it."""
547
- season: MediaSeason
548
- """
549
- The calendar year \`season\` belongs to.
550
-
551
- Separate from \`startDate\` because it survives a coerced date: a source that only knows the year
552
- still files the run under the right season when another source names one, and a January premiere
553
- stays in the WINTER of its own year rather than the FALL of the year before.
554
- """
555
- seasonYear: Int
556
- """
557
- Broad content descriptors, deduplicated across the cluster, richest source first.
558
-
559
- Free-form strings rather than an enum because no two catalogues agree on a fixed set, and an enum
560
- would have to drop every value it had not anticipated. Supplied by AniList and jikan; the bundled
561
- offline catalogue publishes none, so a genre filter cannot be answered during an upstream outage.
562
- """
563
- genres: [String!]!
564
- """
565
- Finer-grained descriptors than \`genres\`, from AniList's own tag vocabulary.
566
-
567
- Kept apart from genres rather than merged into one list because AniList publishes them separately
568
- and its own browse UI groups them separately, so a merged list could not reproduce either. Tags
569
- AniList marks as a spoiler are dropped at the source and never reach here.
570
- """
571
- tags: [String!]!
572
- episodes: [Episode!]!
573
- }
574
-
575
- type MediaTitle {
576
- language: String!
577
- title: String!
578
- score: Float
579
- }
580
-
581
- input MediaShortDescriptionInput {
582
- type: MediaDescriptionContentType = TEXT
583
- count: Int
584
- }
585
-
586
- type MediaShortDescription {
587
- language: String!
588
- shortDescription: String!
589
- score: Float
590
- }
591
-
592
- enum MediaDescriptionContentType {
593
- HTML
594
- TEXT
595
- }
596
-
597
- input MediaDescriptionInput {
598
- type: MediaDescriptionContentType = TEXT
599
- count: Int
600
- }
601
-
602
- type MediaDescription {
603
- language: String!
604
- description: String!
605
- score: Float
606
- }
607
-
608
- type MediaTrailer {
609
- """Uri consists of the \`origin\` and \`id\` fields in the format \`origin:id\`"""
610
- uri: String!
611
- """String that is used to target a specific origin, e.g \`google\` or \`yt\` for youtube"""
612
- origin: String!
613
- """An id that references a specific resource within the origin space"""
614
- id: String!
615
- """An url to the media resource"""
616
- url: String
617
- language: String
618
- thumbnail: String
619
- }
620
-
621
- type MediaAiringEpisode {
622
- """Which episode of the run this is, as the source numbers it."""
623
- episodeNumber: Int!
624
- """When it airs."""
625
- airingAt: Date!
626
- }
627
-
628
- type MediaCover {
629
- language: String
630
- url: String!
631
- height: Int
632
- width: Int
633
- """Average #hex color of cover image"""
634
- color: String
635
- score: Float
636
- }
637
-
638
- type MediaBanner {
639
- language: String
640
- url: String!
641
- height: Int
642
- width: Int
643
- """Average #hex color of cover image"""
644
- color: String
645
- score: Float
646
- }
647
-
648
- """
649
- What the app asked for at the TOP of the call, so a source can tell a detail view from a listing.
650
-
651
- THE WORKER WRITES THIS. Every field is regenerated from the worker's own registry at each source's
652
- boundary before the arguments are coerced, so a value supplied by a caller is replaced rather than
653
- trusted, and only \`token\` is ever read off the wire. Nullable because the app's own documents send
654
- none: they are validated by the app-level server before the fan-out that stamps them runs.
655
- """
656
- input RequestContext {
657
- """Identifies THIS hop to the worker. The only field read back off the wire."""
658
- token: ID!
659
- """Stable for the whole call tree, so a source may memoize per root rather than per hop."""
660
- rootId: ID!
661
- operation: RootOperation!
662
- """The origins already on the stack, nearest last. A source seeing itself here is in a cycle."""
663
- chain: [String!]!
664
- }
665
-
666
- enum RootOperation {
667
- MEDIA
668
- MEDIA_PAGE
669
- SIMILAR_MEDIA
670
- }
671
-
672
- input MediaInput {
673
- uri: ID
674
- context: RequestContext
675
- }
676
-
677
- enum MediaSort {
678
- POPULARITY
679
- POPULARITY_DESC
680
- }
681
-
682
- input MediaPageInput {
683
- context: RequestContext
684
- """Filter by media IDs"""
685
- nodes: [MediaInput!]
686
- """Filter by search terms"""
687
- search: String
688
- """Filter by the media's current release status"""
689
- status: MediaStatus
690
- """Filter by category (anime / series / movie); media matching ANY of these are kept."""
691
- categories: [MediaCategory!]
692
- """Filter by format; media whose \`type\` is ANY of these are kept. A media with no type is dropped."""
693
- formats: [MediaType!]
694
- """
695
- Filter by broadcast season. Pair it with \`seasonYear\` to name one season rather than every WINTER.
696
-
697
- A source that can answer a season directly is asked for THIS one instead of the clock's; a source
698
- that cannot answers nothing rather than answering the current season, which would look like a
699
- result set and be the wrong year.
700
- """
701
- season: MediaSeason
702
- """Filter by the year of \`season\`."""
703
- seasonYear: Int
704
- """Filter by genre; media carrying ALL of these are kept, compared case-insensitively."""
705
- genres: [String!]
706
- """Filter by tag; media carrying ALL of these are kept, compared case-insensitively."""
707
- tags: [String!]
708
-
709
- sorts: [MediaSort!]
710
-
711
- """Filter by the start date of the media"""
712
- startDate: Date
713
- """Filter by the end date of the media"""
714
- endDate: Date
715
-
716
- """Cursor from where to start"""
717
- at: Id
718
- """How many pages before the cursor to return"""
719
- before: Int
720
- """How many pages after the cursor to return"""
721
- after: Int
722
- }
723
-
724
- type MediaPage {
725
- """The current page"""
726
- firstPageCursor: Id
727
- """The current page"""
728
- previousPageCursor: Id
729
- """The current page"""
730
- currentPageCursor: Id
731
- """The first page"""
732
- nextPageCursor: Id
733
- """The last page cursor"""
734
- lastPageCursor: Id
735
- """Total number of items on the current page"""
736
- currentPageNodeCount: Int
737
- """The total number of items. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
738
- totalNodeCount: Int
739
- """Total number of items before the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
740
- beforeCurrentPageNodeCount: Int
741
- """Total number of items after the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
742
- afterCurrentPageNodeCount: Int
743
- """The media page nodes"""
744
- nodes: [Media!]!
745
- }
746
-
747
- """
748
- The run a caller is looking for, described by EVIDENCE about its own run and never by a season number.
749
-
750
- Stub models a broadcast run; every catalogue models a show with seasons hanging off it, and no two
751
- catalogues number those seasons the same way. Netflix folds two cours into one season (its season 2 of
752
- Mushoku Tensei is 25 episodes over anime's 13 and 12), JustWatch numbers by its own list, anime metadata
753
- says "Season 2 Part 2". Two numberings in one id space collide: on 2026-09-05 anime season 1 (11
754
- episodes, no ordinal in its title) took \`nf:80987039-3\` by episode count while season 3 took the same id
755
- by its ordinal, and \`graph.link\` has no inverse. So a caller holding a show-level id says what it knows
756
- about ITS run and the owning origin answers with the one run of that show the evidence establishes, or
757
- with null.
758
-
759
- What counts as established is decided in ONE place, \`sources/similar.ts\`, and every answering source
760
- goes through it: a season premiere within 45 days of a day-precise start, episode titles covering most
761
- of a season, an ordinal every title agrees on with an episode count the season does not exceed, the
762
- one season dated our year holding no more than our count, or the first season holding our episodes. A
763
- season holding MORE episodes than the run is a fold of several runs and is never the answer, and a
764
- season whose length is unknown cannot be shown not to be one. Anything ambiguous is null.
765
-
766
- The rules decide WHICH season of the show and never WHICH show: \`showId\` settles that, and it came off
767
- a PART_OF edge whose container cluster a listing's fuzzy title pass may have unioned, so an answer is
768
- only as right as that union.
769
- """
770
- input SimilarMediaInput {
771
- """The show's id in the ANSWERING origin's own space: a Crunchyroll series id, a Netflix title id, a JustWatch node objectId."""
772
- showId: ID!
773
- """When our run started. A date naming a DAY is matched within 45 days; a bare year (\`YYYY-01-01\`) vetoes a season dated another year and, with an episode count on both sides, names the one season dated ours."""
774
- startDate: Date
775
- """Every title the caller knows for its run. Read for the season ordinals they agree on, never for the franchise: the show id already settles that."""
776
- titles: [String!]
777
- """How many episodes our run has. A season holding more is a fold of several runs and is refused."""
778
- episodeCount: Int
779
- """The titles of our run's episodes, when the caller has them. A season most of whose episode titles we carry is ours; one sharing none is not, whatever its number."""
780
- episodeTitles: [String!]
781
- context: RequestContext
782
- }
783
-
784
- extend type Subscription {
785
- media(input: MediaInput!): Media
786
- mediaPage(input: MediaPageInput!): MediaPage!
787
- """
788
- The one run of \`showId\` that is the caller's run by the evidence given, or null.
789
-
790
- The answer is a RUN at the answering origin and carries no handle naming another run: the CALLER
791
- decides what to claim about it. Null is the expected answer and never an error: no such show, no
792
- evidence that settles it, or evidence fitting two seasons. Answering with the SHOW here, or with a
793
- season the evidence merely fails to contradict, recreates the weld the caller asked in order to avoid.
794
- """
795
- similarMedia(input: SimilarMediaInput!): Media
796
- }
797
- `;function Gv(e,t={skipIntrospection:!0}){let n=Symbol(`hasWrappedResolve`);return{onSchemaChange({schema:r}){let i=r;if(i){for(let r of Object.values(i.getTypeMap()))if((!t.skipIntrospection||!Un(r))&&k(r))for(let t of Object.values(r.getFields())){if(t[n])continue;let r=t.resolve||_a;t.resolve=(t,n,i,a)=>P(()=>e({root:t,args:n,context:i,info:a,resolver:r,replaceResolver:e=>{r=e}}),e=>typeof e==`function`?P(()=>r(t,n,i,a),t=>Ja(e({result:t,setResult:e=>{t=e}}),()=>t),t=>P(()=>e({result:t,setResult:e=>{t=e}}),()=>{throw t})):r(t,n,i,a)),t[n]=!0}}}}}const Kv=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,qv=new Set,Jv=typeof process==`object`&&process?process:{},Yv=(e,t,n,r)=>{typeof Jv.emitWarning==`function`?Jv.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let Xv=globalThis.AbortController,Zv=globalThis.AbortSignal;if(Xv===void 0){Zv=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},Xv=class{constructor(){t()}signal=new Zv;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=Jv.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,Yv("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}const Qv=e=>!qv.has(e),$v=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),ey=e=>$v(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ty:null:null;var ty=class extends Array{constructor(e){super(e),this.fill(0)}},ny=class e{heap;length;static#e=!1;static create(t){let n=ey(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ry=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,memoMethod:_,noDeleteOnFetchRejection:ee,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:te,ignoreFetchAbort:b}=t;if(n!==0&&!$v(n))throw TypeError(`max option must be a nonnegative integer`);let ne=n?ey(n):Array;if(!ne)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(_!==void 0&&typeof _!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=_,g!==void 0&&typeof g!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=g,this.#x=!!g,this.#c=new Map,this.#l=Array(n).fill(void 0),this.#u=Array(n).fill(void 0),this.#d=new ne(n),this.#f=new ne(n),this.#p=0,this.#m=0,this.#h=ny.create(n),this.#o=0,this.#s=0,typeof l==`function`&&(this.#n=l),typeof u==`function`?(this.#r=u,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!ee,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!te,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(this.#t!==0&&!$v(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!$v(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=$v(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!$v(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;Qv(t)&&(qv.add(t),Yv(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new ty(this.#e),t=new ty(this.#e);this.#y=e,this.#v=t,this.#E=(n,r,i=Kv.now())=>{if(t[n]=r===0?0:i,e[n]=r,r!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(n)&&this.#B(this.#l[n],`expire`)},r+1);e.unref&&e.unref()}},this.#w=n=>{t[n]=e[n]===0?0:Kv.now()},this.#T=(i,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;i.ttl=o,i.start=s,i.now=n||r(),i.remainingTTL=o-(i.now-s)}};let n=0,r=()=>{let e=Kv.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#c.get(i);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((n||r())-s)},this.#D=i=>{let a=t[i],o=e[i];return!!o&&!!a&&(n||r())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};#D=()=>!1;#O(){let e=new ty(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!$v(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!$v(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let n=this.#u[t],r=this.#L(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#y&&this.#v){let e=this.#y[t],n=this.#v[t];e&&n&&(i.ttl=e-(Kv.now()-n),i.start=Date.now())}return this.#_&&(i.size=this.#_[t]),i}dump(){let e=[];for(let t of this.#M({allowStale:!0})){let n=this.#l[t],r=this.#u[t],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#y&&this.#v){a.ttl=this.#y[t];let e=Kv.now()-this.#v[t];a.start=Math.floor(Date.now()-e)}this.#_&&(a.size=this.#_[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=Kv.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let a=new Xv,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason);let l=f;return this.#u[t]===f&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)),u=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=f;if(this.#u[t]===f&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):o||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},d=(t,r)=>{let o=this.#i?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=p,p}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof Xv}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let ee={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},v=this.#c.get(e);if(v===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,v,ee,m);return t.__returned=t}else{let t=this.#u[v];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(v);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(v),r&&this.#w(v),g&&this.#T(g,v),t;let a=this.#I(e,v,ee,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}else a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}};const iy=e=>{let t=e?.buildEntityId??ay,n=new ry({max:e?.max??1e3,allowStale:!1,noDisposeOnSet:!0,dispose(e){a(e,!1)}}),r=new Map,i=new Map;function a(e,t=!0){let a=i.get(e);if(a!==void 0){for(let t of a)r.get(t)?.delete(e);i.delete(e)}t&&n.delete(e)}function o(e){let t=r.get(e);if(t!==void 0)for(let e of t)a(e)}return{set(e,a,o,s){n.set(e,a,{ttl:s});let c=new Set;i.set(e,c);for(let{typename:n,id:i}of o){let a=r.get(n);if(a??(a=new Set,r.set(n,a)),a.add(e),c.add(n),i!==void 0){let a=t(n,i),o=r.get(a);o??(o=new Set,r.set(a,o)),o.add(e),c.add(a)}}},get(e){return n.get(e)??null},invalidate(e){for(let{typename:n,id:r}of e)o(r==null?n:t(n,r))}}},ay=(e,t)=>`${e}:${t}`;var oy=s(((e,t)=>{t.exports=function(e,t){t||={},typeof t==`function`&&(t={cmp:t});var n=typeof t.cycles==`boolean`?t.cycles:!1,r=t.cmp&&(function(e){return function(t){return function(n,r){return e({key:n,value:t[n]},{key:r,value:t[r]})}}})(t.cmp),i=[];return(function e(t){if(t&&t.toJSON&&typeof t.toJSON==`function`&&(t=t.toJSON()),t!==void 0){if(typeof t==`number`)return isFinite(t)?``+t:`null`;if(typeof t!=`object`)return JSON.stringify(t);var a,o;if(Array.isArray(t)){for(o=`[`,a=0;a<t.length;a++)a&&(o+=`,`),o+=e(t[a])||`null`;return o+`]`}if(t===null)return`null`;if(i.indexOf(t)!==-1){if(n)return JSON.stringify(`__cycle__`);throw TypeError(`Converting circular structure to JSON`)}var s=i.push(t)-1,c=Object.keys(t).sort(r&&r(t));for(o=``,a=0;a<c.length;a++){var l=c[a],u=e(t[l]);u&&(o&&(o+=`,`),o+=JSON.stringify(l)+`:`+u)}return i.splice(s,1),`{`+o+`}`}})(e)}}));function sy(e){let t=new Vd.TextEncoder().encode(e);return P(()=>Vd.crypto.subtle.digest({name:`SHA-256`},t),e=>{let t=new Uint8Array(e),n=``;for(let e=0,r=t.length;e<r;e++){let r=t[e].toString(16);n+=`00`.slice(0,Math.max(0,2-r.length))+r}return n})}var cy=u(oy(),1);const ly=e=>sy([e.documentString,e.operationName??``,(0,cy.default)(e.variableValues??{}),e.sessionId??``].join(`|`)),uy=e=>e.result.errors?(console.warn(`[useResponseCache] Failed to cache due to errors`),!1):!0;function dy(e){return Ml(e.document,ht)}const fy=co(function(e,{invalidateViaMutation:t,ttlPerSchemaCoordinate:n},r,i){let a=new hr(r),o;return[ft(e,_r(a,{OperationDefinition:{enter(e){if(!t&&e.operation===`mutation`||e.operation===`subscription`)return!1}},...n!=null&&{Field(e){let t=a.getParentType();if(t){let r=n[`${t.name}.${e.name.value}`];o=gy(r,o)}}},SelectionSet(e,t){let n=a.getParentType(),r=n&&i.get(n.name),o=e.selections.some(e=>e.kind===C.FIELD&&e.name.value===`__typename`&&!e.alias),s=[...e.selections];return o||s.push({kind:C.FIELD,name:{kind:C.NAME,value:`__typename`},alias:{kind:C.NAME,value:`__responseCacheTypeName`}}),r&&(e.selections.some(e=>e.kind===C.FIELD&&e.name.value===r&&!e.alias)||s.push({kind:C.FIELD,name:{kind:C.NAME,value:r},alias:{kind:C.NAME,value:`__responseCacheId`}})),{...e,selections:s}}})),o]});function py({cache:e=iy(),ttl:t=1/0,session:n,enabled:r,ignoredTypes:i=[],ttlPerType:a={},ttlPerSchemaCoordinate:o={},scopePerSchemaCoordinate:s={},idFields:c=[`id`],invalidateViaMutation:l=!0,buildResponseCacheKey:u=ly,getDocumentString:d=dy,shouldCacheResult:f=uy,onTtl:p,includeExtensionMetadata:m=typeof process<`u`?!!{}.DEBUG:!1}){let h=typeof e==`function`?oo(e):()=>e,g=new Set(i),_=new Map;r&&=oo(r),o={"Query.__schema":0,...o};let ee={queries:{invalidateViaMutation:l,ttlPerSchemaCoordinate:o},mutations:{invalidateViaMutation:l}},v=new Map,y;function te(e,t){return s[e]===`PRIVATE`?!0:Object.keys(t).some(t=>s[`${e}.${t}`]===`PRIVATE`)}return{onSchemaChange({schema:e}){if(y===e)return;y=e;let t=y.getDirective(`cacheControl`);ps(y,{...t&&{[I.COMPOSITE_TYPE]:e=>(po(y,e,`cacheControl`)?.forEach(t=>{t.maxAge!=null&&(a[e.name]=t.maxAge*1e3),t.scope&&(s[e.name]=t.scope)}),e)},[I.FIELD]:(e,n,r)=>{let i=`${r}.${n}`,a=_y(e.type);return _.set(i,a),c.includes(n)&&!v.has(r)&&v.set(r,n),t&&po(y,e,`cacheControl`)?.forEach(e=>{e.maxAge!=null&&(o[i]=e.maxAge*1e3),e.scope&&(s[i]=e.scope)}),e}})},onExecute(e){if(r&&!r(e.args.contextValue))return;let i=new Map,o=new Set,s,c=!1,b=n(e.args.contextValue);function ne({execute:t,onExecuteDone:n}){let r=!1;return e.setExecuteFn(e=>(r=!0,t(e))),{onExecuteDone(e){return r||console.warn(`[useResponseCache] The cached execute function was not called, another plugin might have overwritten it. Please check your plugin order.`),n?.(e)}}}function x(e,t){if(!c){if(g.has(e.typename)||!b&&te(e.typename,t)){c=!0;return}if(!e.id){let n=v.get(e.typename);n&&(e.id=t[n])}if(o.add(e.typename),e.typename in a){let t=a[e.typename];s=gy(t,s)}e.id!=null&&i.set(`${e.typename}:${e.id}`,e);for(let n in t){let r=t[n];(r==null||Array.isArray(r)&&r.length===0)&&_.get(`${e.typename}.${n}`)?.forEach(e=>{if(e in a){let t=a[e];s=gy(t,s)}i.set(e,{typename:e})})}}}function re(t,n){let r=!1;t.data&&(t={...t},t.data=vy(t.data,x),r=!0);let a=h(e.args.contextValue);if(a==null){console.warn(`[useResponseCache] Cache instance is not available for the context. Skipping invalidation.`);return}if(i.size>0&&(a.invalidate(i.values()),m))return n(hy(t,{invalidatedEntities:Array.from(i.values())}));r&&n(t)}return l!==!1&&va(e.args.document,e.args.operationName)?.operation===`mutation`?ne({execute(t){let[n]=fy(t.document,ee.mutations,t.schema,v);return e.executeFn({...t,document:n})},onExecuteDone({result:e,setResult:t}){return Ll(e)?my(re):re(e,t)}}):P(()=>u({documentString:d(e.args),variableValues:e.args.variableValues,operationName:e.args.operationName,sessionId:b,context:e.args.contextValue}),n=>{let r=h(e.args.contextValue);return r??console.warn(`[useResponseCache] Cache instance is not available for the context. Skipping cache lookup.`),P(()=>r.get(n),a=>{if(a!=null)return ne({execute:()=>m?hy(a,{hit:!0}):a});function o(a,o){a.data&&=vy(a.data,x);let l=s??t;if(p&&(l=p({ttl:l,context:e.args.contextValue})),c||!f({cacheKey:n,result:a})||l===0){m&&o(hy(a,{hit:!1,didCache:!1}));return}r.set(n,a,i.values(),l),m&&o(hy(a,{hit:!1,didCache:!0,ttl:l}))}return ne({execute(t){let[n,r]=fy(t.document,ee.queries,y,v);return s=r,e.executeFn({...t,document:n})},onExecuteDone({result:e,setResult:t}){return Ll(e)?my(o):o(e,t)}})})})}}}function my(e){let t={};return{onNext(n){if(n.result.data&&(t.data=n.result.data),n.result.errors&&(t.errors=n.result.errors),n.result.extensions&&(t.extensions=n.result.extensions),`hasNext`in n.result){let{incremental:r,hasNext:i}=n.result;if(r)for(let e of r)Qs({executionResult:t,incrementalResult:e});i||e(t,n.setResult)}let r={...n.result};r.data&&=vy(r.data),`hasNext`in r&&r.incremental&&(r.incremental=r.incremental.map(e=>`items`in e&&e.items?{...e,items:vy(e.items)}:`data`in e&&e.data?{...e,data:vy(e.data)}:e)),n.setResult(r)}}}function hy(e,t){return{...e,extensions:{...e.extensions,responseCache:{...e.extensions?.responseCache,...t}}}}function gy(e,t){return typeof e==`number`&&!Number.isNaN(e)?typeof t==`number`?Math.min(t,e):e:t}function _y(e){return Ot(e)||j(e)?_y(e.ofType):Tt(e)?e.getTypes().map(e=>_y(e)).flat():[e.name]}function vy(e,t){if(Array.isArray(e))return e.map(e=>vy(e,t));if(typeof e!=`object`||!e)return e;let n=Object.getPrototypeOf(e);if(n!=null&&n!==Object.prototype)return e;e={...e};let r=e.__responseCacheTypeName??e.__typename;if(typeof r==`string`){let n={typename:r};delete e.__responseCacheTypeName,e.__responseCacheId&&(typeof e.__responseCacheId==`string`||typeof e.__responseCacheId==`number`)&&(n.id=e.__responseCacheId,delete e.__responseCacheId),t?.(n,e)}for(let n in e){let r=e[n];Array.isArray(r)&&(e[n]=vy(r,t)),typeof r==`object`&&r&&(e[n]=vy(r,t))}return e}const yy=new WeakMap,by=new WeakMap;function xy({request:e}){return by.get(e)}const Sy=function({context:e}){let t=yy.get(e);if(t==null)throw Error(`[useResponseCache] This plugin is not configured correctly. Make sure you use this plugin with GraphQL Yoga`);return t},Cy=e=>e.contextValue.params.query||Ml(e.document,ht);function wy(e){let t=e?.buildResponseCacheKey||ly,n=e.cache??Ty(),r=e.enabled??(()=>!0),i;return{onYogaInit({yoga:e}){i=e.logger},onPluginInit({addPlugin:t}){t(py({...e,enabled:e=>r(e.request,e),cache:n,getDocumentString:Cy,session:xy,buildResponseCacheKey:Sy,shouldCacheResult({cacheKey:t,result:n}){let r;if(e.shouldCacheResult?r=e.shouldCacheResult({cacheKey:t,result:n}):(r=!n.errors?.length,r||i.debug(`[useResponseCache] Decided not to cache the response because it contains errors`)),r){let e=n.extensions||={},r=e.http||={},i=r.headers||={};i.ETag=t,i[`Last-Modified`]=new Date().toUTCString()}return r}}))},onRequest({request:e,serverContext:t,fetchAPI:i,endResponse:a}){if(r(e,t)){let t=e.headers.get(`If-None-Match`);if(t)return P(()=>n.get(t),n=>{if(n){let r=e.headers.get(`If-Modified-Since`),o=n.extensions?.http?.headers?.[`Last-Modified`];o!=null&&(r==null||new Date(r).getTime()>=new Date(o).getTime())&&a(new i.Response(null,{status:304,headers:{ETag:t}}))}})}},onParams({params:i,request:a,context:o,setResult:s}){return P(()=>e.session(a,o),c=>P(()=>t({documentString:i.query||``,variableValues:i.variables,operationName:i.operationName,sessionId:c,request:a,context:o}),t=>{if(yy.set(o,t),by.set(a,c),r(a,o))return P(()=>n.get(t),t=>{if(t){let n={...t,[Symbol.for(`servedFromResponseCache`)]:!0};e.includeExtensionMetadata?s(hy(n,{hit:!0})):s(n);return}})}))}}}const Ty=iy;var Ey={NAME:`Name`,DOCUMENT:`Document`,OPERATION_DEFINITION:`OperationDefinition`,VARIABLE_DEFINITION:`VariableDefinition`,SELECTION_SET:`SelectionSet`,FIELD:`Field`,ARGUMENT:`Argument`,FRAGMENT_SPREAD:`FragmentSpread`,INLINE_FRAGMENT:`InlineFragment`,FRAGMENT_DEFINITION:`FragmentDefinition`,VARIABLE:`Variable`,INT:`IntValue`,FLOAT:`FloatValue`,STRING:`StringValue`,BOOLEAN:`BooleanValue`,NULL:`NullValue`,ENUM:`EnumValue`,LIST:`ListValue`,OBJECT:`ObjectValue`,OBJECT_FIELD:`ObjectField`,DIRECTIVE:`Directive`,NAMED_TYPE:`NamedType`,LIST_TYPE:`ListType`,NON_NULL_TYPE:`NonNullType`},Dy=class extends Error{constructor(e,t,n,r,i,a,o){super(e),this.name=`GraphQLError`,this.message=e,i&&(this.path=i),t&&(this.nodes=Array.isArray(t)?t:[t]),n&&(this.source=n),r&&(this.positions=r),a&&(this.originalError=a);var s=o;if(!s&&a){var c=a.extensions;c&&typeof c==`object`&&(s=c)}this.extensions=s||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return`GraphQLError`}},L,R;function Oy(e){return new Dy(`Syntax Error: Unexpected token at ${R} in ${e}`)}function ky(e){if(e.lastIndex=R,e.test(L))return L.slice(R,R=e.lastIndex)}var Ay=/ +(?=[^\s])/y;function jy(e){for(var t=e.split(`
798
- `),n=``,r=0,i=0,a=t.length-1,o=0;o<t.length;o++)Ay.lastIndex=0,Ay.test(t[o])&&(o&&(!r||Ay.lastIndex<r)&&(r=Ay.lastIndex),i||=o,a=o);for(var s=i;s<=a;s++)s!==i&&(n+=`
799
- `),n+=t[s].slice(r).replace(/\\"""/g,`"""`);return n}function z(){for(var e=0|L.charCodeAt(R++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|L.charCodeAt(R++))if(e===35)for(;(e=0|L.charCodeAt(R++))&&e!==10&&e!==13;);R--}function My(){for(var e=R,t=0|L.charCodeAt(R++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|L.charCodeAt(R++));if(e===R-1)throw Oy(`Name`);var n=L.slice(e,--R);return z(),n}function Ny(){return{kind:`Name`,value:My()}}var Py=/(?:"""|(?:[\s\S]*?[^\\])""")/y,Fy=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function Iy(e){var t;switch(L.charCodeAt(R)){case 91:R++,z();for(var n=[];L.charCodeAt(R)!==93;)n.push(Iy(e));return R++,z(),{kind:`ListValue`,values:n};case 123:R++,z();for(var r=[];L.charCodeAt(R)!==125;){var i=Ny();if(L.charCodeAt(R++)!==58)throw Oy(`ObjectField`);z(),r.push({kind:`ObjectField`,name:i,value:Iy(e)})}return R++,z(),{kind:`ObjectValue`,fields:r};case 36:if(e)throw Oy(`Variable`);return R++,{kind:`Variable`,name:Ny()};case 34:if(L.charCodeAt(R+1)===34&&L.charCodeAt(R+2)===34){if(R+=3,(t=ky(Py))==null)throw Oy(`StringValue`);return z(),{kind:`StringValue`,value:jy(t.slice(0,-3)),block:!0}}else{var a=R,o;R++;var s=!1;for(o=0|L.charCodeAt(R++);o===92&&(R++,s=!0)||o!==10&&o!==13&&o!==34&&o;o=0|L.charCodeAt(R++));if(o!==34)throw Oy(`StringValue`);return t=L.slice(a,R),z(),{kind:`StringValue`,value:s?JSON.parse(t):t.slice(1,-1),block:!1}}case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var c=R++,l;(l=0|L.charCodeAt(R++))>=48&&l<=57;);var u=L.slice(c,--R);if((l=L.charCodeAt(R))===46||l===69||l===101){if((t=ky(Fy))==null)throw Oy(`FloatValue`);return z(),{kind:`FloatValue`,value:u+t}}else return z(),{kind:`IntValue`,value:u};case 110:if(L.charCodeAt(R+1)===117&&L.charCodeAt(R+2)===108&&L.charCodeAt(R+3)===108)return R+=4,z(),{kind:`NullValue`};break;case 116:if(L.charCodeAt(R+1)===114&&L.charCodeAt(R+2)===117&&L.charCodeAt(R+3)===101)return R+=4,z(),{kind:`BooleanValue`,value:!0};break;case 102:if(L.charCodeAt(R+1)===97&&L.charCodeAt(R+2)===108&&L.charCodeAt(R+3)===115&&L.charCodeAt(R+4)===101)return R+=5,z(),{kind:`BooleanValue`,value:!1};break}return{kind:`EnumValue`,value:My()}}function Ly(e){if(L.charCodeAt(R)===40){var t=[];R++,z();do{var n=Ny();if(L.charCodeAt(R++)!==58)throw Oy(`Argument`);z(),t.push({kind:`Argument`,name:n,value:Iy(e)})}while(L.charCodeAt(R)!==41);return R++,z(),t}}function Ry(e){if(L.charCodeAt(R)===64){var t=[];do R++,t.push({kind:`Directive`,name:Ny(),arguments:Ly(e)});while(L.charCodeAt(R)===64);return t}}function zy(){for(var e=0;L.charCodeAt(R)===91;)e++,R++,z();var t={kind:`NamedType`,name:Ny()};do if(L.charCodeAt(R)===33&&(R++,z(),t={kind:`NonNullType`,type:t}),e){if(L.charCodeAt(R++)!==93)throw Oy(`NamedType`);z(),t={kind:`ListType`,type:t}}while(e--);return t}function By(){if(L.charCodeAt(R++)!==123)throw Oy(`SelectionSet`);return z(),Vy()}function Vy(){var e=[];do if(L.charCodeAt(R)===46){if(L.charCodeAt(++R)!==46||L.charCodeAt(++R)!==46)throw Oy(`SelectionSet`);switch(R++,z(),L.charCodeAt(R)){case 64:e.push({kind:`InlineFragment`,typeCondition:void 0,directives:Ry(!1),selectionSet:By()});break;case 111:L.charCodeAt(R+1)===110?(R+=2,z(),e.push({kind:`InlineFragment`,typeCondition:{kind:`NamedType`,name:Ny()},directives:Ry(!1),selectionSet:By()})):e.push({kind:`FragmentSpread`,name:Ny(),directives:Ry(!1)});break;case 123:R++,z(),e.push({kind:`InlineFragment`,typeCondition:void 0,directives:void 0,selectionSet:Vy()});break;default:e.push({kind:`FragmentSpread`,name:Ny(),directives:Ry(!1)})}}else{var t=Ny(),n=void 0;L.charCodeAt(R)===58&&(R++,z(),n=t,t=Ny());var r=Ly(!1),i=Ry(!1),a=void 0;L.charCodeAt(R)===123&&(R++,z(),a=Vy()),e.push({kind:`Field`,alias:n,name:t,arguments:r,directives:i,selectionSet:a})}while(L.charCodeAt(R)!==125);return R++,z(),{kind:`SelectionSet`,selections:e}}function Hy(){if(z(),L.charCodeAt(R)===40){var e=[];R++,z();do{var t=void 0;if(L.charCodeAt(R)===34&&(t=Iy(!0)),L.charCodeAt(R++)!==36)throw Oy(`Variable`);var n=Ny();if(L.charCodeAt(R++)!==58)throw Oy(`VariableDefinition`);z();var r=zy(),i=void 0;L.charCodeAt(R)===61&&(R++,z(),i=Iy(!0)),z();var a={kind:`VariableDefinition`,variable:{kind:`Variable`,name:n},type:r,defaultValue:i,directives:Ry(!0)};t&&(a.description=t),e.push(a)}while(L.charCodeAt(R)!==41);return R++,z(),e}}function Uy(e){var t=Ny();if(L.charCodeAt(R++)!==111||L.charCodeAt(R++)!==110)throw Oy(`FragmentDefinition`);z();var n={kind:`FragmentDefinition`,name:t,typeCondition:{kind:`NamedType`,name:Ny()},directives:Ry(!1),selectionSet:By()};return e&&(n.description=e),n}function Wy(){var e=[];do{var t=void 0;if(L.charCodeAt(R)===34&&(t=Iy(!0)),L.charCodeAt(R)===123){if(t)throw Oy(`Document`);R++,z(),e.push({kind:`OperationDefinition`,operation:`query`,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:Vy()})}else{var n=My();switch(n){case`fragment`:e.push(Uy(t));break;case`query`:case`mutation`:case`subscription`:var r,i=void 0;(r=L.charCodeAt(R))!==40&&r!==64&&r!==123&&(i=Ny());var a={kind:`OperationDefinition`,operation:n,name:i,variableDefinitions:Hy(),directives:Ry(!1),selectionSet:By()};t&&(a.description=t),e.push(a);break;default:throw Oy(`Document`)}}}while(R<L.length);return e}function Gy(e,t){return L=e.body?e.body:e,R=0,z(),t&&t.noLocation?{kind:`Document`,definitions:Wy()}:{kind:`Document`,definitions:Wy(),loc:{start:0,end:L.length,startToken:void 0,endToken:void 0,source:{body:L,name:`graphql.web`,locationOffset:{line:1,column:1}}}}}function Ky(e,t,n){for(var r=``,i=0;i<e.length;i++)i&&(r+=t),r+=n(e[i]);return r}function qy(e){return JSON.stringify(e)}function Jy(e){return`"""
800
- `+e.replace(/"""/g,`\\"""`)+`
801
- """`}var Yy=`
802
- `,Xy={OperationDefinition(e){var t=``;e.description&&(t+=Xy.StringValue(e.description)+`
803
- `),t+=e.operation,e.name&&(t+=` `+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(t+=` `),t+=`(`+Ky(e.variableDefinitions,`, `,Xy.VariableDefinition)+`)`),e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive));var n=Xy.SelectionSet(e.selectionSet);return t===`query`?n:t+` `+n},VariableDefinition(e){var t=``;return e.description&&(t+=Xy.StringValue(e.description)+` `),t+=Xy.Variable(e.variable)+`: `+Zy(e.type),e.defaultValue&&(t+=` = `+Zy(e.defaultValue)),e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive)),t},Field(e){var t=e.alias?e.alias.value+`: `+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var n=Ky(e.arguments,`, `,Xy.Argument);t.length+n.length+2>80?t+=`(`+(Yy+=` `)+Ky(e.arguments,Yy,Xy.Argument)+(Yy=Yy.slice(0,-2))+`)`:t+=`(`+n+`)`}return e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive)),e.selectionSet&&e.selectionSet.selections.length&&(t+=` `+Xy.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?Jy(e.value).replace(/\n/g,Yy):qy(e.value)},BooleanValue:e=>``+e.value,NullValue:e=>`null`,IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>`$`+e.name.value,ListValue:e=>`[`+Ky(e.values,`, `,Zy)+`]`,ObjectValue:e=>`{`+Ky(e.fields,`, `,Xy.ObjectField)+`}`,ObjectField:e=>e.name.value+`: `+Zy(e.value),Document(e){return!e.definitions||!e.definitions.length?``:Ky(e.definitions,`
804
-
805
- `,Zy)},SelectionSet:e=>`{`+(Yy+=` `)+Ky(e.selections,Yy,Zy)+(Yy=Yy.slice(0,-2))+`}`,Argument:e=>e.name.value+`: `+Zy(e.value),FragmentSpread(e){var t=`...`+e.name.value;return e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive)),t},InlineFragment(e){var t=`...`;return e.typeCondition&&(t+=` on `+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive)),t+=` `+Xy.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t=``;return e.description&&(t+=Xy.StringValue(e.description)+`
806
- `),t+=`fragment `+e.name.value,t+=` on `+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=` `+Ky(e.directives,` `,Xy.Directive)),t+` `+Xy.SelectionSet(e.selectionSet)},Directive(e){var t=`@`+e.name.value;return e.arguments&&e.arguments.length&&(t+=`(`+Ky(e.arguments,`, `,Xy.Argument)+`)`),t},NamedType:e=>e.name.value,ListType:e=>`[`+Zy(e.type)+`]`,NonNullType:e=>Zy(e.type)+`!`},Zy=e=>Xy[e.kind](e);function Qy(e){return Yy=`
807
- `,Xy[e.kind]?Xy[e.kind](e):``}var $y=()=>{},eb=$y;function tb(e){return{tag:0,0:e}}function nb(e){return{tag:1,0:e}}var rb=()=>typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`,ib=e=>e;function ab(e){return t=>n=>{var r=eb;t((t=>{t===0?n(0):t.tag===0?(r=t[0],n(t)):e(t[0])?n(t):r(0)}))}}function ob(e){return t=>n=>t((t=>{t===0||t.tag===0?n(t):n(nb(e(t[0])))}))}function sb(e){return t=>n=>{var r=[],i=eb,a=!1,o=!1;t((t=>{o||(t===0?(o=!0,r.length||n(0)):t.tag===0?i=t[0]:(a=!1,(function(e){var t=eb;e((e=>{if(e===0){if(r.length){var s=r.indexOf(t);s>-1&&(r=r.slice()).splice(s,1),r.length||(o?n(0):a||(a=!0,i(0)))}}else e.tag===0?(r.push(t=e[0]),t(0)):r.length&&(n(e),t(0))}))})(e(t[0])),a||(a=!0,i(0))))})),n(tb((e=>{if(e===1){o||(o=!0,i(1));for(var t=0,n=r,s=r.length;t<s;t++)n[t](1);r.length=0}else{!o&&!a?(a=!0,i(0)):a=!1;for(var c=0,l=r,u=r.length;c<u;c++)l[c](0)}})))}}function cb(e){return sb(ib)(e)}function lb(e){return cb(xb(e))}function ub(e){return t=>n=>{var r=!1;t((t=>{if(!r)if(t===0)r=!0,n(0),e();else if(t.tag===0){var i=t[0];n(tb((t=>{t===1?(r=!0,i(1),e()):i(t)})))}else n(t)}))}}function db(e){return t=>n=>{var r=!1;t((t=>{if(!r)if(t===0)r=!0,n(0);else if(t.tag===0){var i=t[0];n(tb((e=>{e===1&&(r=!0),i(e)})))}else e(t[0]),n(t)}))}}function fb(e){return t=>n=>t((t=>{t===0?n(0):t.tag===0?(n(t),e()):n(t)}))}function pb(e){var t=[],n=eb,r=!1;return i=>{t.push(i),t.length===1&&e((e=>{if(e===0){for(var i=0,a=t,o=t.length;i<o;i++)a[i](0);t.length=0}else if(e.tag===0)n=e[0];else{r=!1;for(var s=0,c=t,l=t.length;s<l;s++)c[s](e)}})),i(tb((e=>{if(e===1){var a=t.indexOf(i);a>-1&&(t=t.slice()).splice(a,1),t.length||n(1)}else r||(r=!0,n(0))})))}}function mb(e){return t=>n=>{var r=eb,i=eb,a=!1,o=!1,s=!1,c=!1;t((t=>{c||(t===0?(c=!0,s||n(0)):t.tag===0?r=t[0]:(s&&(i(1),i=eb),a?a=!1:(a=!0,r(0)),(function(e){s=!0,e((e=>{s&&(e===0?(s=!1,c?n(0):a||(a=!0,r(0))):e.tag===0?(o=!1,(i=e[0])(0)):(n(e),o?o=!1:i(0)))}))})(e(t[0]))))})),n(tb((e=>{e===1?(c||(c=!0,r(1)),s&&(s=!1,i(1))):(!c&&!a&&(a=!0,r(0)),s&&!o&&(o=!0,i(0)))})))}}function hb(e){return t=>n=>{var r=eb,i=!1,a=0;t((t=>{i||(t===0?(i=!0,n(0)):t.tag===0?e<=0?(i=!0,n(0),t[0](1)):r=t[0]:a++<e?(n(t),!i&&a>=e&&(i=!0,n(0),r(1))):n(t))})),n(tb((t=>{t===1&&!i?(i=!0,r(1)):t===0&&!i&&a<e&&r(0)})))}}function gb(e){return t=>n=>{var r=eb,i=eb,a=!1;t((t=>{a||(t===0?(a=!0,i(1),n(0)):t.tag===0?(r=t[0],e((e=>{e===0||(e.tag===0?(i=e[0])(0):(a=!0,i(1),r(1),n(0)))}))):n(t))})),n(tb((e=>{e===1&&!a?(a=!0,r(1),i(1)):a||r(0)})))}}function _b(e,t){return n=>r=>{var i=eb,a=!1;n((n=>{a||(n===0?(a=!0,r(0)):n.tag===0?(i=n[0],r(n)):e(n[0])?r(n):(a=!0,t&&r(n),r(0),i(1)))}))}}function vb(e){return t=>e()(t)}function yb(e){return t=>{var n=e[rb()]&&e[rb()]()||e,r=!1,i=!1,a=!1,o;t(tb((async e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=await n.next()).done)r=!0,n.return&&await n.return(),t(0);else try{a=!1,t(nb(o.value))}catch(e){if(n.throw)(r=!!(await n.throw(e)).done)&&t(0);else throw e}i=!1}})))}}function bb(e){return e[Symbol.asyncIterator]?yb(e):t=>{var n=e[Symbol.iterator](),r=!1,i=!1,a=!1,o;t(tb((e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=n.next()).done)r=!0,n.return&&n.return(),t(0);else try{a=!1,t(nb(o.value))}catch(e){if(n.throw)(r=!!n.throw(e).done)&&t(0);else throw e}i=!1}})))}}var xb=bb;function Sb(e){return t=>{var n=!1;t(tb((r=>{r===1?n=!0:n||(n=!0,t(nb(e)),t(0))})))}}function Cb(e){return t=>{var n=!1,r=e({next(e){n||t(nb(e))},complete(){n||(n=!0,t(0))}});t(tb((e=>{e===1&&!n&&(n=!0,r())})))}}function wb(){var e,t;return{source:pb(Cb((n=>(e=n.next,t=n.complete,$y)))),next(t){e&&e(t)},complete(){t&&t()}}}function Tb(e){return t=>{var n=eb,r=!1;return t((t=>{t===0?r=!0:t.tag===0?(n=t[0])(0):r||(e(t[0]),n(0))})),{unsubscribe(){r||(r=!0,n(1))}}}}function Eb(e){Tb((e=>{}))(e)}function Db(e){return new Promise((t=>{var n=eb,r;e((e=>{e===0?Promise.resolve(r).then(t):e.tag===0?(n=e[0])(0):(r=e[0],n(0))}))}))}var Ob=(...e)=>{for(var t=e[0],n=1,r=e.length;n<r;n++)t=e[n](t);return t},kb=e=>e&&typeof e.message==`string`&&(e.extensions||e.name===`GraphQLError`)?e:typeof e==`object`&&typeof e.message==`string`?new Dy(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new Dy(e),Ab=class extends Error{constructor(e){var t=(e.graphQLErrors||[]).map(kb),n=((e,t)=>{var n=``;if(e)return`[Network] ${e.message}`;if(t)for(var r=0,i=t.length;r<i;r++)n&&(n+=`
808
- `),n+=`[GraphQL] ${t[r].message}`;return n})(e.networkError,t);super(n),this.name=`CombinedError`,this.message=n,this.graphQLErrors=t,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},jb=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},Mb=new Set,Nb=new WeakMap,Pb=(e,t)=>{if(e===null||Mb.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return Pb(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=Pb(e[r],t)||`null`;return n+=`]`}else if(!t&&(Rb!==Lb&&e instanceof Rb||zb!==Lb&&e instanceof zb))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=Nb.get(e)||Math.random().toString(36).slice(2);return Nb.set(e,o),Pb({__key:o},t)}Mb.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=Pb(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=Pb(a[c],t)+`:`+u)}return Mb.delete(e),s+=`}`},Fb=(e,t,n)=>{if(!(typeof n!=`object`||!n||n.toJSON||Mb.has(n)))if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)Fb(e,`${t}.${r}`,n[r]);else if(n instanceof Rb||n instanceof zb)e.set(t,n);else for(var a in Mb.add(n),n)Fb(e,`${t}.${a}`,n[a])},Ib=(e,t)=>(Mb.clear(),Pb(e,t||!1)),Lb=class{},Rb=typeof File<`u`?File:Lb,zb=typeof Blob<`u`?Blob:Lb,Bb=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,Vb=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,Hb=(e,t)=>t%2==0?e.replace(Vb,`
809
- `):e,Ub=e=>e.split(Bb).map(Hb).join(``).trim(),Wb=new Map,Gb=new Map,Kb=e=>{var t;return typeof e==`string`?t=Ub(e):e.loc&&Gb.get(e.__key)===e?t=e.loc.source.body:(t=Wb.get(e)||Ub(Qy(e)),Wb.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},qb=e=>{var t;if(e.documentId)t=jb(e.documentId);else if(t=jb(Kb(e)),e.definitions){var n=Xb(e);n&&(t=jb(`\n# ${n}`,t))}return t},Jb=e=>{var t,n;return typeof e==`string`?(t=qb(e),n=Gb.get(t)||Gy(e,{noLocation:!0})):(t=e.__key||qb(e),n=Gb.get(t)||e),n.loc||Kb(n),n.__key=t,Gb.set(t,n),n},Yb=(e,t,n)=>{var r=t||{},i=Jb(e),a=Ib(r,!0),o=i.__key;return a!==`{}`&&(o=jb(a,o)),{key:o,query:i,variables:r,extensions:n}},Xb=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===Ey.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},Zb=(e,t,n)=>{if(!(`data`in t||`errors`in t&&Array.isArray(t.errors)))throw Error(`No Content`);var r=e.kind===`subscription`;return{operation:e,data:t.data,error:Array.isArray(t.errors)?new Ab({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},Qb=(e,t)=>{if(typeof e==`object`&&e){if(Array.isArray(e)){e=[...e];for(var n=0,r=t.length;n<r;n++)e[n]=Qb(e[n],t[n]);return e}if(!e.constructor||e.constructor===Object){for(var i in e={...e},t)e[i]=Qb(e[i],t[i]);return e}}return t},$b=(e,t,n,r)=>{var i=e.error?e.error.graphQLErrors:[],a=!!e.extensions||!!(t.payload||t).extensions,o={...e.extensions,...(t.payload||t).extensions},s=t.incremental;`path`in t&&(s=[t]);var c={data:e.data};if(s)for(var l=function(){var e=s[u];Array.isArray(e.errors)&&i.push(...e.errors),e.extensions&&(Object.assign(o,e.extensions),a=!0);var t=`data`,n=c,l=[];if(e.path)l=e.path;else if(r){var d=r.find((t=>t.id===e.id));l=e.subPath?[...d.path,...e.subPath]:d.path}for(var f=0,p=l.length;f<p;t=l[f++])n=n[t]=Array.isArray(n[t])?[...n[t]]:{...n[t]};if(e.items)for(var m=+t>=0?t:0,h=0,g=e.items.length;h<g;h++)n[m+h]=Qb(n[m+h],e.items[h]);else e.data!==void 0&&(n[t]=Qb(n[t],e.data))},u=0,d=s.length;u<d;u++)l();else c.data=(t.payload||t).data||e.data,i=t.errors||t.payload&&t.payload.errors||i;return{operation:e.operation,data:c.data,error:i.length?new Ab({graphQLErrors:i,response:n}):void 0,extensions:a?o:void 0,hasNext:t.hasNext==null?e.hasNext:t.hasNext,stale:!1}},ex=(e,t,n)=>({operation:e,data:void 0,error:new Ab({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function tx(e){var t={query:void 0,documentId:void 0,operationName:Xb(e.query),variables:e.variables||void 0,extensions:e.extensions};return`documentId`in e.query&&e.query.documentId&&(!e.query.definitions||!e.query.definitions.length)?t.documentId=e.query.documentId:(!e.extensions||!e.extensions.persistedQuery||e.extensions.persistedQuery.miss)&&(t.query=Kb(e.query)),t}var nx=(e,t)=>{var n=e.kind===`query`&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=rx(e.context.url);for(var i in t){var a=t[i];a&&r[1].set(i,typeof a==`object`?Ib(a):a)}var o=r.join(`?`);return o.length>2047&&n!==`force`?(e.context.preferGetMethod=!1,e.context.url):o},rx=e=>{var t=e.indexOf(`?`);return t>-1?[e.slice(0,t),new URLSearchParams(e.slice(t+1))]:[e,new URLSearchParams]},ix=(e,t)=>{if(t&&!(e.kind===`query`&&e.context.preferGetMethod)){var n=Ib(t),r=(e=>{var t=new Map;return(Rb!==Lb||zb!==Lb)&&(Mb.clear(),Fb(t,`variables`,e)),t})(t.variables);if(r.size){var i=new FormData;i.append(`operations`,n),i.append(`map`,Ib({...[...r.keys()].map((e=>[e]))}));var a=0;for(var o of r.values())i.append(``+a++,o);return i}return n}},ax=(e,t)=>{var n={accept:e.kind===`subscription`?`text/event-stream, multipart/mixed`:`application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed`},r=(typeof e.context.fetchOptions==`function`?e.context.fetchOptions():e.context.fetchOptions)||{};if(r.headers)if((e=>`has`in e&&!Object.keys(e).length)(r.headers))r.headers.forEach(((e,t)=>{n[t]=e}));else if(Array.isArray(r.headers))r.headers.forEach(((e,t)=>{Array.isArray(e)?n[e[0]]?n[e[0]]=`${n[e[0]]},${e[1]}`:n[e[0]]=e[1]:n[t]=e}));else for(var i in r.headers)n[i.toLowerCase()]=r.headers[i];var a=ix(e,t);return typeof a==`string`&&!n[`content-type`]&&(n[`content-type`]=`application/json`),{...r,method:a?`POST`:`GET`,body:a,headers:n}},ox=/boundary="?([^=";]+)"?/i,sx=/data: ?([^\n]+)/;async function*cx(e){if(e.body[Symbol.asyncIterator])for await(var t of e.body)yield t;else{var n=e.body.getReader(),r;try{for(;!(r=await n.read()).done;)yield r.value}finally{n.cancel()}}}async function*lx(e,t){var n=typeof TextDecoder<`u`?new TextDecoder:null,r=``,i;for await(var a of e)for(r+=a.constructor.name===`Buffer`?a.toString():n.decode(a,{stream:!0});(i=r.indexOf(t))>-1;)yield r.slice(0,i),r=r.slice(i+t.length)}async function*ux(e,t,n){var r=!0,i=null,a;try{yield await Promise.resolve();var o=(a=await(e.context.fetch||fetch)(t,n)).headers.get(`Content-Type`)||``,s=/multipart\/mixed/i.test(o)?async function*(e,t){var n=e.match(ox),r=`--`+(n?n[1]:`-`),i=!0,a;for await(var o of lx(cx(t),`\r
810
- `+r)){if(i){i=!1;var s=o.indexOf(r);if(s>-1)o=o.slice(s+r.length);else continue}try{yield a=JSON.parse(o.slice(o.indexOf(`\r
811
- \r
812
- `)+4))}catch(e){if(!a)throw e}if(a&&!1===a.hasNext)break}a&&!1!==a.hasNext&&(yield{hasNext:!1})}(o,a):/text\/event-stream/i.test(o)?async function*(e){var t;for await(var n of lx(cx(e),`
813
-
814
- `)){var r=n.match(sx);if(r){var i=r[1];try{yield t=JSON.parse(i)}catch(e){if(!t)throw e}if(t&&!1===t.hasNext)break}}t&&!1!==t.hasNext&&(yield{hasNext:!1})}(a):/text\//i.test(o)?async function*(e){var t=await e.text();try{yield JSON.parse(t)}catch{throw Error(t)}}(a):async function*(e){yield JSON.parse(await e.text())}(a),c;for await(var l of s)l.pending&&!i?c=l.pending:l.pending&&(c=[...c,...l.pending]),i=i?$b(i,l,a,c):Zb(e,l,a),r=!1,yield i,r=!0;i||(yield i=Zb(e,{},a))}catch(t){if(!r)throw t;yield ex(e,a&&(a.status<200||a.status>=300)&&a.statusText?Error(a.statusText):t,a)}}function dx(e,t,n){var r;return typeof AbortController<`u`&&(n.signal=(r=new AbortController).signal),ub((()=>{r&&r.abort()}))(ab((e=>!!e))(yb(ux(e,t,n))))}function fx(e){var t=t=>e(t);return t.toPromise=()=>Db(hb(1)(ab((e=>!e.stale&&!e.hasNext))(t))),t.then=(e,n)=>t.toPromise().then(e,n),t.subscribe=e=>Tb(e)(t),t}function px(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var mx=()=>{},hx=({forward:e,dispatchDebug:t})=>t=>lb([sb((e=>{var n=tx(e),r=nx(e,n),i=ax(e,n);return gb(ab((t=>t.kind===`teardown`&&t.key===e.key))(t))(dx(e,r,i))}))(ab((e=>e.kind!==`teardown`&&(e.kind!==`subscription`||!!e.context.fetchSubscriptions)))(t)),e(ab((e=>e.kind===`teardown`||e.kind===`subscription`&&!e.context.fetchSubscriptions))(t))]),gx=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight(((e,n)=>n({client:t,forward(t){return pb(e(pb(t)))},dispatchDebug(e){}})),n),_x=({dispatchDebug:e})=>e=>ab((e=>!1))(e),vx=function e(t){var n=0,r=new Map,i=new Map,a=new Set,o=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||`cache-first`},c=wb();function l(e){(e.kind===`mutation`||e.kind===`teardown`||!a.has(e.key))&&(e.kind===`teardown`?a.delete(e.key):e.kind!==`mutation`&&a.add(e.key),c.next(e))}var u=!1;function d(e){if(e&&l(e),!u){for(u=!0;u&&(e=o.shift());)l(e);u=!1}}var f=e=>{var t=gb(ab((t=>t.kind===`teardown`&&t.key===e.key))(c.source))(ab((t=>t.operation.kind===e.kind&&t.operation.key===e.key&&(!t.operation.context._instance||t.operation.context._instance===e.context._instance)))(g));return t=e.kind===`query`?mb((t=>{var n=Sb(t);return t.stale||t.hasNext?n:lb([n,ob((()=>(t.stale=!0,t)))(hb(1)(ab((t=>t.key===e.key))(c.source)))])}))(t):_b((e=>!!e.hasNext),!0)(t),t=e.kind===`mutation`?fb((()=>{l(e)}))(t):ub((()=>{a.delete(e.key),r.delete(e.key),i.delete(e.key),u=!1;for(var t=o.length-1;t>=0;t--)o[t].key===e.key&&o.splice(t,1);l(px(`teardown`,e,e.context))}))(db((t=>{if(t.stale)if(!t.hasNext)a.delete(e.key);else for(var n=0;n<o.length;n++){var i=o[n];if(i.key===t.operation.key){a.delete(i.key);break}}else t.hasNext||a.delete(e.key);r.set(e.key,t)}))(t)),pb(t)},p=this instanceof e?this:Object.create(e.prototype),m=Object.assign(p,{suspense:!!t.suspense,operations$:c.source,reexecuteOperation(e){if(e.kind===`teardown`)d(e);else if(e.kind===`mutation`)o.push(e),Promise.resolve().then(d);else if(i.has(e.key)){for(var t=!1,n=0;n<o.length;n++)o[n].key===e.key&&(o[n]=e,t=!0);t||a.has(e.key)&&e.context.requestPolicy!==`network-only`?(a.delete(e.key),Promise.resolve().then(d)):(o.push(e),Promise.resolve().then(d))}},createRequestOperation(e,t,r){return r||={},px(e,t,{_instance:e===`mutation`?n=n+1|0:void 0,...s,...r,requestPolicy:r.requestPolicy||s.requestPolicy,suspense:r.suspense||!1!==r.suspense&&m.suspense})},executeRequestOperation(e){return e.kind===`mutation`?fx(f(e)):fx(vb((()=>{var t=i.get(e.key);t||i.set(e.key,t=f(e)),t=fb((()=>{d(e)}))(t);var n=r.get(e.key);return e.kind===`query`&&n&&(n.stale||n.hasNext)?mb(Sb)(lb([t,ab((t=>t===r.get(e.key)))(Sb(n))])):t})))},executeQuery(e,t){var n=m.createRequestOperation(`query`,e,t);return m.executeRequestOperation(n)},executeSubscription(e,t){var n=m.createRequestOperation(`subscription`,e,t);return m.executeRequestOperation(n)},executeMutation(e,t){var n=m.createRequestOperation(`mutation`,e,t);return m.executeRequestOperation(n)},readQuery(e,t,n){var r=null;return Tb((e=>{r=e}))(m.query(e,t,n)).unsubscribe(),r},query:(e,t,n)=>m.executeQuery(Yb(e,t),n),subscription:(e,t,n)=>m.executeSubscription(Yb(e,t),n),mutation:(e,t,n)=>m.executeMutation(Yb(e,t),n)}),h=mx,g=pb(gx(t.exchanges)({client:m,dispatchDebug:h,forward:_x({dispatchDebug:h})})(c.source));return Eb(g),m},yx=u(s(((e,t)=>{var n=function(){function e(e,t){if(typeof e!=`function`)throw TypeError(`DataLoader must be constructed with a function which accepts `+(`Array<key> and returns Promise<Array<value>>, but got: `+e+`.`));this._batchLoadFn=e,this._maxBatchSize=l(t),this._batchScheduleFn=u(t),this._cacheKeyFn=d(t),this._cacheMap=f(t),this._batch=null,this.name=p(t)}var t=e.prototype;return t.load=function(e){if(e==null)throw TypeError(`The loader.load() function must be called with a value, `+(`but got: `+String(e)+`.`));var t=a(this),n=this._cacheMap,r;if(n){r=this._cacheKeyFn(e);var i=n.get(r);if(i){var o=t.cacheHits||=[];return new Promise(function(e){o.push(function(){e(i)})})}}t.keys.push(e);var s=new Promise(function(e,n){t.callbacks.push({resolve:e,reject:n})});return n&&n.set(r,s),s},t.loadMany=function(e){if(!m(e))throw TypeError(`The loader.loadMany() function must be called with Array<key> `+(`but got: `+e+`.`));for(var t=[],n=0;n<e.length;n++)t.push(this.load(e[n]).catch(function(e){return e}));return Promise.all(t)},t.clear=function(e){var t=this._cacheMap;if(t){var n=this._cacheKeyFn(e);t.delete(n)}return this},t.clearAll=function(){var e=this._cacheMap;return e&&e.clear(),this},t.prime=function(e,t){var n=this._cacheMap;if(n){var r=this._cacheKeyFn(e);if(n.get(r)===void 0){var i;t instanceof Error?(i=Promise.reject(t),i.catch(function(){})):i=Promise.resolve(t),n.set(r,i)}}return this},e}(),r=typeof process==`object`&&typeof process.nextTick==`function`?function(e){i||=Promise.resolve(),i.then(function(){process.nextTick(e)})}:typeof setImmediate==`function`?function(e){setImmediate(e)}:function(e){setTimeout(e)},i;function a(e){var t=e._batch;if(t!==null&&!t.hasDispatched&&t.keys.length<e._maxBatchSize)return t;var n={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=n,e._batchScheduleFn(function(){o(e,n)}),n}function o(e,t){if(t.hasDispatched=!0,t.keys.length===0){c(t);return}var n;try{n=e._batchLoadFn(t.keys)}catch(n){return s(e,t,TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function `+(`errored synchronously: `+String(n)+`.`)))}if(!n||typeof n.then!=`function`)return s(e,t,TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did `+(`not return a Promise: `+String(n)+`.`)));n.then(function(e){if(!m(e))throw TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did `+(`not return a Promise of an Array: `+String(e)+`.`));if(e.length!==t.keys.length)throw TypeError(`DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.`+(`
815
-
816
- Keys:
817
- `+String(t.keys))+(`
818
-
819
- Values:
820
- `+String(e)));c(t);for(var n=0;n<t.callbacks.length;n++){var r=e[n];r instanceof Error?t.callbacks[n].reject(r):t.callbacks[n].resolve(r)}}).catch(function(n){s(e,t,n)})}function s(e,t,n){c(t);for(var r=0;r<t.keys.length;r++)e.clear(t.keys[r]),t.callbacks[r].reject(n)}function c(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function l(e){if(!(!e||e.batch!==!1))return 1;var t=e&&e.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!=`number`||t<1)throw TypeError(`maxBatchSize must be a positive number: `+t);return t}function u(e){var t=e&&e.batchScheduleFn;if(t===void 0)return r;if(typeof t!=`function`)throw TypeError(`batchScheduleFn must be a function: `+t);return t}function d(e){var t=e&&e.cacheKeyFn;if(t===void 0)return function(e){return e};if(typeof t!=`function`)throw TypeError(`cacheKeyFn must be a function: `+t);return t}function f(e){if(!(!e||e.cache!==!1))return null;var t=e&&e.cacheMap;if(t===void 0)return new Map;if(t!==null){var n=[`get`,`set`,`delete`,`clear`].filter(function(e){return t&&typeof t[e]!=`function`});if(n.length!==0)throw TypeError(`Custom cacheMap missing methods: `+n.join(`, `))}return t}function p(e){return e&&e.name?e.name:null}function m(e){return typeof e==`object`&&!!e&&typeof e.length==`number`&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}t.exports=n}))(),1),bx=1e4,xx=16,Sx=e=>{let t;try{t=e.contentWindow}catch{return!0}if(!t)return!0;try{let e=t.location.href;return e!==``&&e!==`about:blank`}catch{return!0}},Cx=(e,t=bx)=>new Promise(n=>{if(Sx(e))return n();let r=()=>{clearInterval(i),clearTimeout(a),e.removeEventListener(`load`,r),n()},i=setInterval(()=>{Sx(e)&&r()},xx),a=setTimeout(r,t);e.addEventListener(`load`,r)}),wx=32,Tx=8,Ex=120,Dx=typeof CSS<`u`&&CSS.supports(`clip-path`,`path('M0 0H1V1H0Z')`),Ox=typeof CSS<`u`&&CSS.supports(`clip-path`,`polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)`),kx=e=>{let t=e.style;t.setProperty(`display`,`block`,`important`),t.setProperty(`position`,`fixed`,`important`),t.setProperty(`top`,`0`,`important`),t.setProperty(`left`,`0`,`important`),t.setProperty(`width`,`100%`,`important`),t.setProperty(`height`,`100%`,`important`),t.setProperty(`border`,`none`,`important`),t.setProperty(`padding`,`0`,`important`),t.setProperty(`box-sizing`,`border-box`,`important`),t.setProperty(`clip-path`,`inset(100%)`,`important`),t.setProperty(`background`,`transparent`),t.setProperty(`color-scheme`,`normal`),t.setProperty(`z-index`,`2147483647`),e.setAttribute(`title`,`FKN`)},Ax=({x:e,y:t,width:n,height:r,radius:i})=>{if(!i)return`M${e} ${t}h${n}v${r}h${-n}Z`;let a=Math.min(n,r)/2,[o,s,c,l]=i.map(e=>Math.max(0,Math.min(e,a)));return`M${e+o} ${t}h${n-o-s}a${s} ${s} 0 0 1 ${s} ${s}v${r-s-c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n-c-l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r-l-o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`},jx=()=>Dx&&Ox,Mx=({x:e,y:t,width:n,height:r})=>[[e,t],[e+n,t],[e+n,t+r],[e,t+r],[e,t]],Nx=e=>{let t=e[0];if(!t)return[];let n=Mx(t)[0],r=[];return e.forEach((t,i)=>{r.push(...Mx(t)),i>0&&i<e.length-1&&r.push(n)}),r},Px=e=>`polygon(nonzero, ${Nx(e).map(([e,t])=>`${e}px ${t}px`).join(`, `)})`,Fx=({x:e,y:t,width:n,height:r,radius:i},a)=>{let o=`${t}px ${a.width-e-n}px ${a.height-t-r}px ${e}px`;return i?`inset(${o} round ${i.map(e=>`${e}px`).join(` `)})`:`inset(${o})`},Ix=(e,t,n)=>{if(t)return`none`;if(e.length===0)return`inset(100%)`;let r=e.length===1?e[0]:void 0;return r?Fx(r,n):Ox&&e.length<=5&&!e.some(e=>e.radius)?Px(e):`path('${e.map(Ax).join(``)}')`},Lx=e=>{if(e.length<2)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y));return{x:t,y:n,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-n}},Rx=(e,t,n)=>t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height,zx=16,Bx=(e,t,n)=>t===1?e*zx:t===2?e*n:e,Vx=(e,t,n)=>{let r=getComputedStyle(e);return n!==0&&/auto|scroll/.test(r.overflowY)&&e.scrollHeight>e.clientHeight?!0:t!==0&&/auto|scroll/.test(r.overflowX)&&e.scrollWidth>e.clientWidth},Hx=(e,t,n)=>{for(let r=e;r;r=r.parentElement)if(Vx(r,t,n))return r;return document.scrollingElement},Ux=null,Wx=null,Gx=e=>({width:e.offsetWidth||window.innerWidth,height:e.offsetHeight||window.innerHeight}),Kx=e=>{if(!Wx||!Ux||!Rx(Wx,e.clientX,e.clientY))return;let t=document.elementFromPoint(e.clientX,e.clientY);if(!t||t===Ux)return;let n=Bx(e.deltaX,e.deltaMode,window.innerWidth),r=Bx(e.deltaY,e.deltaMode,window.innerHeight),i=Hx(t,n,r);i&&(i.scrollBy({left:n,top:r,behavior:`instant`}),e.cancelable&&e.preventDefault())},qx=e=>{let t=Wx!==null;Wx=e,t!==(e!==null)&&(e?window.addEventListener(`wheel`,Kx,{capture:!0,passive:!1}):window.removeEventListener(`wheel`,Kx,{capture:!0}))},Jx=0,Yx=e=>{if(e===Jx)return;Jx=e;let t=document.documentElement.style;e>0?(t.setProperty(`margin-top`,`${e}px`,`important`),t.setProperty(`--fkn-inset-top`,`${e}px`)):(t.removeProperty(`margin-top`),t.removeProperty(`--fkn-inset-top`))},Xx=(e,{modal:t,rects:n,inset:r},i)=>{if(Yx(r),!Dx){let r=t||n.length>0;e.style.setProperty(`pointer-events`,r?`auto`:`none`,`important`),e.style.setProperty(`visibility`,r?`visible`:`hidden`,`important`);return}let a=Ix(n,t,i),o=a===`none`||CSS.supports(`clip-path`,a)?a:`inset(100%)`;e.style.setProperty(`clip-path`,o,`important`),qx(t||o!==a?null:Lx(n))},Zx=e=>{if(typeof e!=`object`||!e)return 0;let{top:t}=e;return typeof t!=`number`||!Number.isFinite(t)||t<=0?0:Math.min(Math.round(t),Ex)},Qx=e=>{if(!(!Array.isArray(e)||e.length!==4)&&e.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0))return e.some(e=>e>0)?e:void 0},$x=(e,t)=>{if(typeof e!=`object`||!e)return null;let{x:n,y:r,width:i,height:a}=e;if(![n,r,i,a].every(e=>typeof e==`number`&&Number.isFinite(e)))return null;let o=t.width,s=t.height,c=Math.max(0,Math.min(Math.round(n),o)),l=Math.max(0,Math.min(Math.round(r),s)),u=Math.max(c,Math.min(Math.round(n+i),o)),d=Math.max(l,Math.min(Math.round(r+a),s)),f=Qx(e.radius);return{x:c,y:l,width:u-c,height:d-l,...f?{radius:f}:{}}},eS={"not-rendered":`this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout`,clipped:`it is clipped away or positioned outside the viewport`,"not-shown":`it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter`},tS=e=>Array.isArray(e)?e.slice(0,Tx).flatMap(e=>{if(typeof e!=`object`||!e)return[];let{kind:t,cause:n,level:r}=e;return typeof t!=`string`||t.length>40||typeof n!=`string`||!(n in eS)||r!==`full`&&r!==`liveness`?[]:[{kind:t,cause:n,level:r}]}):[],nS=new Set,rS=e=>{for(let{kind:t,cause:n,level:r}of e)nS.has(t)||(nS.add(t),console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${eS[n]}. Nobody using this page can see or answer it.
821
- @fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.`+(r===`liveness`?`
822
- This browser reports limited detail, so the cause above is a best guess.`:``)))},iS=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,wx):[]).map(e=>$x(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:tS(n.hidden),inset:Zx(n.inset)}},aS=()=>Ux!==null,oS=null,sS=null,cS=()=>{if(!Ux||oS===null)return;let e=Gx(Ux),t=iS(oS,e);t&&Xx(Ux,t,e)},lS=e=>{typeof ResizeObserver>`u`||(sS??=new ResizeObserver(cS),sS.disconnect(),sS.observe(e))},uS=e=>{kx(e),Xx(e,{modal:!1,rects:[],hidden:[],inset:0},Gx(e)),Ux=e,lS(e)},dS=e=>{if(!Ux)return;let t=Gx(Ux),n=iS(e,t);n&&(oS=e,Xx(Ux,n,t),rS(n.hidden))},fS=`https://fkn.app`,pS=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,mS=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,hS=`${fS}/api${mS?`?coi=1`:``}`,gS=`fkn-api-port`,_S=`fkn-api-port-ack`,vS=2e3,yS=()=>{if(!pS||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===_S&&r(t.port1)},a=setTimeout(()=>r(void 0),vS);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:gS},fS,[t.port2])}catch{r(void 0)}})},bS,xS=()=>{if(bS||!pS)return bS;let e=pS.querySelector(`iframe[src="${hS}"]`);if(e)bS=e;else{let e=pS.createElement(`iframe`);mS&&e.setAttribute(`allow`,`cross-origin-isolated`),e.src=hS,pS.body.appendChild(e),bS=e}return uS(bS),bS},SS=(async()=>{if(!pS)return;let e=await yS();if(e)return{receive:e,emit:e};let t=xS();if(!t)return;await Cx(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),CS=e=>{let t,n=()=>{},r=new Promise(e=>{n=e}),i=new Set,a=new Set,o=0,s=0;(async()=>{for await(let r of e){let e=(t?.epoch??0)+1;t={remote:r,epoch:e},e===1&&n(r);let o=[...a];a.clear();let s=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let e of o)try{e(s)}catch{}for(let t of[...i])try{t(r,e)}catch{}}})().catch(()=>{});let c=async(e,n)=>{let i=t?.remote??await r;for(let t of e.slice(0,-1))i=i[t];let c=i[e[e.length-1]??``];o=Date.now(),s+=1;let l=()=>{},u=new Promise((e,t)=>{l=t});a.add(l);try{return await Promise.race([Promise.resolve(c.apply(i,n)),u])}finally{--s,a.delete(l),o=Date.now()}},l=new Map,u=e=>{let n=e.join(`\0`),r=l.get(n);if(r)return r;let i=new Proxy(function(){},{get:(n,r)=>{if(typeof r!=`string`||r===`then`)return;let i=t;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return u([...e,r])},apply:(t,n,r)=>c(e,r)});return l.set(n,i),i};return{facade:u([]),first:r.then(()=>{}),current:()=>t,onEpoch:e=>{if(i.add(e),t)try{e(t.remote,t.epoch)}catch{}return()=>{i.delete(e)}},lastCall:()=>o,inFlight:()=>s}},wS=async()=>{if(typeof window<`u`)return SS;if(typeof self<`u`)return{receive:self,emit:self}},TS=CS({async*[Symbol.asyncIterator](){let e=await wS();if(!e){await new Promise(()=>{});return}yield*Vv({},{key:`fkn-api`,transport:e})}});TS.first.then(()=>TS.facade);var ES=TS.onEpoch;TS.current,TS.lastCall,TS.inFlight,ES(e=>{aS()&&e.overlay.setHost(dS,{exactClips:jx()}).catch(()=>{})});var DS=new Set,OS=(e,t)=>{DS.add({kind:e,probe:t})},kS=`fkn-packages-connection`,AS=3e4,jS=(e,t)=>Object.assign(Error(t),{code:e}),MS=(e,t,n)=>Vv(e??{},{transport:t,key:kS,unregisterSignal:n}),NS=async(e,t,n={})=>{let{signal:r,closed:i}=n;if(r?.aborted)throw jS(`unavailable`,`packages.connect: aborted before connecting`);let a=new AbortController;r&&r.addEventListener(`abort`,()=>a.abort(r.reason),{once:!0});let o=new AbortController,s=new Promise((e,n)=>{let a=setTimeout(()=>n(jS(`timeout`,`packages.connect: the package did not complete the connection`)),AS);o.signal.addEventListener(`abort`,()=>clearTimeout(a),{once:!0}),t.addEventListener(`message`,e=>{if(e.data?.type===`fkn-packages-nack`){let t=e.data.message;n(jS(`unavailable`,typeof t==`string`&&t?t:`packages.connect: the package refused the connection`))}},{signal:o.signal}),t.start(),r&&r.addEventListener(`abort`,()=>n(jS(`unavailable`,`packages.connect: aborted before connecting`)),{once:!0,signal:o.signal}),i?.then(()=>n(jS(`unavailable`,`packages.connect: the package closed before connecting`)))});try{return await Promise.race([MS(e,t,a.signal),s])}catch(e){a.abort(e);try{t.close()}catch{}throw e}finally{o.abort()}},PS=new Map;OS(`package view`,()=>PS.size>0);var FS=(e,t,n)=>NS(t,e,{signal:n?.signal});let IS=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),LS=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),RS=function(e){return e.Cancelled=`CANCELLED`,e.Finished=`FINISHED`,e.Hiatus=`HIATUS`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Releasing=`RELEASING`,e}({}),zS=function(e){return e.Anime=`ANIME`,e.LiveAction=`LIVE_ACTION`,e.Movie=`MOVIE`,e.Ona=`ONA`,e.Ova=`OVA`,e.Special=`SPECIAL`,e.Tv=`TV`,e.TvShort=`TV_SHORT`,e}({});const BS=e=>{let t=e[0];for(let n of e)t&&n.id.startsWith(`${t.id}-`)&&(t=n);return t},VS=(e,t)=>ZS(e)?BS($S(e)?.handleUrisValues.filter(e=>e.origin===t)??[]):KS(e)&&HS(e).origin===t?HS(e):void 0,HS=e=>{let[t,n]=e.split(`:`);return{origin:t,id:n}},US=(e,t)=>{let n=e.split(`,`).filter(Boolean).map(e=>HS(e));return t?n.find(({origin:e})=>e===t):n},WS=({origin:e,id:t})=>`${e}:${t}`,GS=e=>e.join(`,`),KS=e=>{let t=e.split(`:`).filter(e=>e.length);if(t[1]?.includes(`,`))throw Error(`Invalid uri: ${e}, contains "," character in id`);return t.length===2},qS=/[,/()]/,JS=e=>{let t=e.indexOf(`:`);return t>0&&!qS.test(e.slice(t+1))},YS=e=>e.split(`,`).every(KS),XS=/ag:\((.*)\)(?:-(.*))?/,ZS=e=>{if(!e?.startsWith(`ag:`))return!1;let t=e.match(XS);if(!t)return!1;let n=t?.[1];return!n||YS(n)},QS=e=>{if(!e||KS(e)||ZS(e))return e;try{let t=decodeURIComponent(e);return KS(t)||ZS(t)?t:e}catch{return e}},$S=e=>{if(typeof e!=`string`)return;let t=e.match(XS);if(!t)return;let n=US(t[1]).filter(e=>e.origin&&e.id).sort((e,t)=>e.id.localeCompare(t.id)).sort((e,t)=>e.origin.localeCompare(t.origin));return t&&{uri:`ag:(${GS(n.map(WS))})`,origin:`ag`,id:`(${GS(n.map(WS))})`,handleUris:n.map(WS),handleUrisString:GS(n.map(WS)),handleUrisValues:n,episodeId:t[2]}},eC=e=>ZS(e)?[...new Set($S(e)?.handleUrisValues.map(e=>e.origin)??[])]:KS(e)?[HS(e).origin]:[];var tC=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,iC.unregister(this),e}free(){let e=this.__destroy_into_raw();B.__wbg_haystacks_free(e,0)}bytesView(){return B.haystacks_bytesView(this.__wbg_ptr)}clear(){B.haystacks_clear(this.__wbg_ptr)}commit(e,t){let n=B.haystacks_commit(this.__wbg_ptr,e,t);if(n[1])throw xC(n[0])}get length(){return B.haystacks_length(this.__wbg_ptr)>>>0}constructor(e){var t=vC(e)?0:yC(e,B.__wbindgen_malloc),n=EC;let r=B.haystacks_new(t,n);return this.__wbg_ptr=r,iC.register(this,this.__wbg_ptr,this),this}offsetsView(){return B.haystacks_offsetsView(this.__wbg_ptr)}push(e){let t=yC(e,B.__wbindgen_malloc),n=EC;B.haystacks_push(this.__wbg_ptr,t,n)}reserve(e,t){B.haystacks_reserve(this.__wbg_ptr,e,t)}};Symbol.dispose&&(tC.prototype[Symbol.dispose]=tC.prototype.free);var nC=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,aC.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,aC.unregister(this),e}free(){let e=this.__destroy_into_raw();B.__wbg_matcher_free(e,0)}static fromPatterns(t,n){let r=B.matcher_fromPatterns(t,vC(n)?0:oC(n));if(r[2])throw xC(r[1]);return e.__wrap(r[0])}static fromQuery(t,n){let r=bC(t,B.__wbindgen_malloc,B.__wbindgen_realloc),i=EC,a=B.matcher_fromQuery(r,i,vC(n)?0:oC(n));if(a[2])throw xC(a[1]);return e.__wrap(a[0])}matchHaystacks(e){return sC(e,tC),B.matcher_matchHaystacks(this.__wbg_ptr,e.__wbg_ptr)}matchHaystacksIndices(e){return sC(e,tC),B.matcher_matchHaystacksIndices(this.__wbg_ptr,e.__wbg_ptr)}matchList(e){let t=yC(e,B.__wbindgen_malloc),n=EC;return B.matcher_matchList(this.__wbg_ptr,t,n)}matchListIndices(e){let t=yC(e,B.__wbindgen_malloc),n=EC;return B.matcher_matchListIndices(this.__wbg_ptr,t,n)}matchOne(e,t){let n=bC(e,B.__wbindgen_malloc,B.__wbindgen_realloc),r=EC;return B.matcher_matchOne(this.__wbg_ptr,n,r,t)}matchOneIndices(e,t){let n=bC(e,B.__wbindgen_malloc,B.__wbindgen_realloc),r=EC;return B.matcher_matchOneIndices(this.__wbg_ptr,n,r,t)}constructor(e,t){let n=bC(e,B.__wbindgen_malloc,B.__wbindgen_realloc),r=EC,i=B.matcher_new(n,r,vC(t)?0:oC(t));if(i[2])throw xC(i[1]);return this.__wbg_ptr=i[0],aC.register(this,this.__wbg_ptr,this),this}setConfig(e){let t=B.matcher_setConfig(this.__wbg_ptr,e);if(t[1])throw xC(t[0])}setPattern(e){let t=B.matcher_setPattern(this.__wbg_ptr,e);if(t[1])throw xC(t[0])}setPatterns(e){let t=B.matcher_setPatterns(this.__wbg_ptr,e);if(t[1])throw xC(t[0])}};Symbol.dispose&&(nC.prototype[Symbol.dispose]=nC.prototype.free);function rC(){return{__proto__:null,"./frizbee_wasm_bg.js":{__proto__:null,__wbg_Error_bce6d499ff0a4aff:function(e,t){return Error(fC(e,t))},__wbg___wbindgen_boolean_get_2304fb8c853028c8:function(e){let t=e,n=typeof t==`boolean`?t:void 0;return vC(n)?16777215:+!!n},__wbg___wbindgen_is_null_2042690d351e14f0:function(e){return e===null},__wbg___wbindgen_is_object_b4593df85baada48:function(e){let t=e;return typeof t==`object`&&!!t},__wbg___wbindgen_is_undefined_35bb9f4c7fd651d5:function(e){return e===void 0},__wbg___wbindgen_number_get_f73a1244370fcc2c:function(e,t){let n=t,r=typeof n==`number`?n:void 0;dC().setFloat64(e+8,vC(r)?0:r,!0),dC().setInt32(e+0,!vC(r),!0)},__wbg___wbindgen_string_get_d109740c0d18f4d7:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=vC(r)?0:bC(r,B.__wbindgen_malloc,B.__wbindgen_realloc),a=EC;dC().setInt32(e+4,a,!0),dC().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_9c31b086c2b26051:function(e,t){throw Error(fC(e,t))},__wbg_from_fa561fa561dc8031:function(e){return Array.from(e)},__wbg_get_dcf82ab8aad1a593:function(){return _C(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_1dfe6d05ad91d9b7:function(e,t){return e[t>>>0]},__wbg_isArray_94898ed3aad6947b:function(e){return Array.isArray(e)},__wbg_length_2591a0f4f659a55c:function(e){return e.length},__wbg_new_02d162bc6cf02f60:function(){return{}},__wbg_new_310879b66b6e95e1:function(){return[]},__wbg_new_with_length_c2a8f9ac6aaaac03:function(e){return Array(e>>>0)},__wbg_push_b77c476b01548d0a:function(e,t){return e.push(t)},__wbg_set_78ea6a19f4818587:function(e,t,n){e[t>>>0]=n},__wbg_set_a0e911be3da02782:function(){return _C(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbindgen_cast_0000000000000001:function(e){return e},__wbindgen_cast_0000000000000002:function(e,t){return cC(e,t)},__wbindgen_cast_0000000000000003:function(e,t){return lC(e,t)},__wbindgen_cast_0000000000000004:function(e,t){return fC(e,t)},__wbindgen_init_externref_table:function(){let e=B.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const iC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>B.__wbg_haystacks_free(e,1)),aC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>B.__wbg_matcher_free(e,1));function oC(e){let t=B.__externref_table_alloc();return B.__wbindgen_externrefs.set(t,e),t}function sC(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}function cC(e,t){return e>>>=0,mC().subarray(e/4,e/4+t)}function lC(e,t){return e>>>=0,gC().subarray(e/1,e/1+t)}let uC=null;function dC(){return(uC===null||uC.buffer.detached===!0||uC.buffer.detached===void 0&&uC.buffer!==B.memory.buffer)&&(uC=new DataView(B.memory.buffer)),uC}function fC(e,t){return wC(e>>>0,t)}let pC=null;function mC(){return(pC===null||pC.byteLength===0)&&(pC=new Uint32Array(B.memory.buffer)),pC}let hC=null;function gC(){return(hC===null||hC.byteLength===0)&&(hC=new Uint8Array(B.memory.buffer)),hC}function _C(e,t){try{return e.apply(this,t)}catch(e){let t=oC(e);B.__wbindgen_exn_store(t)}}function vC(e){return e==null}function yC(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=oC(e[t]);dC().setUint32(n+4*t,r,!0)}return EC=e.length,n}function bC(e,t,n){if(n===void 0){let n=TC.encode(e),r=t(n.length,1)>>>0;return gC().subarray(r,r+n.length).set(n),EC=n.length,r}let r=e.length,i=t(r,1)>>>0,a=gC(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=gC().subarray(i+o,i+r),a=TC.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return EC=o,i}function xC(e){let t=B.__wbindgen_externrefs.get(e);return B.__externref_table_dealloc(e),t}let SC=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});SC.decode();let CC=0;function wC(e,t){return CC+=t,CC>=2146435072&&(SC=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),SC.decode(),CC=t),SC.decode(gC().subarray(e,e+t))}const TC=new TextEncoder;`encodeInto`in TC||(TC.encodeInto=function(e,t){let n=TC.encode(e);return t.set(n),{read:e.length,written:n.length}});let EC=0,B;function DC(e,t){return B=e.exports,uC=null,pC=null,hC=null,B.__wbindgen_start(),B}async function OC(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function kC(e){if(B!==void 0)return B;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/frizbee_wasm_bg-FO8dlm9E.wasm`,``+import.meta.url));let t=rC();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await OC(await e,t);return DC(n,r)}const AC=new TextEncoder;function jC(e,t){let n=0;for(let e of t)n+=e.length*3;e.reserve(n,t.length);let r=e.bytesView(),i=e.offsetsView(),a=0;for(let e=0;e<t.length;e++)a+=AC.encodeInto(t[e],r.subarray(a)).written,i[e]=a;return e.commit(a,t.length),e}var MC=class extends tC{constructor(e){super(),e?.length&&jC(this,e)}push(e){jC(this,e)}};let NC;function PC(e){return NC??=new MC,NC.clear(),jC(NC,e)}nC.prototype.matchList=function(e){return this.matchHaystacks(e instanceof tC?e:PC(e))},nC.prototype.matchListIndices=function(e){return this.matchHaystacksIndices(e instanceof tC?e:PC(e))};var FC=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,RC.unregister(this),e}free(){let e=this.__destroy_into_raw();V.__wbg_releaseindex_free(e,0)}get len(){return V.releaseindex_len(this.__wbg_ptr)>>>0}constructor(e){let t=ew(e,V.__wbindgen_export),n=sw,r=V.releaseindex_new(t,n);return this.__wbg_ptr=r>>>0,RC.register(this,this.__wbg_ptr,this),this}parsed(e){try{let r=V.__wbindgen_add_to_stack_pointer(-16);V.releaseindex_parsed(r,this.__wbg_ptr,e);var t=UC().getInt32(r+0,!0),n=UC().getInt32(r+4,!0);if(UC().getInt32(r+8,!0))throw nw(n);return nw(t)}finally{V.__wbindgen_add_to_stack_pointer(16)}}search(e,t){try{let i=V.__wbindgen_add_to_stack_pointer(-16),a=ew(e,V.__wbindgen_export),o=sw;V.releaseindex_search(i,this.__wbg_ptr,a,o,$C(t)?0:zC(t));var n=UC().getInt32(i+0,!0),r=UC().getInt32(i+4,!0);if(UC().getInt32(i+8,!0))throw nw(r);return nw(n)}finally{V.__wbindgen_add_to_stack_pointer(16)}}titleMatches(e,t){try{let i=V.__wbindgen_add_to_stack_pointer(-16),a=ew(e,V.__wbindgen_export),o=sw;V.releaseindex_titleMatches(i,this.__wbg_ptr,a,o,$C(t)?4294967297:Math.fround(t));var n=UC().getInt32(i+0,!0),r=UC().getInt32(i+4,!0);if(UC().getInt32(i+8,!0))throw nw(r);return nw(n)}finally{V.__wbindgen_add_to_stack_pointer(16)}}titleScores(e){try{let i=V.__wbindgen_add_to_stack_pointer(-16),a=ew(e,V.__wbindgen_export),o=sw;V.releaseindex_titleScores(i,this.__wbg_ptr,a,o);var t=UC().getInt32(i+0,!0),n=UC().getInt32(i+4,!0),r=VC(t,n).slice();return V.__wbindgen_export4(t,n*4,4),r}finally{V.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(FC.prototype[Symbol.dispose]=FC.prototype.free);function IC(e){try{let r=V.__wbindgen_add_to_stack_pointer(-16),i=tw(e,V.__wbindgen_export,V.__wbindgen_export2),a=sw;V.parse(r,i,a);var t=UC().getInt32(r+0,!0),n=UC().getInt32(r+4,!0);if(UC().getInt32(r+8,!0))throw nw(n);return nw(t)}finally{V.__wbindgen_add_to_stack_pointer(16)}}function LC(){return{__proto__:null,"./sacha_bg.js":{__proto__:null,__wbg_String_8564e559799eccda:function(e,t){let n=tw(String(YC(t)),V.__wbindgen_export,V.__wbindgen_export2),r=sw;UC().setInt32(e+4,r,!0),UC().setInt32(e+0,n,!0)},__wbg___wbindgen_is_null_0b605fc6b167c56f:function(e){return YC(e)===null},__wbg___wbindgen_is_undefined_52709e72fb9f179c:function(e){return YC(e)===void 0},__wbg___wbindgen_number_get_34bb9d9dcfa21373:function(e,t){let n=YC(t),r=typeof n==`number`?n:void 0;UC().setFloat64(e+8,$C(r)?0:r,!0),UC().setInt32(e+0,!$C(r),!0)},__wbg___wbindgen_string_get_395e606bd0ee4427:function(e,t){let n=YC(t),r=typeof n==`string`?n:void 0;var i=$C(r)?0:tw(r,V.__wbindgen_export,V.__wbindgen_export2),a=sw;UC().setInt32(e+4,a,!0),UC().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_6ddd609b62940d55:function(e,t){throw Error(KC(e,t))},__wbg_get_3ef1eba1850ade27:function(){return XC(function(e,t){return zC(Reflect.get(YC(e),YC(t)))},arguments)},__wbg_new_a70fbab9066b301f:function(){return zC([])},__wbg_new_ab79df5bd7c26067:function(){return zC({})},__wbg_set_282384002438957f:function(e,t,n){YC(e)[t>>>0]=nw(n)},__wbg_set_6be42768c690e380:function(e,t,n){YC(e)[nw(t)]=nw(n)},__wbindgen_cast_0000000000000001:function(e){return zC(e)},__wbindgen_cast_0000000000000002:function(e,t){return zC(KC(e,t))},__wbindgen_object_clone_ref:function(e){return zC(YC(e))},__wbindgen_object_drop_ref:function(e){nw(e)}}}}const RC=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>V.__wbg_releaseindex_free(e>>>0,1));function zC(e){QC===ZC.length&&ZC.push(ZC.length+1);let t=QC;return QC=ZC[t],ZC[t]=e,t}function BC(e){e<1028||(ZC[e]=QC,QC=e)}function VC(e,t){return e>>>=0,GC().subarray(e/4,e/4+t)}let HC=null;function UC(){return(HC===null||HC.buffer.detached===!0||HC.buffer.detached===void 0&&HC.buffer!==V.memory.buffer)&&(HC=new DataView(V.memory.buffer)),HC}let WC=null;function GC(){return(WC===null||WC.byteLength===0)&&(WC=new Float32Array(V.memory.buffer)),WC}function KC(e,t){return e>>>=0,aw(e,t)}let qC=null;function JC(){return(qC===null||qC.byteLength===0)&&(qC=new Uint8Array(V.memory.buffer)),qC}function YC(e){return ZC[e]}function XC(e,t){try{return e.apply(this,t)}catch(e){V.__wbindgen_export3(zC(e))}}let ZC=Array(1024).fill(void 0);ZC.push(void 0,null,!0,!1);let QC=ZC.length;function $C(e){return e==null}function ew(e,t){let n=t(e.length*4,4)>>>0,r=UC();for(let t=0;t<e.length;t++)r.setUint32(n+4*t,zC(e[t]),!0);return sw=e.length,n}function tw(e,t,n){if(n===void 0){let n=ow.encode(e),r=t(n.length,1)>>>0;return JC().subarray(r,r+n.length).set(n),sw=n.length,r}let r=e.length,i=t(r,1)>>>0,a=JC(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=JC().subarray(i+o,i+r),a=ow.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return sw=o,i}function nw(e){let t=YC(e);return BC(e),t}let rw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});rw.decode();let iw=0;function aw(e,t){return iw+=t,iw>=2146435072&&(rw=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),rw.decode(),iw=t),rw.decode(JC().subarray(e,e+t))}const ow=new TextEncoder;`encodeInto`in ow||(ow.encodeInto=function(e,t){let n=ow.encode(e);return t.set(n),{read:e.length,written:n.length}});let sw=0,V;function cw(e,t){return V=e.exports,HC=null,WC=null,qC=null,V}async function lw(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function uw(e){if(V!==void 0)return V;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/sacha_bg-CNH7LeJ_.wasm`,``+import.meta.url));let t=LC();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await lw(await e,t);return cw(n,r)}const dw=[`winter`,`spring`,`summer`,`fall`],fw=(e=new Date)=>({season:dw[Math.floor(e.getMonth()/3)],year:e.getFullYear()}),pw=[`WINTER`,`SPRING`,`SUMMER`,`FALL`],mw=e=>e.toUpperCase(),hw=e=>dw.find(t=>t===e.toLowerCase()),gw=(e=new Date)=>{let{season:t,year:n}=fw(e);return{season:mw(t),year:n}},_w={〇:0,零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},vw=e=>{if(/^\d+$/.test(e))return Number(e);let t=0,n=0;for(let r of e){if(r===`十`){t+=(n||1)*10,n=0;continue}let e=_w[r];if(e===void 0)return;n=e}return t+n||void 0},yw=[/\b(\d{1,3})(?:st|nd|rd|th)\s+(?:season|part|cour)\b/i,/\b(?:season|part|cour)\s*(\d{1,3})\b/i,/シーズン\s*(\d{1,3})/,/第\s*([\d〇零一二三四五六七八九十]{1,4})\s*[期季]/,/(\d{1,3})\s*[期기]/,/\bS(\d{1,2})\b/],bw=[/\s*\b(?:(?:season|part|cour)\s*\d{1,3}|\d{1,3}(?:st|nd|rd|th)\s+(?:season|part|cour)|(?:first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth)\s+(?:season|part|cour))\b/gi,/\s*(?:シーズン\s*\d{1,3}|第\s*[\d〇零一二三四五六七八九十]{1,4}\s*[期季])/g],xw=/\p{L}/u,Sw=e=>!xw.test(bw.reduce((e,t)=>e.replace(t,` `),e)),Cw=e=>{for(let t of yw){let n=t.exec(e);if(n){let e=vw(n[1]);if(e!==void 0)return e}}},ww=(e,t)=>{if(e.length<=1)return;let n=e.filter(e=>e.episodeCount===t);return n.length===1?n[0].seasonNumber:void 0},Tw=/^(.+)-s(\d{1,3})$/,Ew=(e,t)=>`${e}-s${t}`,Dw=e=>{let t=Tw.exec(e);return t?{showId:t[1],seasonNumber:Number(t[2])}:{showId:e}},Ow=e=>{if(!e)return!1;let t=new Date(e);return Number.isNaN(t.getTime())?!1:t.getUTCDate()!==1},kw=e=>`node`in e,Aw=e=>`node`in e,jw=e=>({node:e,relation:`SAME_AS`}),Mw=e=>({node:{...e,scope:`CONTAINER`},relation:`PART_OF`}),Nw=e=>({node:e,relation:`SAME_AS`}),H=({origin:e,id:t,handles:n,...r})=>({_id:crypto.randomUUID(),uri:WS({origin:e,id:t}),origin:e,id:t,url:void 0,scope:`RUN`,handles:(n??[]).map(e=>kw(e)?e:jw(e)),relations:[],categories:[],genres:[],tags:[],titles:[],descriptions:[],shortDescriptions:[],covers:[],banners:[],episodes:[],trailers:[],...r}),Pw=({origin:e,id:t,mediaUri:n,handles:r,...i})=>({_id:crypto.randomUUID(),uri:WS({origin:e,id:t}),origin:e,id:t,url:void 0,mediaUri:n,handles:(r??[]).map(e=>Aw(e)?e:Nw(e)),titles:[],descriptions:[],shortDescriptions:[],thumbnails:[],...i}),Fw=(e,t={})=>Pw({origin:e.origin,id:`${e.id}-1`,mediaUri:e.uri,url:e.url,score:e.score??void 0,titles:(e.titles??[]).map(({language:e,title:t,score:n})=>({language:e,title:t,score:n})),descriptions:(e.descriptions??[]).map(({language:e,description:t,score:n})=>({language:e,description:t,score:n})),shortDescriptions:(e.shortDescriptions??[]).map(({language:e,shortDescription:t,score:n})=>({language:e,shortDescription:t,score:n})),thumbnails:(e.covers??[]).map(({url:e,score:t})=>({url:e,score:t})),episodeNumber:1,...t}),Iw=e=>!!e.categories?.includes(`MOVIE`),Lw=async(e,t,n)=>{let r=await Promise.allSettled(e.map(async e=>t(e))),i=[];for(let e of r)e.status===`fulfilled`?i.push(e.value):console.error(`${n}: dropped a record that failed to normalize`,e.reason);return i},Rw=(e,t)=>e?{descriptions:[{language:`en`,description:e,score:t}],shortDescriptions:[{language:`en`,shortDescription:e,score:t}]}:{},zw=(e,t)=>e?[{url:e,score:t}]:[],Bw=e=>e?.titles?.[0]?.title,Vw=e=>e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu,``).replace(/\s+/g,` `).trim();let Hw;const Uw=()=>Hw??=kC();let Ww;const Gw=()=>Ww??=uw(),Kw={maxTypos:1/0,casing:`ignore`,unicode:`always`};let qw;const Jw=(e,t)=>(qw?qw.setPattern(e):qw=new nC(e,Kw),qw.matchOne(t,0)?.score??0);let Yw;const Xw=(e,t)=>{let n={...Kw,maxTypos:0,matching:`substring`};return Yw?Yw.setPattern(e):Yw=new nC(e,n),(Yw.matchOne(t,0)?.score??0)>0},Zw=new Map,Qw=e=>{let t=Zw.get(e);if(t!==void 0)return t;let n=Jw(e,e);return Zw.set(e,n),n},$w=async(e,t)=>{let n=Vw(e),r=Vw(t);if(!n||!r)return 0;await Uw();let i=Qw(n),a=Qw(r);return!i||!a?0:Math.min(Jw(n,r)/i,Jw(r,n)/a)},eT=async(e,t)=>{let n=Vw(e),r=Vw(t);if(!n||!r)return 0;if(await Uw(),Xw(n,r))return 1;let i=Qw(n);return i?Math.min(1,Jw(n,r)/i):0},tT=async(e,t)=>t.length?Math.max(...await Promise.all(t.map(t=>eT(e,t)))):0,nT=async(e,t)=>{let n=await uT(t),r=await Promise.all(e.filter(e=>!!e?.trim()).map(async e=>$w(await uT(e),n)));return r.length?Math.max(...r):0},rT=async(e,t,n)=>{let r;for(let i of t){if(n?.length&&i.categories?.length&&!n.some(e=>i.categories.includes(e)))continue;let t=await $w(e,i.title);t<.44||(!r||t>r.score)&&(r={candidate:i,score:t})}return r?.candidate},iT=`\\u002d\\u2013\\u2014\\u007e\\uff5e\\u301c`,aT=RegExp(`(?:^|\\s)([${iT}])\\s*[^${iT}]{2,}\\s*\\1\\s*$`),oT=/\b(?:the|a|an)\b/gi,sT=e=>e.replace(/\s+/g,` `).trim(),cT=e=>{let t=aT.exec(e);return t?sT(e.slice(0,t.index)):e},lT=e=>sT(bw.reduce((e,t)=>e.replace(t,` `),e)),uT=async e=>{if(!e.trim())return e;await Gw();try{return IC(e).titles?.[0]??e}catch{return e}},dT=e=>sT(e.replace(oT,` `)),fT=e=>{let t=e.indexOf(`:`);return t>2?e.slice(0,t).trim():e},pT=e=>{let t=new Set([e]),n=[],r=e;for(let e of[cT,lT,dT,fT])r=e(r),!(r.length<3||t.has(r))&&(t.add(r),n.push(r));return n},mT=(e,t)=>{let n=$S(e);return n?n.handleUrisValues.filter(({origin:e})=>e!==t).map(({origin:e,id:t})=>jw(H({origin:e,id:t}))):[]},hT=(e,t)=>{let n=mT(t,e.origin),r=new Set(e.handles.map(e=>`${e.node.origin}\0${e.relation}`));e.handles=[...e.handles,...n.filter(e=>!r.has(`${e.node.origin}\0${e.relation}`))]},gT=async(e,t,n,r=15e3)=>{let i=n(await t.findAggregatedMedia(e));if(i)return i;let a=new AbortController,o=setTimeout(()=>a.abort(),r);try{for await(let r of t.listenForMediaChanges({uri:e},{abortSignal:a.signal})){let r=n(await t.findAggregatedMedia(e));if(r)return r}}finally{clearTimeout(o),a.abort()}},_T=/^(https:\/\/cdn\.myanimelist\.net\/images\/anime\/[^/]+\/\d+)[a-z]?(\.\w+)(\?.*)?$/,vT=e=>{let t=e?.match(_T);return t?`${t[1]}l${t[2]}${t[3]??``}`:e},yT=e=>e.section===`TV (Continuing)`,bT={1:`TV`,2:`OVA`,3:`MOVIE`,4:`SPECIAL`,5:`ONA`,6:`MUSIC`,9:`SPECIAL`},xT=e=>{if(!e||!/^\d{8}$/.test(e))return;let[t,n,r]=[e.slice(0,4),e.slice(4,6),e.slice(6,8)];if(!(n===`00`||r===`00`))return`${t}-${n}-${r}`},ST=e=>e.replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#0?39;/g,`'`).replace(/&nbsp;/g,` `).replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(Number(t))),CT=e=>{if(e)return ST(e.replace(/<[^>]*>/g,` `)).replace(/\s+/g,` `).trim()||void 0},wT=e=>{if(!e)return;let t=Number(e.replace(/,/g,``));return Number.isFinite(t)?t:void 0},TT=(e,t)=>t.exec(e)?.[1],ET=e=>{let t=[];for(let n of e.matchAll(/<a[^>]+href="\/anime\/genre\/\d+\/[^"]*"[^>]*title="([^"]+)"/g)){let e=CT(n[1]);e&&!t.includes(e)&&t.push(e)}return t},DT=e=>{let t=[...e.matchAll(/class="anime-header">([^<]*)</g)];return t.length?t.map((n,r)=>({name:CT(n[1])??``,body:e.slice(n.index??0,t[r+1]?.index??e.length)})):[{name:``,body:e}]},OT=e=>{let t=[],n=new Set;for(let r of DT(e))for(let e of r.body.split(`js-anime-category-producer`).slice(1)){let i=TT(e,/myanimelist\.net\/anime\/(\d+)/)??TT(e,/class="genres js-genre" id="(\d+)"/),a=CT(TT(e,/class="link-title">([^<]+)</));if(!i||!a||n.has(i))continue;n.add(i);let o=TT(e,/<img[^>]*\bdata-src="(https:\/\/cdn\.myanimelist\.net\/images\/anime\/[^"]+)"/)??TT(e,/<img[^>]*\bsrc="(https:\/\/cdn\.myanimelist\.net\/images\/anime\/[^"]+)"/);t.push({id:i,title:a,englishTitle:CT(TT(e,/class="h3_anime_subtitle">([^<]*)</)),cover:vT(o),synopsis:CT(TT(e,/class="preline">([\s\S]*?)<\/p>/)),score:wT(TT(e,/class="js-score">([\d.]+)</)),members:wT(TT(e,/class="js-members">([\d,]+)</)),episodes:wT(TT(e,/<span>\s*(\d+)\s*eps?\s*<\/span>/)),startDate:xT(TT(e,/class="js-start_date">(\d+)</)),typeId:wT(TT(e,/js-anime-type-(\d+)/)),section:r.name,genres:ET(e)})}return t},kT=(e,t)=>{let n=typeof e==`string`?Number(e):e;if(n==null||!Number.isFinite(n)||n<=0)return;let r=Math.round(t===10?n*10:n);return r>0&&r<=100?r:void 0};var AT=c({anidbIdFromUrl:()=>BT,categories:()=>NT,icon:()=>jT,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>PT,official:()=>!0,origin:()=>`mal`,originUrl:()=>MT,resolvers:()=>QT,supportedUris:()=>FT});const jT=`https://cdn.myanimelist.net/images/favicon.ico`,MT=`https://myanimelist.net`,NT=[`ANIME`,`SERIES`,`MOVIE`],PT=`MyAnimeList`,FT=[`mal`],IT={spread:!0},LT=.9,RT=.9,zT=/\/embed\/([a-zA-Z0-9_-]{11})/,BT=e=>{if(e)try{let{searchParams:t,pathname:n}=new URL(e),r=t.get(`aid`)??/^\/anime\/([^/?#]+)/.exec(n)?.[1];return r&&/^\d+$/.test(r)?r:void 0}catch{return}},VT=e=>{let t=new Set,n=[];for(let r of[...e.genres??[],...e.themes??[],...e.demographics??[]]){let e=r?.name;!e||t.has(e.toLowerCase())||(t.add(e.toLowerCase()),n.push(e))}return n},HT=async(e,t)=>{let n=e.external?.find(e=>e.name===`AniDB`),r=BT(n?.url),i=r?{_id:crypto.randomUUID(),uri:`anidb:${r}`,origin:`anidb`,id:r,url:n?.url}:void 0,a=r?{_id:crypto.randomUUID(),uri:`anizip:${r}`,origin:`anizip`,id:r,url:`https://api.ani.zip/mappings?anidb_id=${r}`}:void 0,o=e.trailer?.embed_url?e.trailer.embed_url.match(zT)?.[1]:void 0,s=e.trailer?.youtube_id?[{uri:`yt:${e.trailer.youtube_id}`,origin:`yt`,id:e.trailer.youtube_id,url:`https://www.youtube.com/watch?v=${e.trailer.youtube_id}`,language:`en`,thumbnail:e.trailer.images.image_url}]:e.trailer?.embed_url&&o?[{uri:`yt:${o}`,origin:`yt`,id:o,url:`https://www.youtube.com/watch?v=${o}`,language:`en`,thumbnail:e.trailer.images.image_url}]:[],c=e.season?hw(e.season):void 0;return{_id:crypto.randomUUID(),uri:`mal:${e.mal_id}`,origin:`mal`,categories:e.type===`Movie`?[`ANIME`,`MOVIE`]:[`ANIME`,`SERIES`],type:e.type===`TV`?zS.Tv:e.type===`Movie`?zS.Movie:e.type===`Special`?zS.Special:e.type===`OVA`?zS.Ova:e.type===`ONA`?zS.Ona:void 0,id:e.mal_id.toString(),url:e.url,handles:[...i?[jw(i)]:[],...a?[jw(a)]:[]],score:LT,averageScore:kT(e.score,10),descriptions:e.synopsis?[{language:`en`,description:e.synopsis,score:RT}]:[],shortDescriptions:e.synopsis?[{language:`en`,shortDescription:e.synopsis,score:RT}]:[],titles:[...e.title_english?[{language:`en`,title:e.title_english,score:LT}]:[],...e.title?[{language:`jp-en`,title:e.title,score:LT}]:[],...e.title_japanese?[{language:`jp`,title:e.title_japanese,score:LT}]:[]],covers:[{language:`en`,url:vT(e.images.webp.large_image_url),score:LT}],banners:[],episodes:[],episodeCount:e.episodes,popularity:e.members,genres:VT(e),tags:[],status:e.status===`Not yet aired`?RS.NotYetReleased:e.status===`Currently Airing`?RS.Releasing:e.status===`Finished Airing`?RS.Finished:void 0,season:c?mw(c):null,seasonYear:e.year??null,startDate:e.aired?.from??null,endDate:e.aired?.to??null,trailers:s,relations:[]}},UT=({search:e},t)=>t.fetch(`https://api.jikan.moe/v4/anime?q=${encodeURIComponent(e)}`,IT).then(e=>e.json()).catch(e=>(console.error(`Jikan search failed`,e),{})).then(e=>e.data?Lw(e.data,e=>HT(e,t),`Jikan search`):void 0),WT=({id:e},t)=>t.fetch(`https://api.jikan.moe/v4/anime/${e}/full`,IT).then(e=>e.json()).then(e=>e.data?HT(e.data,t):void 0),GT=(e=1,t)=>t.fetch(`https://api.jikan.moe/v4/seasons/now?page=${e}&sfw=true`,IT).then(e=>e.json()).catch(t=>(console.error(`Jikan season page ${e} failed`,t),{})),KT=({season:e,year:t},n,r)=>r.fetch(`https://api.jikan.moe/v4/seasons/${t}/${e}?page=${n}&sfw=true`,IT).then(e=>e.ok?e.json():{}).catch(r=>(console.error(`Jikan ${e} ${t} page ${n} failed`,r),{})),qT=(e,t)=>Promise.all(Array(Math.max(0,Math.min(2,(e?.last_visible_page??1)-1))).fill(void 0).map((e,n)=>t(n+2).then(({data:e})=>e??[]))),JT=e=>{let t=bT[e.typeId],{season:n,year:r}=gw();return H({origin:`mal`,id:e.id,uri:`mal:${e.id}`,url:`https://myanimelist.net/anime/${e.id}`,categories:t===`MOVIE`?[`ANIME`,`MOVIE`]:[`ANIME`,`SERIES`],type:t===`TV`?zS.Tv:t===`MOVIE`?zS.Movie:t===`SPECIAL`?zS.Special:t===`OVA`?zS.Ova:t===`ONA`?zS.Ona:void 0,score:LT,titles:[...e.englishTitle?[{language:`en`,title:e.englishTitle,score:LT}]:[],{language:`jp-en`,title:e.title,score:LT}],covers:e.cover?[{language:`en`,url:e.cover,score:LT}]:[],genres:e.genres??[],descriptions:e.synopsis?[{language:`en`,description:e.synopsis,score:RT}]:[],shortDescriptions:e.synopsis?[{language:`en`,shortDescription:e.synopsis,score:RT}]:[],episodeCount:e.episodes,popularity:e.members,averageScore:kT(e.score,10),startDate:e.startDate,season:n,seasonYear:r})},YT=async e=>{try{let t=await(await e.fetch(`https://myanimelist.net/anime/season`)).text(),n=OT(t);if(!n.length)return console.error(`MyAnimeList season scrape parsed no entries from ${t.length} bytes`),[];let r=n.filter(e=>!yT(e));return n.some(e=>e.section)||console.error(`MyAnimeList season scrape found no section headings, so carried-over shows cannot be told apart`),r.map(JT)}catch(e){return console.error(`MyAnimeList season scrape failed`,e),[]}},XT=async e=>{let{data:t,pagination:n}=await GT(1,e);if(!t?.length)return YT(e);let r=await qT(n,t=>GT(t,e));return Lw([...t,...r.flat()],t=>HT(t,e),`Jikan season`)},ZT=async({season:e,year:t},n)=>{let{data:r,pagination:i}=await KT({season:e,year:t},1,n);if(!r?.length)return[];let a=await qT(i,r=>KT({season:e,year:t},r,n));return Lw([...r,...a.flat()],e=>HT(e,n),`Jikan ${e} ${t}`)},QT={Query:{},Mutation:{},Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!KS(t))return yield{media:null};let r=HS(t);if(r.origin!==`mal`)return yield{media:null};yield{media:await WT({id:Number(r.id)},n)}}},mediaPage:{subscribe:async function*(e,{input:{search:t,status:n,season:r,seasonYear:i}},a){let o=r?hw(r):void 0;if(o&&i){let e=gw();return yield{mediaPage:{nodes:r===e.season&&i===e.year?await XT(a):await ZT({season:o,year:i},a)}}}if(r||i){if(!t)return yield{mediaPage:{nodes:[]}}}else if(n===`RELEASING`)return yield{mediaPage:{nodes:await XT(a)}};if(t)return yield{mediaPage:{nodes:await UT({search:t},a)??[]}};yield{mediaPage:{nodes:[]}}}}}},$T=(e,t,n)=>{if(e?.year&&e.month&&e.day)return new Date(Date.UTC(e.year,e.month-1,e.day)).toUTCString();let r=(t?.edges??[]).map(e=>e?.node).filter(e=>!!e?.airingAt);if(r.length){let e=r.filter(e=>e.episode===1),t=n===`first`&&e.length?e[0]:r.reduce((e,t)=>(n===`first`?t.airingAt<e.airingAt:t.airingAt>e.airingAt)?t:e);return new Date(t.airingAt*1e3).toUTCString()}if(e?.year)return new Date(Date.UTC(e.year,(e.month??1)-1,e.day??1)).toUTCString()},eE=(e,t=new Date)=>{let n=t.getTime()/1e3,r=(e?.edges??[]).map(e=>e?.node).filter(e=>typeof e?.airingAt==`number`&&typeof e.episode==`number`&&e.airingAt>n);if(!r.length)return;let i=r.reduce((e,t)=>t.airingAt<e.airingAt?t:e);return{episodeNumber:i.episode,airingAt:new Date(i.airingAt*1e3).toUTCString()}};let tE=function(e){return e.Finished=`FINISHED`,e.Releasing=`RELEASING`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Cancelled=`CANCELLED`,e.Hiatus=`HIATUS`,e}({});const nE=()=>{let e=new Uint8Array(40),t=globalThis.crypto;if(t?.getRandomValues)t.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256);let n=``;for(let t of e)n+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[t%62];return n},rE=e=>e.match(/al_token\s*=\s*"([A-Za-z0-9]{20,})"/)?.[1],iE=(e,t)=>e===403&&!!t?.errors?.some(e=>/use graphql subdomain/i.test(e?.message??``)),aE=e=>{try{return JSON.parse(e)}catch{return}},oE=e=>{let t,n,r=async()=>{let t=nE(),n=`https://anilist.co/search/anime/this-season?_=${t.slice(0,8)}`;try{let r=await e(n,{headers:{"user-agent":`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,accept:`text/html,application/xhtml+xml`,cookie:`laravel_session=${t}`}}),i=await r.text(),a=rE(i);if(!a){console.error(`AniList frontend: no token in ${i.length} bytes of the page (HTTP ${r.status})`+(i.includes(`csrf_token()`)?`, the PHP template came back un-rendered`:``));return}return{token:a,session:t}}catch(e){console.error(`AniList frontend: could not reach the token page`,e);return}},i=async e=>(e&&(t=void 0),t||(n??=r().finally(()=>{n=void 0}),t=await n,t));return{query:async t=>{for(let n=0;n<2;n++){let r=await i(n>0);if(!r)return;let a;try{a=await e(`https://anilist.co/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json`,"x-csrf-token":r.token,cookie:`laravel_session=${r.session}`},body:JSON.stringify(t)})}catch(e){console.error(`AniList frontend: request failed`,e);return}let o=aE(await a.text());if(iE(a.status,o)){if(n===0)continue;console.error(`AniList frontend: the gate refused a freshly acquired pair`);return}if(o?.errors?.length){let e=o.errors.map(e=>e.message).filter(Boolean).join(`; `);console.error(`AniList frontend request failed (HTTP ${a.status}): ${e||`no message`}`)}if(o?.data==null){o?.errors?.length||console.error(`AniList frontend returned no data (HTTP ${a.status})`);return}return o.data}},currentPair:()=>t}};var sE=c({categories:()=>uE,icon:()=>cE,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>dE,official:()=>!0,origin:()=>fE,originUrl:()=>lE,resolvers:()=>BE,supportedUris:()=>pE});const cE=`https://anilist.co/img/icons/favicon-32x32.png`,lE=`https://anilist.co`,uE=[`ANIME`,`SERIES`,`MOVIE`],dE=`Anilist`,fE=`anilist`,pE=[`anilist`],mE=`
823
- id
824
- idMal
825
- title {
826
- romaji
827
- native
828
- english
829
- }
830
- startDate {
831
- year
832
- month
833
- day
834
- }
835
- endDate {
836
- year
837
- month
838
- day
839
- }
840
- season
841
- seasonYear
842
- status
843
- format
844
- type
845
- genres
846
- tags {
847
- name
848
- isMediaSpoiler
849
- isGeneralSpoiler
850
- }
851
- synonyms
852
- duration
853
- popularity
854
- episodes
855
- source(version: 2)
856
- averageScore
857
- siteUrl
858
- description
859
- bannerImage
860
- coverImage {
861
- medium
862
- large
863
- extraLarge
864
- color
865
- }
866
- trailer {
867
- id
868
- site
869
- thumbnail
870
- }
871
- externalLinks {
872
- site
873
- siteId
874
- url
875
- }
876
- airingSchedule {
877
- edges {
878
- node {
879
- airingAt
880
- episode
881
- id
882
- media {
883
- id
884
- idMal
885
- }
886
- mediaId
887
- timeUntilAiring
888
- }
889
- }
890
- }
891
- `,hE=`
892
- query (
893
- $search: String
894
- $season: MediaSeason
895
- $seasonYear: Int
896
- $format_in: [MediaFormat]
897
- $status: MediaStatus
898
- $genre_in: [String]
899
- $tag_in: [String]
900
- $sort: [MediaSort]
901
- $page: Int
902
- ) {
903
- Page(page: $page) {
904
- pageInfo {
905
- lastPage
906
- hasNextPage
907
- total
908
- }
909
- media(
910
- type: ANIME
911
- search: $search
912
- season: $season
913
- seasonYear: $seasonYear
914
- format_in: $format_in
915
- status: $status
916
- genre_in: $genre_in
917
- tag_in: $tag_in
918
- sort: $sort
919
- ) {
920
- ${mE.split(`
921
- `).join(`
922
- `)}
923
- }
924
- }
925
- }
926
- `,gE=`
927
- id
928
- idMal
929
- type
930
- format
931
- status
932
- episodes
933
- siteUrl
934
- title {
935
- romaji
936
- english
937
- native
938
- }
939
- coverImage {
940
- medium
941
- large
942
- color
943
- }
944
- startDate {
945
- year
946
- month
947
- day
948
- }
949
- `,_E=`
950
- query GetMedia ($id: Int, $idMal: Int, $type: MediaType) {
951
- Media(idMal: $idMal, id: $id, type: $type) {
952
- ${mE.split(`
953
- `).join(`
954
- `)}
955
- relations {
956
- edges {
957
- relationType(version: 2)
958
- node {
959
- ${gE.split(`
960
- `).join(`
961
- `)}
962
- relations {
963
- edges {
964
- relationType(version: 2)
965
- node {
966
- ${gE.split(`
967
- `).join(`
968
- `)}
969
- }
970
- }
971
- }
972
- }
973
- }
974
- }
975
- }
976
- }
977
- `,vE=.8,yE=[{siteId:5,mapper:async(e,t,n,r)=>{let i=e.url?.match(/https:\/\/www\.crunchyroll\.com\/series\/(\w+)/)?.[1];if(!i)return;let a=await r.similarMedia(`cr`,{showId:i,startDate:t.startDate,titles:t.titles,episodeCount:t.episodeCount,context:n??void 0});return a&&H({origin:a.origin,id:a.id,url:a.url,scope:a.scope})}}];let bE=0,xE;const SE=oE((e,t)=>{if(!xE)throw Error(`AniList frontend: queried before any request context bound a fetch`);return xE(e,t)}),CE=async({query:e,variables:t},n)=>{let r=await n.fetch(`https://graphql.anilist.co/`,{method:`POST`,spread:!0,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,variables:t})}),i=await r.json().catch(()=>void 0);if(i?.errors?.length){let e=i.errors.map(e=>e.message).filter(Boolean).join(`; `);console.error(`AniList request failed (HTTP ${r.status}): ${e||`no message`}`)}if(i?.data==null){i?.errors?.length||console.error(`AniList returned no data (HTTP ${r.status})`);return}return i.data},wE=async(e,t)=>{if(xE=t.fetch,Date.now()>=bE){let n=await CE(e,t).catch(()=>void 0);if(n!=null)return n;bE=Date.now()+3e5}return SE.query(e)},TE=async({id:e,idMal:t},n,r)=>{let i=await wE({query:_E,variables:{id:e,idMal:t,type:`ANIME`}},n);if(!i?.Media)return;let a={startDate:$T(i.Media.startDate,i.Media.airingSchedule,`first`),titles:[i.Media.title?.english,i.Media.title?.romaji,i.Media.title?.native].filter(e=>!!e),episodeCount:i.Media.episodes??void 0},o=i.Media.externalLinks?.filter(e=>!!e).filter(e=>OE(e))??[],s=(await Promise.all(o.map(async e=>{let t=yE.find(t=>t.siteId===e.siteId);if(t)try{return await t.mapper(e,a,r,n)}catch(t){console.error(`anilist mapper for siteId ${e.siteId} failed:`,t);return}}))).filter(e=>!!e);return LE(i.Media,s)},EE=(e,t,n)=>wE({query:hE,variables:{...e,page:t}},n),DE=async(e,t)=>{let n=await EE(e,1,t),r=n?.Page?.pageInfo?.lastPage;return Lw([...n?.Page?.media??[],...!e.search&&r?(await Promise.all(Array(Math.min(2,r-1)).fill(void 0).map((n,r)=>EE(e,r+2,t).then(e=>e?.Page?.media??[])))).flat():[]],e=>LE(e),`AniList browse`)},OE=e=>!!e?.siteId,kE=e=>!!e?.name&&!e?.isMediaSpoiler&&!e?.isGeneralSpoiler,AE=e=>pw.find(t=>t===e),jE=new Set([`ADAPTATION`,`PREQUEL`,`SEQUEL`,`PARENT`,`SIDE_STORY`,`CHARACTER`,`SUMMARY`,`ALTERNATIVE`,`SPIN_OFF`,`SOURCE`,`COMPILATION`,`CONTAINS`,`OTHER`]),ME=e=>(e.relations?.edges??[]).flatMap(e=>{let t=e?.node;if(!t?.id)return[];let n=String(e?.relationType??``);return[{relation:jE.has(n)?n:`OTHER`,format:t.format??void 0,node:H({origin:fE,id:t.id.toString(),url:t.siteUrl??void 0,score:vE,episodeCount:t.episodes??void 0,startDate:FE(t.startDate),titles:[...t.title?.english?[{language:`en`,title:t.title.english,score:vE}]:[],...t.title?.romaji?[{language:`jp-en`,title:t.title.romaji,score:vE}]:[],...t.title?.native?[{language:`jp`,title:t.title.native,score:vE}]:[]],covers:t.coverImage?.large?[{language:`jp`,url:t.coverImage.large,color:t.coverImage.color??void 0,score:vE}]:[],status:t.status===tE.NotYetReleased?RS.NotYetReleased:t.status===tE.Releasing?RS.Releasing:t.status===tE.Finished?RS.Finished:void 0})}]}),NE=new Set([`SEQUEL`,`PREQUEL`,`SIDE_STORY`,`SPIN_OFF`,`ALTERNATIVE`,`PARENT`,`SOURCE`,`ADAPTATION`,`SUMMARY`,`COMPILATION`,`CONTAINS`]),PE=e=>{let t=e=>`${fE}:${e}`,n=new Map,r=new Map,i=e=>(e.relations?.edges??[]).filter(Boolean),a=e=>{let r=t(e.id);return n.has(r)||n.set(r,IE(e)),r};a(e);let o=[{uri:t(e.id),node:e}];for(let e=0;e<2&&o.length;e++){let e=[];for(let t of o)for(let n of i(t.node)){let i=n.node,o=String(n.relationType??``);if(!i?.id||!NE.has(o))continue;let s=a(i),c=`${t.uri}\u0000${s}\u0000${o}`;r.has(c)||r.set(c,{from:t.uri,to:s,relation:o}),e.push({uri:s,node:i})}o=e}if(!(n.size<2))return{nodes:[...n.values()],edges:[...r.values()]}},FE=e=>{if(!e?.year)return;let t=e=>String(e??1).padStart(2,`0`);return`${e.year}-${t(e.month)}-${t(e.day)}`},IE=e=>({uri:`${fE}:${e.id}`,format:e.format??void 0,episodeCount:e.episodes??void 0,startDate:FE(e.startDate),status:e.status===tE.NotYetReleased?RS.NotYetReleased:e.status===tE.Releasing?RS.Releasing:e.status===tE.Finished?RS.Finished:void 0,titles:[...e.title?.english?[{language:`en`,title:e.title.english,score:vE}]:[],...e.title?.romaji?[{language:`jp-en`,title:e.title.romaji,score:vE}]:[]],covers:e.coverImage?.large?[{language:`jp`,url:e.coverImage.large,color:e.coverImage.color??void 0,score:vE}]:[]}),LE=(e,t=[])=>{let n=e.idMal?H({_id:crypto.randomUUID(),uri:`mal:${e.idMal}`,origin:`mal`,id:e.idMal.toString(),url:`https://myanimelist.net/anime/${e.idMal}`}):void 0,r=$T(e.startDate,e.airingSchedule,`first`),i=$T(e.endDate,e.airingSchedule,`last`);return H({_id:crypto.randomUUID(),uri:`${fE}:${e.id}`,origin:fE,id:e.id.toString(),url:e.siteUrl,categories:e.format===`MOVIE`?[`ANIME`,`MOVIE`]:[`ANIME`,`SERIES`],genres:(e.genres??[]).filter(e=>!!e),tags:(e.tags??[]).filter(kE).map(e=>e.name),season:AE(e.season),seasonYear:e.seasonYear,type:e.format===`TV`?zS.Tv:e.format===`TV_SHORT`?zS.TvShort:e.format===`MOVIE`?zS.Movie:e.format===`SPECIAL`?zS.Special:e.format===`OVA`?zS.Ova:e.format===`ONA`?zS.Ona:void 0,handles:[...t,...n?[n]:[]],relations:ME(e),franchise:PE(e),score:vE,averageScore:kT(e.averageScore,100),nextAiringEpisode:eE(e.airingSchedule),descriptions:e.description?[{language:`en`,description:e.description,score:vE}]:[],shortDescriptions:e.description?[{language:`en`,shortDescription:e.description,score:vE}]:[],titles:[...e.title?.english?[{language:`en`,title:e.title.english,score:vE}]:[],...e.title?.romaji?[{language:`jp-en`,title:e.title.romaji,score:vE}]:[],...e.title?.native?[{language:`jp`,title:e.title.native,score:vE}]:[]],covers:[...e.coverImage?.extraLarge?[{language:`jp`,url:e.coverImage.extraLarge,color:e.coverImage.color??void 0,score:vE}]:[]],episodeCount:e.episodes,popularity:e.popularity,status:e.status===tE.NotYetReleased?RS.NotYetReleased:e.status===tE.Releasing?RS.Releasing:e.status===tE.Finished?RS.Finished:e.status===tE.Cancelled?RS.Cancelled:e.status===tE.Hiatus?RS.Hiatus:void 0,startDate:r,endDate:i,trailers:e.trailer?.site===`youtube`&&e.trailer.id?[{uri:`yt:${e.trailer.id}`,language:`en`,origin:`yt`,id:e.trailer.id.toString(),url:`https://www.youtube.com/watch?v=${e.trailer.id}`,thumbnail:e.trailer.thumbnail}]:[]})},RE=[`TV`,`TV_SHORT`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`],zE=e=>{let t=e.search||void 0;if(!(e.status||t||e.season||e.seasonYear||e.formats?.length||e.genres?.length||e.tags?.length))return;let n=(e.formats??[]).filter(e=>RE.includes(e));return{search:t,season:e.season??void 0,seasonYear:e.seasonYear??void 0,format_in:n.length?n:void 0,status:e.status??void 0,genre_in:e.genres?.length?e.genres:void 0,tag_in:e.tags?.length?e.tags:void 0,sort:t?[`SEARCH_MATCH`]:[`POPULARITY_DESC`]}},BE={Subscription:{media:{subscribe:async function*(e,{input:{uri:t,context:n}},r){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let i=VS(t,fE);if(!i)return yield{media:null};yield{media:await TE({id:Number(i.id)},r,n)}}},mediaPage:{subscribe:async function*(e,{input:t},n){let r=zE(t);r&&(yield{mediaPage:{nodes:await DE(r,n)}})}}}};var VE=c({categories:()=>WE,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>GE,official:()=>!1,origin:()=>UE,originUrl:()=>HE,resolvers:()=>QE,supportedUris:()=>KE});const HE=`https://api.ani.zip/`,UE=`anizip`,WE=[`ANIME`,`SERIES`],GE=`AniZip`,KE=[`anidb`,`mal`],qE=.9,JE=(e,t)=>{let n=e.mappings.anidb_id.toString(),r=`${UE}:${n}`,i=[e.mappings.mal_id?H({origin:`mal`,id:String(e.mappings.mal_id),url:`https://myanimelist.net/anime/${e.mappings.mal_id}`}):void 0,e.mappings.anilist_id?H({origin:`anilist`,id:String(e.mappings.anilist_id),url:`https://anilist.co/anime/${e.mappings.anilist_id}`}):void 0].filter(e=>!!e);return H({origin:UE,id:n,categories:[`ANIME`,`SERIES`],url:`https://api.ani.zip/mappings?anidb_id=${n}`,handles:i,titles:[...e.titles.en?[{language:`en`,title:e.titles.en,score:qE}]:[],...e.titles.ja?[{language:`ja`,title:e.titles.ja,score:qE}]:[]],covers:e.images?.filter(e=>e.coverType===`Poster`).map(e=>({url:e.url,score:qE}))??[],banners:e.images?.filter(e=>e.coverType===`Banner`).map(e=>({url:e.url,score:qE}))??[],episodeCount:e.episodeCount,episodes:Object.entries(e.episodes).map(([e,t])=>{let i=`${n}-${e}`;return Pw({origin:UE,id:i,mediaUri:r,url:`https://api.ani.zip/mappings?anidb_id=${n}`,score:qE,titles:[...t.title.en?[{language:`en`,title:t.title.en,score:qE}]:[],...t.title.ja?[{language:`ja`,title:t.title.ja,score:qE}]:[]],descriptions:t.overview?[{language:`en`,description:t.overview,score:qE}]:[],shortDescriptions:t.summary?[{language:`en`,shortDescription:t.summary,score:qE}]:t.overview?[{language:`en`,shortDescription:t.overview,score:qE}]:[],thumbnails:t.image?[{url:t.image,score:qE}]:[],seasonNumber:t.seasonNumber,episodeNumber:/^\d+$/.test(e)?Number(e):t.episodeNumber,absoluteEpisodeNumber:t.absoluteEpisodeNumber,runtime:t.runtime??t.length,releaseDate:t.airDateUtc??t.airdate})})})},YE=(e,t,n)=>n.fetch(`https://api.ani.zip/mappings?${e}_id=${t}&specials=1`).then(e=>e.json()),XE=(e,t,n)=>YE(e,t,n).then(e=>e?.mappings?.anidb_id==null?null:JE(e,n)),ZE=(e,t)=>XE(`mal`,e,t),QE={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!ZS(t))return yield{media:null};let r=$S(t)?.handleUrisValues.find(e=>e.origin===`mal`);if(!r)return yield{media:null};yield{media:await ZE(r.id,n)}}}}},$E=e=>[...new Set([e,...pT(e)])].slice(0,4),eD=async(e,t,n)=>(await Promise.all(t.map(async t=>{let r=n(t);return{candidate:t,score:r?await nT(e,r):0}}))).filter(e=>e.score>=.9).sort((e,t)=>t.score-e.score).slice(0,3),tD=e=>{if(e==null||e===``)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t},nD=(e,t)=>{let n=tD(e)?.getUTCFullYear();return n===void 0?!1:t.some(e=>e===n)},rD=(e,t,n)=>{let r=tD(e);if(!r)return;let i;for(let e of t){let t=tD(n(e));if(!t)continue;let a=Math.abs(t.getTime()-r.getTime());(!i||a<i.diff)&&(i={season:e,diff:a})}return i},iD=async(e,t,n,r,i)=>{if(!e.startDate)return;let a=await eD(e.titles,t,n),o;for(let{candidate:t}of a){let n=rD(e.startDate,await r(t),i);!n||n.diff>3888e6||(!o||n.diff<o.diff)&&(o={candidate:t,season:n.season,diff:n.diff})}return o},aD=e=>{if(e==null||e===``)return;let t=typeof e==`number`?e:Date.parse(e);return Number.isNaN(t)?void 0:t},oD=e=>{let t=aD(e);return t===void 0?void 0:new Date(t).getUTCFullYear()},sD=({startDate:e,titles:t,episodeCount:n,episodeTitles:r})=>!!(e&&!Number.isNaN(Date.parse(e)))||!!t?.length||n!=null||!!r?.length,cD=/\b(?:part|cour)\s*(?:\d{1,3}|[ivx]{1,4}|one|two|three|four|five|six|seven|eight|nine|ten)\b/i,lD=/\b(?:\d{1,3}(?:st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|final|last)\s+(?:part|cour|half)\b/i,uD=e=>cD.test(e)||lD.test(e),dD=e=>new Set((e??[]).map(Cw).filter(e=>e!=null)),fD=/^(?:episode|ep|e|part|chapter|第)?\s*\d+\s*(?:話|集|화)?$/,pD=/\p{L}/u,mD=e=>{let t=Vw(e);return!pD.test(t)||fD.test(t)},hD=e=>e.find(e=>Ow(e))??e.find(e=>!!e),gD=(e,t,n)=>n.origin===e&&n.scope!==`CONTAINER`&&n.id!==t,_D=e=>e.year??oD(e.premiere),vD=e=>e.episodeCount||void 0,yD=(e,t)=>{let n=vD(t);return n!=null&&e.episodeCount!=null&&n>e.episodeCount},bD=(e,t)=>{let n=_D(t),r=oD(e.startDate);return n!=null&&r!=null&&n!==r},xD=e=>(e??[]).filter(e=>!mD(e)),SD=(e,t)=>{let n=e.titles??[],r=n.some(uD),i=dD(n),a=oD(e.startDate),o=Ow(e.startDate)?aD(e.startDate):void 0;if(o!==void 0&&t.some(e=>aD(e.premiere)!==void 0)){let n=t.filter(e=>{let t=aD(e.premiere);return t!==void 0&&Math.abs(t-o)<=3888e6});return n.length!==1||yD(e,n[0])?void 0:{season:n[0].season,rule:`date`}}let s=new Set(xD(e.episodeTitles).map(Vw));if(s.size>=3){let n=t.map(e=>({candidate:e,theirs:xD(e.episodeTitles)})).filter(({theirs:e})=>e.length>=3);if(n.length){let t=n.filter(({theirs:e})=>{let t=e.filter(e=>s.has(Vw(e))).length;return t>=3&&t/e.length>=.6});if(t.length!==1)return;let r=t[0].candidate;return yD(e,r)||bD(e,r)?void 0:{season:r.season,rule:`episode-titles`}}}if(i.size>1)return;if(i.size===1&&!r&&e.episodeCount!=null){let[n]=i,r=t.filter(e=>e.seasonNumber===n);if(r.length>1)return;if(r.length===1&&vD(r[0])!=null){let t=r[0];return yD(e,t)||bD(e,t)?void 0:{season:t.season,rule:`ordinal`}}}let c=i.size===0&&!r&&e.episodeCount!=null;if(c&&a!=null&&t.some(e=>_D(e)!=null)){let n=t.filter(e=>_D(e)===a);if(n.length===1){let t=n[0];return vD(t)==null||yD(e,t)?void 0:{season:t.season,rule:`year`}}}if(c){let n=t.filter(e=>e.seasonNumber!=null),r=t.length===1?t[0]:n.length?n.reduce((e,t)=>t.seasonNumber<e.seasonNumber?t:e):void 0;if(!r||yD(e,r)||bD(e,r))return;let i=vD(r);return(t.length===1?i!=null&&i<=e.episodeCount:i===e.episodeCount)?{season:r.season,rule:`first`}:void 0}},CD=(e,t)=>e-t,wD=e=>{let t=aD(e);return t===void 0?`-`:new Date(t).toISOString().slice(0,10)},TD=e=>{let t=e.titles??[],n=[...dD(t)].sort(CD);return`{day:${wD(e.startDate)}, count:${e.episodeCount??`-`}, ordinals:${n.length?n.join(`,`):`-`}, parts:${t.some(uD)?`yes`:`no`}, titles:${t.length}, episodeTitles:${(e.episodeTitles??[]).length}}`},ED=e=>(e??``).replace(/[^\x21-\x7e]/g,`_`).slice(0,128)||`-`,DD=.9,OD=async(e,t)=>{let n=e.filter(e=>e.trim()),r=t.filter(e=>e.trim());if(!n.length||!r.length)return{ok:!1,score:0};let i=await Promise.all(r.map(e=>nT(n,e))),a=Math.max(...i);return{ok:a>=DD,score:a}},kD=(e,t,n)=>{let r=wD(n.startDate),i=n.titles??[],a=[...dD(i)].sort(CD).join(`,`),o=i.some(uD)?`p`:``,s=[...new Set(xD(n.episodeTitles).map(Vw))].sort().join(``);return[e,t,r,n.episodeCount??`-`,a,o,s].join(`\0`)};var AD=c({categories:()=>PD,cdnImageUrl:()=>eO,crunchyrollId:()=>QD,getMedia:()=>cO,icon:()=>MD,isApiOnly:()=>!1,metadataOnly:()=>!1,name:()=>FD,official:()=>!0,origin:()=>`cr`,originUrl:()=>ND,resetCrunchyrollCaches:()=>fO,resolveEpisodeToSeriesId:()=>YD,resolvers:()=>_O,supportedUris:()=>ID});const jD=.5,MD=`https://static.crunchyroll.com/cxweb/assets/img/favicons/favicon-96x96.png`,ND=`https://www.crunchyroll.com`,PD=[`ANIME`,`SERIES`],FD=`Crunchyroll`,ID=[`cr`];let LD,RD;const zD=async e=>LD&&Date.now()-LD.timestamp<LD.expires_in*1e3?LD:RD||(RD=(async()=>{let t=await e.fetch(`https://www.crunchyroll.com/auth/v1/token`,{headers:{accept:`application/json, text/plain, */*`,authorization:`Basic ${btoa(`cr_web:`)}`,"content-type":`application/x-www-form-urlencoded`},body:`grant_type=client_id`,method:`POST`,mode:`cors`,credentials:`include`}).then(e=>e.json());if(!t.access_token)throw Error(`Crunchyroll token fetch failed: ${JSON.stringify(t)}`);return LD={timestamp:Date.now(),access_token:t.access_token,expires_in:t.expires_in}})().finally(()=>{RD=void 0}),RD),BD=new Map,VD=async(e,t)=>{let n=BD.get(e);if(n)return n;let r=zD(t).then(n=>t.fetch(e,{headers:{accept:`application/json, text/plain, */*`,authorization:`Bearer ${n.access_token}`},mode:`cors`,credentials:`include`}).then(e=>e.json()));BD.set(e,r);let i=()=>{BD.delete(e)};return r.then(i,i),r},HD=`https://www.crunchyroll.com/content/v2/cms`,UD=(e,t)=>{let n=e?.data;if(!Array.isArray(n))throw Error(`Crunchyroll answered ${t} with no data: ${JSON.stringify(e)?.slice(0,200)}`);return n},WD=(e,t)=>VD(e,t).then(t=>({data:UD(t,e)})),GD=(e,t)=>WD(`${HD}/series/${e}?preferred_audio_language=ja-JP&locale=en-US`,t),KD=(e,t)=>WD(`${HD}/series/${e}/seasons?force_locale=&preferred_audio_language=ja-JP&locale=en-US`,t),qD=(e,t)=>WD(`${HD}/seasons/${e}/episodes?preferred_audio_language=ja-JP&locale=en-US`,t),JD=(e,t)=>VD(`https://www.crunchyroll.com/content/v2/discover/search?q=${encodeURIComponent(e)}&n=50&type=series&locale=en-US`,t).then(e=>({data:e?.data??[]})),YD=async(e,t)=>{let n=(await VD(`${HD}/objects/${e}?ratings=true&locale=en-US`,t)).data?.[0]?.episode_metadata;return n?.series_id?{seriesId:n.series_id,seasonId:n.season_id}:void 0},XD=e=>e.replace(/JAJP$/,``),ZD=e=>e.versions?.find(e=>e.audio_locale===`ja-JP`)?.guid??e.versions?.find(e=>e.original)?.guid??XD(e.id),QD=(e,t,n)=>[e,t&&XD(t),n].filter(Boolean).join(`-`),$D=/^https?:\/\/www\.crunchyroll\.com\/imgsrv\/display\/[^/]+\/(\d+)x\d+\/(.+)$/,eO=e=>{let t=e.match($D);return t?`https://imgsrv.crunchyroll.com/cdn-cgi/image/fit=contain,format=auto,quality=85,width=${t[1]}/${t[2]}`:e},tO=e=>{let t=e?.at(-1)?.at(-1)?.source;return t&&eO(t)},nO=(e,t)=>e===t.id?`CONTAINER`:`RUN`,rO=(e,t,n,r,i)=>H({origin:`cr`,id:e,scope:nO(e,r),url:`https://www.crunchyroll.com/series/${r.id}/${r.slug_title}`,score:jD,categories:[`ANIME`,`SERIES`],titles:[{language:`en`,title:t,score:jD}],...Rw(n,jD),covers:zw(tO(r.images?.poster_tall),jD),banners:zw(tO(r.images?.poster_wide),jD),startDate:e===r.id&&r.series_metadata?.series_launch_year?`${r.series_metadata.series_launch_year}-01-01`:void 0,episodeCount:i}),iO=(e,t)=>Pw({origin:`cr`,id:QD(e.series_id,e.season_id,e.id),mediaUri:t,url:`https://www.crunchyroll.com/watch/${e.id}`,score:jD,titles:[{language:`en`,title:e.title,score:jD}],...Rw(e.description,jD),thumbnails:zw(tO(e.images?.thumbnail),jD),seasonNumber:e.season_number,episodeNumber:e.episode_number,absoluteEpisodeNumber:e.sequence_number,releaseDate:e.episode_air_date?new Date(e.episode_air_date).toISOString():void 0}),aO=e=>{let t=new Map;for(let n of e)n.episodeNumber!=null&&t.set(n.episodeNumber,n);return e.filter(e=>e.episodeNumber==null||t.get(e.episodeNumber)===e)},oO=async(e,t,n)=>{let{data:r}=await qD(e,n);return aO(r.map(e=>iO(e,t)))},sO=(e,t)=>e.find(e=>XD(e.id)===t||ZD(e)===t),cO=async(e,t)=>{let[n,r]=e.split(`-`);if(!n)return;let[i,a]=await Promise.all([GD(n,t),KD(n,t)]),o=i.data[0];if(!o)return;let s=a.data,c=r?sO(s,r):s.length===1?s[0]:void 0;if(r&&!c)return;let l=c&&!Sw(c.title)?c.title:void 0,u=c?rO(QD(n,ZD(c)),l??o.title,c.description||o.description,o):rO(o.id,o.title,o.description,o);return c&&(u.episodes=await oO(ZD(c),u.uri,t),u.episodeCount=u.episodes.length),u},lO=async(e,t)=>{let{data:n}=await KD(e,t);if(!n.length)return{seasons:n,candidates:[]};let r=n.filter(e=>e.audio_locale===`ja-JP`),i=r.length>0?r:n;return{seasons:n,candidates:await Promise.all(i.map(async e=>{let n=ZD(e),{data:r}=await qD(n,t);return{season:{resolvedId:n},seasonNumber:r[0]?.season_number,episodeCount:new Set(r.filter(e=>e.episode_number!=null).map(e=>e.episode_number)).size,premiere:r[0]?.episode_air_date||void 0,episodeTitles:r.map(e=>e.title),airDates:r.map(e=>e.episode_air_date).filter(e=>!!e)}}))}},uO=new Map,dO=(e,t)=>{let n=uO.get(e);if(n&&Date.now()-n.at<6e5)return n.promise;let r=lO(e,t);return uO.set(e,{at:Date.now(),promise:r}),r.catch(()=>{uO.get(e)?.promise===r&&uO.delete(e)}),r},fO=()=>{uO.clear()},pO=e=>{let t=e?Date.parse(e):NaN;return Number.isFinite(t)?Math.floor(t/864e5):void 0},mO=async(e,t,n,r)=>{let i=pO(t.startDate??void 0),a=t.episodeCount;if(i==null||a==null)return;let o=e.flatMap(({seriesId:e,candidates:t})=>t.filter(e=>(e.episodeCount??0)>a).filter(e=>{let t=(e.airDates??[]).map(pO).filter(e=>e!=null);return t.length>1&&i>=Math.min(...t)-1&&i<=Math.max(...t)+1}).map(t=>({seriesId:e,seasonId:t.season.resolvedId})));if(o.length!==1)return;let s=o[0],c=await cO(QD(s.seriesId,s.seasonId),r);if(!c?.episodes?.length)return;let l=$S(n)?.handleUris?.[0];if(l)return{...c,handles:[],episodes:c.episodes.map(e=>({...e,mediaUri:l}))}},hO=async(e,t)=>{let n=await gT(e,t,e=>Bw(e)&&e.startDate?e:void 0,3e4);if(!n?.startDate||isNaN(new Date(n.startDate).getTime()))return;let r=(n.titles??[]).map(e=>e.title).filter(Boolean),i=r[0];if(!i)return;let a=[...new Set([i,...pT(i)])].slice(0,4);for(let i of a){let{data:a}=await JD(i,t),o=a.find(e=>e.type===`series`)?.items??[];if(!o.length)continue;let s=(await Promise.all(o.map(async e=>({series:e,score:await nT(r,e.title)})))).filter(e=>e.score>=.9).sort((e,t)=>t.score-e.score).slice(0,3);if(!s.length)continue;let c={startDate:n.startDate,titles:r,episodeCount:n.episodeCount},l,u=[];for(let{series:e}of s){let{candidates:n}=await dO(e.id,t);u.push({seriesId:e.id,candidates:n});let r=SD(c,n);if(r){l={seriesId:e.id,seasonId:r.season.resolvedId};break}}if(l){let n=await cO(QD(l.seriesId,l.seasonId),t);if(!n)continue;return n.handles=mT(e,`cr`),n}let d=await mO(u,c,e,t);if(d)return d}},gO=async(e,t)=>{let{candidates:n}=await dO(e.showId,t);if(!n.length)return;let r=SD(e,n);if(r)return console.warn(`similarMedia: cr picked ${r.season.resolvedId} by ${r.rule} for ${e.showId}`),await cO(QD(e.showId,r.season.resolvedId),t)},_O={Subscription:{similarMedia:{subscribe:async function*(e,{input:t},n){if(!t?.showId)return yield{similarMedia:null};yield{similarMedia:await gO(t,n)??null}}},media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,`cr`);if(r)return yield{media:await cO(r.id,n)??null};if(!ZS(t))return yield{media:null};yield{media:await hO(t,n)??null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:((await JD(t,n)).data.find(e=>e.type===`series`)?.items??[]).map(e=>rO(e.id,e.title,e.description,e,e.series_metadata?.episode_count))}}}}},Media:{episodes:async(e,t,n)=>e.origin===`cr`?e.episodes?.length?e.episodes:(await cO(e.id,n))?.episodes??[]:e.episodes??[]}};var vO=c({categories:()=>SO,getMedia:()=>WO,icon:()=>bO,isApiOnly:()=>!1,linkNetflix:()=>YO,metadataOnly:()=>!0,name:()=>CO,official:()=>!1,origin:()=>`nf`,originUrl:()=>xO,resolvers:()=>QO,searchNodes:()=>UO,supportedUris:()=>wO});const yO=.2,bO=`https://assets.nflxext.com/us/ffe/siteui/common/icons/nficon2023.ico`,xO=`https://www.netflix.com`,SO=[`SERIES`,`MOVIE`],CO=`Netflix`,wO=[`nf`];let TO,EO=0,DO;const OO=async e=>TO&&Date.now()<EO?TO:DO||(DO=(async()=>{let t=await e.fetch(`https://unogs.com/api/user`,{headers:{accept:`application/json`,"content-type":`application/x-www-form-urlencoded; charset=UTF-8`,"x-requested-with":`XMLHttpRequest`},body:`user_name=anonymous`,method:`POST`,mode:`cors`,credentials:`include`}).then(e=>e.json());if(!t.token?.access_token)throw Error(`uNoGS token fetch failed: ${JSON.stringify(t)}`);return EO=Date.now()+720*60*1e3,TO=t.token.access_token})().finally(()=>{DO=void 0}),DO),kO=new Map,AO=async(e,t)=>{let n=kO.get(e);if(n)return n;let r=OO(t).then(n=>t.fetch(e,{headers:{accept:`application/json`,authorization:`Bearer ${n}`,REFERRER:`http://unogs.com`,referer:`http://unogs.com`},mode:`cors`,credentials:`include`}).then(e=>e.json()));return kO.set(e,r),r.finally(()=>kO.delete(e)),r},jO=`https://unogs.com/api`,MO=(e,t)=>AO(`${jO}/title/detail?netflixid=${e}`,t),NO=(e,t)=>AO(`${jO}/title/bgimages?netflixid=${e}`,t),PO=(e,t)=>AO(`${jO}/title/episodes?netflixid=${e}`,t),FO=(e,t)=>AO(`${jO}/search?limit=50&offset=0&query=${encodeURIComponent(e)}&countrylist=&country_andorunique=&start_year=&end_year=&start_rating=&end_rating=&genrelist=&type=&audio=&subtitle=&audiosubtitle_andor=&person=&personid=&filterby=&orderby=`,t),IO=e=>e.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(Number(t))).replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&apos;/g,`'`).replace(/&#39;/g,`'`),LO=e=>e.replace(/^http:/,`https:`),RO=e=>e===`movie`?`RUN`:`CONTAINER`,zO=(e,t)=>{let n=[],r=[];if(e.img&&n.push({url:LO(e.img),score:yO}),t){let e=t.bo166x236?.[0]?.url;e&&!n.some(t=>t.url===e)&&n.push({url:e,score:yO});let i=t.bo665x375?.[0]?.url??t.bo342x192?.[0]?.url;i&&r.push({url:i,score:yO});let a=t.bg?.[0]?.url;a&&r.push({url:a,score:yO})}return e.lgimg&&!r.some(t=>t.url===e.lgimg)&&r.push({url:e.lgimg,score:yO}),H({origin:`nf`,id:String(e.netflixid),url:`https://www.netflix.com/title/${e.netflixid}`,score:yO,scope:RO(e.vtype),categories:e.vtype===`movie`?[`MOVIE`]:[`SERIES`],titles:[{language:`en`,title:IO(e.title),score:yO}],...Rw(e.synopsis?IO(e.synopsis):void 0,yO),covers:n,banners:r,startDate:e.year?`${e.year}-01-01`:void 0,averageScore:kT(e.imdbrating,10)})},BO=e=>H({origin:`nf`,id:String(e.nfid),url:`https://www.netflix.com/title/${e.nfid}`,score:yO,scope:RO(e.vtype),categories:e.vtype===`movie`?[`MOVIE`]:[`SERIES`],titles:[{language:`en`,title:IO(e.title),score:yO}],...Rw(e.synopsis?IO(e.synopsis):void 0,yO),covers:e.img?zw(LO(e.img),yO):[],startDate:e.year?`${e.year}-01-01`:void 0}),VO=(e,t,n)=>{let r=e.synopsis?.trim(),i=r&&!r.startsWith(`THIS EPISODE'S SYNOPSIS IS COMING SOON`)?IO(r):void 0;return Pw({origin:`nf`,id:String(e.epid),mediaUri:t,url:`https://www.netflix.com/watch/${e.epid}`,score:yO,titles:[{language:`en`,title:IO(e.title),score:yO}],...Rw(i,yO),thumbnails:e.img?zw(LO(e.img),yO):[],seasonNumber:e.seasnum,episodeNumber:n})},HO=e=>Fw(e,{url:`https://www.netflix.com/watch/${e.id}`,score:yO}),UO=async(e,t)=>{let{results:n=[]}=await FO(e,t);return n.filter(e=>e.vtype===`movie`).map(BO)},WO=async(e,t,n,r=!1)=>{let[i,a]=await Promise.all([MO(e,t),NO(e,t)]),o=i[0];if(!o||r&&n==null&&o.vtype===`series`)return;let s=o.vtype===`series`?await PO(e,t):void 0;return GO(o,a,s,n)},GO=(e,t,n,r)=>{let i=zO(e,t);if(r!=null&&(i.id=`${i.id}-${r}`,i.uri=WS({origin:`nf`,id:i.id}),i.scope=`RUN`,i.startDate=void 0),e.vtype===`series`){if(!Array.isArray(n))return i;i.episodes=(r==null?n:n.filter(e=>e.season===r)).flatMap(e=>e.episodes.map((e,t)=>VO(e,i.uri,t+1))),i.episodeCount=i.episodes.length}else i.episodes=[HO(i)],i.episodeCount=1;return i},KO=(e,t)=>[...e].sort((e,t)=>e.season-t.season).map((e,n)=>({season:e,seasonNumber:e.season,episodeCount:e.episodes.length,episodeTitles:e.episodes.map(e=>IO(e.title??``)),year:n===0&&Number(t)||void 0})),qO=async(e,t,n,r)=>{let i=await gT(t,n,e=>e?.episodeCount??e?.episodes?.length?e:void 0);if(!i)return;let a=await PO(e,n);if(!Array.isArray(a)||!a.length)return;let o=SD({titles:(i.titles??[]).map(e=>e.title),episodeCount:i.episodeCount??i.episodes?.length,startDate:i.startDate},KO(a,r));return o?{kind:`season`,season:o.season.season}:{kind:`title`}},JO=async(e,t)=>{if(!e?.showId)return;let n=(await MO(e.showId,t))?.[0];if(n?.vtype!==`series`)return;let r=await PO(e.showId,t);if(!Array.isArray(r)||!r.length)return;let i=SD(e,KO(r,n.year));if(i)return GO(n,await NO(e.showId,t),r,i.season.season)},YO=async(e,t,n,r,i)=>{let a=r===void 0?(await MO(e,n))[0]:void 0;if((r??a?.vtype)!==`series`)return WO(e,n,void 0,!0);let o=await qO(e,t,n,i??a?.year);if(!o)return;if(o.kind===`season`)return WO(e,n,o.season,!0);let s=await WO(e,n,void 0,!1);if(s)return s.episodes=[],s.episodeCount=void 0,s},XO=async(e,t,n,r)=>{for(let i of[e,...pT(e)]){let{results:e=[]}=await FO(i,n);if(!e.length)continue;let a=await rT(i,e.map(e=>({result:e,title:IO(e.title),categories:e.vtype===`movie`?[`MOVIE`]:[`SERIES`]})),r);if(!a)continue;let o=String(a.result.nfid),s=await YO(o,t,n,a.result.vtype,a.result.year);if(s)return s.handles=mT(t,`nf`),s}return null},ZO=async(e,t)=>{let n=VS(e,`nf`);if(n){let r=n.id.indexOf(`-`),i=r===-1?n.id:n.id.slice(0,r),a=r===-1?void 0:Number(n.id.slice(r+1)),o=a!=null||!ZS(e)?await WO(i,t,a,ZS(e)):await YO(i,e,t);return o?(ZS(e)&&(o.handles=mT(e,`nf`)),o):null}if(!ZS(e))return null;let r=await gT(e,t,e=>Bw(e)?e:void 0,3e4),i=Bw(r);return i?XO(i,e,t,r?.categories):null},QO={Subscription:{similarMedia:{subscribe:async function*(e,{input:t},n){yield{similarMedia:await JO(t,n)??null}}},media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};yield{media:await ZO(t,n)}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await UO(t,n)}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`nf`)return e.episodes??[];if(e.episodes?.length)return e.episodes;if(Iw(e))return[HO(e)];let r=await PO(e.id,n);return Array.isArray(r)?r.flatMap(t=>t.episodes.map((t,n)=>VO(t,e.uri,n+1))):e.episodes??[]}}},$O=(e,t)=>`${e}-${t}`,ek=e=>{let t=/^(\d+)-(\d+)$/.exec(e);return t?{objectId:t[1],seasonObjectId:Number(t[2])}:{objectId:e}},tk=e=>e!==`MOVIE`,nk=(e,t)=>e===`cr`?void 0:t,rk={cru:`cr`,nfx:`nf`,nfa:`nf`,dnp:`disney`,amp:`amazon`,atp:`appletv`,hlu:`hulu`,mxx:`hbo`,pcp:`peacock`,pct:`peacock`,ppp:`paramount`,ppe:`paramount`,fuv:`fubo`},ik=e=>{try{let t=new URL(e),n=t.hostname.replace(`www.`,``),r=t.pathname.split(`/`).filter(Boolean);if(n===`netflix.com`||n===`crunchyroll.com`&&r[0]===`series`)return r[1];if(n.startsWith(`amazon.`)||n.endsWith(`.amazon.com`))return t.searchParams.get(`gti`)??(n.startsWith(`amazon.`)?r.at(-1):void 0);if(n===`hulu.com`){let e=r.at(-1);return e?.match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i)?.[1]??e}if(n===`tv.apple.com`)return t.searchParams.get(`showId`)??r.find(e=>e.startsWith(`umc.`));if(n===`disneyplus.com`){let e=r.find(e=>e.startsWith(`entity-`));return e?e.slice(7):r[0]===`play`?r[1]:r[2]}if(n===`peacocktv.com`)return r[2]===`tv`?r[4]:r.at(-1);if(n===`paramountplus.com`)return r[1];if(n===`fubo.tv`)return r[0]===`welcome`?r[2]:void 0;if(n===`play.hbomax.com`||n===`hbomax.com`)return r[0]===`video`?r[2]:r[1]}catch{}},ak={MEDIA:{crossSource:!0},MEDIA_PAGE:{crossSource:!1},SIMILAR_MEDIA:{crossSource:!0}},ok={crossSource:!0};let sk=0;const ck=new Map;let lk=0;const uk=e=>{let t=`r${++lk}`;return fk({rootId:t,operation:e,chain:[]})},dk=(e,t)=>fk({rootId:e.rootId,operation:e.operation,chain:[...e.chain,t]}),fk=({rootId:e,operation:t,chain:n})=>{let r={token:`t${++lk}`,rootId:e,operation:t,chain:n};return ck.set(r.token,r),r},pk=e=>typeof e==`string`?ck.get(e):void 0,mk=e=>{for(let[t,n]of ck)n.rootId===e&&ck.delete(t)},hk=e=>{let t=e?.context?.token,n=pk(t);return n||sk++,n},gk=e=>{let t=hk(e);return t?ak[t.operation]:ok},_k=(e,t)=>{let n=e.input;return typeof n!=`object`||!n?e:{...e,input:{...n,context:t}}};var vk=c({categories:()=>Sk,icon:()=>bk,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>Ck,official:()=>!1,origin:()=>`jw`,originUrl:()=>xk,resolvers:()=>Wk,showAsContainer:()=>Ik,supportedUris:()=>wk});const yk=.2,bk=`https://www.justwatch.com/appasset/img/favicon/favicon-32x32.png`,xk=`https://www.justwatch.com`,Sk=[`SERIES`,`MOVIE`],Ck=`JustWatch`,wk=[`jw`],Tk={primary:`US`,extra:`JP`},Ek=e=>{try{let t=new URL(e);return t.searchParams.get(`u`)??t.searchParams.get(`r`)??void 0}catch{}},Dk=e=>{try{let{hostname:t,pathname:n}=new URL(e);if(t.replace(`www.`,``)!==`crunchyroll.com`)return;let r=n.split(`/`).filter(Boolean);return r[0]===`watch`?r[1]:void 0}catch{}},Ok=async(e,t,n)=>(await n.fetch(`https://apis.justwatch.com/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`*/*`},body:JSON.stringify({query:e,variables:t})})).json(),kk=new Map,Ak=async(e,t)=>{let n=kk.get(e);if(n)return n;let r=t();return kk.set(e,r),r.finally(()=>kk.delete(e)),r},jk=(e,t)=>Ak(`search:${e}`,()=>Ok(`
978
- query GetSearchTitles($searchTitlesFilter: TitleFilter!, $country: Country!, $extraCountry: Country!, $language: Language!, $first: Int!) {
979
- popularTitles(country: $country, filter: $searchTitlesFilter, first: $first, sortBy: POPULAR, sortRandomSeed: 0) {
980
- edges {
981
- node {
982
- id
983
- objectId
984
- objectType
985
- content(country: $country, language: $language) {
986
- title
987
- fullPath
988
- originalReleaseYear
989
- shortDescription
990
- posterUrl(profile: S718, format: JPG)
991
- externalIds {
992
- imdbId
993
- }
994
- genres {
995
- shortName
996
- }
997
- }
998
- offers(country: $country, platform: WEB, filter: { bestOnly: true }) {
999
- monetizationType
1000
- presentationType
1001
- standardWebURL
1002
- package {
1003
- id
1004
- packageId
1005
- clearName
1006
- technicalName
1007
- shortName
1008
- icon(profile: S100)
1009
- }
1010
- }
1011
- extraOffers: offers(country: $extraCountry, platform: WEB, filter: { bestOnly: true }) {
1012
- monetizationType
1013
- presentationType
1014
- standardWebURL
1015
- package {
1016
- id
1017
- packageId
1018
- clearName
1019
- technicalName
1020
- shortName
1021
- icon(profile: S100)
1022
- }
1023
- }
1024
- ... on Show {
1025
- seasons(sortDirection: ASC) {
1026
- objectId
1027
- totalEpisodeCount
1028
- content(country: $country, language: $language) {
1029
- seasonNumber
1030
- isReleased
1031
- }
1032
- }
1033
- }
1034
- }
1035
- }
1036
- }
1037
- }
1038
- `,{first:10,searchTitlesFilter:{searchQuery:e},language:`en`,country:Tk.primary,extraCountry:Tk.extra},t)),Mk=(e,t)=>Ak(`node:${e}`,()=>Ok(`
1039
- query GetTitleNode($nodeId: ID!, $language: Language!, $country: Country!, $extraCountry: Country!) {
1040
- node(id: $nodeId) {
1041
- ... on MovieOrShow {
1042
- id
1043
- objectId
1044
- objectType
1045
- content(country: $country, language: $language) {
1046
- title
1047
- fullPath
1048
- originalReleaseYear
1049
- shortDescription
1050
- posterUrl(profile: S718, format: JPG)
1051
- externalIds {
1052
- imdbId
1053
- }
1054
- genres {
1055
- shortName
1056
- }
1057
- }
1058
- offers(country: $country, platform: WEB, filter: { bestOnly: true }) {
1059
- monetizationType
1060
- presentationType
1061
- standardWebURL
1062
- package {
1063
- id
1064
- packageId
1065
- clearName
1066
- technicalName
1067
- shortName
1068
- icon(profile: S100)
1069
- }
1070
- }
1071
- extraOffers: offers(country: $extraCountry, platform: WEB, filter: { bestOnly: true }) {
1072
- monetizationType
1073
- presentationType
1074
- standardWebURL
1075
- package {
1076
- id
1077
- packageId
1078
- clearName
1079
- technicalName
1080
- shortName
1081
- icon(profile: S100)
1082
- }
1083
- }
1084
- ... on Show {
1085
- totalSeasonCount
1086
- seasons(sortDirection: ASC) {
1087
- id
1088
- objectId
1089
- totalEpisodeCount
1090
- content(country: $country, language: $language) {
1091
- title
1092
- seasonNumber
1093
- fullPath
1094
- posterUrl
1095
- originalReleaseYear
1096
- isReleased
1097
- }
1098
- episodes(limit: 50) {
1099
- id
1100
- objectId
1101
- content(country: $country, language: $language) {
1102
- title
1103
- episodeNumber
1104
- seasonNumber
1105
- isReleased
1106
- shortDescription
1107
- runtime
1108
- }
1109
- flatrate: offers(
1110
- country: $country, platform: WEB,
1111
- filter: { monetizationTypes: [FLATRATE_AND_BUY, FLATRATE, ADS, FREE], bestOnly: true }
1112
- ) {
1113
- package {
1114
- clearName
1115
- packageId
1116
- shortName
1117
- }
1118
- }
1119
- }
1120
- }
1121
- }
1122
- }
1123
- }
1124
- }
1125
- `,{nodeId:e,language:`en`,country:Tk.primary,extraCountry:Tk.extra},t)),Nk=e=>e?e.startsWith(`http`)?e:`https://images.justwatch.com${e}`:void 0,Pk=e=>e.map(e=>({season:e,seasonNumber:e.content.seasonNumber,episodeCount:e.totalEpisodeCount||void 0,year:e.content.originalReleaseYear,episodeTitles:(e.episodes??[]).map(e=>e.content.title)})),Fk=async(e,t,n,r=ok)=>{let i=new Set,a=[];for(let o of e){if(![`FLATRATE`,`FLATRATE_AND_BUY`,`FREE`,`ADS`].includes(o.monetizationType))continue;let e=rk[o.package.shortName];if(!e||i.has(e))continue;i.add(e);let s=(o.standardWebURL?Ek(o.standardWebURL):void 0)??o.standardWebURL??void 0,c,l=`SAME_AS`,u=s?ik(s):void 0;if(!u&&e===`cr`&&s&&t.seasonNumber==null&&!t.showContainer&&r.crossSource){let e=Dk(s);if(e){let t=await YD(e,n);t&&(c=QD(t.seriesId,t.seasonId))}}else u&&(c=nk(e,u),c?t.seasonNumber!=null&&(l=`PART_OF`):e===`cr`&&(c=u,l=`PART_OF`));if(!c)continue;let d=H({origin:e,id:c,url:s});a.push(l===`PART_OF`?Mw(d):jw(d))}return a},Ik=async(e,t,n=ok)=>{let r=await Fk([...e.offers??[],...e.extraOffers??[]],{shortDescription:e.content.shortDescription,title:e.content.title,posterUrl:Nk(e.content.posterUrl),showContainer:!0},t,n);return r.length?H({origin:`jw`,id:String(e.objectId),url:`https://www.justwatch.com${e.content.fullPath}`,scope:`CONTAINER`,categories:[e.objectType===`MOVIE`?`MOVIE`:`SERIES`],score:yk,handles:r,titles:[{language:`en`,title:e.content.title,score:yk}],...Rw(e.content.shortDescription??void 0,yk),covers:zw(Nk(e.content.posterUrl),yk),startDate:e.content.originalReleaseYear?`${e.content.originalReleaseYear}-01-01`:void 0}):null},Lk=async(e,t,n,r=ok)=>{if(t.seasonNumber==null&&tk(e.objectType))return null;let i=(t.seasons??[]).find(e=>e.content.seasonNumber===t.seasonNumber);if(t.seasonNumber!=null&&i?.objectId==null)return null;let a=t.seasonNumber==null?String(e.objectId):$O(e.objectId,i.objectId),{shortDescription:o}=e.content,s=i?.content?.originalReleaseYear??e.content.originalReleaseYear,c=i?.content.title&&!Sw(i.content.title)?i.content.title:e.content.title,l=t.seasonNumber==null?t.seasons??[]:(t.seasons??[]).filter(e=>e.content.seasonNumber===t.seasonNumber),u=l.flatMap(e=>(e.episodes??[]).filter(e=>e.content.isReleased).map(e=>Rk(e,WS({origin:`jw`,id:a})))),d=await Fk([...e.offers??[],...e.extraOffers??[]],{shortDescription:o,title:c,posterUrl:Nk(e.content.posterUrl),seasonNumber:t.seasonNumber},n,r);t.seasonNumber!=null&&d.push(Mw(H({origin:`jw`,id:String(e.objectId),url:`https://www.justwatch.com${e.content.fullPath}`,categories:[e.objectType===`MOVIE`?`MOVIE`:`SERIES`],titles:[{language:`en`,title:e.content.title,score:yk}],startDate:e.content.originalReleaseYear?`${e.content.originalReleaseYear}-01-01`:void 0})));let f=H({origin:`jw`,id:a,categories:[e.objectType===`MOVIE`?`MOVIE`:`SERIES`],url:`https://www.justwatch.com${e.content.fullPath}`,score:yk,handles:d,episodes:u,episodeCount:u.length||l.reduce((e,t)=>e+(t.totalEpisodeCount??0),0)||void 0,startDate:s?`${s}-01-01`:void 0});return Iw(f)&&(f.episodes=[Fw(f,{score:yk,titles:[{language:`en`,title:c,score:yk}],...Rw(o,yk)})],f.episodeCount=1),f},Rk=(e,t)=>Pw({origin:`jw`,id:String(e.objectId),mediaUri:t,score:yk,titles:[{language:`en`,title:e.content.title,score:yk}],...Rw(e.content.shortDescription,yk),seasonNumber:e.content.seasonNumber,episodeNumber:e.content.episodeNumber,runtime:e.content.runtime??void 0}),zk=async(e,t,n)=>{if(!t.seasons?.length)return;let r=Pk(t.seasons);return gT(e,n,e=>{let t={titles:(e?.titles??[]).map(e=>e.title),episodeCount:e?.episodeCount??e?.episodes?.length,startDate:e?.startDate};return sD(t)?SD(t,r)?.season.content.seasonNumber:void 0})},Bk=async(e,t)=>{if(!e?.showId)return;let n=(await Mk(`ts${e.showId}`,t)).data?.node;if(!n?.seasons?.length||!tk(n.objectType))return;let r=SD(e,Pk(n.seasons));if(r)return await Lk(n,{seasons:n.seasons,seasonNumber:r.season.content.seasonNumber},t,gk(e))??void 0},Vk=(e,t)=>{let n=(t.seasons??[]).map(e=>e.content?.originalReleaseYear);return n.length?nD(e,n):!tk(t.objectType)&&nD(e,[t.content.originalReleaseYear])},Hk=async(e,t)=>{let n=await gT(e,t,e=>Bw(e)&&e?.startDate?e:void 0,3e4);if(!n)return null;let r=n.startDate??void 0;if(!r)return null;let i=(n.titles??[]).map(e=>e.title).filter(Boolean),a=i[0];if(!a)return null;let o=new Map,s=e=>{let n=o.get(e);if(n)return n;let r=Mk(e,t);return o.set(e,r),r},c=null;for(let o of $E(a)){let a=((await jk(o,t)).data?.popularTitles?.edges??[]).map(e=>e.node);if(!a.length)continue;let l=await eD(i,a,e=>e.content?.title);if(l.length)for(let{candidate:a}of l){let o=(await s(a.id)).data?.node;if(!o?.content?.title||!Vk(r,o))continue;let l=o.seasons?.length?SD({titles:i,episodeCount:n.episodeCount??n.episodes?.length,startDate:r},Pk(o.seasons))?.season.content.seasonNumber:void 0,u=await Lk(o,{seasons:o.seasons,seasonNumber:l},t);if(u)return hT(u,e),u;c||=await Ik(o,t)}}return c},Uk=async(e,t)=>{let n=VS(e,`jw`);if(n){let{objectId:r,seasonObjectId:i}=ek(n.id),a=(await Mk(`ts${r}`,t)).data?.node;if(!a)return null;let o=(i==null?void 0:a.seasons?.find(e=>e.objectId===i)?.content.seasonNumber)??(ZS(e)?await zk(e,a,t):void 0),s=await Lk(a,{seasons:a.seasons,seasonNumber:o},t);return s?(ZS(e)&&hT(s,e),s):null}return ZS(e)?Hk(e,t):null},Wk={Subscription:{similarMedia:{subscribe:async function*(e,{input:t},n){yield{similarMedia:await Bk(t,n)??null}}},media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};yield{media:await Uk(t,n)}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:t},n){let{search:r}=t;if(!r)return yield{mediaPage:{nodes:[]}};let i=gk(t),a=await jk(r,n);yield{mediaPage:{nodes:(await Promise.all((a.data?.popularTitles?.edges??[]).map(e=>Lk(e.node,{},n,i)))).filter(e=>e!==null)}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`jw`)return e.episodes??[];if(e.episodes?.length)return e.episodes;if(Iw(e))return[Fw(e,{score:yk})];let{objectId:r,seasonObjectId:i}=ek(e.id),a=(await Mk(`ts${r}`,n)).data?.node;if(!a?.seasons)return[];let o=(i==null?void 0:a.seasons.find(e=>e.objectId===i)?.content.seasonNumber)??(e.titles?.[0]?.title?Cw(e.titles[0].title):void 0);return(o==null?a.seasons:a.seasons.filter(e=>e.content.seasonNumber===o)).flatMap(t=>(t.episodes??[]).filter(e=>e.content.isReleased).map(t=>Rk(t,e.uri)))}}};var Gk=c({categories:()=>Yk,color:()=>$k,icon:()=>qk,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>Xk,official:()=>!1,origin:()=>Zk,originUrl:()=>Jk,resolvers:()=>hA,supportedUris:()=>Qk});const Kk=.2,qk=`https://tv.apple.com/favicon.ico`,Jk=`https://tv.apple.com`,Yk=[`SERIES`,`MOVIE`],Xk=`Apple TV+`,Zk=`appletv`,Qk=[`appletv`],$k=`#e8e8ed`,eA=(e,t)=>t.fetch(`https://uts-api.itunes.apple.com/uts/v3${e}${e.includes(`?`)?`&`:`?`}caller=web&sf=143441&v=58&pfm=web&locale=en-US&utsk=0`).then(e=>e.json()),tA=(e,t,n)=>e?.url?.replace(`{w}`,String(t)).replace(`{h}`,String(n)).replace(`{c}`,``).replace(`{f}`,`jpg`),nA=(e,t)=>{let n=tA(e.images?.coverArt,600,900),r=tA(e.images?.coverArt16X9,1920,1080),i=t?.seasonNumber!=null,a=i?t.releaseDate:e.releaseDate,o=i||e.type===`Movie`?`RUN`:`CONTAINER`;return H({origin:Zk,id:i?Ew(e.id,t.seasonNumber):e.id,scope:o,url:e.url,score:Kk,categories:e.type===`Movie`?[`MOVIE`]:[`SERIES`],titles:[{language:`en`,title:e.title,score:Kk}],...Rw(e.description,Kk),covers:zw(n,Kk),banners:zw(r,Kk),startDate:a==null?void 0:new Date(a).toISOString()})},rA=(e,t)=>Pw({origin:Zk,id:e.id,mediaUri:t,url:e.url,score:Kk,titles:[{language:`en`,title:e.title,score:Kk}],...Rw(e.description,Kk),thumbnails:zw(tA(e.images?.previewFrame??e.images?.coverArt16X9,1280,720),Kk),seasonNumber:e.seasonNumber,episodeNumber:e.episodeNumber,releaseDate:e.releaseDate==null?void 0:new Date(e.releaseDate).toISOString()}),iA=async(e,t,n,r,i)=>{let a=Object.values(t??{}).filter(e=>i==null||e.seasonNumber===i).map(e=>e.id).filter(Boolean);if(!a.length)return[];let o=await Promise.all(a.map(t=>eA(`/shows/${e}/episodes?selectedSeasonId=${t}`,r).then(e=>e.data?.episodes??[]).catch(()=>[]))),s=new Map;for(let e of o.flat())i!=null&&e.seasonNumber!==i||s.has(e.id)||s.set(e.id,e);return[...s.values()].sort((e,t)=>(e.seasonNumber??0)-(t.seasonNumber??0)||(e.episodeNumber??0)-(t.episodeNumber??0)).map(e=>rA(e,n))},aA=async(e,t)=>{let n=await eA(`/shows/${e}`,t);if(n.data?.content)return n.data;let r=await eA(`/movies/${e}`,t);return r.data?.content?r.data:void 0},oA=e=>Object.values(e.seasons??{}).filter(e=>e.seasonNumber!=null).map(e=>({season:e,seasonNumber:e.seasonNumber,premiere:e.releaseDate})),sA=async(e,t,n,r)=>{if(n!=null)return t.find(({season:e})=>e.seasonNumber===n)?.season;if(t.length)return gT(e,r,e=>SD({titles:(e?.titles??[]).map(e=>e.title),startDate:e?.startDate,episodeCount:e?.episodeCount??e?.episodes?.length},t)?.season)},cA=async(e,t,n)=>{let r=e.content;if(!r)return;if(r.type===`Movie`){let e=nA(r);return e.episodes=[Fw(e)],e.episodeCount=1,e}if(t?.seasonNumber==null)return nA(r);let i=nA(r,t);return i.episodes=await iA(r.id,e.seasons,i.uri,n,t.seasonNumber),i.episodeCount=i.episodes.length,i},lA=async(e,t)=>{let n=await aA(e.showId,t);if(!n?.content||n.content.type===`Movie`)return;let r=SD(e,oA(n));return r?cA(n,r.season,t):void 0},uA=async(e,t,n,r)=>{let i=await aA(t,r);if(!i?.content)return;let a=await sA(e,oA(i),n,r);return cA(i,a,r)},dA=async(e,t)=>{let n=((await eA(`/search?searchTerm=${encodeURIComponent(e)}`,t)).data?.canvas?.shelves??[]).flatMap(e=>e.items??[]).filter(e=>e.type===`Show`||e.type===`Movie`),r=new Map;for(let e of n)r.has(e.id)||r.set(e.id,e);return[...r.values()]},fA=e=>e?.content?e.content.type===`Movie`?[{id:e.content.id,releaseDate:e.content.releaseDate}]:Object.values(e.seasons??{}):[],pA=async(e,t)=>{let n=await gT(e,t,e=>Bw(e)&&e?.startDate?e:void 0,3e4);if(!n)return null;let r=n.startDate??void 0;if(!r)return null;let i=(n.titles??[]).map(e=>e.title).filter(Boolean),a=i[0];if(!a)return null;let o=new Map,s=e=>{let n=o.get(e);if(n)return n;let r=aA(e,t).catch(()=>void 0);return o.set(e,r),r};for(let n of $E(a)){let a=await dA(n,t);if(!a.length)continue;let o=await iD({titles:i,startDate:r},a,e=>e.title,async e=>fA(await s(e.id)),e=>e.releaseDate);if(!o)continue;let c=await s(o.candidate.id);if(!c)continue;let l=await cA(c,o.season,t);if(l)return l.handles=mT(e,Zk),l}return null},mA=async(e,t)=>{let n=VS(e,Zk);if(n){let{showId:r,seasonNumber:i}=Dw(n.id),a=await uA(e,r,i,t);return a?(ZS(e)&&(a.handles=mT(e,Zk)),a):null}return ZS(e)?pA(e,t):null},hA={Subscription:{similarMedia:{subscribe:async function*(e,{input:t},n){if(!t?.showId)return yield{similarMedia:null};yield{similarMedia:await lA(t,n)??null}}},media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};yield{media:await mA(t,n)}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:(await dA(t,n)).map(e=>nA(e))}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`appletv`)return e.episodes??[];if(e.episodes?.length)return e.episodes;if(Iw(e))return[Fw(e)];let{showId:r,seasonNumber:i}=Dw(e.id),a=await aA(r,n);return iA(r,a?.seasons,e.uri,n,i)}}};var gA=c({categories:()=>bA,color:()=>wA,icon:()=>vA,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>xA,official:()=>!1,origin:()=>SA,originUrl:()=>yA,resolvers:()=>OA,supportedUris:()=>CA});const _A=.2,vA=`https://www.paramountplus.com/favicon.ico`,yA=`https://www.paramountplus.com`,bA=[`SERIES`],xA=`Paramount+`,SA=`paramount`,CA=[`paramount`],wA=`#0064ff`,TA=`https://www.paramountplus.com`,EA=async(e,t,n)=>((await n.fetch(`${TA}/shows/${e}/xhr/episodes/page/0/size/100000/xs/0/season/0/`).then(e=>e.json()).catch(()=>void 0))?.result?.data??[]).map(e=>Pw({origin:SA,id:e.content_id,mediaUri:t,url:e.url?`${TA}${e.url}`:void 0,score:_A,titles:e.title?[{language:`en`,title:e.title,score:_A}]:[],thumbnails:zw(e.thumbnail,_A),seasonNumber:e.season_num==null?void 0:Number(e.season_num),episodeNumber:e.episode_num==null?void 0:Number(e.episode_num)})),DA=async(e,t)=>{let n=H({origin:SA,id:e,url:`${TA}/shows/${e}`,score:_A,scope:`CONTAINER`,categories:[`SERIES`]}),r=await EA(e,n.uri,t);return new Set(r.map(e=>e.seasonNumber??0)).size<=1&&(n.episodes=r,n.episodeCount=r.length),n},OA={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,SA)?.id;yield{media:r?await DA(r,n):null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}},Media:{episodes:async(e,t,n)=>e.origin===`paramount`?e.episodes?.length?e.episodes:EA(e.id,e.uri,n):e.episodes??[]}};var kA=c({categories:()=>MA,color:()=>IA,icon:()=>AA,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>NA,official:()=>!1,origin:()=>PA,originUrl:()=>jA,resolvers:()=>LA,supportedUris:()=>FA});const AA=`https://www.disneyplus.com/favicon.ico`,jA=`https://www.disneyplus.com`,MA=[`SERIES`,`MOVIE`],NA=`Disney+`,PA=`disney`,FA=[`disney`],IA=`#0063e5`,LA={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var RA=c({categories:()=>VA,color:()=>GA,icon:()=>zA,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>HA,official:()=>!1,origin:()=>UA,originUrl:()=>BA,resolvers:()=>KA,supportedUris:()=>WA});const zA=`https://www.primevideo.com/favicon.ico`,BA=`https://www.primevideo.com`,VA=[`SERIES`,`MOVIE`],HA=`Prime Video`,UA=`amazon`,WA=[`amazon`],GA=`#00a8e1`,KA={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var qA=c({categories:()=>XA,color:()=>ej,icon:()=>JA,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>ZA,official:()=>!1,origin:()=>QA,originUrl:()=>YA,resolvers:()=>tj,supportedUris:()=>$A});const JA=`https://www.hulu.com/favicon.ico`,YA=`https://www.hulu.com`,XA=[`SERIES`,`MOVIE`],ZA=`Hulu`,QA=`hulu`,$A=[`hulu`],ej=`#1ce783`,tj={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var nj=c({categories:()=>aj,color:()=>lj,icon:()=>rj,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>oj,official:()=>!1,origin:()=>sj,originUrl:()=>ij,resolvers:()=>uj,supportedUris:()=>cj});const rj=`https://www.peacocktv.com/favicon.ico`,ij=`https://www.peacocktv.com`,aj=[`SERIES`,`MOVIE`],oj=`Peacock`,sj=`peacock`,cj=[`peacock`],lj=`#069de0`,uj={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var dj=c({categories:()=>mj,color:()=>gj,icon:()=>fj,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>`Max`,official:()=>!1,origin:()=>`hbo`,originUrl:()=>pj,resolvers:()=>_j,supportedUris:()=>hj});const fj=`https://www.max.com/favicon.ico`,pj=`https://www.max.com`,mj=[`SERIES`,`MOVIE`],hj=[`hbo`],gj=`#7b5cff`,_j={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var vj=c({categories:()=>xj,color:()=>Tj,icon:()=>yj,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>Sj,official:()=>!1,origin:()=>Cj,originUrl:()=>bj,resolvers:()=>Ej,supportedUris:()=>wj});const yj=`https://www.fubo.tv/favicon.ico`,bj=`https://www.fubo.tv`,xj=[`SERIES`,`MOVIE`],Sj=`Fubo`,Cj=`fubo`,wj=[`fubo`],Tj=`#fa4616`,Ej={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var Dj=c({categories:()=>Mj,color:()=>Ij,icon:()=>Aj,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>Nj,official:()=>!1,origin:()=>Pj,originUrl:()=>jj,resolvers:()=>Qj,supportedUris:()=>Fj});const Oj=.3,kj=`https://www.themoviedb.org`,Aj=`https://www.themoviedb.org/favicon.ico`,jj=`https://www.themoviedb.org`,Mj=[`SERIES`],Nj=`TMDB`,Pj=`tmdb`,Fj=[`tmdb`],Ij=`#01b4e4`,Lj={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:` `},Rj=e=>e.replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t))).replace(/&([a-z]+);/gi,(e,t)=>Lj[t.toLowerCase()]??e),zj=(e,t)=>t.fetch(`${kj}${e}`).then(e=>e.text()).catch(()=>void 0),Bj=(e,t)=>e.match(RegExp(`<meta property="${t}" content="([^"]*)"`))?.[1],Vj=(e,t)=>{let n=(e.match(RegExp(`href="/tv/${t}(?![0-9])[^"]*"><h2[\\s\\S]{0,400}?class="release_date[^"]*">([^<]*)<`))?.[1])?.match(/\b(?:19|20)\d{2}\b/)?.[0];return n?Number(n):void 0},Hj=e=>{let t=[],n=new Set;for(let r of e.matchAll(/data-media-type="tv"[\s\S]{0,200}?href="\/tv\/(\d+)[^"]*"[\s\S]{0,400}?<img\s+alt="([^"]*)"(?:[\s\S]{0,300}?(?:src|data-src)="(https:\/\/[^"]+)")?/g)){let i=r[1];!i||n.has(i)||(n.add(i),t.push({id:i,title:Rj(r[2]??``),poster:r[3],year:Vj(e,i)}))}return t},Uj=(e,t)=>{let n=e.match(/\/t\/p\/w1920[^"']+\.(?:jpg|png)/)?.[0],r=e.match(/class="user_score_chart"[^>]*data-percent="([\d.]+)"/)?.[1],i=[...new Set([...e.matchAll(RegExp(`/tv/${t}/season/(\\d+)`,`g`))].map(e=>Number(e[1])))].filter(e=>e>0).sort((e,t)=>e-t);return{id:t,title:Rj(Bj(e,`og:title`)??``),overview:Rj(Bj(e,`og:description`)??``)||void 0,poster:Bj(e,`og:image`),banner:n?`https://media.themoviedb.org${n}`:void 0,score:r?Math.round(Number(r))/10:void 0,seasons:i}},Wj=e=>{let t=[];for(let n of e.split(`<div class="card`)){let e=n.match(/data-episode-number="(\d+)"/)?.[1];if(!e)continue;let r=n.match(/<h3><a[^>]*>([^<]+)<\/a><\/h3>/)?.[1]??n.match(/<img[^>]*\balt="([^"]*)"/)?.[1],i=n.match(/class="overview"[^>]*>\s*<p>([\s\S]*?)<\/p>/)?.[1];t.push({number:Number(e),title:r?Rj(r):void 0,overview:i?Rj(i.replace(/<[^>]+>/g,``)).trim():void 0,still:n.match(/src="(https:\/\/media\.themoviedb\.org\/t\/p\/[^"]+)"/)?.[1]})}return t},Gj=(e,t)=>H({origin:Pj,id:t==null?e.id:Ew(e.id,t),scope:t==null?`CONTAINER`:`RUN`,url:`${kj}/tv/${e.id}`,categories:[`SERIES`],score:Oj,titles:[{language:`en`,title:e.title,score:Oj}],...Rw(e.overview,Oj),covers:zw(e.poster,Oj),banners:zw(e.banner,Oj),averageScore:kT(e.score,10),startDate:t==null&&e.year?`${e.year}-01-01`:void 0}),Kj=(e,t,n,r)=>Pw({origin:Pj,id:`${n}-s${t}e${e.number}`,mediaUri:r,score:Oj,titles:e.title?[{language:`en`,title:e.title,score:Oj}]:[],...Rw(e.overview,Oj),thumbnails:zw(e.still,Oj),seasonNumber:t,episodeNumber:e.number}),qj=async(e,t,n)=>Promise.all(t.map(async t=>({seasonNumber:t,episodeCount:await zj(`/tv/${e}/season/${t}?language=en-US`,n).then(e=>e?Wj(e).length:0)}))),Jj=async(e,t,n,r)=>{if(n.length===1)return n[0];if(!n.length)return;let i=await gT(e,r,e=>{let t=Bw(e),n=t?Cw(t):void 0,r=e?.episodeCount??e?.episodes?.length;return n!=null||r?{season:n,count:r}:void 0});if(i?.season!=null)return i.season;if(i?.count)return ww(await qj(t,n,r),i.count)},Yj=async(e,t,n,r)=>(await Promise.all(t.map(t=>zj(`/tv/${e}/season/${t}?language=en-US`,r).then(r=>r?Wj(r).map(r=>Kj(r,t,e,n)):[])))).flat(),Xj=async(e,t,n,r)=>{let i=await zj(`/tv/${t}?language=en-US`,r);if(!i)return;let a=Uj(i,t);if(!a.title)return;let o=n??await Jj(e,t,a.seasons,r);if(o==null&&a.seasons.length>1)return;let s=Gj(a,o);return s.episodes=await Yj(t,o==null?a.seasons:[o],s.uri,r),s.episodeCount=s.episodes.length,s},Zj=async(e,t)=>{let n=await zj(`/search/tv?query=${encodeURIComponent(e)}&language=en-US`,t);return n?Hj(n).map(e=>Gj(e)):[]},Qj={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,Pj);if(!r)return yield{media:null};let{showId:i,seasonNumber:a}=Dw(r.id);yield{media:await Xj(t,i,a,n)??null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await Zj(t,n)}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`tmdb`)return e.episodes??[];if(e.episodes?.length)return e.episodes;let{showId:r,seasonNumber:i}=Dw(e.id),a=await zj(`/tv/${r}?language=en-US`,n);if(!a)return[];let o=i==null?Uj(a,r).seasons:[i];return Yj(r,o,e.uri,n)}}};var $j=c({categories:()=>rM,color:()=>sM,icon:()=>tM,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>iM,official:()=>!1,origin:()=>aM,originUrl:()=>nM,resolvers:()=>bM,supportedUris:()=>oM});const eM=.3,tM=`https://www.tvmaze.com/favicon.ico`,nM=`https://www.tvmaze.com`,rM=[`SERIES`],iM=`TVmaze`,aM=`tvmaze`,oM=[`tvmaze`],sM=`#3c948b`,cM={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:` `},lM=e=>{if(e)return e.replace(/<[^>]+>/g,``).replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t))).replace(/&([a-z]+);/gi,(e,t)=>cM[t.toLowerCase()]??e).trim()||void 0},uM=(e,t)=>t.fetch(`https://api.tvmaze.com${e}`).then(e=>e.json()).catch(()=>void 0),dM=e=>{let t=e.externals?.imdb;return t?[H({origin:`imdb`,id:t,url:`https://www.imdb.com/title/${t}`,scope:`CONTAINER`})]:[]},fM=(e,t,n=[],r)=>H({origin:aM,id:t==null?String(e.id):Ew(e.id,t),scope:t==null?`CONTAINER`:`RUN`,url:e.url??`https://www.tvmaze.com/shows/${e.id}`,handles:n,categories:[`SERIES`],score:eM,titles:e.name?[{language:`en`,title:e.name,score:eM}]:[],...Rw(lM(e.summary),eM),covers:zw(e.image?.original??e.image?.medium,eM),startDate:(t==null?e.premiered:r)||void 0,averageScore:e.rating?.average??void 0}),pM=(e,t)=>Pw({origin:aM,id:String(e.id),mediaUri:t,score:eM,titles:e.name?[{language:`en`,title:e.name,score:eM}]:[],...Rw(lM(e.summary),eM),thumbnails:zw(e.image?.original??e.image?.medium,eM),seasonNumber:e.season,episodeNumber:e.number}),mM=(e,t)=>{if(t==null)return;let n;for(let r of e)r.season!==t||!r.airdate||(!n||r.airdate<n)&&(n=r.airdate);return n},hM=e=>{let t=new Map;for(let n of e)n.season!=null&&t.set(n.season,(t.get(n.season)??0)+1);return[...t].map(([t,n])=>({season:{seasonNumber:t},seasonNumber:t,episodeCount:n,premiere:mM(e,t),episodeTitles:e.filter(e=>e.season===t).map(e=>e.name??``)}))},gM=(e,t,n)=>{let r=fM(e,n,dM(e),mM(t,n));return r.episodes=(n==null?t:t.filter(e=>e.season===n)).map(e=>pM(e,r.uri)),r.episodeCount=r.episodes.length,r},_M=async(e,t,n,r)=>{let i=await uM(`/shows/${t}?embed=episodes`,r);if(!i)return;let a=i._embedded?.episodes??[],o=hM(a),s=n??(o.length?await gT(e,r,e=>SD({titles:(e?.titles??[]).map(e=>e.title),startDate:e?.startDate,episodeCount:e?.episodeCount??e?.episodes?.length},o)?.season.seasonNumber):void 0);if(!(s==null&&o.length>1))return gM(i,a,s)},vM=async(e,t)=>{let n=await uM(`/shows/${e.showId}?embed=episodes`,t);if(!n)return;let r=n._embedded?.episodes??[],i=SD(e,hM(r));return i?gM(n,r,i.season.seasonNumber):void 0},yM=async(e,t)=>(await uM(`/search/shows?q=${encodeURIComponent(e)}`,t)??[]).map(e=>fM(e.show,void 0,dM(e.show))),bM={Subscription:{similarMedia:{subscribe:async function*(e,{input:t},n){if(!t?.showId)return yield{similarMedia:null};yield{similarMedia:await vM(t,n)??null}}},media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,aM);if(!r)return yield{media:null};let{showId:i,seasonNumber:a}=Dw(r.id);yield{media:await _M(t,i,a,n)??null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await yM(t,n)}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`tvmaze`)return e.episodes??[];if(e.episodes?.length)return e.episodes;let{showId:r,seasonNumber:i}=Dw(e.id),a=await uM(`/shows/${r}/episodes`,n);return(i==null?a??[]:(a??[]).filter(e=>e.season===i)).map(t=>pM(t,e.uri))}}},xM=({season:e,year:t,page:n})=>`/anime?filter%5Bseason%5D=${e}&filter%5BseasonYear%5D=${t}&page%5Bsize%5D=20&page%5Bnumber%5D=${n}&sort=-userCount%2CcreatedAt&include=mappings`,SM=(e=8)=>Array.from({length:e},(e,t)=>t+1),CM=/\/(series|title|watch|shows?)\/([^/?#]+)/,wM=[[/crunchyroll\.com/,`cr`],[/netflix\.com/,`nf`],[/hulu\.com/,`hulu`],[/disneyplus\.com/,`disney`],[/(primevideo|amazon)\./,`amazon`],[/(hbomax|max)\.com/,`hbo`]],TM=e=>{let t=[];for(let n of e){if(!n)continue;let e;try{e=new URL(n)}catch{continue}let r=wM.find(([t])=>t.test(e.hostname))?.[1];if(!r)continue;let i=CM.exec(e.pathname);i&&t.push({origin:r,id:i[2],url:n,scope:i[1]})}return t},EM=new Set([`nf:title`,`nf:watch`]),DM=({origin:e,scope:t})=>EM.has(`${e}:${t}`);var OM=c({categories:()=>MM,color:()=>IM,icon:()=>AM,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>NM,official:()=>!1,origin:()=>PM,originUrl:()=>jM,resolvers:()=>ZM,supportedUris:()=>FM});const kM=.3,AM=`https://kitsu.io/favicon.ico`,jM=`https://kitsu.io`,MM=[`ANIME`,`SERIES`,`MOVIE`],NM=`Kitsu`,PM=`kitsu`,FM=[`kitsu`],IM=`#f75239`,LM=(e,t)=>t.fetch(`https://kitsu.io/api/edge${e}`).then(e=>e.json()).catch(()=>void 0),RM=e=>{let t=[];for(let n of e){let e=n.externalId;e&&(n.externalSite===`anilist/anime`?t.push(H({origin:`anilist`,id:e,url:`https://anilist.co/anime/${e}`})):n.externalSite===`myanimelist/anime`&&t.push(H({origin:`mal`,id:e,url:`https://myanimelist.net/anime/${e}`})))}return t},zM=(e,t)=>{let n=TM(e.map(e=>e.url)),r=({origin:e,id:t,url:n})=>Mw(H({origin:e,id:t,url:n}));return t.subtype===`movie`?n.map(e=>DM(e)?jw(H({origin:e.origin,id:e.id,url:e.url})):r(e)):n.map(r)},BM=e=>new Map((e.included??[]).map(e=>[e.id,e.attributes])),VM=(e,t)=>(e.relationships?.mappings?.data??[]).map(e=>t.get(e.id)).filter(e=>!!e),HM=e=>{let t=e.titles??{},n=[[t.en,`en`],[e.canonicalTitle??void 0,`en`],[t.ja_jp,`ja`]],r=[],i=new Set;for(let[e,t]of n)e&&!i.has(e)&&(i.add(e),r.push({language:t,title:e,score:kM}));return r},UM=(e,t=[])=>{let n=e.attributes;return H({origin:PM,id:e.id,url:`https://kitsu.io/anime/${e.id}`,handles:t,score:kM,categories:n.subtype===`movie`?[`ANIME`,`MOVIE`]:[`ANIME`,`SERIES`],type:n.subtype===`TV`?zS.Tv:n.subtype===`movie`?zS.Movie:n.subtype===`special`?zS.Special:n.subtype===`OVA`?zS.Ova:n.subtype===`ONA`?zS.Ona:void 0,titles:HM(n),...Rw(n.synopsis??void 0,kM),covers:zw(n.posterImage?.original??n.posterImage?.large??n.posterImage?.medium,kM),banners:zw(n.coverImage?.original??n.coverImage?.large,kM),startDate:n.startDate||void 0,endDate:n.endDate||void 0,episodeCount:n.episodeCount??void 0,popularity:n.userCount??void 0,status:n.status===`current`?RS.Releasing:n.status===`upcoming`?RS.NotYetReleased:n.status===`finished`?RS.Finished:void 0,trailers:n.youtubeVideoId?[{uri:`yt:${n.youtubeVideoId}`,origin:`yt`,id:n.youtubeVideoId,url:`https://www.youtube.com/watch?v=${n.youtubeVideoId}`,language:`en`}]:[],averageScore:kT(n.averageRating,100)})},WM=(e,t)=>{let n=e.attributes;return Pw({origin:PM,id:e.id,mediaUri:t,score:kM,titles:n.canonicalTitle?[{language:`en`,title:n.canonicalTitle,score:kM}]:[],...Rw(n.synopsis??void 0,kM),thumbnails:zw(n.thumbnail?.original??n.thumbnail?.large??n.thumbnail?.medium,kM),seasonNumber:n.seasonNumber??void 0,episodeNumber:n.number??void 0})},GM=async(e,t,n)=>{let r=[];for(let i=0;i<2e3;i+=20){let a=await LM(`/anime/${e}/episodes?page%5Blimit%5D=20&page%5Boffset%5D=${i}&sort=number`,n),o=Array.isArray(a?.data)?a.data:[];if(r.push(...o.map(e=>WM(e,t))),o.length<20)break}return r},KM=async(e,t)=>{let[n,r]=await Promise.all([LM(`/anime/${e}?include=mappings`,t),LM(`/anime/${e}/streaming-links`,t)]),i=n?.data,a=Array.isArray(i)?i[0]:i;if(!a)return;let o=Array.isArray(r?.data)?r.data:[],s=[...RM(VM(a,BM(n??{}))),...zM(o.map(e=>e.attributes),a.attributes)],c=UM(a,s);return c.episodes=await GM(e,c.uri,t),c.episodeCount=c.episodes.length,c},qM=async(e,t)=>{let n=await LM(`/anime?filter%5Btext%5D=${encodeURIComponent(e)}&include=mappings&page%5Blimit%5D=10`,t),r=Array.isArray(n?.data)?n.data:[],i=BM(n??{});return r.map(e=>UM(e,RM(VM(e,i))))},JM=async({season:e,year:t,page:n},r)=>{try{let i=await LM(xM({season:e,year:t,page:n}),r),a=Array.isArray(i?.data)?i.data:[],o=BM(i??{});return a.map(n=>({...UM(n,RM(VM(n,o))),season:mw(e),seasonYear:t}))}catch(e){return console.error(`Kitsu season page ${n} failed`,e),[]}},YM=async(e,{season:t,year:n}=fw())=>{let r=await Promise.all(SM().map(r=>JM({season:t,year:n,page:r},e))),i=new Map;for(let e of r.flat())i.has(e.uri)||i.set(e.uri,e);return[...i.values()]},XM=({season:e,seasonYear:t})=>{let n=e?hw(e):void 0;return n&&t?{season:n,year:t}:void 0},ZM={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,PM);yield{media:r?await KM(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:t},n){let{search:r,status:i,season:a,seasonYear:o}=t,s=XM(t);if(s)return yield{mediaPage:{nodes:await YM(n,s)}};if(i===`RELEASING`&&!a&&!o)return yield{mediaPage:{nodes:await YM(n)}};if(!r)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await qM(r,n)}}}}},Media:{episodes:async(e,t,n)=>e.origin===`kitsu`?e.episodes?.length?e.episodes:GM(e.id,e.uri,n):e.episodes??[]}};var QM=c({categories:()=>nN,color:()=>oN,icon:()=>eN,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>rN,official:()=>!1,origin:()=>iN,originUrl:()=>tN,resolvers:()=>mN,supportedUris:()=>aN});const $M=.3,eN=`https://www.omdbapi.com/favicon.ico`,tN=`https://www.omdbapi.com`,nN=[`SERIES`,`MOVIE`],rN=`OMDb`,iN=`omdb`,aN=[`omdb`],oN=`#f5c518`,sN=e=>e&&e!==`N/A`?e:void 0,cN=(e,t)=>{let n=t.key(iN);return n?t.fetch(`https://www.omdbapi.com/?apikey=${n}&${e}`).then(e=>e.json()).catch(()=>void 0):Promise.resolve(void 0)},lN=e=>{let t=e.imdbID;if(!t)return;let n=sN(e.imdbRating),r=sN(e.Year)?.match(/\d{4}/)?.[0],i=e.Type===`movie`?`RUN`:`CONTAINER`;return H({origin:iN,id:t,url:`https://www.imdb.com/title/${t}`,scope:i,handles:[H({origin:`imdb`,id:t,url:`https://www.imdb.com/title/${t}`,scope:i})],categories:e.Type===`movie`?[`MOVIE`]:[`SERIES`],score:$M,titles:e.Title?[{language:`en`,title:e.Title,score:$M}]:[],...Rw(sN(e.Plot),$M),covers:zw(sN(e.Poster),$M),averageScore:kT(n,10),startDate:r?`${r}-01-01`:void 0})},uN=(e,t,n,r)=>Pw({origin:iN,id:e.imdbID??`${n}-s${t}e${e.Episode}`,mediaUri:r,score:$M,titles:sN(e.Title)?[{language:`en`,title:e.Title,score:$M}]:[],seasonNumber:t,episodeNumber:e.Episode?Number(e.Episode):void 0}),dN=async(e,t,n,r)=>{let i=Array.from({length:t},(e,t)=>t+1);return(await Promise.all(i.map(t=>cN(`i=${e}&Season=${t}`,r).then(r=>(r?.Episodes??[]).map(r=>uN(r,t,e,n)))))).flat()},fN=async(e,t)=>{let n=await cN(`i=${e}&plot=full`,t);if(!n||n.Response===`False`)return;let r=lN(n);if(!r)return;let i=sN(n.totalSeasons);return i&&Number(i)===1?(r.episodes=await dN(e,1,r.uri,t),r.episodeCount=r.episodes.length):i?r.episodeCount=void 0:Iw(r)&&(r.episodes=[Fw(r)],r.episodeCount=1),r},pN=async(e,t)=>((await cN(`s=${encodeURIComponent(e)}`,t))?.Search??[]).map(lN).filter(e=>!!e),mN={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,iN);yield{media:r?await fN(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await pN(t,n)}}}}},Media:{episodes:async(e,t,n)=>{if(e.origin!==`omdb`)return e.episodes??[];if(e.episodes?.length)return e.episodes;if(Iw(e))return[Fw(e)];let r=await cN(`i=${e.id}&plot=short`,n),i=sN(r?.totalSeasons);return i?dN(e.id,Number(i),e.uri,n):[]}}};var hN=c({categories:()=>yN,color:()=>CN,icon:()=>_N,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>bN,official:()=>!1,origin:()=>xN,originUrl:()=>vN,resolvers:()=>MN,supportedUris:()=>SN});const gN=.3,_N=`https://walter.trakt.tv/hotlink-ok/public/favicon.ico`,vN=`https://trakt.tv`,yN=[`SERIES`],bN=`Trakt`,xN=`trakt`,SN=[`trakt`],CN=`#ed1c24`,wN=(e,t)=>{let n=t.key(xN);return n?t.fetch(`https://api.trakt.tv${e}`,{headers:{"trakt-api-key":n,"trakt-api-version":`2`,"Content-Type":`application/json`}}).then(e=>e.json()).catch(()=>void 0):Promise.resolve(void 0)},TN=e=>e?.slug??(e?.trakt===void 0?void 0:String(e.trakt)),EN=e=>{let t=[];return e?.imdb&&t.push(H({origin:`imdb`,id:e.imdb,url:`https://www.imdb.com/title/${e.imdb}`,scope:`CONTAINER`})),e?.tmdb!==void 0&&t.push(H({origin:`tmdb`,id:String(e.tmdb),url:`https://www.themoviedb.org/tv/${e.tmdb}`,scope:`CONTAINER`})),t},DN=e=>{let t=TN(e.ids);if(!t)return;let n=e.rating;return H({origin:xN,id:t,url:`https://trakt.tv/shows/${t}`,scope:`CONTAINER`,handles:EN(e.ids),categories:[`SERIES`],score:gN,titles:e.title?[{language:`en`,title:e.title,score:gN}]:[],...Rw(e.overview,gN),startDate:e.first_aired?new Date(e.first_aired).toISOString():void 0,averageScore:n===void 0?void 0:Math.round(n*10)})},ON=(e,t,n,r)=>{let i=e.number;return Pw({origin:xN,id:e.ids?.trakt===void 0?`${n}-s${t}e${i??0}`:String(e.ids.trakt),mediaUri:r,score:gN,titles:e.title?[{language:`en`,title:e.title,score:gN}]:[],...Rw(e.overview,gN),seasonNumber:t,episodeNumber:i})},kN=async(e,t,n)=>{let r=await wN(`/shows/${encodeURIComponent(e)}/seasons?extended=episodes,full`,n);return r?r.filter(e=>(e.number??0)>0).flatMap(n=>(n.episodes??[]).map(r=>ON(r,n.number??0,e,t))):[]},AN=async(e,t)=>{let n=await wN(`/shows/${encodeURIComponent(e)}?extended=full`,t);if(!n)return;let r=DN(n);if(!r)return;let i=await kN(e,r.uri,t);return new Set(i.map(e=>e.seasonNumber??0)).size<=1&&(r.episodes=i,r.episodeCount=i.length),r},jN=async(e,t)=>(await wN(`/search/show?query=${encodeURIComponent(e)}`,t)??[]).map(e=>e.show?DN(e.show):void 0).filter(e=>!!e),MN={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,xN);yield{media:r?await AN(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await jN(t,n)}}}}},Media:{episodes:async(e,t,n)=>e.origin===`trakt`?e.episodes?.length?e.episodes:kN(e.id,e.uri,n):e.episodes??[]}};var NN=c({categories:()=>RN,color:()=>HN,icon:()=>IN,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>zN,official:()=>!1,origin:()=>BN,originUrl:()=>LN,resolvers:()=>uP,supportedUris:()=>VN});const PN=.3,FN=`https://simkl.in`,IN=`https://simkl.com/favicon.ico`,LN=`https://simkl.com`,RN=[`ANIME`,`SERIES`,`MOVIE`],zN=`Simkl`,BN=`simkl`,VN=[`simkl`],HN=`#0b0f10`,UN=(e,t)=>{let n=t.key(BN);return n?t.fetch(`https://api.simkl.com${e}`,{headers:{"simkl-api-key":n}}).then(e=>e.json()).catch(()=>void 0):Promise.resolve(void 0)},WN=e=>e?`${FN}/posters/${e}_m.jpg`:void 0,GN=e=>e?`${FN}/fanart/${e}_w.jpg`:void 0,KN=e=>e?`${FN}/episodes/${e}_w.jpg`:void 0,qN=e=>e===`tv`?`/tv`:e===`anime`?`/anime`:`/movies`,JN=e=>e===`tv`?`/tv/episodes`:`/anime/episodes`,YN=e=>e===`anime`?`anime`:e===`movies`?`movies`:`tv`,XN=e=>e===`movies`?[`MOVIE`]:e===`anime`?[`ANIME`,`SERIES`]:[`SERIES`],ZN=e=>e===`tv`?`CONTAINER`:`RUN`,QN=e=>e===`movies`?`RUN`:`CONTAINER`,$N=(e,t)=>{if(!e)return[];let n=[];return e.imdb&&n.push(H({origin:`imdb`,id:e.imdb,url:`https://www.imdb.com/title/${e.imdb}`,scope:QN(t)})),e.mal&&n.push(H({origin:`mal`,id:e.mal,url:`https://myanimelist.net/anime/${e.mal}`})),e.anilist&&n.push(H({origin:`anilist`,id:e.anilist,url:`https://anilist.co/anime/${e.anilist}`})),e.kitsu&&n.push(H({origin:`kitsu`,id:e.kitsu,url:`https://kitsu.io/anime/${e.kitsu}`})),n},eP=e=>e?.simkl?.rating??e?.imdb?.rating??e?.mal?.rating,tP=(e,t)=>{let n=[],r=new Set;for(let i of[e,t??void 0])i&&!r.has(i)&&(r.add(i),n.push({language:`en`,title:i,score:PN}));return n},nP=e=>{let t=e.ids?.simkl??e.ids?.simkl_id;if(t===void 0)return;let n=YN(e.endpoint_type);return H({origin:BN,id:String(t),url:`https://simkl.com/${n}/${t}`,scope:ZN(n),handles:$N(e.ids,n),categories:XN(n),score:PN,titles:tP(e.title),covers:zw(WN(e.poster),PN),averageScore:kT(eP(e.ratings),10)})},rP=(e,t,n)=>{if(e.title)return H({origin:BN,id:t,url:`https://simkl.com/${n}/${t}`,scope:ZN(n),handles:$N(e.ids,n),categories:XN(n),score:PN,titles:tP(e.title,e.en_title),...Rw(e.overview,PN),covers:zw(WN(e.poster),PN),banners:zw(GN(e.fanart),PN),startDate:e.first_aired||void 0,averageScore:kT(eP(e.ratings),10)})},iP=(e,t,n,r)=>{let i=e.season??1,a=e.episode;return Pw({origin:BN,id:a===void 0?`${t}-i${r}`:`${t}-s${i}e${a}`,mediaUri:n,score:PN,titles:e.title?[{language:`en`,title:e.title,score:PN}]:[],...Rw(e.description??void 0,PN),thumbnails:zw(KN(e.img),PN),seasonNumber:e.season??void 0,episodeNumber:a??void 0})},aP=async(e,t,n,r)=>{if(t===`movies`)return[];let i=await UN(`${JN(t)}/${e}?extended=full`,r);return(Array.isArray(i)?i:[]).filter(e=>e.type!==`special`||e.episode!==void 0||!!e.title).map((t,r)=>iP(t,e,n,r))},oP=async(e,t)=>{for(let n of[`tv`,`anime`,`movies`]){let r=await UN(`${qN(n)}/${e}?extended=full`,t),i=r?rP(r,e,n):void 0;if(i)return Iw(i)?(i.episodes=[Fw(i)],i.episodeCount=1,i):(i.episodes=await aP(e,n,i.uri,t),i.episodeCount=i.episodes.length,i)}},sP=e=>e===`movies`?`movie`:e,cP=async(e,t,n)=>{let r=await UN(`/search/${sP(t)}?q=${encodeURIComponent(e)}&extended=full&limit=10`,n);return(Array.isArray(r)?r:[]).map(nP).filter(e=>!!e)},lP=async(e,t)=>{let n=await Promise.all([`tv`,`anime`,`movies`].map(n=>cP(e,n,t))),r=[],i=new Set;for(let e of n.flat())i.has(e.id)||(i.add(e.id),r.push(e));return r},uP={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,BN);yield{media:r?await oP(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await lP(t,n)}}}}},Media:{episodes:async(e,t,n)=>e.origin===`simkl`?e.episodes?.length?e.episodes:Iw(e)?[Fw(e)]:(await oP(e.id,n))?.episodes??[]:e.episodes??[]}};var dP=c({categories:()=>gP,color:()=>bP,icon:()=>mP,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>_P,official:()=>!1,origin:()=>vP,originUrl:()=>hP,resolvers:()=>FP,supportedUris:()=>yP});const fP=.3,pP=`https://api4.thetvdb.com/v4`,mP=`https://www.thetvdb.com/images/icon.png`,hP=`https://www.thetvdb.com`,gP=[`SERIES`],_P=`TheTVDB`,vP=`tvdb`,yP=[`tvdb`],bP=`#6cd591`,xP=e=>e?e.startsWith(`http`)?e:`https://artworks.thetvdb.com${e.startsWith(`/`)?``:`/`}${e}`:void 0,SP={imdb:`imdb`,themoviedb:`tmdb`,tmdb:`tmdb`},CP=(e,t)=>e===`imdb`?`https://www.imdb.com/title/${t}`:e===`tmdb`?`https://www.themoviedb.org/tv/${t}`:void 0,wP=e=>{let t=[];for(let n of e??[]){let e=n.id,r=n.sourceName?SP[n.sourceName.toLowerCase()]:void 0,i=e&&r?CP(r,e):void 0;e&&r&&i&&t.push(H({origin:r,id:e,url:i,scope:`CONTAINER`}))}return t};let TP;const EP=async e=>{let t=e.key(vP);if(!t)return;let n=t.indexOf(`:`),r=n===-1?t:t.slice(0,n),i=n===-1?void 0:t.slice(n+1),a=JSON.stringify(i?{apikey:r,pin:i}:{apikey:r});return(await e.fetch(`${pP}/login`,{method:`POST`,headers:{"content-type":`application/json`},body:a}).then(e=>e.json()).catch(()=>void 0))?.data?.token},DP=async e=>(TP||=await EP(e),TP),OP=async(e,t)=>{if(!t.key(`tvdb`))return;let n=await DP(t);if(!n)return;let r=n=>t.fetch(`${pP}${e}`,{headers:{Authorization:`Bearer ${n}`}}),i=await r(n).catch(()=>void 0);if(i?.status===401){if(TP=await EP(t),!TP)return;i=await r(TP).catch(()=>void 0)}if(!(!i||!i.ok))return i.json().then(e=>e).catch(()=>void 0)},kP=e=>{let t=e.tvdb_id;if(t)return H({origin:vP,id:t,url:`https://www.thetvdb.com/series/${t}`,scope:`CONTAINER`,handles:wP(e.remote_ids),categories:[`SERIES`],score:fP,titles:e.name?[{language:`en`,title:e.name,score:fP}]:[],...Rw(e.overview,fP),covers:zw(xP(e.image_url),fP),startDate:e.year?`${e.year}-01-01`:void 0})},AP=e=>{let t=e.id==null?void 0:String(e.id);if(t)return H({origin:vP,id:t,url:`https://www.thetvdb.com/series/${t}`,scope:`CONTAINER`,handles:wP(e.remoteIds),categories:[`SERIES`],score:fP,titles:e.name?[{language:`en`,title:e.name,score:fP}]:[],...Rw(e.overview,fP),covers:zw(xP(e.image),fP),startDate:e.firstAired||void 0})},jP=(e,t,n)=>Pw({origin:vP,id:e.id==null?`${t}-s${e.seasonNumber??0}e${e.number??0}`:String(e.id),mediaUri:n,score:fP,titles:e.name?[{language:`en`,title:e.name,score:fP}]:[],...Rw(e.overview,fP),thumbnails:zw(xP(e.image),fP),seasonNumber:e.seasonNumber,episodeNumber:e.number}),MP=async(e,t,n)=>{let r=[],i=0;for(;i<50;){let a=await OP(`/series/${e}/episodes/default?page=${i}`,n),o=a?.data?.episodes??[];for(let n of o)r.push(jP(n,e,t));if(!a?.links?.next||o.length===0)break;i+=1}return r},NP=async(e,t)=>{let n=await OP(`/series/${e}/extended`,t);if(!n?.data)return;let r=AP(n.data);if(!r)return;let i=await MP(e,r.uri,t);return new Set(i.map(e=>e.seasonNumber??0)).size<=1&&(r.episodes=i,r.episodeCount=i.length),r},PP=async(e,t)=>((await OP(`/search?query=${encodeURIComponent(e)}&type=series`,t))?.data??[]).map(kP).filter(e=>!!e),FP={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,vP);yield{media:r?await NP(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await PP(t,n)}}}}},Media:{episodes:async(e,t,n)=>e.origin===`tvdb`?e.episodes?.length?e.episodes:MP(e.id,e.uri,n):e.episodes??[]}},IP=`offline`,LP=.2,RP=e=>vT(e.startsWith(`http`)?e:`https://cdn.myanimelist.net/images/anime/${e}`),zP=({season:e,year:t})=>`${t}-${e.toUpperCase()}`,BP=/^(\d{4})-([A-Z]+)$/,VP=e=>{let t=BP.exec(e),n=pw.find(e=>e===t?.[2]);return t&&n?{season:n,year:Number(t[1])}:void 0},HP={TV:zS.Tv,MOVIE:zS.Movie,OVA:zS.Ova,ONA:zS.Ona,SPECIAL:zS.Special},UP=e=>e.ml?`mal-${e.ml}`:e.al?`anilist-${e.al}`:e.ku?`kitsu-${e.ku}`:void 0,WP=e=>{let t=[];return e.ml&&t.push(H({origin:`mal`,id:String(e.ml),url:`https://myanimelist.net/anime/${e.ml}`})),e.al&&t.push(H({origin:`anilist`,id:String(e.al),url:`https://anilist.co/anime/${e.al}`})),e.ku&&t.push(H({origin:`kitsu`,id:String(e.ku),url:`https://kitsu.app/anime/${e.ku}`})),t},GP=(e,t)=>{let n=UP(e);if(!n)return;let r=HP[e.ty],i=t?VP(t):void 0;return H({origin:IP,id:n,handles:WP(e),score:LP,season:i?.season??null,seasonYear:i?.year??null,categories:r===zS.Movie?[`ANIME`,`MOVIE`]:[`ANIME`,`SERIES`],type:r,titles:[{language:`en`,title:e.t,score:LP}],covers:e.p?[{url:RP(e.p),score:LP}]:[],episodeCount:e.ep||void 0,popularity:e.pop||void 0,...e.sy?{descriptions:[{language:`en`,description:e.sy,score:LP}],shortDescriptions:[{language:`en`,shortDescription:e.sy,score:LP}]}:{},trailers:e.tr?[{uri:`yt:${e.tr}`,origin:`yt`,id:e.tr,url:`https://www.youtube.com/watch?v=${e.tr}`,language:`en`,...e.th?{thumbnail:e.th}:{}}]:[],averageScore:e.sc?Math.round(e.sc*10):void 0})},KP=(e,t)=>e.map(e=>GP(e,t)).filter(e=>!!e),qP=[`mal`,`anilist`,`kitsu`,`anidb`],JP=e=>{let t={mal:new Map,anilist:new Map,kitsu:new Map,anidb:new Map},n=[],r=0;for(let i=0;i<e.mal.length;i++){let a=e.mal[i],o=a?r+=a:0;n.push(o),o&&t.mal.set(o,i);for(let n of[`anilist`,`kitsu`,`anidb`]){let r=e[n][i];r&&t[n].set(r,i)}}let i=t=>({mal:n[t]??0,anilist:e.anilist[t]??0,kitsu:e.kitsu[t]??0,anidb:e.anidb[t]??0});return{size:n.length,lookup:(e,n)=>{let r=t[e]?.get(n);return r===void 0?void 0:i(r)}}},YP=e=>e.mal?`mal-${e.mal}`:e.anilist?`anilist-${e.anilist}`:e.kitsu?`kitsu-${e.kitsu}`:e.anidb?`anidb-${e.anidb}`:void 0,XP=/^([a-z]+)-(\d+)$/,ZP=(e,t)=>{let n=[],r=new Set;for(let i of e){let[e,a]=i.origin===t?XP.exec(i.id)?.slice(1,3)??[]:[i.origin,i.id];if(!e||!a||!qP.includes(e))continue;let o=Number(a);if(!Number.isInteger(o)||o<=0)continue;let s=`${e}:${o}`;r.has(s)||(r.add(s),n.push({origin:e,id:o}))}return n},QP=`season-seed.json.gz`,$P=`season-seed-episodes.json.gz`,eF=e=>`https://github.com/banou26/stub/releases/download/season-seed/${e}`,tF=/^\d{4}-(WINTER|SPRING|SUMMER|FALL)$/,nF=/^(mal|anilist|kitsu)-\d+$/,rF=/^[a-z0-9]+$/,iF=/[,/()]/,aF=/^https?:\/\//,oF=/^[0-9a-f]{7,40}$/,sF=[`TV`,`TV_SHORT`,`MOVIE`,`ANIME`,`SPECIAL`,`OVA`,`ONA`,`LIVE_ACTION`],cF=[`ANIME`,`SERIES`,`MOVIE`],lF=e=>e.replace(`-`,`:`),uF=`offline`,dF=e=>typeof e==`object`&&!!e&&!Array.isArray(e),fF=e=>typeof e==`string`&&e.length>0,pF=e=>e===null||typeof e==`number`&&Number.isFinite(e),mF=e=>e===null||typeof e==`string`,hF=e=>e.length<=50?e:[...e.slice(0,50),`... and ${e.length-50} more`],gF=(e,t,n,r,i)=>{if(!dF(e)){i.push(`run ${t}: ${n} entry is not an object`);return}let{uri:a,origin:o,id:s,scope:c}=e;if(!fF(a)||!fF(o)||!fF(s)||a!==`${o}:${s}`||!rF.test(o)){i.push(`run ${t}: ${n} uri ${JSON.stringify(a)} is not <origin>:<id>`);return}iF.test(s)&&i.push(`run ${t}: ${n} id ${JSON.stringify(s)} is not routable`),c!==r&&i.push(`run ${t}: ${n} ${a} scope ${JSON.stringify(c)}, expected ${r}`),o===uF&&i.push(`run ${t}: ${n} member ${a} is of origin ${uF}`)},_F=(e,t,n,r)=>{if(!Array.isArray(e)){r.push(`${t}: titles is not an array`);return}e.length>n&&r.push(`${t}: ${e.length} titles over the cap of ${n}`);for(let n of e)(!dF(n)||!fF(n.language)||!fF(n.title))&&r.push(`${t}: title ${JSON.stringify(n)} needs a non-empty language and title`)},vF=(e,t,n,r,i)=>{if(!Array.isArray(e)){i.push(`${t}: ${n}s is not an array`);return}e.length>r&&i.push(`${t}: ${e.length} ${n}s over the cap of ${r}`);for(let r of e)(!dF(r)||!fF(r.url)||!aF.test(r.url)||!mF(r.language))&&i.push(`${t}: ${n} ${JSON.stringify(dF(r)?r.url:r)} is not an http url`)},yF=(e,t,n,r)=>{if(!dF(e)){r.push(`runs[${t}]: not an object`);return}let i=e,a=fF(i.key)?i.key:`runs[${t}]`,o=Array.isArray(i.identity)?i.identity:[],s=`run ${a}`;!fF(i.key)||!nF.test(i.key)?r.push(`${s}: key ${JSON.stringify(i.key)} is not <mal|anilist|kitsu>-<digits>`):o.some(e=>dF(e)&&e.uri===lF(i.key))||r.push(`${s}: key names no identity member (${lF(i.key)})`),Array.isArray(i.identity)?i.identity.length||r.push(`${s}: identity is empty`):r.push(`${s}: identity is not an array`);for(let e of o)gF(e,a,`identity`,`RUN`,r);Array.isArray(i.containers)||r.push(`${s}: containers is not an array`);for(let e of Array.isArray(i.containers)?i.containers:[])gF(e,a,`containers`,`CONTAINER`,r);for(let e of o){if(!dF(e)||!fF(e.uri))continue;let t=n.identity.get(e.uri);t?r.push(`${e.uri} is in the identity of both ${t} and ${a}`):n.identity.set(e.uri,a)}for(let e of Array.isArray(i.containers)?i.containers:[])!dF(e)||!fF(e.uri)||n.containers.has(e.uri)||n.containers.set(e.uri,a);_F(i.titles,s,1,r),vF(i.covers,s,`cover`,3,r),vF(i.banners,s,`banner`,2,r),i.type!==null&&!sF.includes(i.type)&&r.push(`${s}: type ${JSON.stringify(i.type)} is not a media type`),(!Array.isArray(i.categories)||i.categories.some(e=>!cF.includes(e)))&&r.push(`${s}: categories ${JSON.stringify(i.categories)} are not media categories`),pF(i.episodeCount)||r.push(`${s}: episodeCount is neither a number nor null`),pF(i.averageScore)||r.push(`${s}: averageScore is neither a number nor null`),pF(i.popularity)||r.push(`${s}: popularity is neither a number nor null`),i.isAdult!==null&&typeof i.isAdult!=`boolean`&&r.push(`${s}: isAdult is neither a boolean nor null`),i.season!==null&&!(fF(i.season)&&tF.test(i.season))&&r.push(`${s}: season ${JSON.stringify(i.season)} is not a season key`)},bF=e=>{if(!dF(e))return[`seed: not an object`];let t=[],n=e;if(n.version!==1&&t.push(`seed: version ${JSON.stringify(n.version)}, expected 1`),(!fF(n.generatedAt)||!Number.isFinite(Date.parse(n.generatedAt)))&&t.push(`seed: generatedAt ${JSON.stringify(n.generatedAt)} is not a date`),(!fF(n.commit)||!oF.test(n.commit))&&t.push(`seed: commit ${JSON.stringify(n.commit)} is not a sha`),!Array.isArray(n.runs))return t.push(`seed: runs is not an array`),hF(t);let r={identity:new Map,containers:new Map};n.runs.forEach((e,n)=>yF(e,n,r,t));for(let[e,n]of r.identity){let i=r.containers.get(e);i&&t.push(`${e} is a RUN member of ${n} and a CONTAINER of ${i}`)}let i=new Set(n.runs.map(e=>dF(e)?e.key:void 0).filter(fF)),a=new Map;if(!dF(n.seasons))t.push(`seed: seasons is not an object`);else{for(let[e,r]of Object.entries(n.seasons)){if(tF.test(e)||t.push(`seasons: ${JSON.stringify(e)} is not a season key`),!Array.isArray(r)){t.push(`seasons ${e}: not an array of run keys`);continue}for(let n of r)!fF(n)||!i.has(n)?t.push(`seasons ${e}: names ${JSON.stringify(n)}, which is not a run`):a.has(n)||a.set(n,e)}for(let e of n.runs){if(!dF(e)||!fF(e.key))continue;let n=a.get(e.key)??null;(e.season??null)!==n&&t.push(`run ${e.key}: season ${JSON.stringify(e.season)}, expected ${JSON.stringify(n)}`)}}return hF(t)},xF=e=>bF(e).length===0,SF=(e,t,n)=>{if(!dF(e)){n.push(`${t}: not an object`);return}let r=e;if(_F(r.titles,t,2,n),vF(r.thumbnails,t,`thumbnail`,1,n),!Array.isArray(r.urls))n.push(`${t}: urls is not an array`);else{r.urls.length>2&&n.push(`${t}: ${r.urls.length} urls over the cap of 2`);let e=new Set,i=!1;for(let a of r.urls){if(!dF(a)||!fF(a.origin)||!fF(a.url)||!aF.test(a.url)){n.push(`${t}: url ${JSON.stringify(a)} needs an origin and an http url`);continue}a.origin===uF&&n.push(`${t}: url ${a.url} is of origin ${uF}`),e.has(a.origin)&&!i&&(i=!0,n.push(`${t}: two urls of origin ${a.origin}`)),e.add(a.origin)}}mF(r.releaseDate)||n.push(`${t}: releaseDate is neither a string nor null`),pF(r.seasonNumber)||n.push(`${t}: seasonNumber is neither a number nor null`),pF(r.absoluteEpisodeNumber)||n.push(`${t}: absoluteEpisodeNumber is neither a number nor null`),pF(r.runtime)||n.push(`${t}: runtime is neither a number nor null`)},CF=(e,t)=>{if(!dF(e))return[`seed episodes: not an object`];let n=[],r=e;if(r.version!==1&&n.push(`seed episodes: version ${JSON.stringify(r.version)}, expected 1`),r.generatedAt!==t.generatedAt&&n.push(`seed episodes: generatedAt ${JSON.stringify(r.generatedAt)} is not the index's ${JSON.stringify(t.generatedAt)}`),r.commit!==t.commit&&n.push(`seed episodes: commit ${JSON.stringify(r.commit)} is not the index's ${JSON.stringify(t.commit)}`),!dF(r.episodes))return n.push(`seed episodes: episodes is not an object`),hF(n);let i=new Set((t.runs??[]).map(e=>e?.key));for(let[e,t]of Object.entries(r.episodes)){if(i.has(e)||n.push(`seed episodes ${e}: names no run in the index`),!Array.isArray(t)){n.push(`seed episodes ${e}: not an array`);continue}t.length>60&&n.push(`seed episodes ${e}: ${t.length} episodes over the cap of 60`);let r=0;for(let[i,a]of t.entries()){let t=dF(a)?a.number:void 0;if(typeof t!=`number`||!Number.isFinite(t)||t<=r){n.push(`seed episodes ${e}: number ${JSON.stringify(t)} at ${i} is not ascending and positive`);break}r=t}for(let r of t)SF(r,`seed episodes ${e}`,n)}return hF(n)},wF=(e,t)=>CF(e,t).length===0,TF=async e=>{let t=await e.arrayBuffer();try{let e=new Response(t).body;if(!e)throw Error(`the response carried no body to decompress`);return await new Response(e.pipeThrough(new DecompressionStream(`gzip`))).text()}catch{return new TextDecoder().decode(t)}},EF=async(e,t)=>{let n=await e(eF(t));if(!n.ok)throw Error(`${t} answered ${n.status}`);return JSON.parse(await TF(n))},DF=async(e,t,n)=>{let r,i=new Promise(e=>{r=setTimeout(()=>e(void 0),t)});try{return await Promise.race([e,i])}catch(e){console.warn(`offline: ${n} could not be read, the bundled data still answers`,e);return}finally{clearTimeout(r)}};let OF,kF;const AF=e=>OF??=DF(EF(e,QP),1e4,QP).then(e=>{if(e!==void 0){if(xF(e))return e;console.warn(`offline: ${QP} is not a seed index, the bundled data still answers`)}}),jF=(e,t)=>kF??=DF(EF(e,$P),15e3,$P).then(e=>{if(e!==void 0){if(wF(e,t))return e;console.warn(`offline: ${$P} does not belong to this index, the index still answers`)}}),MF=new WeakMap,NF=e=>{let t=MF.get(e);if(t)return t;let n=new Map;for(let t of e.runs){n.set(`${IP}:${t.key}`,t);for(let e of t.identity)n.set(e.uri,t)}return MF.set(e,n),n},PF=(e,t)=>{let n=NF(e);for(let e of t){let t=n.get(`${e.origin}:${e.id}`);if(t)return t}},FF=e=>H({origin:e.origin,id:e.id}),IF=e=>({node:FF(e),relation:`PART_OF`}),LF=(e,t)=>Pw({origin:IP,id:`${e.key}-${t.number}`,mediaUri:`${IP}:${e.key}`,url:t.urls[0]?.url,score:LP,episodeNumber:t.number,titles:t.titles.map(({language:e,title:t})=>({language:e,title:t,score:LP})),thumbnails:t.thumbnails.map(({url:e,language:t})=>({url:e,language:t,score:LP})),releaseDate:t.releaseDate,seasonNumber:t.seasonNumber,absoluteEpisodeNumber:t.absoluteEpisodeNumber,runtime:t.runtime}),RF=(e,t)=>{let n=e.season?VP(e.season):void 0;return H({origin:IP,id:e.key,score:LP,season:n?.season??null,seasonYear:n?.year??null,handles:[...e.identity.map(e=>jw(FF(e))),...e.containers.map(IF)],titles:e.titles.map(({language:e,title:t})=>({language:e,title:t,score:LP})),covers:e.covers.map(({url:e,language:t})=>({url:e,language:t,score:LP})),banners:e.banners.map(({url:e,language:t})=>({url:e,language:t,score:LP})),type:e.type,categories:e.categories,episodeCount:e.episodeCount,averageScore:e.averageScore,popularity:e.popularity,isAdult:e.isAdult,episodes:(t??[]).map(t=>LF(e,t))})},zF=(e,t)=>{let n=new Map(e.runs.map(e=>[e.key,e]));return(e.seasons[t]??[]).map(e=>n.get(e)).filter(e=>!!e).map(e=>RF(e))};var BF=c({categories:()=>HF,color:()=>KF,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>UF,official:()=>!1,origin:()=>WF,originUrl:()=>VF,resolvers:()=>nI,supportedUris:()=>GF});const VF=`https://github.com/manami-project/anime-offline-database`,HF=[`ANIME`,`SERIES`,`MOVIE`],UF=`Offline database`,WF=IP,GF=[`offline`,...qP],KF=`#2b6cb0`;let qF,JF;const YF=()=>qF??=import(`./anime-seasons-CVM0BQGM.js`).then(e=>e.default).catch(e=>(console.error(`offline: the bundled season data could not be loaded`,e),{tag:`unavailable`,updated:``,seasons:{}})),XF=()=>JF??=import(`./anime-index-Jbe1K3rX.js`).then(e=>JP(e.default)).catch(e=>(console.error(`offline: the bundled id index could not be loaded`,e),JP({mal:[],anilist:[],kitsu:[],anidb:[]}))),ZF=async e=>{let t=await YF(),n=t.seasons[e];return n?KP(n,e):(console.warn(`offline: no bundled data for ${e}; the dump (${t.tag}) holds ${Object.keys(t.seasons).join(`, `)||`nothing`}`),[])},QF=e=>{if(ZS(e))return $S(e)?.handleUrisValues??[];if(KS(e)){let t=HS(e);return t?[t]:[]}return[]},$F=e=>{let t=YP(e);if(!t)return;let n=[];if(e.mal&&n.push(H({origin:`mal`,id:String(e.mal),url:`https://myanimelist.net/anime/${e.mal}`})),e.anilist&&n.push(H({origin:`anilist`,id:String(e.anilist),url:`https://anilist.co/anime/${e.anilist}`})),e.kitsu&&n.push(H({origin:`kitsu`,id:String(e.kitsu),url:`https://kitsu.app/anime/${e.kitsu}`})),e.anidb&&n.push(H({origin:`anidb`,id:String(e.anidb),url:`https://anidb.net/anime/${e.anidb}`})),!(n.length<2))return H({origin:WF,id:t,handles:n,score:LP})},eI=async e=>{let t=await YF();for(let[n,r]of Object.entries(t.seasons)){let t=KP(r,n).find(t=>t.id===e);if(t)return t}},tI=async e=>{let t=QF(e);if(!t.length)return null;let n=t.find(e=>e.origin===WF);if(n){let e=await eI(n.id);if(e)return e}let r=ZP(t,WF);if(!r.length)return null;let i=await XF();for(let e of r){let t=i.lookup(e.origin,e.id);if(!t)continue;let n=$F(t);if(n)return await eI(n.id)??n}return null},nI={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t)return yield{media:null};yield{media:await tI(t)};let r=await AF(n.fetch);if(!r)return;let i=PF(r,QF(t));i&&(yield{media:RF(i,(await jF(n.fetch,r))?.episodes[i.key])})}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{status:t,season:n,seasonYear:r}},i){let a=n&&r?zP({season:n,year:r}):void 0;if(!a&&(n||r||t!==`RELEASING`))return yield{mediaPage:{nodes:[]}};let o=a??zP(fw());yield{mediaPage:{nodes:await ZF(o)}};let s=await AF(i.fetch);if(!s)return;let c=zF(s,o);c.length&&(yield{mediaPage:{nodes:c}})}}}};var rI=c({categories:()=>oI,color:()=>uI,icon:()=>iI,isApiOnly:()=>!1,metadataOnly:()=>!0,name:()=>sI,official:()=>!1,origin:()=>cI,originUrl:()=>aI,resolvers:()=>dI,supportedUris:()=>lI});const iI=`https://www.imdb.com/favicon.ico`,aI=`https://www.imdb.com`,oI=[`SERIES`,`MOVIE`],sI=`IMDb`,cI=`imdb`,lI=[`imdb`],uI=`#f5c518`,dI={Subscription:{media:{subscribe:async function*(){yield{media:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(){yield{mediaPage:{nodes:[]}}}}}};var fI=c({categories:()=>gI,color:()=>bI,icon:()=>mI,isApiOnly:()=>!0,metadataOnly:()=>!0,name:()=>_I,official:()=>!1,origin:()=>vI,originUrl:()=>hI,resolvers:()=>PI,supportedUris:()=>yI});const pI=.25,mI=`https://api.watchmode.com/favicon.ico`,hI=`https://www.watchmode.com`,gI=[`SERIES`,`MOVIE`],_I=`Watchmode`,vI=`watchmode`,yI=[`watchmode`],bI=`#1fb6ff`,xI=(e,t)=>{let n=t.key(vI);if(!n)return Promise.resolve(void 0);let r=e.includes(`?`)?`&`:`?`;return t.fetch(`https://api.watchmode.com/v1${e}${r}apiKey=${n}`).then(e=>e.json()).catch(()=>void 0)},SI=[{match:e=>e.endsWith(`crunchyroll.com`),origin:`cr`},{match:e=>e.endsWith(`netflix.com`),origin:`nf`},{match:e=>e.endsWith(`hulu.com`),origin:`hulu`},{match:e=>e.endsWith(`disneyplus.com`),origin:`disney`},{match:e=>e.endsWith(`primevideo.com`)||e.includes(`amazon.`),origin:`amazon`},{match:e=>e.endsWith(`max.com`)||e.endsWith(`hbomax.com`),origin:`hbo`}],CI=e=>SI.find(t=>t.match(e))?.origin,wI=(e,t)=>{let n=ik(e);return n?nk(t,n):void 0},TI=(e,t)=>{let n=e.web_url;if(!n)return;let r;try{r=new URL(n).hostname.replace(/^www\./,``)}catch{return}let i=CI(r);if(!i)return;let a=wI(n,i);if(!a)return;let o=H({origin:i,id:a,url:n}),s=TM([n])[0];return t&&s?.origin===i&&s.id===a&&DM(s)?jw(o):Mw(o)},EI=e=>{let t=[],n=e.imdb_id;n&&t.push(Mw(H({origin:`imdb`,id:n,url:`https://www.imdb.com/title/${n}`})));let r=e.tmdb_id;return r!=null&&e.tmdb_type!==`movie`&&t.push(Mw(H({origin:`tmdb`,id:String(r),url:`https://www.themoviedb.org/tv/${r}`}))),t},DI=e=>{let t=new Set,n=[];for(let r of e)t.has(r.node.uri)||(t.add(r.node.uri),n.push(r));return n},OI=e=>e&&(e.includes(`movie`)||e.includes(`short_film`))?[`MOVIE`]:[`SERIES`],kI=e=>OI(e)[0]===`MOVIE`?`RUN`:`CONTAINER`,AI=e=>{let t=e.id;if(t==null)return;let n=String(t);return H({origin:vI,id:n,url:`https://www.watchmode.com/title/${n}/`,handles:EI(e),score:pI,scope:kI(e.type),categories:OI(e.type),titles:e.name?[{language:`en`,title:e.name,score:pI}]:[]})},jI=(e,t)=>{let n=e.id;if(n==null)return;let r=String(n),i=e.user_rating,a=OI(e.type)[0]===`MOVIE`,o=t.map(e=>TI(e,a)).filter(e=>!!e);return H({origin:vI,id:r,url:`https://www.watchmode.com/title/${r}/`,handles:DI([...EI(e),...o]),score:pI,scope:kI(e.type),categories:OI(e.type),titles:e.title?[{language:`en`,title:e.title,score:pI}]:[],...Rw(e.plot_overview??void 0,pI),covers:zw(e.poster??void 0,pI),averageScore:i==null?void 0:Math.round(i*10)})},MI=async(e,t)=>{let[n,r]=await Promise.all([xI(`/title/${encodeURIComponent(e)}/details/`,t),xI(`/title/${encodeURIComponent(e)}/sources/`,t)]);if(!n)return;let i=jI(n,Array.isArray(r)?r:[]);return i&&Iw(i)&&(i.episodes=[Fw(i)],i.episodeCount=1),i},NI=async(e,t)=>((await xI(`/search/?search_field=name&search_value=${encodeURIComponent(e)}`,t))?.title_results??[]).map(AI).filter(e=>!!e),PI={Subscription:{media:{subscribe:async function*(e,{input:{uri:t}},n){if(!t||!(KS(t)||ZS(t)))return yield{media:null};let r=VS(t,vI);yield{media:r?await MI(r.id,n)??null:null}}},mediaPage:{resolve:e=>e.mediaPage,subscribe:async function*(e,{input:{search:t}},n){if(!t)return yield{mediaPage:{nodes:[]}};yield{mediaPage:{nodes:await NI(t,n)}}}}},Media:{episodes:async(e,t,n)=>e.origin===`watchmode`?e.episodes?.length?e.episodes:Iw(e)?[Fw(e)]:[]:e.episodes??[]}};var FI=c({amazon:()=>RA,anilist:()=>sE,anizip:()=>VE,appletv:()=>Gk,crunchyroll:()=>AD,disney:()=>kA,fubo:()=>vj,hbo:()=>dj,hulu:()=>qA,imdb:()=>rI,jikan:()=>AT,justwatch:()=>vk,kitsu:()=>OM,offline:()=>BF,omdb:()=>QM,paramount:()=>gA,peacock:()=>nj,simkl:()=>NN,tmdb:()=>Dj,trakt:()=>hN,tvdb:()=>dP,tvmaze:()=>$j,unogs:()=>vO,watchmode:()=>fI});const II=e=>{if(typeof e==`object`&&e){if(typeof Object.getPrototypeOf==`function`){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)===`[object Object]`}return!1},LI=(...e)=>e.reduce((e,t)=>{if(Array.isArray(t))throw TypeError(`Arguments provided to ts-deepmerge must be objects, not arrays.`);return Object.keys(t).forEach(n=>{[`__proto__`,`constructor`,`prototype`].includes(n)||(Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=LI.options.mergeArrays?LI.options.uniqueArrayItems?Array.from(new Set(e[n].concat(t[n]))):[...e[n],...t[n]]:t[n]:II(e[n])&&II(t[n])?e[n]=LI(e[n],t[n]):e[n]=t[n]===void 0?LI.options.allowUndefinedOverrides?t[n]:e[n]:t[n])}),e},{}),RI={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};LI.options=RI,LI.withOptions=(e,...t)=>{LI.options={...RI,...e};let n=LI(...t);return LI.options=RI,n};const zI=(e,t)=>t.includes(e.origin)||(e.supportedUris??[]).some(e=>t.includes(e)),BI=new Set([408,429,502,503,504,522,524]),VI=15e3,HI=(e,t,n=Date.now())=>{let r=e.headers.get(`retry-after`),i=Number(r),a=r&&Number.isFinite(i)?i*1e3:r?new Date(r).getTime()-n:NaN,o=Number.isFinite(a)&&a>0?a:UI(t);return Math.min(o,VI)},UI=e=>Math.min(1e3*2**e,VI),WI=(e,{wait:t=e=>new Promise(t=>setTimeout(t,e)),now:n=()=>Date.now()}={})=>async(r,i)=>{for(let a=0;;a++){let o;try{o=await e(r,i)}catch(e){if(a>=3)throw e;await t(UI(a));continue}if(!BI.has(o.status)||a>=3)return o;o.body?.cancel().catch(()=>{}),await t(HI(o,a,n()))}},GI=Vv({},{transport:globalThis,key:`fetch`}),KI=WI((e,t)=>GI.then(({fetch:n})=>n(e,t)));function qI(){let e=new Map,t=new Map,n=new Map;function r(r){e.has(r)||(e.set(r,r),t.set(r,0),n.set(r,new Set([r])))}function i(t){r(t);let n=t;for(;e.get(n)!==n;)n=e.get(n);let i=t;for(;i!==n;){let t=e.get(i);e.set(i,n),i=t}return n}function a(r,a){let o=i(r),s=i(a);if(o===s)return!1;let c=t.get(o),l=t.get(s),u,d;c<l?(u=s,d=o):c>l?(u=o,d=s):(u=o,d=s,t.set(u,c+1)),e.set(d,u);let f=n.get(u);for(let e of n.get(d))f.add(e);return n.delete(d),!0}function o(t){return e.has(t)?n.get(i(t))??YI:YI}function s(){return n.values()}function c(t){return e.has(t)}return{has:c,find:i,union:a,component:o,allComponents:s}}function JI(){let e=new Map,t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=new Map,s=(e,t)=>`${e}\u0000${t}`,c=new Map,l=new Map,u=new Map;function d(e,t){let n=e.get(t);return n||(n=new Map,e.set(t,n)),n}function f(e){let t=a.get(e);return t||(t=qI(),a.set(e,t)),t}function p(t,n,r){let i=c.get(t),a=new Set(i);if(r?.addLabels)for(let e of r.addLabels)a.add(e);if(r?.removeLabels)for(let e of r.removeLabels)a.delete(e);let o=[];for(let e of a){let t=u.get(e);t&&o.push(t)}if(o.length>1)throw Error(`Node "${t}" has multiple labels with merge functions: cannot resolve which to use`);let s=e.get(t),d=o.length===1&&s!=null?o[0](n,s):n;if(e.set(t,d),i)for(let e of i)a.has(e)||l.get(e)?.delete(t);if(a.size>0){c.set(t,a);for(let e of a)l.has(e)||l.set(e,new Set),l.get(e).add(t)}else c.delete(t)}function m(e,t){t?.merge&&u.set(e,t.merge),l.has(e)||l.set(e,new Set)}function h(t,...n){if(!e.has(t))return;let r=c.get(t);r||(r=new Set,c.set(t,r));for(let e of n)r.add(e),l.has(e)||l.set(e,new Set),l.get(e).add(t)}function g(e){return l.get(e)??YI}function _(n){return e.get(n)??e.get(t.get(n))}function ee(n){return e.has(n)||t.has(n)}function v(e,n){t.set(e,n)}function y(e){return t.get(e)??e}function te(e,t){let n=a.get(t);return n?.has(e)?n.find(e):e}function b(e,n){let r=te(e,n),i=s(n,r),a=o.get(i);return a||(a=crypto.randomUUID(),o.set(i,a),t.set(a,r)),a}function ne(e,n,r,i,a,c){let l=s(e,n),u=s(e,i),d=o.get(l),f=o.get(u);if(o.delete(l),o.delete(u),!d&&!f)return;let p=d&&f?r>a||r===a&&n<i?d:f:d??f;o.set(s(e,c),p),t.set(p,c),d&&f&&t.set(p===d?f:d,c)}function x(e,t,r){let i=d(n,r),a=!i.get(e)?.has(t);return i.has(e)||i.set(e,new Set),i.has(t)||i.set(t,new Set),i.get(e).add(t),i.get(t).add(e),a}function re(e,t){return n.get(t)?.get(e)??YI}function ie(e,t,n){let r=x(e,t,n),i=f(n),a=i.find(e),o=i.find(t);if(a!==o){let r=i.component(a).size,s=i.component(o).size;i.union(e,t),ne(n,a,r,o,s,i.find(e))}return r}function ae(e,t,n){let a=d(r,n),o=!a.get(e)?.has(t);a.has(e)||a.set(e,new Set),a.get(e).add(t);let s=d(i,n);return s.has(t)||s.set(t,new Set),s.get(t).add(e),o}function oe(e,t){return r.get(t)?.get(e)??YI}function se(e,t){return i.get(t)?.get(e)??YI}function ce(t,n){let r=a.get(n),i=r?.has(t)?r.component(t):void 0,o=[];if(i)for(let t of i){let n=e.get(t);n&&o.push(n)}else{let n=e.get(t);n&&o.push(n)}return o}function S(t,n,r){let i=a.get(t),o=new Set,s=[],c=r?r.map(e=>y(e)):n?l.get(n)??YI:e.keys();for(let t of c){let n=i?.has(t)?i.find(t):t;if(o.has(n))continue;o.add(n);let r=i?.has(t)?i.component(t):void 0,a=[];if(r)for(let t of r){let n=e.get(t);n&&a.push(n)}else{let n=e.get(t);n&&a.push(n)}a.length>0&&s.push(a)}return s}function C(){e.clear(),t.clear(),n.clear(),r.clear(),i.clear(),a.clear(),o.clear(),c.clear();for(let e of l.values())e.clear()}return{set:p,registerLabel:m,setLabel:h,labeled:g,get:_,has:ee,alias:v,resolve:y,link:ie,connect:x,neighbours:re,root:te,componentId:b,edge:ae,targets:oe,sources:se,cluster:ce,clusters:S,clear:C}}const YI=new Set;function XI(e,t){let n={...t};for(let r in e){let i=e[r];if(Array.isArray(i)){let e=t[r];n[r]=Array.isArray(e)&&e.length>i.length?e:i}else n[r]=i??t[r]}return n}const ZI=new EventTarget;function QI(e,t){ZI.dispatchEvent(new CustomEvent(e,{detail:t}))}function $I(e,t){let n=e=>t(e.detail);return ZI.addEventListener(e,n),()=>ZI.removeEventListener(e,n)}function eL(e,t,n){let r=null,i=!1,a=e(()=>{r?(r({value:t,done:!1}),r=null):i=!0});return n?.abortSignal&&n.abortSignal.addEventListener(`abort`,()=>{a(),r&&r({value:void 0,done:!0})}),{async next(){return i?(i=!1,{value:t,done:!1}):new Promise(e=>{r=e})},async return(){return a(),{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}function tL(e,t){let n=null,r=[],i=$I(e,e=>{n?(n({value:e,done:!1}),n=null):r.push(e)});return t?.abortSignal&&t.abortSignal.addEventListener(`abort`,()=>{i(),n&&n({value:void 0,done:!0})}),{async next(){return r.length>0?{value:r.shift(),done:!1}:new Promise(e=>{n=e})},async return(){return i(),{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}function nL(e,t){return eL(t=>{let n=e.map(e=>$I(e,t));return()=>n.forEach(e=>e())},void 0,t)}function rL(e,t,n){let r=null;return eL(n=>{let i=e.map(e=>$I(e,()=>{r&&clearTimeout(r),r=setTimeout(n,t)}));return()=>{r&&clearTimeout(r),i.forEach(e=>e())}},void 0,n)}const iL=e=>{let t=e.filter(e=>e.value!=null);if(!t.length)return;let n=Math.max(...t.map(e=>e.score??0)),r=t.filter(e=>(e.score??0)===n),i=new Map;for(let e of r)i.set(e.value,(i.get(e.value)??0)+1);let a,o=0;for(let[e,t]of i){let n=t>o||t===o&&a!=null&&Number(e)>Number(a);(a==null||n)&&(a=e,o=t)}return a==null?void 0:{value:a,tier:n}},aL=e=>iL(e.map(e=>({value:e.episodeCount,score:e.score})))?.value,oL=e=>{let t=e.releaseDate?Date.parse(e.releaseDate):NaN;return Number.isFinite(t)?Math.floor(t/864e5):void 0},sL=(e,t)=>{let n=new Map;for(let t of e){let e=oL(t);if(e==null||t.episodeNumber==null)continue;let r=n.get(e)??new Set;r.add(t.episodeNumber),n.set(e,r)}if(!n.size)return;let r=new Map;for(let e of t){let t=oL(e);if(t==null||e.episodeNumber==null)continue;let i=new Set([...n.get(t-1)??[],...n.get(t)??[],...n.get(t+1)??[]]);if(i.size!==1)continue;let a=e.episodeNumber-[...i][0];r.set(a,(r.get(a)??0)+1)}let i=[...r.entries()].sort((e,t)=>t[1]-e[1]),[a,o]=i[0]??[];if(!(a==null||o==null||o<2)&&!(i[1]&&i[1][1]===o))return a},cL=(e,t)=>{let n=iL(e.map(e=>({value:e.episodeCount,score:e.score})));if(!n)return[...t];let{value:r,tier:i}=n,a=e.filter(e=>e.episodeCount===r),o=new Set(a.map(e=>e.origin)),s=new Set(e.filter(e=>(e.score??0)>=i).map(e=>e.origin)),c=new Set(e.map(e=>e.origin));if(a.length<2)return t.filter(e=>c.has(e.origin));let l=e=>!o.has(e.origin)&&!s.has(e.origin);return t.filter(e=>!l(e)||e.episodeNumber==null||e.episodeNumber>=1&&e.episodeNumber<=r)},lL=(e,t)=>{let n=new Map,r=aL(e);if(r==null)return n;let i=new Set(e.filter(e=>e.episodeCount===r).map(e=>e.origin));if(!i.size)return n;let a=t.filter(e=>i.has(e.origin));if(!a.length)return n;for(let e of new Set(t.map(e=>e.origin))){if(i.has(e))continue;let r=t.filter(t=>t.origin===e),o=sL(a,r);if(o!=null)for(let e of r)e.episodeNumber!=null&&n.set(e.uri,{...e,episodeNumber:e.episodeNumber-o})}return n},uL=`media:same_as`,dL=`container:same_as`,fL=new Set([`imdb`]),pL=e=>e.slice(0,e.indexOf(`:`)),mL=`episode:same_as`,hL=`has_episode`,gL={RUN:uL,CONTAINER:dL,EPISODE:mL},_L={RUN:`asserted:media_same_as`,CONTAINER:`asserted:container_same_as`,PART_OF:`asserted:media_part_of`},vL=`media:part_of`,U=JI(),yL=new Map;U.registerLabel(`media`,{merge:XI}),U.registerLabel(`episode`,{merge:XI});const bL=e=>fL.has(pL(e))?`CONTAINER`:U.get(e)?.scope??`RUN`,xL=e=>e===`CONTAINER`?dL:uL,SL=e=>e.scope!==`CONTAINER`,CL=(e,t)=>e<t?-1:+(e>t),wL=e=>e.map(e=>e.uri).sort()[0]??``,TL=new Set([`uri`,`origin`,`id`,`scope`]),EL=e=>e.scope!==`CONTAINER`&&Object.entries(e).every(([e,t])=>TL.has(e)||t==null||Array.isArray(t)&&t.length===0),DL=({mediaUri:e,handleUri:t,relation:n})=>`${e}\0${t}\0${n??`SAME_AS`}`,OL=new Map,kL=(e,t)=>{let n=OL.get(e);n||OL.set(e,n=new Map),n.set(DL(t),t)};async function AL(e,t){let n=!1,r=[];for(let t of e){if(EL(t))continue;let e=!U.has(t.uri),i=bL(t.uri)===`CONTAINER`?`CONTAINER`:t.scope??`RUN`;U.set(t.uri,{...t,scope:i},{addLabels:[`media`]}),e&&(n=!0,r.push(t.uri))}let i=[...t];for(let e of r){let t=OL.get(e);t&&(OL.delete(e),i.push(...t.values()))}for(let e of i){let{mediaUri:t,handleUri:r,relation:i}=e,a=[t,r].filter(e=>!U.has(e));if(a.length){for(let t of a)kL(t,e);continue}let o=i??`SAME_AS`,s=bL(t);if(s!==bL(r)){let[e,i]=s===`RUN`?[t,r]:[r,t];U.edge(e,i,_L.PART_OF),U.edge(e,i,vL)&&(n=!0)}else o===`SAME_AS`?(U.connect(t,r,s===`CONTAINER`?_L.CONTAINER:_L.RUN),U.link(t,r,xL(s))&&(n=!0)):(U.edge(t,r,_L.PART_OF),U.edge(t,r,vL)&&(n=!0))}n&&QI(`media:changed`,{})}function jL(e){let t=!1;for(let[n,r]of e)bL(n)===`CONTAINER`||bL(r)===`CONTAINER`||U.link(n,r,uL)&&(t=!0);return t&&QI(`media:changed`,{}),t}function ML(e){let t=!1;for(let[n,r]of e)bL(n)!==`CONTAINER`||bL(r)!==`CONTAINER`||U.link(n,r,dL)&&(t=!0);return t&&QI(`media:changed`,{}),t}function NL(e){let t=!1;for(let[n,r]of e)bL(n)!==`RUN`||bL(r)!==`CONTAINER`||U.edge(n,r,vL)&&(t=!0);return t&&QI(`media:changed`,{}),t}async function PL(e){let t=U.resolve(e);return U.labeled(`media`).has(t)?U.cluster(t,xL(bL(t))):[]}function FL(e){let t=new Set,n=new Set(e.map(e=>e.uri)),r=[];for(let i of e)for(let e of U.targets(i.uri,vL)){let i=U.cluster(e,xL(bL(e)));if(!i.some(e=>n.has(e.uri)))for(let e of i)t.has(e.uri)||(t.add(e.uri),r.push(e))}return r}function IL(e){let t=new Set,n=[];for(let r of e)for(let e of U.sources(r.uri,vL)){if(!U.has(e)||bL(e)!==`RUN`)continue;let r=U.cluster(e,uL),i=wL(r);t.has(i)||(t.add(i),n.push(r))}return n}const LL=e=>Math.min(...e.map(e=>{let t=e.startDate?Date.parse(e.startDate):NaN;return Number.isNaN(t)?1/0:t}));function RL(e){if(e.some(SL))return e;let t=IL(e);return t.length?t.sort((e,t)=>LL(e)-LL(t)||CL(wL(e),wL(t)))[0]:e}async function zL(e){let t=await PL(e);if(!t.length&&ZS(e)){let n=$S(e);for(let e of n?.handleUris??[]){let n=await PL(e);if(n.length){if(n.some(SL)){t=n;break}t.length||(t=n)}}}return RL(t)}async function BL(e){let t=e?void 0:`media`,n=U.clusters(uL,t,e).filter(e=>e.some(SL)),r=new Set(n.flatMap(e=>e.map(e=>e.uri))),i=U.clusters(dL,t,e).map(e=>e.filter(e=>!SL(e)&&!r.has(e.uri))).filter(e=>e.length>0);return[...n,...i]}function VL(e){let t=new Set;for(let n of e)if(n.some(SL))for(let e of FL(n))t.add(e.uri);return e.filter(e=>e.some(SL)||!e.some(e=>t.has(e.uri)))}async function HL(e,t){for(let t of e)U.set(t.uri,t,{addLabels:[`episode`]}),U.edge(t.mediaUri,t.uri,hL);for(let{episodeUri:e,handleUri:n,relation:r}of t)(r??`SAME_AS`)===`SAME_AS`?U.link(e,n,mL):U.edge(e,n,`episode:part_of`);QI(`episode:changed`,{})}async function UL(e){let t=await WL(e.map(e=>e.uri)),n=lL(e,t.flat());return t.map(t=>cL(e,t.map(e=>n.get(e.uri)??e))).filter(e=>e.length)}async function WL(e){let t=new Set,n=[];for(let r of e)for(let e of U.targets(r,hL))if(!t.has(e)){t.add(e);let r=U.get(e);r&&n.push(r)}let r=new Set,i=[];for(let e of n){if(r.has(e.uri))continue;let t=U.cluster(e.uri,mL);for(let e of t)r.add(e.uri);i.push(t)}return GL(i)}const GL=e=>{let t=new Map,n=[];for(let r of e){let e=r.map(e=>e.episodeNumber).find(e=>typeof e==`number`&&Number.isInteger(e)&&e>0);if(e==null){n.push(r);continue}let i=t.get(e);if(i)i.push(...r);else{let i=[...r];t.set(e,i),n.push(i)}}return n};async function KL(e){for(let t of e){let e=yL.get(t.id);yL.set(t.id,e?XI(t,e):t)}QI(`origin:changed`,{})}async function qL(e){return yL.get(e)??null}async function JL(e,t){let n;return n=e.length>0?e.map(e=>yL.get(e)).filter(e=>e!=null):[...yL.values()].sort((e,t)=>e.name.localeCompare(t.name)),t?.length&&(n=n.filter(e=>t.every(t=>t===`IS_API_ONLY`?e.isApiOnly:!e.isApiOnly))),n}let YL=function(e){return e.HOME=`HOME`,e.MEDIA=`MEDIA`,e.MEDIA_EPISODE=`MEDIA_EPISODE`,e.SEARCH=`SEARCH`,e.SEARCH_LEGACY=`SEARCH_LEGACY`,e.LEGAL=`LEGAL`,e.PRIVACY=`PRIVACY`,e.SETTINGS=`SETTINGS`,e.WATCH=`WATCH`,e.PARTY=`PARTY`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({});const XL={HOME:()=>`/`,MEDIA:({uri:e})=>`/media/${e}`,MEDIA_EPISODE:({uri:e,mediaUri:t})=>`/media/${e}/${t}`,SEARCH:()=>`/search`,SEARCH_LEGACY:({query:e})=>`/search/${encodeURIComponent(e)}`,LEGAL:()=>`/legal`,PRIVACY:()=>`/privacy`,SETTINGS:()=>`/settings`,WATCH:({mediaUri:e,episodeUri:t,sourceUri:n})=>`/watch/${e}/${t}${n?`/${n}`:``}`,PARTY:()=>`/party`,LOGIN_CALLBACK:()=>`/login/callback`},ZL=(e,t)=>XL[e](t),QL=e=>{let t=[];e.includes(`ANIME`)&&t.push(`ANIME`);let n=e.find(e=>e===`MOVIE`||e===`SERIES`);return n&&t.push(n),t};function $L(e){return[...e].sort((e,t)=>(t.score??-1)-(e.score??-1))}const eR=e=>{let t=e.find(e=>e.season);return{season:t?.season??null,seasonYear:(t?t.seasonYear:e.find(e=>e.seasonYear!==null)?.seasonYear)??null}},tR=e=>{let t=new Set,n=[];for(let r of e??[]){let e=r.toLowerCase();!r||t.has(e)||(t.add(e),n.push(r))}return n};function nR(e,t){let n=new Set,r=[];for(let i of t)n.has(i[e])||(n.add(i[e]),r.push(i));return r}const rR=e=>({node:e,relation:`SAME_AS`}),iR=e=>({node:e,relation:`PART_OF`}),aR=e=>({node:e,relation:`SAME_AS`}),oR=e=>(e??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node.uri),sR=new WeakMap;function cR(e){if(sR.has(e))return sR.get(e);let t=e.handles?[e,...e.handles.flatMap(t=>t?.node?t.relation===`PART_OF`?[{...t.node,handles:[]}]:cR(t.node):(console.warn(`a handle of ${e.uri} names no node and was skipped`),[]))]:[e];return e.handles&&sR.set(e,t),t}function lR(e){return{_id:e.uri,uri:e.uri,origin:e.origin,id:e.id,url:e.url,score:e.score,type:e.type,categories:e.categories??[],status:e.status,titles:e.titles??[],descriptions:e.descriptions??[],shortDescriptions:e.shortDescriptions??[],trailers:e.trailers??[],covers:e.covers??[],banners:e.banners??[],averageScore:e.averageScore,popularity:e.popularity,startDate:e.startDate,endDate:e.endDate,isAdult:e.isAdult,episodeCount:e.episodeCount,nextAiringEpisode:e.nextAiringEpisode,season:e.season,seasonYear:e.seasonYear,genres:e.genres??[],tags:e.tags??[],scope:e.scope,episodes:[],handles:[],relations:(e.relations??[]).map(uR),franchise:e.franchise??null}}function uR(e){return{relation:e.relation,format:e.format,node:{_id:e.uri,uri:e.uri,origin:e.origin,id:e.id,url:e.url,score:null,type:null,categories:[],status:e.status,titles:e.titles??[],descriptions:[],shortDescriptions:[],trailers:[],covers:e.covers??[],banners:[],averageScore:null,popularity:null,startDate:e.startDate,endDate:null,isAdult:null,episodeCount:e.episodeCount,nextAiringEpisode:null,season:null,seasonYear:null,genres:[],tags:[],scope:`RUN`,episodes:[],handles:[],relations:[]}}}function dR(e,t){let n=new Set(t.map(e=>e.uri)),r=new Set,i=[];for(let t of e){if(!t?.node?.uri||n.has(t.node.uri))continue;let e=`${t.relation}\u0000${t.node.uri}`;r.has(e)||(r.add(e),i.push(t))}return i}const fR=e=>e.every(e=>e.scope===`CONTAINER`)?`CONTAINER`:`RUN`;function pR(e){return{_id:e.uri,uri:e.uri,origin:e.origin,id:e.id,url:e.url,embedUrl:e.embedUrl,mediaUri:e.mediaUri,score:e.score,titles:e.titles??[],descriptions:e.descriptions??[],shortDescriptions:e.shortDescriptions??[],thumbnails:e.thumbnails??[],releaseDate:e.releaseDate,seasonNumber:e.seasonNumber,episodeNumber:e.episodeNumber,absoluteEpisodeNumber:e.absoluteEpisodeNumber,runtime:e.runtime,handles:[]}}const mR=(e,t)=>U.componentId(e[0],gL[t]);function hR(e){let t=e.filter(JS),n=[...t.length?t:e].sort();return{uri:`ag:(${n.join(`,`)})`,id:`(${n.join(`,`)})`}}function gR(e,t){if(e.length===0)throw Error(`Cannot aggregate empty cluster`);if(e.length===1){let t=e[0],n=mR([t.uri],fR(e));return{...lR(t),_id:n,scope:fR(e),handles:[rR(lR(t)),...FL(e).map(e=>iR(lR(e)))]}}let n=[...e].sort((e,t)=>(t.score??0)-(e.score??0)),{uri:r,id:i}=hR(e.map(e=>e.uri)),a=mR(e.map(e=>e.uri),fR(e)),o=n.reduce((e,t)=>{let n=lR(t);return{...n,...e,url:e.url??n.url,type:e.type??n.type,status:e.status??n.status,averageScore:e.averageScore??n.averageScore,popularity:e.popularity??n.popularity,startDate:e.startDate??n.startDate,endDate:e.endDate??n.endDate,isAdult:e.isAdult??n.isAdult,episodeCount:e.episodeCount??n.episodeCount,nextAiringEpisode:e.nextAiringEpisode??n.nextAiringEpisode,categories:[...e.categories??[],...n.categories??[]],genres:[...e.genres??[],...n.genres??[]],tags:[...e.tags??[],...n.tags??[]],titles:[...e.titles??[],...t.titles??[]],descriptions:[...e.descriptions??[],...t.descriptions??[]],shortDescriptions:[...e.shortDescriptions??[],...t.shortDescriptions??[]],covers:[...e.covers??[],...t.covers??[]],banners:[...e.banners??[],...t.banners??[]],trailers:[...e.trailers??[],...t.trailers??[]],relations:[...e.relations??[],...n.relations??[]],franchise:e.franchise??n.franchise}},{_id:a,uri:r,id:i,origin:`ag`,url:`${t}/${ZL(YL.MEDIA,{uri:r}).replace(/^\//,``)}`,score:Math.max(...e.map(e=>e.score??0)),scope:fR(e),handles:[...n.map(e=>rR(lR(e))),...FL(e).map(e=>iR(lR(e)))],episodes:[]});return{...o,episodeCount:aL(e)??o.episodeCount??null,relations:dR(o.relations??[],e),categories:QL(o.categories??[]),...eR(n),genres:tR(o.genres),tags:tR(o.tags),titles:nR(`title`,$L(o.titles??[])),descriptions:$L(o.descriptions??[]),shortDescriptions:$L(o.shortDescriptions??[]),covers:$L(o.covers??[]),banners:$L(o.banners??[]),trailers:nR(`uri`,o.trailers??[])}}function _R(e,t){if(e.length===0)throw Error(`Cannot aggregate empty cluster`);if(e.length===1){let t=e[0];return{...pR(t),_id:mR([t.uri],`EPISODE`),handles:[aR(pR(t))]}}let n=[...e].sort((e,t)=>(t.score??0)-(e.score??0)),{uri:r,id:i}=hR(e.map(e=>e.uri)),a=mR(e.map(e=>e.uri),`EPISODE`),o=n.reduce((e,t)=>{let n=pR(t);return{...n,...e,url:e.url??n.url,embedUrl:e.embedUrl??n.embedUrl,releaseDate:e.releaseDate??n.releaseDate,seasonNumber:e.seasonNumber??n.seasonNumber,episodeNumber:e.episodeNumber??n.episodeNumber,absoluteEpisodeNumber:e.absoluteEpisodeNumber??n.absoluteEpisodeNumber,runtime:e.runtime??n.runtime,titles:[...e.titles??[],...t.titles??[]],descriptions:[...e.descriptions??[],...t.descriptions??[]],shortDescriptions:[...e.shortDescriptions??[],...t.shortDescriptions??[]],thumbnails:[...e.thumbnails??[],...t.thumbnails??[]]}},{_id:a,uri:r,id:i,origin:`ag`,url:`${t}/${ZL(YL.MEDIA,{uri:r}).replace(/^\//,``)}`,mediaUri:r,score:Math.max(...e.map(e=>e.score??0)),handles:n.map(e=>aR(pR(e)))});return{...o,titles:nR(`title`,$L(o.titles??[])),descriptions:$L(o.descriptions??[]),shortDescriptions:$L(o.shortDescriptions??[]),thumbnails:$L(o.thumbnails??[])}}const vR=e=>({uri:e.uri,origin:e.origin,id:e.id,url:e.url??null,score:e.score??null,type:e.type??null,categories:e.categories??[],status:e.status??null,titles:e.titles??[],descriptions:e.descriptions??[],shortDescriptions:e.shortDescriptions??[],trailers:e.trailers??[],covers:e.covers??[],banners:e.banners??[],averageScore:e.averageScore??null,popularity:e.popularity??null,startDate:e.startDate??null,endDate:e.endDate??null,isAdult:e.isAdult??null,episodeCount:e.episodeCount??null,nextAiringEpisode:e.nextAiringEpisode??null,season:e.season??null,seasonYear:e.seasonYear??null,genres:e.genres??[],tags:e.tags??[],scope:e.scope??`RUN`,relations:(e.relations??[]).flatMap(e=>{let t=e?.node;return t?.uri?[{relation:e.relation,format:e.format??null,uri:t.uri,origin:t.origin,id:t.id,url:t.url??null,titles:t.titles??[],covers:t.covers??[],status:t.status??null,episodeCount:t.episodeCount??null,startDate:t.startDate??null}]:[]}),franchise:e.franchise?{nodes:(e.franchise.nodes??[]).map(e=>({uri:e.uri,titles:e.titles??[],covers:e.covers??[],format:e.format??null,status:e.status??null,episodeCount:e.episodeCount??null,startDate:e.startDate??null})),edges:(e.franchise.edges??[]).map(e=>({from:e.from,to:e.to,relation:e.relation}))}:null}),yR=/^[a-z0-9][a-z0-9-]{0,31}$/,bR=(e,t)=>{let n=Array.isArray(e.sources)&&e.sources.length?e.sources:[e],r=[],i=[],a=new Set;for(let e of n){let n=typeof e.origin==`string`?e.origin:``;if(!yR.test(n)){i.push({origin:n||`(none)`,reason:`origin must be a short lowercase token`});continue}if(a.has(n)){i.push({origin:n,reason:`declared twice by '${t}'`});continue}a.add(n),r.push({source:e,meta:{origin:n,originUrl:typeof e.originUrl==`string`?e.originUrl:``,name:typeof e.name==`string`&&e.name?e.name.slice(0,64):n,icon:typeof e.icon==`string`?e.icon:null,color:typeof e.color==`string`?e.color:null,isApiOnly:e.isApiOnly===!0,metadataOnly:e.metadataOnly===!0}})}return{sources:r,rejected:i}},xR=e=>typeof e==`object`&&!!e,SR=e=>{if(xR(e)){if(typeof e.uri==`string`)return e;if(typeof e.origin==`string`&&typeof e.id==`string`)return{...e,uri:`${e.origin}:${e.id}`}}},CR=(e,t)=>{if(xR(e)&&`node`in e)return xR(e.node)?{...e,node:TR(e.node,t),relation:typeof e.relation==`string`?e.relation:`SAME_AS`}:void 0;let n=SR(e);return n?{node:TR(n,t),relation:`SAME_AS`}:void 0},wR=(e,t)=>Array.isArray(e)&&t>0?e.map(e=>CR(e,t-1)).filter(e=>e!==void 0):[],TR=(e,t=4)=>{if(!xR(e))return e;let n=Array.isArray(e.episodes)?e.episodes.map(e=>xR(e)?{...e,handles:wR(e.handles,1)}:e):e.episodes;return{...e,handles:wR(e.handles,t),episodes:n}},ER=(e,t)=>{if(!xR(t))return t;if(e===`mediaPage`){let e=t.mediaPage?.nodes;return Array.isArray(e)?{...t,mediaPage:{...t.mediaPage,nodes:e.map(e=>TR(e))}}:t}return t[e]?{...t,[e]:TR(t[e])}:t};let DR={};const OR=e=>{DR=e??{}},kR=e=>({uri:e.uri,origin:e.origin,id:e.id,url:e.url??null,embedUrl:e.embedUrl??null,mediaUri:e.mediaUri,score:e.score??null,titles:e.titles??[],descriptions:e.descriptions??[],shortDescriptions:e.shortDescriptions??[],thumbnails:e.thumbnails??[],releaseDate:e.releaseDate??null,seasonNumber:e.seasonNumber??null,episodeNumber:e.episodeNumber??null,absoluteEpisodeNumber:e.absoluteEpisodeNumber??null,runtime:e.runtime??null}),AR=e=>({id:e.id,url:e.url??null,name:e.name,icon:e.icon??null,color:e.color??null,isApiOnly:e.isApiOnly}),jR=async e=>{let t=await PL(e);if(!t.length&&ZS(e)){let n=$S(e);for(let e of n?.handleUris??[])if(t=await PL(e),t.length)break}if(t.length)return gR(t,location.origin)},MR=async function*(e,t){yield await jR(e.uri);let n=nL([`media:changed`,`episode:changed`],{abortSignal:t?.abortSignal});for await(let t of n)yield await jR(e.uri)},NR=new yx.default(async e=>{let t=e.flatMap(cR),n=[],r=new Set;for(let e of t)for(let t of e.handles??[]){if(!t?.node)continue;let i=`${e.uri}\0${t.node.uri}\0${t.relation}`;r.has(i)||(r.add(i),n.push({mediaUri:e.uri,handleUri:t.node.uri,relation:t.relation}))}return await AL(t.map(vR),n),e},{cache:!1,batch:!0,maxBatchSize:250,batchScheduleFn:e=>setTimeout(e,50)}),PR=new yx.default(async e=>{let t=[];for(let n of e)for(let e of n.handles??[])e?.node&&t.push({episodeUri:n.uri,handleUri:e.node.uri,relation:e.relation});return await HL(e.map(kR),t),e},{cache:!1,batch:!0,maxBatchSize:250,batchScheduleFn:e=>setTimeout(e,50)}),FR=new yx.default(async e=>(await KL(e.map(e=>AR({...e,url:e.url??null,icon:e.icon??null,color:e.color??null}))),e),{cache:!1,batch:!0,maxBatchSize:50,batchScheduleFn:e=>setTimeout(e,50)}),IR=3e4,LR=/^[A-Za-z0-9._~-]{1,128}$/,RR=new Map,zR=new Map,BR=(e,t)=>new Promise(n=>{let r=!1,i,a=e=>{r||(r=!0,clearTimeout(o),queueMicrotask(()=>{try{i?.unsubscribe()}catch{}}),n(e))},o=setTimeout(()=>a({kind:`timeout`}),IR);try{i=e.client.subscription(`
1126
- subscription SimilarMedia($input: SimilarMediaInput!) {
1127
- similarMedia(input: $input) {
1128
- uri
1129
- origin
1130
- id
1131
- url
1132
- scope
1133
- titles { language title score }
1134
- episodes {
1135
- uri
1136
- origin
1137
- id
1138
- url
1139
- embedUrl
1140
- mediaUri
1141
- score
1142
- titles { language title score }
1143
- descriptions { language description score }
1144
- shortDescriptions { language shortDescription score }
1145
- thumbnails { url width height language color score }
1146
- releaseDate
1147
- seasonNumber
1148
- episodeNumber
1149
- absoluteEpisodeNumber
1150
- runtime
1151
- }
1152
- }
1153
- }
1154
- `,{input:t}).subscribe(e=>{if(e.error)return a({kind:`error`});if(!e.data)return;let t=e.data.similarMedia;a(t?{kind:`media`,media:t}:{kind:`null`})})}catch(t){console.error(Error(`Extractor ${e.name} failed to answer similarMedia`,{cause:t})),a({kind:`error`})}}),VR=e=>GR.some(t=>t.extractor.origin===e&&!!t.extractor.resolvers.Subscription?.similarMedia),HR=e=>async(t,n)=>{if(!t||!n?.showId||!sD(n))return console.warn(`similarMedia: declined ${ED(t)} ${ED(n?.showId)} to '${e}' (no-evidence)`),{outcome:`declined`,reason:`no-evidence`};let r=hk(n);r&&(n={...n,context:dk(r,e)});let{showId:i}=n;if(!LR.test(i))return console.warn(`similarMedia: declined ${t} ${ED(i)} to '${e}' (bad-show-id)`),{outcome:`declined`,reason:`bad-show-id`};let a=VR(t)?GR.find(e=>e.extractor.origin===t):void 0;if(!a)return console.warn(`similarMedia: declined ${t} ${i} to '${e}' (not-implemented)`),{outcome:`declined`,reason:`not-implemented`};let o=kD(t,i,n),s=RR.get(o);if(s)return console.warn(`similarMedia: joined ${t} ${i} by '${e}' (in flight with the same evidence)`),s;let c=zR.get(e)??0;if(c>=8||RR.size>=32)return console.warn(`similarMedia: declined ${t} ${i} to '${e}' (ceiling ${c}/8 by caller, ${RR.size}/32 global)`),{outcome:`declined`,reason:`ceiling`};zR.set(e,c+1),console.warn(`similarMedia: asked ${t} ${i} by '${e}' with ${TD(n)}`);let l=BR(a,n).then(n=>n.kind===`media`?gD(t,i,n.media)?(console.warn(`similarMedia: answered ${n.media.uri} to '${e}' for ${t} ${i}`),{outcome:`answered`,media:n.media}):(console.warn(`similarMedia: refused ${t} ${i} to '${e}' (not-a-run ${n.media.uri} scope ${n.media.scope??`RUN`})`),{outcome:`refused`,reason:`not-a-run`}):n.kind===`null`?(console.warn(`similarMedia: refused ${t} ${i} to '${e}' (null)`),{outcome:`refused`,reason:`null`}):n.kind===`timeout`?(console.warn(`similarMedia: declined ${t} ${i} to '${e}' (timeout ${IR}ms)`),{outcome:`declined`,reason:`timeout`}):(console.warn(`similarMedia: declined ${t} ${i} to '${e}' (error)`),{outcome:`declined`,reason:`error`})).finally(()=>{RR.delete(o);let t=(zR.get(e)??1)-1;t>0?zR.set(e,t):zR.delete(e)});return RR.set(o,l),l},UR=e=>{let t=HR(e);return async(e,n)=>{let r=await t(e,n);return r.outcome===`answered`?r.media:void 0}},WR=e=>{let t=AR({...e,id:e.origin,url:e.originUrl,icon:e.icon??null,color:e.color??null}),n=fp({schema:Ol({typeDefs:Hv,resolvers:LI({Media:{_id:e=>e.uri,handles:e=>e.handles??[],relations:e=>e.relations??[],categories:e=>e.categories??[],genres:e=>e.genres??[],tags:e=>e.tags??[],titles:e=>e.titles??[],descriptions:e=>e.descriptions??[],shortDescriptions:e=>e.shortDescriptions??[],covers:e=>e.covers??[],banners:e=>e.banners??[],trailers:e=>e.trailers??[],episodes:e=>e.episodes??[]},Episode:{_id:e=>e.uri,handles:e=>e.handles??[],descriptions:e=>e.descriptions??[],shortDescriptions:e=>e.shortDescriptions??[]},Query:{},Mutation:{},Subscription:{origin:{resolve:()=>t,subscribe:async function*(){return yield t}},originPage:{resolve:()=>({nodes:[t]}),subscribe:async function*(){yield[t]}},media:{subscribe:async function*(e){yield{media:null}}},mediaPage:{subscribe:async function*(e){yield{mediaPage:{nodes:[]}}}},similarMedia:{subscribe:async function*(e){yield{similarMedia:null}}}}},e.resolvers)}),plugins:[wy({session:()=>null,ttl:900*1e3}),{onPluginInit:({addPlugin:e})=>{e(Gv(({info:e})=>async({result:t})=>{zt(e.returnType).name===`Media`?Array.isArray(t)?await NR.loadMany(t):t&&await NR.load(t):zt(e.returnType).name===`Episode`?Array.isArray(t)?await PR.loadMany(t):t&&await PR.load(t):zt(e.returnType).name===`Origin`&&(Array.isArray(t)?await FR.loadMany(t):t&&await FR.load(t))}))}}],maskedErrors:{maskError(t,n,r){return console.error(`Server Extractor ${e.name} GQLError occurred:`,t),new b(t.message)}}}),r=new vx({url:`http://d/graphql`,exchanges:[({forward:t})=>n=>Ob(t(n),db(t=>{t.error&&(t.error.networkError&&console.error(Error(`Client Extractor ${e.name} Network error on ${Xb(t.operation.query)}:`,{cause:t.error.networkError})),t.error.graphQLErrors?.length&&t.error.graphQLErrors.forEach(n=>{console.error(Error(`Client Extractor ${e.name} GraphQL error on ${Xb(t.operation.query)}:`,{cause:n}))}))})),hx],fetchSubscriptions:!0,fetch:async(t,r)=>n.handleRequest(new Request(t,r),{fetch:KI,key:e=>DR[e],findAggregatedMedia:e=>jR(e),listenForMediaChanges:MR,similarMedia:UR(e.origin)})});return{name:e.name,server:n,client:r,extractor:e,pluginUri:void 0}},GR=Object.values(FI).map(WR),KR=(e,t,n)=>{if(t===`media`||t===`similarMedia`)return n?.[t]&&n[t].origin!==e?(console.warn(`Plugin source '${e}' yielded media from origin '${n[t].origin}', dropped`),{[t]:null}):n;let r=n?.mediaPage?.nodes;if(!Array.isArray(r))return n;let i=r.filter(t=>t?.origin===e?!0:(console.warn(`Plugin source '${e}' yielded media from origin '${t?.origin}', dropped`),!1));return{...n,mediaPage:{...n.mediaPage,nodes:i}}},qR=(e,t)=>{let n=t.resolvers?.Subscription,r=t=>({subscribe:async function*(r,i){let a=n?.[t]?.subscribe;if(a)for await(let n of await a(void 0,i,{similarMedia:UR(e)}))yield KR(e,t,ER(t,n))}});return{Query:{},Mutation:{},Subscription:{...n?.media?.subscribe?{media:r(`media`)}:{},...n?.mediaPage?.subscribe?{mediaPage:r(`mediaPage`)}:{},...n?.similarMedia?.subscribe?{similarMedia:r(`similarMedia`)}:{}}}},JR=new Map,YR=e=>{let t=JR.get(e);return t?{pluginUri:t.pluginUri}:null},XR=async(e,t)=>{let n=JR.get(e);return n?await n.select(t)??null:null},ZR=new Map,QR=e=>{let t=ZR.get(e);return t?{pluginUri:t}:null},$R=async(e,t)=>{let{sources:n,rejected:r}=bR(await FS(e),t);ez(t);let i=[],a=[...r];for(let{meta:e,source:r}of n)try{if(GR.some(t=>t.extractor.origin===e.origin))throw Error(`origin '${e.origin}' is already registered by another source`);let n=WR({...e,resolvers:qR(e.origin,r)});n.pluginUri=t,GR.push(n);let a=r.selectRelease;typeof a==`function`&&JR.set(e.origin,{pluginUri:t,select:a}),typeof r.play==`function`&&ZR.set(e.origin,t);for(let e of tz)nz(e,n);i.push({origin:e.origin,name:e.name})}catch(n){let r=n instanceof Error?n.message:String(n);console.error(Error(`plugin '${t}': source '${e.origin}' failed to register`,{cause:n})),a.push({origin:e.origin,reason:r})}for(let e of a)console.warn(`plugin '${t}': skipped source '${e.origin}' (${e.reason})`);if(!i.length){let e=a.map(e=>`${e.origin}: ${e.reason}`).join(`; `);throw Error(`plugin '${t}': no source could be registered${e?` (${e})`:``}`)}return{sources:i,rejected:a}},ez=e=>{for(let[t,n]of JR)n.pluginUri===e&&JR.delete(t);for(let[t,n]of ZR)n===e&&ZR.delete(t);for(let t=GR.length-1;t>=0;--t){let n=GR[t];if(n.pluginUri===e){GR.splice(t,1);for(let e of tz)rz(e,n)}}},tz=new Set,nz=(e,t)=>{if(e.joined.has(t))return;let n;try{n=t.client.subscription(e.query,_k(e.variables??{},e.root)).subscribe(n=>{if(e.extractUris)try{for(let t of e.extractUris(n)??[])e.insertedUris.add(t)}catch(e){console.error(Error(`Extractor ${t.name} produced an unreadable fan-out result`,{cause:e}))}})}catch(e){console.error(Error(`Extractor ${t.name} failed to join the fan-out`,{cause:e}));return}e.joined.set(t,n),e.subscriptions.push(n)},rz=(e,t)=>{let n=e.joined.get(t);if(!n)return;e.joined.delete(t);let r=e.subscriptions.indexOf(n);r!==-1&&e.subscriptions.splice(r,1),Promise.resolve(n.unsubscribe()).catch(()=>{})},iz=(e,t,n)=>{let r=uk(t),i={query:e.params.query,variables:e.params.variables,insertedUris:new Set,extractUris:n,subscriptions:[],joined:new Map,root:r};for(let e of GR)nz(i,e);return tz.add(i),{subscriptions:i.subscriptions,insertedUris:i.insertedUris,askOrigins:(e,t)=>{for(let n of GR){let r=n.extractor;if(zI(r,e))try{i.subscriptions.push(n.client.subscription(i.query,_k(t??{},i.root)).subscribe(()=>{}))}catch(e){console.error(Error(`Extractor ${n.name} failed to re-join the fan-out`,{cause:e}))}}},root:r,close:()=>{tz.delete(i),mk(r.rootId)}}},az=new Map,oz=e=>{for(;e.mergedInto;)e=e.mergedInto;return e},sz=(e,t)=>{let n=az.get(e);n||(n=[],az.set(e,n));let r=n.filter(e=>t.some(t=>e.members.has(t.uri)));if(!r.length){let e={members:new Set(t.map(e=>e.uri)),fingerprints:new Set,refusedTitles:new Set,asks:0,settled:!1,skipLogged:!1};return n.push(e),e}let[i,...a]=r;for(let e of a){for(let t of e.members)i.members.add(t);for(let t of e.fingerprints)i.fingerprints.add(t);for(let t of e.refusedTitles)i.refusedTitles.add(t);i.asks+=e.asks,i.settled=i.settled||e.settled,i.driver=i.driver??e.driver,i.latest=i.latest??e.latest,e.mergedInto=i,n.splice(n.indexOf(e),1)}for(let e of t)i.members.add(e.uri);return a.length&&console.warn(`similarMedia: consumer merged ${r.length} records under ${e} (${i.members.size} members)`),i},cz=e=>[...new Set(e)],lz=(e,t)=>({fingerprint:kD(e.origin,e.showId,t),titles:[...t.titles??[]].sort().join(``),evidence:t,ask:e}),uz=(e,t)=>e.fingerprints.has(t.fingerprint)||e.refusedTitles.has(t.titles),dz=(e,t,n)=>{let r=e.filter(e=>e.scope!==`CONTAINER`);if(!r.length)return[];let i=r.map(e=>e.uri).sort()[0],a=new Set(e.map(e=>e.origin)),o=[],s=new Set;for(let e of t)s.has(e.uri)||(s.add(e.uri),n(e.origin)&&(a.has(e.origin)||o.push({runUri:i,origin:e.origin,showId:e.id,containerUri:e.uri})));return o},fz=(e,t)=>e.score==null?t.score==null?0:1:t.score==null?-1:t.score-e.score,pz=(e,t)=>{let n=[...e].sort(fz);return{titles:cz(n.flatMap(e=>(e.titles??[]).map(e=>e.title))).filter(e=>!Sw(e)),startDate:hD(n.map(e=>e.startDate)),episodeCount:aL(e)??void 0,episodeTitles:cz(t).slice(0,200)}},mz=async(e,t,n)=>{if(e.driver){let{ask:t}=e.latest;console.warn(`similarMedia: consumer deferred ${t.origin} ${t.showId} for ${t.runUri} (an ask is in flight; asked when it settles if still new)`);return}let r=Symbol(`similarMedia consumer driver`);e.driver=r;let i=e;try{for(;;){if(i=oz(i),i.driver??=r,i.driver!==r||i.settled||!i.latest||uz(i,i.latest))return;let e=i.latest,{evidence:a,ask:o}=e;if(i.asks>=4){i.settled=!0,console.warn(`similarMedia: consumer settled ${o.origin} ${o.showId} for ${o.runUri} (cap 4 reached)`);return}i.asks+=1,console.warn(`similarMedia: consumer asked ${o.origin} ${o.showId} for ${o.runUri} (ask ${i.asks} of 4) with ${TD(a)}`);let s=await n.ask(o.origin,{showId:o.showId,context:t,startDate:a.startDate??void 0,titles:a.titles?[...a.titles]:void 0,episodeCount:a.episodeCount??void 0,episodeTitles:a.episodeTitles?[...a.episodeTitles]:void 0});if(i=oz(i),i.settled){console.warn(`similarMedia: consumer dropped ${o.origin} ${o.showId} for ${o.runUri} (the pair settled while the ask was in flight)`);return}if(s.outcome===`declined`){console.warn(`similarMedia: consumer declined ${o.origin} ${o.showId} for ${o.runUri} (${s.reason}); retries on the next read`);return}if(s.outcome===`refused`){i.fingerprints.add(e.fingerprint),console.warn(`similarMedia: consumer refused ${o.origin} ${o.showId} for ${o.runUri} (${s.reason}); re-asks on new evidence`);continue}let c=(await PL(o.runUri)).find(e=>e.origin===o.origin&&e.scope!==`CONTAINER`);if(c){i.settled=!0,c.uri===s.media.uri?console.warn(`similarMedia: consumer settled ${o.origin} ${o.showId} for ${o.runUri} (${c.uri} is already the cluster's ${o.origin} run)`):console.warn(`similarMedia: consumer refused-by-origin ${s.media.uri} for ${o.runUri} (${c.uri} is already the cluster's ${o.origin} run)`);return}let l=a.titles??[],u=(s.media.titles??[]).map(e=>e.title),d=await OD(l,u);if(!d.ok){i.refusedTitles.add(e.titles),console.warn(`similarMedia: consumer refused-by-title ${s.media.uri} for ${o.runUri} (best ${d.score.toFixed(3)} of ${l.length} run titles against ${u.length} answer titles, threshold ${DD}); re-asks on a new title`);continue}i.settled=!0,await AL([],[{mediaUri:o.runUri,handleUri:s.media.uri,relation:`SAME_AS`}]),console.warn(`similarMedia: consumer claimed ${s.media.uri} as SAME_AS of ${o.runUri}`);return}}catch(e){console.error(Error(`similarMedia consumer failed`,{cause:e}))}finally{for(let t=e;t;t=t.mergedInto)t.driver===r&&(t.driver=void 0)}},hz=async(e,t,n)=>{try{if(!gk({context:t}).crossSource)return;let r=dz(e,FL(e),n.implemented);if(!r.length)return;let i=await WL(e.map(e=>e.uri)),a=pz(e,i.flat().flatMap(e=>(e.titles??[]).map(e=>e.title)));if(!sD(a))return;await Promise.all(r.map(r=>{let i=sz(r.containerUri,e);if(!i.settled){if(!a.titles?.length){i.skipLogged||(i.skipLogged=!0,console.warn(`similarMedia: consumer skipped ${r.origin} ${r.showId} for ${r.runUri} (no run titles to verify the show against)`));return}return i.latest=lz(r,a),mz(i,t,n)}}))}catch(e){console.error(Error(`similarMedia consumer failed`,{cause:e}))}},gz=e=>new Set((e??[]).map(e=>e.toLowerCase())),_z=(e,t)=>{let n=t.categories??[],r=t.formats??[],i=gz(t.genres),a=gz(t.tags),{status:o,season:s,seasonYear:c}=t;return e.filter(e=>{if(n.length&&!(e.categories??[]).some(e=>n.includes(e))||r.length&&!(e.type&&r.includes(e.type))||o&&e.status!==o||s&&e.season!==s||c&&e.seasonYear!==c)return!1;if(i.size){let t=gz(e.genres);for(let e of i)if(!t.has(e))return!1}if(a.size){let t=gz(e.tags);for(let e of a)if(!t.has(e))return!1}return!0})},vz=.9,yz=new Set([`TV`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`]),bz=e=>e===`TV_SHORT`?`TV`:e,xz=[`specials`,`special`,`picture drama`,`recap`,`ova`,`ona`,`bonus`,`mini anime`,`episode 0`,`trailer`],Sz=e=>Vw(e).replace(/\b(?:the|a|an)\b/g,` `).replace(/\s+/g,` `).trim(),Cz=/\p{L}/u,wz=e=>Cz.test(e)&&!Sw(e),Tz=(e,t)=>e<t?-1:+(e>t),Ez=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.getUTCFullYear()},Dz=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())||t.getUTCDate()===1?null:Math.floor(t.getTime()/864e5)},Oz=(e,t)=>{for(let[n,r]of[[e,t],[t,e]])for(let e of n)for(let t of xz)if(!(e.length<=t.length+1||!e.endsWith(` ${t}`))&&r.includes(e.slice(0,-(t.length+1)).trim()))return!0;return!1},kz=e=>[...e].sort(Tz),Az=e=>{let t=new Map;for(let n of e)for(let{title:e,score:r}of n.titles??[]){let n=Sz(e);if(!wz(n))continue;let i=r??-1,a=t.get(n);(a===void 0||i>a)&&t.set(n,i)}let n=new Map;for(let[e,r]of t){let t=n.get(r);t?t.push(e):n.set(r,[e])}return[...n].sort(([e],[t])=>t-e).flatMap(([,e])=>kz(e)).slice(0,6)},jz=e=>{let t=e.map(e=>e.uri).sort()[0],n=e.every(e=>e.scope===`CONTAINER`)?`CONTAINER`:`RUN`,r=e.filter(e=>(e.scope===`CONTAINER`?`CONTAINER`:`RUN`)===n).map(e=>e.uri).sort()[0]??t,i=Az(e),a=new Set(e.map(e=>Ez(e.startDate)).filter(e=>e!==null)),o=new Set(e.map(e=>Dz(e.startDate)).filter(e=>e!==null)),s=new Set(e.flatMap(e=>{let t=bz(e.type);return t===`SPECIAL`||t===`OVA`||t===`ONA`?[]:[...e.categories??[],...t===`MOVIE`?[`MOVIE`]:t===`TV`?[`SERIES`]:[]]}).filter(e=>e===`MOVIE`||e===`SERIES`)),c=new Set(e.map(e=>bz(e.type)).filter(e=>e!==null&&yz.has(e))),l=new Set(e.flatMap(e=>e.titles??[]).map(({title:e})=>Cw(e)).filter(e=>e!==void 0));return{cluster:e,key:t,scope:n,linkUri:r,titles:i,years:a,days:o,formats:s,types:c,seasons:l,cacheKey:`${t}#${[...i].sort(Tz).join(`,`)}#${[...s].sort(Tz).join(`,`)}#${[...l].sort((e,t)=>e-t).join(`,`)}#${[...o].sort((e,t)=>e-t).join(`,`)}#${[...c].sort(Tz).join(`,`)}`}},Mz=(e,t)=>{let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);let r=0;for(let e of t){let t=n.get(e)??0;t>0&&(n.set(e,t-1),r++)}return r/Math.max(e.length,t.length)},Nz=e=>{let t=/^(.*?)\s*(\d+)$/.exec(e);return t?{stem:t[1],value:Number(t[2])}:{stem:e,value:null}},Pz=(e,t)=>{let n=Nz(e),r=Nz(t);return n.value!==r.value&&n.stem===r.stem},Fz=async(e,t)=>{if(e.formats.size&&t.formats.size&&![...e.formats].some(e=>t.formats.has(e))||e.seasons.size&&t.seasons.size&&![...e.seasons].some(e=>t.seasons.has(e))||e.days.size&&t.days.size&&![...e.days].some(e=>[...t.days].some(t=>Math.abs(e-t)<=45))||e.types.size&&t.types.size&&![...e.types].some(e=>t.types.has(e))&&Oz(e.titles,t.titles))return!1;for(let n of e.titles)for(let e of t.titles)if(n===e||!Pz(n,e)&&!(Mz(n,e)<vz)&&await $w(n,e)>=vz)return!0;return!1},Iz=(e,t)=>e.cacheKey<t.cacheKey?`${e.cacheKey}|${t.cacheKey}`:`${t.cacheKey}|${e.cacheKey}`,Lz=new Map,Rz=async(e,t)=>{let n=Iz(e,t),r=Lz.get(n);if(r!==void 0)return r;let i=await Fz(e,t);return Lz.set(n,i),i},zz=async e=>{let t=e.filter(e=>e.length).map(jz),n=new Map;for(let e of t)if(e.titles.length)for(let t of e.years){let r=n.get(t);r?r.push(e):n.set(t,[e])}Lz.size>5e4&&Lz.clear();let r=[],i=new Set;for(let e of n.values())for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let a=e[t],o=e[n],s=Iz(a,o);i.has(s)||(i.add(s),await Rz(a,o)&&r.push(a.linkUri<o.linkUri?[a.linkUri,o.linkUri]:[o.linkUri,a.linkUri]))}r.sort(([e,t],[n,r])=>Tz(e,n)||Tz(t,r));let a=!1;for(let[e,t]of r){let n=await PL(e),r=await PL(t);if(!n.length||!r.length)continue;let i=jz(n),o=jz(r);if(i.key!==o.key&&await Rz(i,o))if(i.scope!==o.scope){let[e,t]=i.scope===`RUN`?[i.linkUri,o.linkUri]:[o.linkUri,i.linkUri];NL([[e,t]])&&(a=!0)}else i.scope===`CONTAINER`?ML([[e,t]])&&(a=!0):jL([[e,t]])&&(a=!0)}return a};function Bz(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Vz=Bz();function Hz(e){Vz=e}var Uz={exec:()=>null};function W(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Gz.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Wz=(()=>{try{return!0}catch{return!1}})(),Gz={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Kz=/^(?:[ \t]*(?:\n|$))+/,qz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yz=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zz=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qz=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$z=W(Qz).replace(/bull/g,Zz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),eB=W(Qz).replace(/bull/g,Zz).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),tB=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nB=/^[^\n]+/,rB=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,iB=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,rB).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),aB=W(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zz).getRegex(),oB=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,sB=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cB=W(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,sB).replace(`tag`,oB).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lB=W(tB).replace(`hr`,Yz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oB).getRegex(),uB={blockquote:W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,lB).getRegex(),code:qz,def:iB,fences:Jz,heading:Xz,hr:Yz,html:cB,lheading:$z,list:aB,newline:Kz,paragraph:lB,table:Uz,text:nB},dB=W(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Yz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oB).getRegex(),fB={...uB,lheading:eB,table:dB,paragraph:W(tB).replace(`hr`,Yz).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,dB).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,oB).getRegex()},pB={...uB,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,sB).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Uz,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(tB).replace(`hr`,Yz).replace(`heading`,` *#{1,6} *[^
1155
- ]`).replace(`lheading`,$z).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},mB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gB=/^( {2,}|\\)\n(?!\s*$)/,_B=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vB=/[\p{P}\p{S}]/u,yB=/[\s\p{P}\p{S}]/u,bB=/[^\s\p{P}\p{S}]/u,xB=W(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,yB).getRegex(),SB=/(?!~)[\p{P}\p{S}]/u,CB=/(?!~)[\s\p{P}\p{S}]/u,wB=/(?:[^\s\p{P}\p{S}]|~)/u,TB=W(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Wz?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),EB=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,DB=W(EB,`u`).replace(/punct/g,vB).getRegex(),OB=W(EB,`u`).replace(/punct/g,SB).getRegex(),kB=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,AB=W(kB,`gu`).replace(/notPunctSpace/g,bB).replace(/punctSpace/g,yB).replace(/punct/g,vB).getRegex(),jB=W(kB,`gu`).replace(/notPunctSpace/g,wB).replace(/punctSpace/g,CB).replace(/punct/g,SB).getRegex(),MB=W(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,bB).replace(/punctSpace/g,yB).replace(/punct/g,vB).getRegex(),NB=W(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,vB).getRegex(),PB=W(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,bB).replace(/punctSpace/g,yB).replace(/punct/g,vB).getRegex(),FB=W(/\\(punct)/,`gu`).replace(/punct/g,vB).getRegex(),IB=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),LB=W(sB).replace(`(?:-->|$)`,`-->`).getRegex(),RB=W(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,LB).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zB=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,BB=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,zB).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),VB=W(/^!?\[(label)\]\[(ref)\]/).replace(`label`,zB).replace(`ref`,rB).getRegex(),HB=W(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,rB).getRegex(),UB=W(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,VB).replace(`nolink`,HB).getRegex(),WB=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,GB={_backpedal:Uz,anyPunctuation:FB,autolink:IB,blockSkip:TB,br:gB,code:hB,del:Uz,delLDelim:Uz,delRDelim:Uz,emStrongLDelim:DB,emStrongRDelimAst:AB,emStrongRDelimUnd:MB,escape:mB,link:BB,nolink:HB,punctuation:xB,reflink:VB,reflinkSearch:UB,tag:RB,text:_B,url:Uz},KB={...GB,link:W(/^!?\[(label)\]\((.*?)\)/).replace(`label`,zB).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,zB).getRegex()},qB={...GB,emStrongRDelimAst:jB,emStrongLDelim:OB,delLDelim:NB,delRDelim:PB,url:W(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,WB).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:W(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,WB).getRegex()},JB={...qB,br:W(gB).replace(`{2,}`,`*`).getRegex(),text:W(qB.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},YB={normal:uB,gfm:fB,pedantic:pB},XB={normal:GB,gfm:qB,breaks:JB,pedantic:KB},ZB={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},QB=e=>ZB[e];function $B(e,t){if(t){if(Gz.escapeTest.test(e))return e.replace(Gz.escapeReplace,QB)}else if(Gz.escapeTestNoEncode.test(e))return e.replace(Gz.escapeReplaceNoEncode,QB);return e}function eV(e){try{e=encodeURI(e).replace(Gz.percentDecode,`%`)}catch{return null}return e}function tV(e,t){let n=e.replace(Gz.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Gz.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Gz.slashPipe,`|`);return n}function nV(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function rV(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function iV(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function aV(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function oV(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
1156
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
1157
- `)}var sV=class{options;rules;lexer;constructor(e){this.options=e||Vz}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:nV(e,`
1158
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=oV(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=nV(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:nV(t[0],`
1159
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=nV(t[0],`
1160
- `).split(`
1161
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
1162
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
1163
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
1164
- ${s}`:s,r=r?`${r}
1165
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
1166
- `+e.join(`
1167
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
1168
- `+e.join(`
1169
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
1170
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=iV(t[2].split(`
1171
- `,1)[0],t[1].length),l=e.split(`
1172
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
1173
- `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
1174
- `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
1175
- `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
1176
- `+l}u=!l.trim(),r+=p+`
1177
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=tV(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
1178
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(tV(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
1179
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=nV(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=rV(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),aV(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return aV(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},cV=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Vz,this.options.tokenizer=this.options.tokenizer||new sV,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Gz,block:YB.normal,inline:XB.normal};this.options.pedantic?(t.block=YB.pedantic,t.inline=XB.pedantic):this.options.gfm&&(t.block=YB.gfm,this.options.breaks?t.inline=XB.breaks:t.inline=XB.gfm),this.tokenizer.rules=t}static get rules(){return{block:YB,inline:XB}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Gz.carriageReturn,`
1180
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Gz.tabCharGlobal,` `).replace(Gz.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
1181
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
1182
- `)?``:`
1183
- `)+r.raw,n.text+=`
1184
- `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
1185
- `)?``:`
1186
- `)+r.raw,n.text+=`
1187
- `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
1188
- `)?``:`
1189
- `)+r.raw,a.text+=`
1190
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
1191
- `)?``:`
1192
- `)+r.raw,n.text+=`
1193
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},lV=class{options;parser;constructor(e){this.options=e||Vz}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Gz.notSpaceStart)?.[0],i=e.replace(Gz.endingNewline,``)+`
1194
- `;return r?`<pre><code class="language-`+$B(r)+`">`+(n?i:$B(i,!0))+`</code></pre>
1195
- `:`<pre><code>`+(n?i:$B(i,!0))+`</code></pre>
1196
- `}blockquote({tokens:e}){return`<blockquote>
1197
- ${this.parser.parse(e)}</blockquote>
1198
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
1199
- `}hr(e){return`<hr>
1200
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
1201
- `+r+`</`+i+`>
1202
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
1203
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
1204
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
1205
- <thead>
1206
- `+t+`</thead>
1207
- `+r+`</table>
1208
- `}tablerow({text:e}){return`<tr>
1209
- ${e}</tr>
1210
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
1211
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${$B(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=eV(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+$B(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=eV(e);if(i===null)return $B(n);e=i;let a=`<img src="${e}" alt="${$B(n)}"`;return t&&(a+=` title="${$B(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:$B(e.text)}},uV=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},dV=class e{options;renderer;textRenderer;constructor(e){this.options=e||Vz,this.options.renderer=this.options.renderer||new lV,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new uV}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},fV=class{options;block;constructor(e){this.options=e||Vz}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?cV.lex:cV.lexInline}provideParser(){return this.block?dV.parse:dV.parseInline}},pV=new class{defaults=Bz();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=dV;Renderer=lV;TextRenderer=uV;Lexer=cV;Tokenizer=sV;Hooks=fV;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new lV(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new sV(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fV;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];fV.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&fV.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return cV.lex(e,t??this.defaults)}parser(e,t){return dV.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?cV.lex:cV.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?dV.parse:dV.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?cV.lex:cV.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?dV.parse:dV.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
1212
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+$B(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function mV(e,t){return pV.parse(e,t)}mV.options=mV.setOptions=function(e){return pV.setOptions(e),mV.defaults=pV.defaults,Hz(mV.defaults),mV},mV.getDefaults=Bz,mV.defaults=Vz,mV.use=function(...e){return pV.use(...e),mV.defaults=pV.defaults,Hz(mV.defaults),mV},mV.walkTokens=function(e,t){return pV.walkTokens(e,t)},mV.parseInline=pV.parseInline,mV.Parser=dV,mV.parser=dV.parse,mV.Renderer=lV,mV.TextRenderer=uV,mV.Lexer=cV,mV.lexer=cV.lex,mV.Tokenizer=sV,mV.Hooks=fV,mV.parse=mV,mV.options,mV.setOptions,mV.use,mV.walkTokens,mV.parseInline,dV.parse,cV.lex;
1213
- /*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
1214
- function hV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gV(e){if(Array.isArray(e))return e}function _V(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function vV(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1215
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yV(e,t){return gV(e)||_V(e,t)||bV(e,t)||vV()}function bV(e,t){if(e){if(typeof e==`string`)return hV(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hV(e,t):void 0}}const xV=Object.entries,SV=Object.setPrototypeOf,CV=Object.isFrozen,wV=Object.getPrototypeOf,TV=Object.getOwnPropertyDescriptor;let EV=Object.freeze,DV=Object.seal,OV=Object.create,kV=typeof Reflect<`u`&&Reflect,AV=kV.apply,jV=kV.construct;EV||=function(e){return e},DV||=function(e){return e},AV||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},jV||=function(e){return new e(...[...arguments].slice(1))};const MV=QV(Array.prototype.forEach),NV=QV(Array.prototype.lastIndexOf),PV=QV(Array.prototype.pop),FV=QV(Array.prototype.push),IV=QV(Array.prototype.splice),LV=Array.isArray,RV=QV(String.prototype.toLowerCase),zV=QV(String.prototype.toString),BV=QV(String.prototype.match),VV=QV(String.prototype.replace),HV=QV(String.prototype.indexOf),UV=QV(String.prototype.trim),WV=QV(Number.prototype.toString),GV=QV(Boolean.prototype.toString),KV=typeof BigInt>`u`?null:QV(BigInt.prototype.toString),qV=typeof Symbol>`u`?null:QV(Symbol.prototype.toString),JV=QV(Object.prototype.hasOwnProperty),YV=QV(Object.prototype.toString),XV=QV(RegExp.prototype.test),ZV=$V(TypeError);function QV(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return AV(e,t,n)}}function $V(e){return function(){return jV(e,[...arguments])}}function eH(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:RV;if(SV&&SV(e,null),!LV(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(CV(t)||(t[r]=e),i=e)}e[i]=!0}return e}function tH(e){for(let t=0;t<e.length;t++)JV(e,t)||(e[t]=null);return e}function nH(e){let t=OV(null);for(let r of xV(e)){var n=yV(r,2);let i=n[0],a=n[1];JV(e,i)&&(LV(a)?t[i]=tH(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=nH(a):t[i]=a)}return t}function rH(e){switch(typeof e){case`string`:return e;case`number`:return WV(e);case`boolean`:return GV(e);case`bigint`:return KV?KV(e):`0`;case`symbol`:return qV?qV(e):`Symbol()`;case`undefined`:return YV(e);case`function`:case`object`:{if(e===null)return YV(e);let t=e,n=iH(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:YV(e)}return YV(e)}default:return YV(e)}}function iH(e,t){for(;e!==null;){let n=TV(e,t);if(n){if(n.get)return QV(n.get);if(typeof n.value==`function`)return QV(n.value)}e=wV(e)}function n(){return null}return n}function aH(e){try{return XV(e,``),!0}catch{return!1}}const oH=EV(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),sH=EV(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),cH=EV([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),lH=EV([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),uH=EV(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),dH=EV([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),fH=EV([`#text`]),pH=EV(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),mH=EV(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),hH=EV(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),gH=EV([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),_H=DV(/{{[\w\W]*|^[\w\W]*}}/g),vH=DV(/<%[\w\W]*|^[\w\W]*%>/g),yH=DV(/\${[\w\W]*/g),bH=DV(/^data-[\-\w.\u00B7-\uFFFF]+$/),xH=DV(/^aria-[\-\w]+$/),SH=DV(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CH=DV(/^(?:\w+script|data):/i),wH=DV(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TH=DV(/^html$/i),EH=DV(/^[a-z][.\w]*(-[.\w]+)+$/i),DH=DV(/<[/\w!]/g),OH=DV(/<[/\w]/g),kH=DV(/<\/no(script|embed|frames)/i),AH=DV(/\/>/i),jH={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},MH=function(){return typeof window>`u`?null:window},NH=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},PH=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},FH=function(e,t,n,r){return JV(e,t)&&LV(e[t])?eH(r.base?nH(r.base):{},e[t],r.transform):n};function IH(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MH(),t=e=>IH(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==jH.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=iH(d,`cloneNode`),p=iH(d,`remove`),m=iH(d,`nextSibling`),h=iH(d,`childNodes`),g=iH(d,`parentNode`),_=iH(d,`shadowRoot`),ee=iH(d,`attributes`),v=o&&o.prototype?iH(o.prototype,`nodeType`):null,y=o&&o.prototype?iH(o.prototype,`nodeName`):null,te=o&&o.prototype?iH(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,ne=``,x,re=!1,ie=0,ae=function(){if(ie>0)throw ZV(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},oe=function(e){ae(),ie++;try{return b.createHTML(e)}finally{ie--}},se=function(e){ae(),ie++;try{return b.createScriptURL(e)}finally{ie--}},ce=function(){return re||=(x=NH(u,i),!0),x},S=n,C=S.implementation,le=S.createNodeIterator,ue=S.createDocumentFragment,de=S.getElementsByTagName,fe=r.importNode,pe=PH();t.isSupported=typeof xV==`function`&&typeof g==`function`&&C&&C.createHTMLDocument!==void 0;let me=_H,he=vH,ge=yH,w=bH,_e=xH,ve=CH,ye=wH,be=EH,xe=SH,Se=null,Ce=eH({},[...oH,...sH,...cH,...uH,...fH]),T=null,we=eH({},[...pH,...mH,...hH,...gH]),Te=Object.seal(OV(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,De=null,Oe=Object.seal(OV(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ke=!0,Ae=!0,je=!1,Me=!0,Ne=!1,Pe=!0,Fe=!1,E=!1,Ie=null,Le=null,Re=!1,ze=!1,Be=!1,Ve=!1,He=!0,Ue=!1,We=`user-content-`,Ge=!0,Ke=!1,qe={},Je=null,Ye=eH({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Xe=null,Ze=eH({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Qe=null,$e=eH({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),et=`http://www.w3.org/1998/Math/MathML`,tt=`http://www.w3.org/2000/svg`,nt=`http://www.w3.org/1999/xhtml`,rt=nt,it=!1,at=null,ot=eH({},[et,tt,nt],zV),st=EV([`mi`,`mo`,`mn`,`ms`,`mtext`]),ct=eH({},st),lt=EV([`annotation-xml`]),ut=eH({},lt),dt=eH({},[`title`,`style`,`font`,`a`,`script`]),ft=null,pt=[`application/xhtml+xml`,`text/html`],mt=null,ht=null,gt=n.createElement(`form`),D=function(e){return e instanceof RegExp||e instanceof Function},_t=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ht&&ht===e)return;(!e||typeof e!=`object`)&&(e={}),e=nH(e),ft=pt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,mt=ft===`application/xhtml+xml`?zV:RV,Se=FH(e,`ALLOWED_TAGS`,Ce,{transform:mt}),T=FH(e,`ALLOWED_ATTR`,we,{transform:mt}),at=FH(e,`ALLOWED_NAMESPACES`,ot,{transform:zV}),Qe=FH(e,`ADD_URI_SAFE_ATTR`,$e,{transform:mt,base:$e}),Xe=FH(e,`ADD_DATA_URI_TAGS`,Ze,{transform:mt,base:Ze}),Je=FH(e,`FORBID_CONTENTS`,Ye,{transform:mt}),Ee=FH(e,`FORBID_TAGS`,nH({}),{transform:mt}),De=FH(e,`FORBID_ATTR`,nH({}),{transform:mt}),qe=JV(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?nH(e.USE_PROFILES):e.USE_PROFILES:!1,ke=e.ALLOW_ARIA_ATTR!==!1,Ae=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=e.SAFE_FOR_TEMPLATES||!1,Pe=e.SAFE_FOR_XML!==!1,Fe=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,He=e.SANITIZE_DOM!==!1,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,Ke=e.IN_PLACE||!1,xe=aH(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:SH,rt=typeof e.NAMESPACE==`string`?e.NAMESPACE:nt,ct=JV(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?nH(e.MATHML_TEXT_INTEGRATION_POINTS):eH({},st),ut=JV(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?nH(e.HTML_INTEGRATION_POINTS):eH({},lt);let t=JV(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?nH(e.CUSTOM_ELEMENT_HANDLING):OV(null);if(Te=OV(null),JV(t,`tagNameCheck`)&&D(t.tagNameCheck)&&(Te.tagNameCheck=t.tagNameCheck),JV(t,`attributeNameCheck`)&&D(t.attributeNameCheck)&&(Te.attributeNameCheck=t.attributeNameCheck),JV(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),DV(Te),Ne&&(Ae=!1),Be&&(ze=!0),qe&&(Se=eH({},fH),T=OV(null),qe.html===!0&&(eH(Se,oH),eH(T,pH)),qe.svg===!0&&(eH(Se,sH),eH(T,mH),eH(T,gH)),qe.svgFilters===!0&&(eH(Se,cH),eH(T,mH),eH(T,gH)),qe.mathMl===!0&&(eH(Se,uH),eH(T,hH),eH(T,gH))),Oe.tagCheck=null,Oe.attributeCheck=null,JV(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Oe.tagCheck=e.ADD_TAGS:LV(e.ADD_TAGS)&&(Se===Ce&&(Se=nH(Se)),eH(Se,e.ADD_TAGS,mt))),JV(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Oe.attributeCheck=e.ADD_ATTR:LV(e.ADD_ATTR)&&(T===we&&(T=nH(T)),eH(T,e.ADD_ATTR,mt))),JV(e,`ADD_URI_SAFE_ATTR`)&&LV(e.ADD_URI_SAFE_ATTR)&&eH(Qe,e.ADD_URI_SAFE_ATTR,mt),JV(e,`FORBID_CONTENTS`)&&LV(e.FORBID_CONTENTS)&&(Je===Ye&&(Je=nH(Je)),eH(Je,e.FORBID_CONTENTS,mt)),JV(e,`ADD_FORBID_CONTENTS`)&&LV(e.ADD_FORBID_CONTENTS)&&(Je===Ye&&(Je=nH(Je)),eH(Je,e.ADD_FORBID_CONTENTS,mt)),Ge&&(Se[`#text`]=!0),Fe&&eH(Se,[`html`,`head`,`body`]),Se.table&&(eH(Se,[`tbody`]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ZV(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ZV(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=b;b=e.TRUSTED_TYPES_POLICY;try{ne=oe(``)}catch(e){throw b=t,e}}else e.TRUSTED_TYPES_POLICY===null?(b=void 0,ne=``):(b===void 0&&(b=ce()),b&&typeof ne==`string`&&(ne=oe(``)));EV&&EV(e),ht=e},O=eH({},[...sH,...cH,...lH]),vt=eH({},[...uH,...dH]),yt=function(e,t,n){return t.namespaceURI===nt?e===`svg`:t.namespaceURI===et?e===`svg`&&(n===`annotation-xml`||ct[n]):!!O[e]},bt=function(e,t,n){return t.namespaceURI===nt?e===`math`:t.namespaceURI===tt?e===`math`&&ut[n]:!!vt[e]},xt=function(e,t,n){return t.namespaceURI===tt&&!ut[n]||t.namespaceURI===et&&!ct[n]?!1:!vt[e]&&(dt[e]||!O[e])},St=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:rt,tagName:`template`});let n=RV(e.tagName),r=RV(t.tagName);return at[e.namespaceURI]?e.namespaceURI===tt?yt(n,t,r):e.namespaceURI===et?bt(n,t,r):e.namespaceURI===nt?xt(n,t,r):!!(ft===`application/xhtml+xml`&&at[e.namespaceURI]):!1},Ct=function(e){FV(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw ZV(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},wt=function(e){Tt(e);let t=h(e);if(t){let e=[];MV(t,t=>{FV(e,t)}),MV(e,e=>{try{p(e)}catch{}})}let n=ee(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},k=function(e,n){try{FV(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{FV(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ze||Be)try{Ct(n)}catch{}else try{n.setAttribute(e,``)}catch{}},A=function(e){let t=ee(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||T[mt(i)]))try{e.removeAttribute(i)}catch{}}},Tt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(v?v(e):e.nodeType)===jH.element&&A(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Et=function(e){if(!Pe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=v?v(e):e.nodeType;if(n===jH.processingInstruction||n===jH.comment&&XV(OH,e.data)){try{p(e)}catch{}continue}if(n===jH.element){let t=e,n=mt(y?y(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Dt=function(e){let t=null,r=null;if(Re)e=`<remove></remove>`+e;else{let t=BV(e,/^[\r\n\t ]+/);r=t&&t[0]}ft===`application/xhtml+xml`&&rt===nt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?oe(e):e;if(rt===nt)try{t=new l().parseFromString(i,ft)}catch{}if(!t||!t.documentElement){t=C.createDocument(rt,`template`,null);try{t.documentElement.innerHTML=it?ne:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),rt===nt?de.call(t,Fe?`html`:`body`)[0]:Fe?t.documentElement:a},Ot=function(e){let t=te?te(e):e.ownerDocument;return le.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},j=function(e){return e=VV(e,me,` `),e=VV(e,he,` `),e=VV(e,ge,` `),e},kt=function(e){e.normalize();let t=te?te(e):e.ownerDocument,n=le.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=j(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&MV(i,e=>{jt(e.content)&&kt(e.content)})},At=function(e){let t=y?y(e):null;return typeof t!=`string`||mt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ee(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==v(e)||e.childNodes!==h(e)},jt=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return v(e)===jH.documentFragment}catch{return!1}},Mt=function(e){if(!v||typeof e!=`object`||!e)return!1;try{return typeof v(e)==`number`}catch{return!1}};function Nt(e,n,r){e.length!==0&&MV(e,e=>{e.call(t,n,r,ht)})}let Pt=function(e,t){return!!(Pe&&e.hasChildNodes()&&!Mt(e.firstElementChild)&&XV(DH,e.textContent)&&XV(DH,e.innerHTML)||Pe&&e.namespaceURI===nt&&t===`style`&&Mt(e.firstElementChild)||e.nodeType===jH.processingInstruction||Pe&&e.nodeType===jH.comment&&XV(OH,e.data))},M=function(e,t,n){if(!Ee[t]&&zt(t)&&(Te.tagNameCheck instanceof RegExp&&XV(Te.tagNameCheck,t)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(t)))return!1;if(Ge&&!Je[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return Ct(e),!0},Ft=function(e,t,n,r){return e.length===0?t:t===n||t===r?nH(t):t},It=function(e,n){if(Nt(pe.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return Ke&&Tt(e),!0;if(At(e))return Ct(e),!0;let r=mt(y?y(e):e.nodeName);if(Se=Ft(pe.uponSanitizeElement,Se,Ce,Ie),Nt(pe.uponSanitizeElement,e,{tagName:r,allowedTags:Se}),e!==n&&g(e)===null)return Ke&&Tt(e),!0;if(Pt(e,r))return Ct(e),!0;if(Ee[r]||!(Oe.tagCheck instanceof Function&&Oe.tagCheck(r))&&!Se[r]){let t=M(e,r,n);return t===!1&&Nt(pe.afterSanitizeElements,e,null),t}if((v?v(e):e.nodeType)===jH.element&&!St(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&XV(kH,e.innerHTML))return Ct(e),!0;if(Ne&&e.nodeType===jH.text){let n=j(e.textContent);e.textContent!==n&&(FV(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Nt(pe.afterSanitizeElements,e,null),!1},Lt=function(e,t,r){if(De[t]||Pe&&t===`patchsrc`||Pe&&t===`for`&&e!==`label`&&e!==`output`||He&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;let i=T[t]||Oe.attributeCheck instanceof Function&&Oe.attributeCheck(t,e);if(!(Ae&&XV(w,t))&&!(ke&&XV(_e,t))){if(!i){if(!(zt(e)&&(Te.tagNameCheck instanceof RegExp&&XV(Te.tagNameCheck,e)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(e))&&(Te.attributeNameCheck instanceof RegExp&&XV(Te.attributeNameCheck,t)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(t,e))||t===`is`&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&XV(Te.tagNameCheck,r)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(r))))return!1}else if(!Qe[t]&&!XV(xe,VV(r,ye,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&HV(r,`data:`)===0&&Xe[e])&&!(je&&!XV(ve,VV(r,ye,``)))&&r)return!1}return!0},Rt=eH({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),zt=function(e){return!Rt[RV(e)]&&XV(be,e)},Bt=function(e,t,n,r){if(b&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return oe(r);case`TrustedScriptURL`:return se(r)}return r},Vt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),At(e)?Ct(e):PV(t.removed)}catch{k(n,e)}},Ht=function(e){Nt(pe.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||At(e))return;T=Ft(pe.uponSanitizeAttribute,T,we,Le);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},r=t.length,i=mt(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=mt(o),u=c,d=o===`value`?u:UV(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,Nt(pe.uponSanitizeAttribute,e,n),d=n.attrValue,Ue&&(l===`id`||l===`name`)&&HV(d,We)!==0&&(k(o,e),d=We+d),Pe&&XV(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){k(o,e);continue}if(l===`attributename`&&BV(d,`href`)){k(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){k(o,e);continue}if(!Me&&XV(AH,d)){k(o,e);continue}if(Ne&&(d=j(d)),!Lt(i,l,d)){k(o,e);continue}d=Bt(i,l,s,d),d!==u&&Vt(e,o,s,d)}}Nt(pe.afterSanitizeAttributes,e,null)},Ut=function(e){let t=null,n=Ot(e);for(Nt(pe.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Nt(pe.uponSanitizeShadowNode,t,null),It(t,e),Ht(t),jt(t.content)&&Ut(t.content),(v?v(t):t.nodeType)===jH.element){let e=_(t);jt(e)&&(Wt(e),Ut(e))}Nt(pe.afterSanitizeShadowDOM,e,null)},Wt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ut(e.shadow);continue}let n=e.node,r=(v?v(n):n.nodeType)===jH.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=y?y(n):null;if(typeof e==`string`&&mt(e)===`template`){let e=n.content;jt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);jt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(it=!e,it&&(e=`<!-->`),typeof e!=`string`&&!Mt(e)&&(e=rH(e),typeof e!=`string`))throw ZV(`dirty is not a string, aborting`);if(!t.isSupported)return e;E?(Se=Ie,T=Le):_t(n),(pe.uponSanitizeElement.length>0||pe.uponSanitizeAttribute.length>0)&&(Se=nH(Se)),pe.uponSanitizeAttribute.length>0&&(T=nH(T)),t.removed=[];let c=Ke&&typeof e!=`string`&&Mt(e);if(c){Et(e);let t=y?y(e):e.nodeName;if(typeof t==`string`){let n=mt(t);if(!Se[n]||Ee[n])throw wt(e),ZV(`root node is forbidden and cannot be sanitized in-place`)}if(At(e))throw wt(e),ZV(`root node is clobbered and cannot be sanitized in-place`);try{Wt(e)}catch(t){throw wt(e),t}}else if(Mt(e))i=Dt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===jH.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Wt(a);else{if(!ze&&!Ne&&!Fe&&e.indexOf(`<`)===-1)return b&&Ve?oe(e):e;if(i=Dt(e),!i)return ze?null:Ve?ne:``}i&&Re&&Ct(i.firstChild);let l=c?e:i;try{let e=Ot(l);for(;o=e.nextNode();)It(o,l),Ht(o),jt(o.content)&&Ut(o.content)}catch(n){throw c&&(wt(e),MV(t.removed,e=>{e.element&&Tt(e.element)})),n}if(c)return MV(t.removed,e=>{e.element&&Tt(e.element)}),Ne&&kt(e),e;if(ze){if(Ne&&kt(i),Be)for(s=ue.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(T.shadowroot||T.shadowrootmode)&&(s=fe.call(r,s,!0)),s}let u=Fe?i.outerHTML:i.innerHTML;return Fe&&Se[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&XV(TH,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
1216
- `+u),Ne&&(u=j(u)),b&&Ve?oe(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(e),E=!0,Ie=Se,Le=T},t.clearConfig=function(){ht=null,E=!1,Ie=null,Le=null,b=x,ne=``},t.isValidAttribute=function(e,t,n){ht||_t({});let r=mt(e),i=mt(t);return Lt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&JV(pe,e)&&FV(pe[e],t)},t.removeHook=function(e,t){if(JV(pe,e)){if(t!==void 0){let n=NV(pe[e],t);return n===-1?void 0:IV(pe[e],n,1)[0]}return PV(pe[e])}},t.removeHooks=function(e){JV(pe,e)&&(pe[e]=[])},t.removeAllHooks=function(){pe=PH()},t}var LH=IH();const RH=Symbol(`changed`),zH=Symbol(`classList`),BH=Symbol(`CustomElements`),VH=Symbol(`content`),HH=Symbol(`dataset`),UH=Symbol(`doctype`),WH=Symbol(`DOMParser`),G=Symbol(`end`),GH=Symbol(`EventTarget`),KH=Symbol(`globals`),qH=Symbol(`image`),JH=Symbol(`mime`),YH=Symbol(`MutationObserver`),K=Symbol(`next`),XH=Symbol(`ownerElement`),ZH=Symbol(`prev`),QH=Symbol(`private`),$H=Symbol(`sheet`),eU=Symbol(`start`),tU=Symbol(`style`),nU=Symbol(`upgrade`),rU=Symbol(`value`),iU=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),aU=String.fromCodePoint??(e=>{let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function oU(e){return e>=55296&&e<=57343||e>1114111?65533:iU.get(e)??e}function sU(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}const cU=sU(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),lU=sU(`AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg`);var uU;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(uU||={});var dU;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(dU||={});function fU(e){return e>=dU.ZERO&&e<=dU.NINE}function pU(e){return e>=dU.UPPER_A&&e<=dU.UPPER_F||e>=dU.LOWER_A&&e<=dU.LOWER_F}function mU(e){return e>=dU.UPPER_A&&e<=dU.UPPER_Z||e>=dU.LOWER_A&&e<=dU.LOWER_Z||fU(e)}function hU(e){return e===dU.EQUALS||mU(e)}var gU;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(gU||={});var _U;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(_U||={});var vU=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=gU.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_U.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=gU.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case gU.EntityStart:return e.charCodeAt(t)===dU.NUM?(this.state=gU.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=gU.NamedEntity,this.stateNamedEntity(e,t));case gU.NumericStart:return this.stateNumericStart(e,t);case gU.NumericDecimal:return this.stateNumericDecimal(e,t);case gU.NumericHex:return this.stateNumericHex(e,t);case gU.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|32)===dU.LOWER_X?(this.state=gU.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=gU.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(fU(n)||pU(n)){let e=n<=dU.NINE?n-dU.ZERO:(n|32)-dU.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(fU(n))this.result=this.result*10+(n-dU.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===dU.SEMI)this.consumed+=1;else if(this.decodeMode===_U.Strict)return 0;return this.emitCodePoint(oU(this.result),this.consumed),this.errors&&(e!==dU.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&uU.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&uU.FLAG13)!==0){let a=(r&uU.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&uU.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&uU.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===dU.SEMI&&i!==0&&(r&uU.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=yU(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===_U.Attribute&&(i===0||hU(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&uU.VALUE_LENGTH)>>14,i!==0){if(a===dU.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==_U.Strict&&(r&uU.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&uU.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(uU.VALUE_LENGTH|uU.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case gU.NamedEntity:return this.result!==0&&(this.decodeMode!==_U.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gU.NumericDecimal:return this.emitNumericEntity(0,2);case gU.NumericHex:return this.emitNumericEntity(0,3);case gU.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gU.EntityStart:return 0}}};function yU(e,t,n,r){let i=(t&uU.BRANCH_LENGTH)>>7,a=t&uU.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var q;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(q||={});var J;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.InSpecialComment=20]=`InSpecialComment`,e[e.InCommentLike=21]=`InCommentLike`,e[e.BeforeSpecialS=22]=`BeforeSpecialS`,e[e.BeforeSpecialT=23]=`BeforeSpecialT`,e[e.SpecialStartSequence=24]=`SpecialStartSequence`,e[e.InSpecialTag=25]=`InSpecialTag`,e[e.InEntity=26]=`InEntity`})(J||={});function bU(e){return e===q.Space||e===q.NewLine||e===q.Tab||e===q.FormFeed||e===q.CarriageReturn}function xU(e){return e===q.Slash||e===q.Gt||bU(e)}function SU(e){return e>=q.LowerA&&e<=q.LowerZ||e>=q.UpperA&&e<=q.UpperZ}var CU;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(CU||={});const wU={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};var TU=class{constructor({xmlMode:e=!1,decodeEntities:t=!0},n){this.cbs=n,this.state=J.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=J.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=t,this.entityDecoder=new vU(e?lU:cU,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=J.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.baseState=J.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===q.Lt||!this.decodeEntities&&this.fastForwardTo(q.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=J.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===q.Amp&&this.startEntity()}stateSpecialStartSequence(e){let t=this.sequenceIndex===this.currentSequence.length;if(!(t?xU(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!t){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=J.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===q.Gt||bU(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.isSpecial=!1,this.sectionStart=t+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===wU.TitleEnd?this.decodeEntities&&e===q.Amp&&this.startEntity():this.fastForwardTo(q.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===q.Lt)}stateCDATASequence(e){e===wU.Cdata[this.sequenceIndex]?++this.sequenceIndex===wU.Cdata.length&&(this.state=J.InCommentLike,this.currentSequence=wU.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=J.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===wU.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=J.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!xU(e):SU(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=J.SpecialStartSequence}stateBeforeTagName(e){if(e===q.ExclamationMark)this.state=J.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===q.Questionmark)this.state=J.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){let t=e|32;this.sectionStart=this.index,this.xmlMode?this.state=J.InTagName:t===wU.ScriptEnd[2]?this.state=J.BeforeSpecialS:t===wU.TitleEnd[2]||t===wU.XmpEnd[2]?this.state=J.BeforeSpecialT:this.state=J.InTagName}else e===q.Slash?this.state=J.BeforeClosingTagName:(this.state=J.Text,this.stateText(e))}stateInTagName(e){xU(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){bU(e)||(e===q.Gt?this.state=J.Text:(this.state=this.isTagStartChar(e)?J.InClosingTagName:J.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===q.Gt||bU(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=J.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.state=J.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===q.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=J.InSpecialTag,this.sequenceIndex=0):this.state=J.Text,this.sectionStart=this.index+1):e===q.Slash?this.state=J.InSelfClosingTag:bU(e)||(this.state=J.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===q.Gt?(this.cbs.onselfclosingtag(this.index),this.state=J.Text,this.sectionStart=this.index+1,this.isSpecial=!1):bU(e)||(this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===q.Eq||xU(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=J.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===q.Eq?this.state=J.BeforeAttributeValue:e===q.Slash||e===q.Gt?(this.cbs.onattribend(CU.NoValue,this.sectionStart),this.sectionStart=-1,this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e)):bU(e)||(this.cbs.onattribend(CU.NoValue,this.sectionStart),this.state=J.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===q.DoubleQuote?(this.state=J.InAttributeValueDq,this.sectionStart=this.index+1):e===q.SingleQuote?(this.state=J.InAttributeValueSq,this.sectionStart=this.index+1):bU(e)||(this.sectionStart=this.index,this.state=J.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===q.DoubleQuote?CU.Double:CU.Single,this.index+1),this.state=J.BeforeAttributeName):this.decodeEntities&&e===q.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,q.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,q.SingleQuote)}stateInAttributeValueNoQuotes(e){bU(e)||e===q.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(CU.Unquoted,this.index),this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===q.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===q.OpeningSquareBracket?(this.state=J.CDATASequence,this.sequenceIndex=0):this.state=e===q.Dash?J.BeforeComment:J.InDeclaration}stateInDeclaration(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=J.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=J.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===q.Dash?(this.state=J.InCommentLike,this.currentSequence=wU.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=J.InDeclaration}stateInSpecialComment(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=J.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){let t=e|32;t===wU.ScriptEnd[3]?this.startSpecial(wU.ScriptEnd,4):t===wU.StyleEnd[3]?this.startSpecial(wU.StyleEnd,4):(this.state=J.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){switch(e|32){case wU.TitleEnd[3]:this.startSpecial(wU.TitleEnd,4);break;case wU.TextareaEnd[3]:this.startSpecial(wU.TextareaEnd,4);break;case wU.XmpEnd[3]:this.startSpecial(wU.XmpEnd,4);break;default:this.state=J.InTagName,this.stateInTagName(e)}}startEntity(){this.baseState=this.state,this.state=J.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?_U.Strict:this.baseState===J.Text||this.baseState===J.InSpecialTag?_U.Legacy:_U.Attribute)}stateInEntity(){let e=this.index-this.offset,t=this.entityDecoder.write(this.buffer,e);if(t>=0)this.state=this.baseState,t===0&&--this.index;else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===q.Amp){this.state=this.baseState,--this.index;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===J.Text||this.state===J.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===J.InAttributeValueDq||this.state===J.InAttributeValueSq||this.state===J.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case J.Text:this.stateText(e);break;case J.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case J.InSpecialTag:this.stateInSpecialTag(e);break;case J.CDATASequence:this.stateCDATASequence(e);break;case J.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case J.InAttributeName:this.stateInAttributeName(e);break;case J.InCommentLike:this.stateInCommentLike(e);break;case J.InSpecialComment:this.stateInSpecialComment(e);break;case J.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case J.InTagName:this.stateInTagName(e);break;case J.InClosingTagName:this.stateInClosingTagName(e);break;case J.BeforeTagName:this.stateBeforeTagName(e);break;case J.AfterAttributeName:this.stateAfterAttributeName(e);break;case J.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case J.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case J.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case J.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case J.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case J.BeforeSpecialT:this.stateBeforeSpecialT(e);break;case J.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case J.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case J.InDeclaration:this.stateInDeclaration(e);break;case J.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case J.BeforeComment:this.stateBeforeComment(e);break;case J.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case J.InEntity:this.stateInEntity();break}this.index++}this.cleanup()}finish(){this.state===J.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===J.InCommentLike?this.currentSequence===wU.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===J.InTagName||this.state===J.BeforeAttributeName||this.state===J.BeforeAttributeValue||this.state===J.AfterAttributeName||this.state===J.InAttributeName||this.state===J.InAttributeValueSq||this.state===J.InAttributeValueDq||this.state===J.InAttributeValueNq||this.state===J.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==J.Text&&this.baseState!==J.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}};const EU=new Set([`input`,`option`,`optgroup`,`select`,`button`,`datalist`,`textarea`]),DU=new Set([`p`]),OU=new Set([`thead`,`tbody`]),kU=new Set([`dd`,`dt`]),AU=new Set([`rt`,`rp`]),jU=new Map([[`tr`,new Set([`tr`,`th`,`td`])],[`th`,new Set([`th`])],[`td`,new Set([`thead`,`th`,`td`])],[`body`,new Set([`head`,`link`,`script`])],[`li`,new Set([`li`])],[`p`,DU],[`h1`,DU],[`h2`,DU],[`h3`,DU],[`h4`,DU],[`h5`,DU],[`h6`,DU],[`select`,EU],[`input`,EU],[`output`,EU],[`button`,EU],[`datalist`,EU],[`textarea`,EU],[`option`,new Set([`option`])],[`optgroup`,new Set([`optgroup`,`option`])],[`dd`,kU],[`dt`,kU],[`address`,DU],[`article`,DU],[`aside`,DU],[`blockquote`,DU],[`details`,DU],[`div`,DU],[`dl`,DU],[`fieldset`,DU],[`figcaption`,DU],[`figure`,DU],[`footer`,DU],[`form`,DU],[`header`,DU],[`hr`,DU],[`main`,DU],[`nav`,DU],[`ol`,DU],[`pre`,DU],[`section`,DU],[`table`,DU],[`ul`,DU],[`rt`,AU],[`rp`,AU],[`tbody`,OU],[`tfoot`,OU]]),MU=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),NU=new Set([`math`,`svg`]),PU=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignobject`,`desc`,`title`]),FU=/\s|\//;var IU=class{constructor(e,t={}){var n,r;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname=``,this.attribname=``,this.attribvalue=``,this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=t.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=t.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=t.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(t.Tokenizer??TU)(this.options,this),this.foreignContext=[!this.htmlMode],(r=(n=this.cbs).onparserinit)==null||r.call(n,this)}ontext(e,t){var n,r;let i=this.getSlice(e,t);this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,i),this.startIndex=t}ontextentity(e,t){var n,r;this.endIndex=t-1,(r=(n=this.cbs).ontext)==null||r.call(n,aU(e)),this.startIndex=t}isVoidElement(e){return this.htmlMode&&MU.has(e)}onopentagname(e,t){this.endIndex=t;let n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)}emitOpenTag(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;let a=this.htmlMode&&jU.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){let e=this.stack.shift();(n=(t=this.cbs).onclosetag)==null||n.call(t,e,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(NU.has(e)?this.foreignContext.unshift(!0):PU.has(e)&&this.foreignContext.unshift(!1))),(i=(r=this.cbs).onopentagname)==null||i.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&=((n=(t=this.cbs).onopentag)==null||n.call(t,this.tagname,this.attribs,e),null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=``}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var n,r,i,a,o,s,c,l;this.endIndex=t;let u=this.getSlice(e,t);if(this.lowerCaseTagNames&&(u=u.toLowerCase()),this.htmlMode&&(NU.has(u)||PU.has(u))&&this.foreignContext.shift(),this.isVoidElement(u))this.htmlMode&&u===`br`&&((a=(i=this.cbs).onopentagname)==null||a.call(i,`br`),(s=(o=this.cbs).onopentag)==null||s.call(o,`br`,{},!0),(l=(c=this.cbs).onclosetag)==null||l.call(c,`br`,!1));else{let e=this.stack.indexOf(u);if(e!==-1)for(let t=0;t<=e;t++){let i=this.stack.shift();(r=(n=this.cbs).onclosetag)==null||r.call(n,i,t!==e)}else this.htmlMode&&u===`p`&&(this.emitOpenTag(`p`),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,n;let r=this.tagname;this.endOpenTag(e),this.stack[0]===r&&((n=(t=this.cbs).onclosetag)==null||n.call(t,r,!e),this.stack.shift())}onattribname(e,t){this.startIndex=e;let n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=aU(e)}onattribend(e,t){var n,r;this.endIndex=t,(r=(n=this.cbs).onattribute)==null||r.call(n,this.attribname,this.attribvalue,e===CU.Double?`"`:e===CU.Single?`'`:e===CU.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=``}getInstructionName(e){let t=e.search(FU),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){var r,i,a,o;this.endIndex=t,(i=(r=this.cbs).oncomment)==null||i.call(r,this.getSlice(e,t-n)),(o=(a=this.cbs).oncommentend)==null||o.call(a),this.startIndex=t+1}oncdata(e,t,n){var r,i,a,o,s,c,l,u,d,f;this.endIndex=t;let p=this.getSlice(e,t-n);!this.htmlMode||this.options.recognizeCDATA?((i=(r=this.cbs).oncdatastart)==null||i.call(r),(o=(a=this.cbs).ontext)==null||o.call(a,p),(c=(s=this.cbs).oncdataend)==null||c.call(s)):((u=(l=this.cbs).oncomment)==null||u.call(l,`[CDATA[${p}]]`),(f=(d=this.cbs).oncommentend)==null||f.call(d)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}(t=(e=this.cbs).onend)==null||t.call(e)}reset(){var e,t,n,r;(t=(e=this.cbs).onreset)==null||t.call(e),this.tokenizer.reset(),this.tagname=``,this.attribname=``,this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(r=(n=this.cbs).onparserinit)==null||r.call(n,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.write() after done!`));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var t,n;if(this.ended){(n=(t=this.cbs).onerror)==null||n.call(t,Error(`.end() after done!`));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}},LU=c({CDATA:()=>qU,Comment:()=>UU,Directive:()=>HU,Doctype:()=>JU,ElementType:()=>RU,Root:()=>BU,Script:()=>WU,Style:()=>GU,Tag:()=>KU,Text:()=>VU,isTag:()=>zU}),RU;(function(e){e.Root=`root`,e.Text=`text`,e.Directive=`directive`,e.Comment=`comment`,e.Script=`script`,e.Style=`style`,e.Tag=`tag`,e.CDATA=`cdata`,e.Doctype=`doctype`})(RU||={});function zU(e){return e.type===RU.Tag||e.type===RU.Script||e.type===RU.Style}const BU=RU.Root,VU=RU.Text,HU=RU.Directive,UU=RU.Comment,WU=RU.Script,GU=RU.Style,KU=RU.Tag,qU=RU.CDATA,JU=RU.Doctype;var YU=class{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return dW(this,e)}},XU=class extends YU{constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}},ZU=class extends XU{constructor(){super(...arguments),this.type=RU.Text}get nodeType(){return 3}},QU=class extends XU{constructor(){super(...arguments),this.type=RU.Comment}get nodeType(){return 8}},$U=class extends XU{constructor(e,t){super(t),this.name=e,this.type=RU.Directive}get nodeType(){return 1}},eW=class extends YU{constructor(e){super(),this.children=e}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}},tW=class extends eW{constructor(){super(...arguments),this.type=RU.CDATA}get nodeType(){return 4}},nW=class extends eW{constructor(){super(...arguments),this.type=RU.Root}get nodeType(){return 9}},rW=class extends eW{constructor(e,t,n=[],r=e===`script`?RU.Script:e===`style`?RU.Style:RU.Tag){super(n),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this[`x-attribsNamespace`]?.[e],prefix:this[`x-attribsPrefix`]?.[e]}))}};function iW(e){return zU(e)}function aW(e){return e.type===RU.CDATA}function oW(e){return e.type===RU.Text}function sW(e){return e.type===RU.Comment}function cW(e){return e.type===RU.Directive}function lW(e){return e.type===RU.Root}function uW(e){return Object.prototype.hasOwnProperty.call(e,`children`)}function dW(e,t=!1){let n;if(oW(e))n=new ZU(e.data);else if(sW(e))n=new QU(e.data);else if(iW(e)){let r=t?fW(e.children):[],i=new rW(e.name,{...e.attribs},r);r.forEach(e=>e.parent=i),e.namespace!=null&&(i.namespace=e.namespace),e[`x-attribsNamespace`]&&(i[`x-attribsNamespace`]={...e[`x-attribsNamespace`]}),e[`x-attribsPrefix`]&&(i[`x-attribsPrefix`]={...e[`x-attribsPrefix`]}),n=i}else if(aW(e)){let r=t?fW(e.children):[],i=new tW(r);r.forEach(e=>e.parent=i),n=i}else if(lW(e)){let r=t?fW(e.children):[],i=new nW(r);r.forEach(e=>e.parent=i),e[`x-mode`]&&(i[`x-mode`]=e[`x-mode`]),n=i}else if(cW(e)){let t=new $U(e.name,e.data);e[`x-name`]!=null&&(t[`x-name`]=e[`x-name`],t[`x-publicId`]=e[`x-publicId`],t[`x-systemId`]=e[`x-systemId`]),n=t}else throw Error(`Not implemented yet: ${e.type}`);return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function fW(e){let t=e.map(e=>dW(e,!0));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}const pW={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};var mW=class{constructor(e,t,n){this.dom=[],this.root=new nW(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof t==`function`&&(n=t,t=pW),typeof e==`object`&&(t=e,e=void 0),this.callback=e??null,this.options=t??pW,this.elementCB=n??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new nW(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;let e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){let n=new rW(e,t,void 0,this.options.xmlMode?RU.Tag:void 0);this.addNode(n),this.tagStack.push(n)}ontext(e){let{lastNode:t}=this;if(t&&t.type===RU.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{let t=new ZU(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===RU.Comment){this.lastNode.data+=e;return}let t=new QU(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){let e=new ZU(``),t=new tW([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){let n=new $U(e,t);this.addNode(n)}handleCallback(e){if(typeof this.callback==`function`)this.callback(e,this.dom);else if(e)throw e}addNode(e){let t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null}};const hW=/["&'<>$\x80-\uFFFF]/g,gW=new Map([[34,`&quot;`],[38,`&amp;`],[39,`&apos;`],[60,`&lt;`],[62,`&gt;`]]),_W=String.prototype.codePointAt==null?(e,t)=>(e.charCodeAt(t)&64512)==55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t):(e,t)=>e.codePointAt(t);function vW(e){let t=``,n=0,r;for(;(r=hW.exec(e))!==null;){let i=r.index,a=e.charCodeAt(i),o=gW.get(a);o===void 0?(t+=`${e.substring(n,i)}&#x${_W(e,i).toString(16)};`,n=hW.lastIndex+=Number((a&64512)==55296)):(t+=e.substring(n,i)+o,n=i+1)}return t+e.substr(n)}function yW(e,t){return function(n){let r,i=0,a=``;for(;r=e.exec(n);)i!==r.index&&(a+=n.substring(i,r.index)),a+=t.get(r[0].charCodeAt(0)),i=r.index+1;return a+n.substring(i)}}const bW=yW(/["&\u00A0]/g,new Map([[34,`&quot;`],[38,`&amp;`],[160,`&nbsp;`]])),xW=yW(/[&<>\u00A0]/g,new Map([[38,`&amp;`],[60,`&lt;`],[62,`&gt;`],[160,`&nbsp;`]])),SW=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),CW=new Map(`definitionURL.attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),wW=new Set([`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`]);function TW(e){return e.replace(/"/g,`&quot;`)}function EW(e,t){if(!e)return;let n=(t.encodeEntities??t.decodeEntities)===!1?TW:t.xmlMode||t.encodeEntities!==`utf8`?vW:bW;return Object.keys(e).map(r=>{let i=e[r]??``;return t.xmlMode===`foreign`&&(r=CW.get(r)??r),!t.emptyAttrs&&!t.xmlMode&&i===``?r:`${r}="${n(i)}"`}).join(` `)}const DW=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function OW(e,t={}){let n=`length`in e?e:[e],r=``;for(let e=0;e<n.length;e++)r+=kW(n[e],t);return r}function kW(e,t){switch(e.type){case BU:return OW(e.children,t);case JU:case HU:return NW(e);case UU:return IW(e);case qU:return FW(e);case WU:case GU:case KU:return MW(e,t);case VU:return PW(e,t)}}const AW=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignObject`,`desc`,`title`]),jW=new Set([`svg`,`math`]);function MW(e,t){t.xmlMode===`foreign`&&(e.name=SW.get(e.name)??e.name,e.parent&&AW.has(e.parent.name)&&(t={...t,xmlMode:!1})),!t.xmlMode&&jW.has(e.name)&&(t={...t,xmlMode:`foreign`});let n=`<${e.name}`,r=EW(e.attribs,t);return r&&(n+=` ${r}`),e.children.length===0&&(t.xmlMode?t.selfClosingTags!==!1:t.selfClosingTags&&DW.has(e.name))?(t.xmlMode||(n+=` `),n+=`/>`):(n+=`>`,e.children.length>0&&(n+=OW(e.children,t)),(t.xmlMode||!DW.has(e.name))&&(n+=`</${e.name}>`)),n}function NW(e){return`<${e.data}>`}function PW(e,t){let n=e.data||``;return(t.encodeEntities??t.decodeEntities)!==!1&&!(!t.xmlMode&&e.parent&&wW.has(e.parent.name))&&(n=t.xmlMode||t.encodeEntities!==`utf8`?vW(n):xW(n)),n}function FW(e){return`<![CDATA[${e.children[0].data}]]>`}function IW(e){return`<!--${e.data}-->`}function LW(e,t){return OW(e,t)}function RW(e,t){return uW(e)?e.children.map(e=>LW(e,t)).join(``):``}function zW(e){return Array.isArray(e)?e.map(zW).join(``):iW(e)?e.name===`br`?`
1217
- `:zW(e.children):aW(e)?zW(e.children):oW(e)?e.data:``}function BW(e){return Array.isArray(e)?e.map(BW).join(``):uW(e)&&!sW(e)?BW(e.children):oW(e)?e.data:``}function VW(e){return Array.isArray(e)?e.map(VW).join(``):uW(e)&&(e.type===RU.Tag||aW(e))?VW(e.children):oW(e)?e.data:``}function HW(e){return uW(e)?e.children:[]}function UW(e){return e.parent||null}function WW(e){let t=UW(e);if(t!=null)return HW(t);let n=[e],{prev:r,next:i}=e;for(;r!=null;)n.unshift(r),{prev:r}=r;for(;i!=null;)n.push(i),{next:i}=i;return n}function GW(e,t){return e.attribs?.[t]}function KW(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function qW(e){return e.name}function JW(e){let{next:t}=e;for(;t!==null&&!iW(t);)({next:t}=t);return t}function YW(e){let{prev:t}=e;for(;t!==null&&!iW(t);)({prev:t}=t);return t}function XW(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){let t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}function ZW(e,t){let n=t.prev=e.prev;n&&(n.next=t);let r=t.next=e.next;r&&(r.prev=t);let i=t.parent=e.parent;if(i){let n=i.children;n[n.lastIndexOf(e)]=t,e.parent=null}}function QW(e,t){if(XW(t),t.next=null,t.parent=e,e.children.push(t)>1){let n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null}function $W(e,t){XW(t);let{parent:n}=e,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){let e=n.children;e.splice(e.lastIndexOf(r),0,t)}}else n&&n.children.push(t)}function eG(e,t){if(XW(t),t.parent=e,t.prev=null,e.children.unshift(t)!==1){let n=e.children[1];n.prev=t,t.next=n}else t.next=null}function tG(e,t){XW(t);let{parent:n}=e;if(n){let r=n.children;r.splice(r.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}function nG(e,t,n=!0,r=1/0){return rG(e,Array.isArray(t)?t:[t],n,r)}function rG(e,t,n,r){let i=[],a=[Array.isArray(t)?t:[t]],o=[0];for(;;){if(o[0]>=a[0].length){if(o.length===1)return i;a.shift(),o.shift();continue}let t=a[0][o[0]++];if(e(t)&&(i.push(t),--r<=0))return i;n&&uW(t)&&t.children.length>0&&(o.unshift(0),a.unshift(t.children))}}function iG(e,t){return t.find(e)}function aG(e,t,n=!0){let r=Array.isArray(t)?t:[t];for(let t=0;t<r.length;t++){let i=r[t];if(iW(i)&&e(i))return i;if(n&&uW(i)&&i.children.length>0){let t=aG(e,i.children,!0);if(t)return t}}return null}function oG(e,t){return(Array.isArray(t)?t:[t]).some(t=>iW(t)&&e(t)||uW(t)&&oG(e,t.children))}function sG(e,t){let n=[],r=[Array.isArray(t)?t:[t]],i=[0];for(;;){if(i[0]>=r[0].length){if(r.length===1)return n;r.shift(),i.shift();continue}let t=r[0][i[0]++];iW(t)&&e(t)&&n.push(t),uW(t)&&t.children.length>0&&(i.unshift(0),r.unshift(t.children))}}const cG={tag_name(e){return typeof e==`function`?t=>iW(t)&&e(t.name):e===`*`?iW:t=>iW(t)&&t.name===e},tag_type(e){return typeof e==`function`?t=>e(t.type):t=>t.type===e},tag_contains(e){return typeof e==`function`?t=>oW(t)&&e(t.data):t=>oW(t)&&t.data===e}};function lG(e,t){return typeof t==`function`?n=>iW(n)&&t(n.attribs[e]):n=>iW(n)&&n.attribs[e]===t}function uG(e,t){return n=>e(n)||t(n)}function dG(e){let t=Object.keys(e).map(t=>{let n=e[t];return Object.prototype.hasOwnProperty.call(cG,t)?cG[t](n):lG(t,n)});return t.length===0?null:t.reduce(uG)}function fG(e,t){let n=dG(e);return n?n(t):!0}function pG(e,t,n,r=1/0){let i=dG(e);return i?nG(i,t,n,r):[]}function mG(e,t,n=!0){return Array.isArray(t)||(t=[t]),aG(lG(`id`,e),t,n)}function hG(e,t,n=!0,r=1/0){return nG(cG.tag_name(e),t,n,r)}function gG(e,t,n=!0,r=1/0){return nG(lG(`class`,e),t,n,r)}function _G(e,t,n=!0,r=1/0){return nG(cG.tag_type(e),t,n,r)}function vG(e){let t=e.length;for(;--t>=0;){let n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(let r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e}var yG;(function(e){e[e.DISCONNECTED=1]=`DISCONNECTED`,e[e.PRECEDING=2]=`PRECEDING`,e[e.FOLLOWING=4]=`FOLLOWING`,e[e.CONTAINS=8]=`CONTAINS`,e[e.CONTAINED_BY=16]=`CONTAINED_BY`})(yG||={});function bG(e,t){let n=[],r=[];if(e===t)return 0;let i=uW(e)?e:e.parent;for(;i;)n.unshift(i),i=i.parent;for(i=uW(t)?t:t.parent;i;)r.unshift(i),i=i.parent;let a=Math.min(n.length,r.length),o=0;for(;o<a&&n[o]===r[o];)o++;if(o===0)return yG.DISCONNECTED;let s=n[o-1],c=s.children,l=n[o],u=r[o];return c.indexOf(l)>c.indexOf(u)?s===t?yG.FOLLOWING|yG.CONTAINED_BY:yG.FOLLOWING:s===e?yG.PRECEDING|yG.CONTAINS:yG.PRECEDING}function xG(e){return e=e.filter((e,t,n)=>!n.includes(e,t+1)),e.sort((e,t)=>{let n=bG(e,t);return n&yG.PRECEDING?-1:n&yG.FOLLOWING?1:0}),e}function SG(e){let t=OG(jG,e);return t?t.name===`feed`?CG(t):wG(t):null}function CG(e){let t=e.children,n={type:`atom`,items:hG(`entry`,t).map(e=>{let{children:t}=e,n={media:DG(t)};AG(n,`id`,`id`,t),AG(n,`title`,`title`,t);let r=OG(`link`,t)?.attribs.href;r&&(n.link=r);let i=kG(`summary`,t)||kG(`content`,t);i&&(n.description=i);let a=kG(`updated`,t);return a&&(n.pubDate=new Date(a)),n})};AG(n,`id`,`id`,t),AG(n,`title`,`title`,t);let r=OG(`link`,t)?.attribs.href;r&&(n.link=r),AG(n,`description`,`subtitle`,t);let i=kG(`updated`,t);return i&&(n.updated=new Date(i)),AG(n,`author`,`email`,t,!0),n}function wG(e){let t=OG(`channel`,e.children)?.children??[],n={type:e.name.substr(0,3),id:``,items:hG(`item`,e.children).map(e=>{let{children:t}=e,n={media:DG(t)};AG(n,`id`,`guid`,t),AG(n,`title`,`title`,t),AG(n,`link`,`link`,t),AG(n,`description`,`description`,t);let r=kG(`pubDate`,t)||kG(`dc:date`,t);return r&&(n.pubDate=new Date(r)),n})};AG(n,`title`,`title`,t),AG(n,`link`,`link`,t),AG(n,`description`,`description`,t);let r=kG(`lastBuildDate`,t);return r&&(n.updated=new Date(r)),AG(n,`author`,`managingEditor`,t,!0),n}const TG=[`url`,`type`,`lang`],EG=[`fileSize`,`bitrate`,`framerate`,`samplingrate`,`channels`,`duration`,`height`,`width`];function DG(e){return hG(`media:content`,e).map(e=>{let{attribs:t}=e,n={medium:t.medium,isDefault:!!t.isDefault};for(let e of TG)t[e]&&(n[e]=t[e]);for(let e of EG)t[e]&&(n[e]=parseInt(t[e],10));return t.expression&&(n.expression=t.expression),n})}function OG(e,t){return hG(e,t,!0,1)[0]}function kG(e,t,n=!1){return BW(hG(e,t,n,1)).trim()}function AG(e,t,n,r,i=!1){let a=kG(n,r,i);a&&(e[t]=a)}function jG(e){return e===`rss`||e===`feed`||e===`rdf:RDF`}var MG=c({DocumentPosition:()=>yG,append:()=>$W,appendChild:()=>QW,compareDocumentPosition:()=>bG,existsOne:()=>oG,filter:()=>nG,find:()=>rG,findAll:()=>sG,findOne:()=>aG,findOneChild:()=>iG,getAttributeValue:()=>GW,getChildren:()=>HW,getElementById:()=>mG,getElements:()=>pG,getElementsByClassName:()=>gG,getElementsByTagName:()=>hG,getElementsByTagType:()=>_G,getFeed:()=>SG,getInnerHTML:()=>RW,getName:()=>qW,getOuterHTML:()=>LW,getParent:()=>UW,getSiblings:()=>WW,getText:()=>zW,hasAttrib:()=>KW,hasChildren:()=>uW,innerText:()=>VW,isCDATA:()=>aW,isComment:()=>sW,isDocument:()=>lW,isTag:()=>iW,isText:()=>oW,nextElementSibling:()=>JW,prepend:()=>tG,prependChild:()=>eG,prevElementSibling:()=>YW,removeElement:()=>XW,removeSubsets:()=>vG,replaceElement:()=>ZW,testElement:()=>fG,textContent:()=>BW,uniqueSort:()=>xG}),NG=c({DefaultHandler:()=>mW,DomHandler:()=>mW,DomUtils:()=>MG,ElementType:()=>LU,Parser:()=>IU,QuoteType:()=>CU,Tokenizer:()=>TU,createDocumentStream:()=>IG,createDomStream:()=>LG,getFeed:()=>SG,parseDOM:()=>FG,parseDocument:()=>PG,parseFeed:()=>zG});function PG(e,t){let n=new mW(void 0,t);return new IU(n,t).end(e),n.root}function FG(e,t){return PG(e,t).children}function IG(e,t,n){let r=new mW(t=>e(t,r.root),t,n);return new IU(r,t)}function LG(e,t,n){return new IU(new mW(e,t,n),t)}const RG={xmlMode:!0};function zG(e,t=RG){return SG(FG(e,t))}const BG=new Set(`ARTICLE.ASIDE.BLOCKQUOTE.BODY.BR.BUTTON.CANVAS.CAPTION.COL.COLGROUP.DD.DIV.DL.DT.EMBED.FIELDSET.FIGCAPTION.FIGURE.FOOTER.FORM.H1.H2.H3.H4.H5.H6.LI.UL.OL.P`.split(`.`)),VG=`http://www.w3.org/2000/svg`,{assign:HG,create:UG,defineProperties:WG,entries:GG,getOwnPropertyDescriptors:KG,keys:qG,setPrototypeOf:JG}=Object,YG=String,XG=e=>e.nodeType===1?e[G]:e,ZG=({ownerDocument:e})=>e[JH].ignoreCase,QG=(e,t)=>{e[K]=t,t[ZH]=e},$G=(e,t,n)=>{QG(e,t),QG(XG(t),n)},eK=(e,t,n,r)=>{QG(e,t),QG(XG(n),r)},tK=(e,t,n)=>{QG(e,t),QG(t,n)},nK=({localName:e,ownerDocument:t})=>t[JH].ignoreCase?e.toUpperCase():e,rK=(e,t)=>{e&&(e[K]=t),t&&(t[ZH]=e)},iK=(e,t)=>{let n=e.createDocumentFragment(),r=e.createElement(``);r.innerHTML=t;let{firstChild:i,lastChild:a}=r;if(i){eK(n,i,a,n[G]);let e=i;do e.parentNode=n;while(e!==a&&(e=XG(e)[K]))}return n},aK=new WeakMap;let oK=!1;const sK=new WeakMap,cK=new WeakMap,lK=(e,t,n,r)=>{oK&&cK.has(e)&&e.attributeChangedCallback&&e.constructor.observedAttributes.includes(t)&&e.attributeChangedCallback(t,n,r)},uK=(e,t)=>n=>{if(cK.has(n)){let r=cK.get(n);r.connected!==t&&n.isConnected===t&&(r.connected=t,e in n&&n[e]())}},dK=uK(`connectedCallback`,!0),fK=e=>{if(oK){dK(e),aK.has(e)&&(e=aK.get(e).shadowRoot);let{[K]:t,[G]:n}=e;for(;t!==n;)t.nodeType===1&&dK(t),t=t[K]}},pK=uK(`disconnectedCallback`,!1),mK=e=>{if(oK){pK(e),aK.has(e)&&(e=aK.get(e).shadowRoot);let{[K]:t,[G]:n}=e;for(;t!==n;)t.nodeType===1&&pK(t),t=t[K]}};var hK=class{constructor(e){this.ownerDocument=e,this.registry=new Map,this.waiting=new Map,this.active=!1}define(e,t,n={}){let{ownerDocument:r,registry:i,waiting:a}=this;if(i.has(e))throw Error(`unable to redefine `+e);if(sK.has(t))throw Error(`unable to redefine the same class: `+t);this.active=oK=!0;let{extends:o}=n;sK.set(t,{ownerDocument:r,options:{is:o?e:``},localName:o||e});let s=o?t=>t.localName===o&&t.getAttribute(`is`)===e:t=>t.localName===e;if(i.set(e,{Class:t,check:s}),a.has(e)){for(let n of a.get(e))n(t);a.delete(e)}r.querySelectorAll(o?`${o}[is="${e}"]`:e).forEach(this.upgrade,this)}upgrade(e){if(cK.has(e))return;let{ownerDocument:t,registry:n}=this,r=e.getAttribute(`is`)||e.localName;if(n.has(r)){let{Class:i,check:a}=n.get(r);if(a(e)){let{attributes:n,isConnected:a}=e;for(let t of n)e.removeAttributeNode(t);let o=GG(e);for(let[t]of o)delete e[t];JG(e,i.prototype),t[nU]={element:e,values:o},new i(t,r),cK.set(e,{connected:a});for(let t of n)e.setAttributeNode(t);a&&e.connectedCallback&&e.connectedCallback()}}}whenDefined(e){let{registry:t,waiting:n}=this;return new Promise(r=>{t.has(e)?r(t.get(e).Class):(n.has(e)||n.set(e,[]),n.get(e).push(r))})}get(e){let t=this.registry.get(e);return t&&t.Class}getName(e){if(sK.has(e)){let{localName:t}=sK.get(e);return t}return null}};const{Parser:gK}=NG,_K=(e,t,n)=>{let r=e[G];return t.parentNode=e,$G(r[ZH],t,r),n&&t.nodeType===1&&fK(t),t},vK=(e,t,n,r,i)=>{n[rU]=r,n.ownerElement=e,tK(t[ZH],n,t),n.name===`class`&&(e.className=r),i&&lK(e,n.name,null,r)},yK=(e,t,n)=>{let{active:r,registry:i}=e[BH],a=e,o=null,s=!1,c=new gK({onprocessinginstruction(t,n){t.toLowerCase()===`!doctype`&&(e.doctype=n.slice(t.length).trim())},onopentag(n,s){let c=!0;if(t){if(o)a=_K(a,e.createElementNS(VG,n),r),a.ownerSVGElement=o,c=!1;else if(n===`svg`||n===`SVG`)o=e.createElementNS(VG,n),a=_K(a,o,r),c=!1;else if(r){let e=n.includes(`-`)?n:s.is||``;if(e&&i.has(e)){let{Class:t}=i.get(e);a=_K(a,new t,r),delete s.is,c=!1}}}c&&(a=_K(a,e.createElement(n),!1));let l=a[G];for(let t of qG(s))vK(a,l,e.createAttribute(t),s[t],r)},oncomment(t){_K(a,e.createComment(t),r)},ontext(t){s?_K(a,e.createCDATASection(t),r):_K(a,e.createTextNode(t),r)},oncdatastart(){s=!0},oncdataend(){s=!1},onclosetag(){t&&a===o&&(o=null),a=a.parentNode}},{lowerCaseAttributeNames:!1,decodeEntities:!0,xmlMode:!t});return c.write(n),c.end(),e},bK=new Map,xK=(e,t)=>{for(let n of[].concat(e))bK.set(n,t),bK.set(n.toUpperCase(),t)},SK=({[K]:e,[G]:t},n)=>{for(;e!==t;){switch(e.nodeType){case 2:CK(e,n);break;case 3:case 8:case 4:wK(e,n);break;case 1:DK(e,n),e=XG(e);break;case 10:EK(e,n);break}e=e[K]}let r=n.length-1,i=n[r];typeof i==`number`&&i<0?n[r]+=-1:n.push(-1)},CK=(e,t)=>{t.push(2,e.name);let n=e[rU].trim();n&&t.push(n)},wK=(e,t)=>{let n=e[rU];n.trim()&&t.push(e.nodeType,n)},TK=(e,t)=>{t.push(e.nodeType),SK(e,t)},EK=({name:e,publicId:t,systemId:n},r)=>{r.push(10,e),t&&r.push(t),n&&r.push(n)},DK=(e,t)=>{t.push(1,e.localName),SK(e,t)},OK=(e,t,n,r,i,a,o)=>({type:e,target:t,addedNodes:r,removedNodes:i,attributeName:a,oldValue:o,previousSibling:n?.previousSibling||null,nextSibling:n?.nextSibling||null}),kK=(e,t,n,r,i,a)=>{if(!r||r.includes(n)){let{callback:r,records:o,scheduled:s}=e;o.push(OK(`attributes`,t,null,[],[],n,i?a:void 0)),s||(e.scheduled=!0,Promise.resolve().then(()=>{e.scheduled=!1,r(o.splice(0),e)}))}},AK=(e,t,n)=>{let{ownerDocument:r}=e,{active:i,observers:a}=r[YH];if(i){for(let i of a)for(let[a,{childList:o,subtree:s,attributes:c,attributeFilter:l,attributeOldValue:u}]of i.nodes)if(o){if(s&&(a===r||a.contains(e))||!s&&a.children.includes(e)){kK(i,e,t,l,u,n);break}}else if(c&&a===e){kK(i,e,t,l,u,n);break}}},jK=(e,t)=>{let{ownerDocument:n}=e,{active:r,observers:i}=n[YH];if(r){for(let r of i)for(let[i,{subtree:a,childList:o,characterData:s}]of r.nodes)if(o&&(t&&(i===t||a&&i.contains(t))||!t&&(a&&(i===n||i.contains(e))||!a&&i[s?`childNodes`:`children`].includes(e)))){let{callback:n,records:a,scheduled:o}=r;a.push(OK(`childList`,i,e,t?[]:[e],t?[e]:[])),o||(r.scheduled=!0,Promise.resolve().then(()=>{r.scheduled=!1,n(a.splice(0),r)}));break}}};var MK=class{constructor(e){let t=new Set;this.observers=t,this.active=!1,this.class=class{constructor(e){this.callback=e,this.nodes=new Map,this.records=[],this.scheduled=!1}disconnect(){this.records.splice(0),this.nodes.clear(),t.delete(this),e[YH].active=!!t.size}observe(n,r={subtree:!1,childList:!1,attributes:!1,attributeFilter:null,attributeOldValue:!1,characterData:!1}){(`attributeOldValue`in r||`attributeFilter`in r)&&(r.attributes=!0),r.childList=!!r.childList,r.subtree=!!r.subtree,this.nodes.set(n,r),t.add(this),e[YH].active=!0}takeRecords(){return this.records.splice(0)}}}};const NK=new Set(`allowfullscreen.allowpaymentrequest.async.autofocus.autoplay.checked.class.contenteditable.controls.default.defer.disabled.draggable.formnovalidate.hidden.id.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected.style.truespeed`.split(`.`)),PK=(e,t)=>{let{[rU]:n,name:r}=t;t.ownerElement=e,tK(e,t,e[K]),r===`class`&&(e.className=n),AK(e,r,null),lK(e,r,null,n)},FK=(e,t)=>{let{[rU]:n,name:r}=t;QG(t[ZH],t[K]),t.ownerElement=t[ZH]=t[K]=null,r===`class`&&(e[zH]=null),AK(e,r,n),lK(e,r,n,null)},IK={get(e,t){return e.hasAttribute(t)},set(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}},LK={get(e,t){return parseFloat(e.getAttribute(t)||0)},set(e,t,n){e.setAttribute(t,n)}},Y={get(e,t){return e.getAttribute(t)||``},set(e,t,n){e.setAttribute(t,n)}},RK=new WeakMap;function zK(e,t){return typeof t==`function`?t.call(e.target,e):t.handleEvent(e),e._stopImmediatePropagationFlag}function BK({currentTarget:e,target:t}){let n=RK.get(e);if(n&&n.has(this.type)){let r=n.get(this.type);e===t?this.eventPhase=this.AT_TARGET:this.eventPhase=this.BUBBLING_PHASE,this.currentTarget=e,this.target=t;for(let[e,t]of r)if(t&&t.once&&r.delete(e),zK(this,e))break;return delete this.currentTarget,delete this.target,this.cancelBubble}}var VK=class{constructor(){RK.set(this,new Map)}_getParent(){return null}addEventListener(e,t,n){let r=RK.get(this);r.has(e)||r.set(e,new Map),r.get(e).set(t,n)}removeEventListener(e,t){let n=RK.get(this);if(n.has(e)){let r=n.get(e);r.delete(t)&&!r.size&&n.delete(e)}}dispatchEvent(e){let t=this;for(e.eventPhase=e.CAPTURING_PHASE;t;)t.dispatchEvent&&e._path.push({currentTarget:t,target:this}),t=e.bubbles&&t._getParent&&t._getParent();return e._path.some(BK,e),e._path=[],e.eventPhase=e.NONE,!e.defaultPrevented}},HK=class extends Array{item(e){return e<this.length?this[e]:null}};const UK=({parentNode:e})=>{let t=0;for(;e;)t++,e=e.parentNode;return t};var WK=class extends VK{static get ELEMENT_NODE(){return 1}static get ATTRIBUTE_NODE(){return 2}static get TEXT_NODE(){return 3}static get CDATA_SECTION_NODE(){return 4}static get COMMENT_NODE(){return 8}static get DOCUMENT_NODE(){return 9}static get DOCUMENT_FRAGMENT_NODE(){return 11}static get DOCUMENT_TYPE_NODE(){return 10}constructor(e,t,n){super(),this.ownerDocument=e,this.localName=t,this.nodeType=n,this.parentNode=null,this[K]=null,this[ZH]=null}get ELEMENT_NODE(){return 1}get ATTRIBUTE_NODE(){return 2}get TEXT_NODE(){return 3}get CDATA_SECTION_NODE(){return 4}get COMMENT_NODE(){return 8}get DOCUMENT_NODE(){return 9}get DOCUMENT_FRAGMENT_NODE(){return 11}get DOCUMENT_TYPE_NODE(){return 10}get baseURI(){let e=this.nodeType===9?this:this.ownerDocument;if(e){let t=e.querySelector(`base`);if(t)return t.getAttribute(`href`);let{location:n}=e.defaultView;if(n)return n.href}return null}get isConnected(){return!1}get nodeName(){return this.localName}get parentElement(){return null}get previousSibling(){return null}get previousElementSibling(){return null}get nextSibling(){return null}get nextElementSibling(){return null}get childNodes(){return new HK}get firstChild(){return null}get lastChild(){return null}get nodeValue(){return null}set nodeValue(e){}get textContent(){return null}set textContent(e){}normalize(){}cloneNode(){return null}contains(){return!1}insertBefore(e,t){return e}appendChild(e){return e}replaceChild(e,t){return t}removeChild(e){return e}toString(){return``}hasChildNodes(){return!!this.lastChild}isSameNode(e){return this===e}compareDocumentPosition(e){let t=0;if(this!==e){let n=UK(this),r=UK(e);if(n<r)t+=4,this.contains(e)&&(t+=16);else if(r<n)t+=2,e.contains(this)&&(t+=8);else if(n&&r){let{childNodes:n}=this.parentNode;n.indexOf(this)<n.indexOf(e)?t+=4:t+=2}(!n||!r)&&(t+=32,t+=1)}return t}isEqualNode(e){if(this===e)return!0;if(this.nodeType===e.nodeType){switch(this.nodeType){case 9:case 11:{let t=this.childNodes,n=e.childNodes;return t.length===n.length&&t.every((e,t)=>e.isEqualNode(n[t]))}}return this.toString()===e.toString()}return!1}_getParent(){return this.parentNode}getRootNode(){let e=this;for(;e.parentNode;)e=e.parentNode;return e}};const{replace:GK}=``,KK=/[<>&\xA0]/g,qK={"\xA0":`&#160;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`},JK=e=>qK[e],YK=e=>GK.call(e,KK,JK),XK=/"/g;var ZK=class e extends WK{constructor(e,t,n=``){super(e,t,2),this.ownerElement=null,this.name=YG(t),this[rU]=YG(n),this[RH]=!1}get value(){return this[rU]}set value(e){let{[rU]:t,name:n,ownerElement:r}=this;this[rU]=YG(e),this[RH]=!0,r&&(AK(r,n,t),lK(r,n,t,this[rU]))}cloneNode(){let{ownerDocument:t,name:n,[rU]:r}=this;return new e(t,n,r)}toString(){let{name:e,[rU]:t}=this;return NK.has(e)&&!t?ZG(this)?e:`${e}=""`:`${e}="${(ZG(this)?t:YK(t)).replace(XK,`&quot;`)}"`}toJSON(){let e=[];return CK(this,e),e}};const QK=({ownerDocument:e,parentNode:t})=>{for(;t;){if(t===e)return!0;t=t.parentNode||t.host}return!1},$K=({parentNode:e})=>{if(e)switch(e.nodeType){case 9:case 11:return null}return e},eq=({[ZH]:e})=>{switch(e?e.nodeType:0){case-1:return e[eU];case 3:case 8:case 4:return e}return null},tq=e=>{let t=XG(e)[K];return t&&(t.nodeType===-1?null:t)},nq=e=>{let t=tq(e);for(;t&&t.nodeType!==1;)t=tq(t);return t},rq=e=>{let t=eq(e);for(;t&&t.nodeType!==1;)t=eq(t);return t},iq=(e,t)=>{let n=e.createDocumentFragment();return n.append(...t),n},aq=(e,t)=>{let{ownerDocument:n,parentNode:r}=e;r&&r.insertBefore(iq(n,t),e)},oq=(e,t)=>{let{ownerDocument:n,parentNode:r}=e;r&&r.insertBefore(iq(n,t),XG(e)[K])},sq=(e,t)=>{let{ownerDocument:n,parentNode:r}=e;r&&(t.includes(e)&&sq(e,[e=e.cloneNode()]),r.insertBefore(iq(n,t),e),e.remove())},cq=(e,t,n)=>{let{parentNode:r,nodeType:i}=t;(e||n)&&(rK(e,n),t[ZH]=null,XG(t)[K]=null),r&&(t.parentNode=null,jK(t,r),i===1&&mK(t))};var lq=class extends WK{constructor(e,t,n,r){super(e,t,n),this[rU]=YG(r)}get isConnected(){return QK(this)}get parentElement(){return $K(this)}get previousSibling(){return eq(this)}get nextSibling(){return tq(this)}get previousElementSibling(){return rq(this)}get nextElementSibling(){return nq(this)}before(...e){aq(this,e)}after(...e){oq(this,e)}replaceWith(...e){sq(this,e)}remove(){cq(this[ZH],this,this[K])}get data(){return this[rU]}set data(e){this[rU]=YG(e),jK(this,this.parentNode)}get nodeValue(){return this.data}set nodeValue(e){this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}get length(){return this.data.length}substringData(e,t){return this.data.substr(e,t)}appendData(e){this.data+=e}insertData(e,t){let{data:n}=this;this.data=n.slice(0,e)+t+n.slice(e)}deleteData(e,t){let{data:n}=this;this.data=n.slice(0,e)+n.slice(e+t)}replaceData(e,t,n){let{data:r}=this;this.data=r.slice(0,e)+n+r.slice(e+t)}toJSON(){let e=[];return wK(this,e),e}},uq=class e extends lq{constructor(e,t=``){super(e,`#cdatasection`,4,t)}cloneNode(){let{ownerDocument:t,[rU]:n}=this;return new e(t,n)}toString(){return`<![CDATA[${this[rU]}]]>`}},dq=class e extends lq{constructor(e,t=``){super(e,`#comment`,8,t)}cloneNode(){let{ownerDocument:t,[rU]:n}=this;return new e(t,n)}toString(){return`<!--${this[rU]}-->`}},fq=s(((e,t)=>{t.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}})),X;(function(e){e.Attribute=`attribute`,e.Pseudo=`pseudo`,e.PseudoElement=`pseudo-element`,e.Tag=`tag`,e.Universal=`universal`,e.Adjacent=`adjacent`,e.Child=`child`,e.Descendant=`descendant`,e.Parent=`parent`,e.Sibling=`sibling`,e.ColumnCombinator=`column-combinator`})(X||={});var pq;(function(e){e.Any=`any`,e.Element=`element`,e.End=`end`,e.Equals=`equals`,e.Exists=`exists`,e.Hyphen=`hyphen`,e.Not=`not`,e.Start=`start`})(pq||={});const mq=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,hq=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,gq=new Map([[126,pq.Element],[94,pq.Start],[36,pq.End],[42,pq.Any],[33,pq.Not],[124,pq.Hyphen]]),_q=new Set([`has`,`not`,`matches`,`is`,`where`,`host`,`host-context`]);function vq(e){switch(e.type){case X.Adjacent:case X.Child:case X.Descendant:case X.Parent:case X.Sibling:case X.ColumnCombinator:return!0;default:return!1}}const yq=new Set([`contains`,`icontains`]);function bq(e,t,n){let r=parseInt(t,16)-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function xq(e){return e.replace(hq,bq)}function Sq(e){return e===39||e===34}function Cq(e){return e===32||e===9||e===10||e===12||e===13}function wq(e){let t=[],n=Tq(t,`${e}`,0);if(n<e.length)throw Error(`Unmatched selector: ${e.slice(n)}`);return t}function Tq(e,t,n){let r=[];function i(e){let r=t.slice(n+e).match(mq);if(!r)throw Error(`Expected name, found ${t.slice(n)}`);let[i]=r;return n+=e+i.length,xq(i)}function a(e){for(n+=e;n<t.length&&Cq(t.charCodeAt(n));)n++}function o(){n+=1;let e=n,r=1;for(;r>0&&n<t.length;n++)t.charCodeAt(n)===40&&!s(n)?r++:t.charCodeAt(n)===41&&!s(n)&&r--;if(r)throw Error(`Parenthesis not matched`);return xq(t.slice(e,n-1))}function s(e){let n=0;for(;t.charCodeAt(--e)===92;)n++;return(n&1)==1}function c(){if(r.length>0&&vq(r[r.length-1]))throw Error(`Did not expect successive traversals.`)}function l(e){if(r.length>0&&r[r.length-1].type===X.Descendant){r[r.length-1].type=e;return}c(),r.push({type:e})}function u(e,t){r.push({type:X.Attribute,name:e,action:t,value:i(1),namespace:null,ignoreCase:`quirks`})}function d(){if(r.length&&r[r.length-1].type===X.Descendant&&r.pop(),r.length===0)throw Error(`Empty sub-selector`);e.push(r)}if(a(0),t.length===n)return n;loop:for(;n<t.length;){let e=t.charCodeAt(n);switch(e){case 32:case 9:case 10:case 12:case 13:(r.length===0||r[0].type!==X.Descendant)&&(c(),r.push({type:X.Descendant})),a(1);break;case 62:l(X.Child),a(1);break;case 60:l(X.Parent),a(1);break;case 126:l(X.Sibling),a(1);break;case 43:l(X.Adjacent),a(1);break;case 46:u(`class`,pq.Element);break;case 35:u(`id`,pq.Equals);break;case 91:{a(1);let e,o=null;t.charCodeAt(n)===124?e=i(1):t.startsWith(`*|`,n)?(o=`*`,e=i(2)):(e=i(0),t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==61&&(o=e,e=i(1))),a(0);let c=pq.Exists,l=gq.get(t.charCodeAt(n));if(l){if(c=l,t.charCodeAt(n+1)!==61)throw Error("Expected `=`");a(2)}else t.charCodeAt(n)===61&&(c=pq.Equals,a(1));let u=``,d=null;if(c!==`exists`){if(Sq(t.charCodeAt(n))){let e=t.charCodeAt(n),r=n+1;for(;r<t.length&&(t.charCodeAt(r)!==e||s(r));)r+=1;if(t.charCodeAt(r)!==e)throw Error(`Attribute value didn't end`);u=xq(t.slice(n+1,r)),n=r+1}else{let e=n;for(;n<t.length&&(!Cq(t.charCodeAt(n))&&t.charCodeAt(n)!==93||s(n));)n+=1;u=xq(t.slice(e,n))}a(0);let e=t.charCodeAt(n)|32;e===115?(d=!1,a(1)):e===105&&(d=!0,a(1))}if(t.charCodeAt(n)!==93)throw Error(`Attribute selector didn't terminate`);n+=1;let f={type:X.Attribute,name:e,action:c,value:u,namespace:o,ignoreCase:d};r.push(f);break}case 58:{if(t.charCodeAt(n+1)===58){r.push({type:X.PseudoElement,name:i(2).toLowerCase(),data:t.charCodeAt(n)===40?o():null});continue}let e=i(1).toLowerCase(),a=null;if(t.charCodeAt(n)===40)if(_q.has(e)){if(Sq(t.charCodeAt(n+1)))throw Error(`Pseudo-selector ${e} cannot be quoted`);if(a=[],n=Tq(a,t,n+1),t.charCodeAt(n)!==41)throw Error(`Missing closing parenthesis in :${e} (${t})`);n+=1}else{if(a=o(),yq.has(e)){let e=a.charCodeAt(0);e===a.charCodeAt(a.length-1)&&Sq(e)&&(a=a.slice(1,-1))}a=xq(a)}r.push({type:X.Pseudo,name:e,data:a});break}case 44:d(),r=[],a(1);break;default:{if(t.startsWith(`/*`,n)){let e=t.indexOf(`*/`,n+2);if(e<0)throw Error(`Comment was not terminated`);n=e+2,r.length===0&&a(0);break}let o=null,s;if(e===42)n+=1,s=`*`;else if(e===124){if(s=``,t.charCodeAt(n+1)===124){l(X.ColumnCombinator),a(2);break}}else if(mq.test(t.slice(n)))s=i(0);else break loop;t.charCodeAt(n)===124&&t.charCodeAt(n+1)!==124&&(o=s,t.charCodeAt(n+1)===42?(s=`*`,n+=2):s=i(1)),r.push(s===`*`?{type:X.Universal,namespace:o}:{type:X.Tag,name:s,namespace:o})}}}return d(),n}var Z=u(fq());const Eq=new Map([[X.Universal,50],[X.Tag,30],[X.Attribute,1],[X.Pseudo,0]]);function Dq(e){return!Eq.has(e.type)}const Oq=new Map([[pq.Exists,10],[pq.Equals,8],[pq.Not,7],[pq.Start,6],[pq.End,6],[pq.Any,5]]);function kq(e){let t=e.map(Aq);for(let n=1;n<e.length;n++){let r=t[n];if(!(r<0))for(let i=n-1;i>=0&&r<t[i];i--){let n=e[i+1];e[i+1]=e[i],e[i]=n,t[i+1]=t[i],t[i]=r}}}function Aq(e){let t=Eq.get(e.type)??-1;return e.type===X.Attribute?(t=Oq.get(e.action)??4,e.action===pq.Equals&&e.name===`id`&&(t=9),e.ignoreCase&&(t>>=1)):e.type===X.Pseudo&&(e.data?e.name===`has`||e.name===`contains`?t=0:Array.isArray(e.data)?(t=Math.min(...e.data.map(e=>Math.min(...e.map(Aq)))),t<0&&(t=0)):t=2:t=3),t}const jq=/[-[\]{}()*+?.,\\^$|#\s]/g;function Mq(e){return e.replace(jq,`\\$&`)}const Nq=new Set(`accept.accept-charset.align.alink.axis.bgcolor.charset.checked.clear.codetype.color.compact.declare.defer.dir.direction.disabled.enctype.face.frame.hreflang.http-equiv.lang.language.link.media.method.multiple.nohref.noresize.noshade.nowrap.readonly.rel.rev.rules.scope.scrolling.selected.shape.target.text.type.valign.valuetype.vlink`.split(`.`));function Pq(e,t){return typeof e.ignoreCase==`boolean`?e.ignoreCase:e.ignoreCase===`quirks`?!!t.quirksMode:!t.xmlMode&&Nq.has(e.name)}const Fq={equals(e,t,n){let{adapter:r}=n,{name:i}=t,{value:a}=t;return Pq(t,n)?(a=a.toLowerCase(),t=>{let n=r.getAttributeValue(t,i);return n!=null&&n.length===a.length&&n.toLowerCase()===a&&e(t)}):t=>r.getAttributeValue(t,i)===a&&e(t)},hyphen(e,t,n){let{adapter:r}=n,{name:i}=t,{value:a}=t,o=a.length;return Pq(t,n)?(a=a.toLowerCase(),function(t){let n=r.getAttributeValue(t,i);return n!=null&&(n.length===o||n.charAt(o)===`-`)&&n.substr(0,o).toLowerCase()===a&&e(t)}):function(t){let n=r.getAttributeValue(t,i);return n!=null&&(n.length===o||n.charAt(o)===`-`)&&n.substr(0,o)===a&&e(t)}},element(e,t,n){let{adapter:r}=n,{name:i,value:a}=t;if(/\s/.test(a))return Z.default.falseFunc;let o=RegExp(`(?:^|\\s)${Mq(a)}(?:$|\\s)`,Pq(t,n)?`i`:``);return function(t){let n=r.getAttributeValue(t,i);return n!=null&&n.length>=a.length&&o.test(n)&&e(t)}},exists(e,{name:t},{adapter:n}){return r=>n.hasAttrib(r,t)&&e(r)},start(e,t,n){let{adapter:r}=n,{name:i}=t,{value:a}=t,o=a.length;return o===0?Z.default.falseFunc:Pq(t,n)?(a=a.toLowerCase(),t=>{let n=r.getAttributeValue(t,i);return n!=null&&n.length>=o&&n.substr(0,o).toLowerCase()===a&&e(t)}):t=>!!r.getAttributeValue(t,i)?.startsWith(a)&&e(t)},end(e,t,n){let{adapter:r}=n,{name:i}=t,{value:a}=t,o=-a.length;return o===0?Z.default.falseFunc:Pq(t,n)?(a=a.toLowerCase(),t=>r.getAttributeValue(t,i)?.substr(o).toLowerCase()===a&&e(t)):t=>!!r.getAttributeValue(t,i)?.endsWith(a)&&e(t)},any(e,t,n){let{adapter:r}=n,{name:i,value:a}=t;if(a===``)return Z.default.falseFunc;if(Pq(t,n)){let t=new RegExp(Mq(a),`i`);return function(n){let o=r.getAttributeValue(n,i);return o!=null&&o.length>=a.length&&t.test(o)&&e(n)}}return t=>!!r.getAttributeValue(t,i)?.includes(a)&&e(t)},not(e,t,n){let{adapter:r}=n,{name:i}=t,{value:a}=t;return a===``?t=>!!r.getAttributeValue(t,i)&&e(t):Pq(t,n)?(a=a.toLowerCase(),t=>{let n=r.getAttributeValue(t,i);return(n==null||n.length!==a.length||n.toLowerCase()!==a)&&e(t)}):t=>r.getAttributeValue(t,i)!==a&&e(t)}},Iq=new Set([9,10,12,13,32]);function Lq(e){if(e=e.trim().toLowerCase(),e===`even`)return[2,0];if(e===`odd`)return[2,1];let t=0,n=0,r=a(),i=o();if(t<e.length&&e.charAt(t)===`n`&&(t++,n=r*(i??1),s(),t<e.length?(r=a(),s(),i=o()):r=i=0),i===null||t<e.length)throw Error(`n-th rule couldn't be parsed ('${e}')`);return[n,r*i];function a(){return e.charAt(t)===`-`?(t++,-1):(e.charAt(t)===`+`&&t++,1)}function o(){let n=t,r=0;for(;t<e.length&&e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57;)r=r*10+(e.charCodeAt(t)-48),t++;return t===n?null:r}function s(){for(;t<e.length&&Iq.has(e.charCodeAt(t));)t++}}function Rq(e){let t=e[0],n=e[1]-1;if(n<0&&t<=0)return Z.default.falseFunc;if(t===-1)return e=>e<=n;if(t===0)return e=>e===n;if(t===1)return n<0?Z.default.trueFunc:e=>e>=n;let r=Math.abs(t),i=(n%r+r)%r;return t>1?e=>e>=n&&e%r===i:e=>e<=n&&e%r===i}function zq(e){return Rq(Lq(e))}function Bq(e,t){return n=>{let r=t.getParent(n);return r!=null&&t.isTag(r)&&e(n)}}const Vq={contains(e,t,{adapter:n}){return function(r){return e(r)&&n.getText(r).includes(t)}},icontains(e,t,{adapter:n}){let r=t.toLowerCase();return function(t){return e(t)&&n.getText(t).toLowerCase().includes(r)}},"nth-child"(e,t,{adapter:n,equals:r}){let i=zq(t);return i===Z.default.falseFunc?Z.default.falseFunc:i===Z.default.trueFunc?Bq(e,n):function(t){let a=n.getSiblings(t),o=0;for(let e=0;e<a.length&&!r(t,a[e]);e++)n.isTag(a[e])&&o++;return i(o)&&e(t)}},"nth-last-child"(e,t,{adapter:n,equals:r}){let i=zq(t);return i===Z.default.falseFunc?Z.default.falseFunc:i===Z.default.trueFunc?Bq(e,n):function(t){let a=n.getSiblings(t),o=0;for(let e=a.length-1;e>=0&&!r(t,a[e]);e--)n.isTag(a[e])&&o++;return i(o)&&e(t)}},"nth-of-type"(e,t,{adapter:n,equals:r}){let i=zq(t);return i===Z.default.falseFunc?Z.default.falseFunc:i===Z.default.trueFunc?Bq(e,n):function(t){let a=n.getSiblings(t),o=0;for(let e=0;e<a.length;e++){let i=a[e];if(r(t,i))break;n.isTag(i)&&n.getName(i)===n.getName(t)&&o++}return i(o)&&e(t)}},"nth-last-of-type"(e,t,{adapter:n,equals:r}){let i=zq(t);return i===Z.default.falseFunc?Z.default.falseFunc:i===Z.default.trueFunc?Bq(e,n):function(t){let a=n.getSiblings(t),o=0;for(let e=a.length-1;e>=0;e--){let i=a[e];if(r(t,i))break;n.isTag(i)&&n.getName(i)===n.getName(t)&&o++}return i(o)&&e(t)}},root(e,t,{adapter:n}){return t=>{let r=n.getParent(t);return(r==null||!n.isTag(r))&&e(t)}},scope(e,t,n,r){let{equals:i}=n;return!r||r.length===0?Vq.root(e,t,n):r.length===1?t=>i(r[0],t)&&e(t):t=>r.includes(t)&&e(t)},hover:Hq(`isHovered`),visited:Hq(`isVisited`),active:Hq(`isActive`)};function Hq(e){return function(t,n,{adapter:r}){let i=r[e];return typeof i==`function`?function(e){return i(e)&&t(e)}:Z.default.falseFunc}}const Uq={empty(e,{adapter:t}){return!t.getChildren(e).some(e=>t.isTag(e)||t.getText(e)!==``)},"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return t.prevElementSibling(e)==null;let r=t.getSiblings(e).find(e=>t.isTag(e));return r!=null&&n(e,r)},"last-child"(e,{adapter:t,equals:n}){let r=t.getSiblings(e);for(let i=r.length-1;i>=0;i--){if(n(e,r[i]))return!0;if(t.isTag(r[i]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){let r=t.getSiblings(e),i=t.getName(e);for(let a=0;a<r.length;a++){let o=r[a];if(n(e,o))return!0;if(t.isTag(o)&&t.getName(o)===i)break}return!1},"last-of-type"(e,{adapter:t,equals:n}){let r=t.getSiblings(e),i=t.getName(e);for(let a=r.length-1;a>=0;a--){let o=r[a];if(n(e,o))return!0;if(t.isTag(o)&&t.getName(o)===i)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){let r=t.getName(e);return t.getSiblings(e).every(i=>n(e,i)||!t.isTag(i)||t.getName(i)!==r)},"only-child"(e,{adapter:t,equals:n}){return t.getSiblings(e).every(r=>n(e,r)||!t.isTag(r))}};function Wq(e,t,n,r){if(n===null){if(e.length>r)throw Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===r)throw Error(`Pseudo-class :${t} doesn't have any arguments`)}const Gq={"any-link":`:is(a, area, link)[href]`,link:`:any-link:not(:visited)`,disabled:`:is(
1218
- :is(button, input, select, textarea, optgroup, option)[disabled],
1219
- optgroup[disabled] > option,
1220
- fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
1221
- )`,enabled:`:not(:disabled)`,checked:`:is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)`,required:`:is(input, select, textarea)[required]`,optional:`:is(input, select, textarea):not([required])`,selected:`option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)`,checkbox:`[type=checkbox]`,file:`[type=file]`,password:`[type=password]`,radio:`[type=radio]`,reset:`[type=reset]`,image:`[type=image]`,submit:`[type=submit]`,parent:`:not(:empty)`,header:`:is(h1, h2, h3, h4, h5, h6)`,button:`:is(button, input[type=button])`,input:`:is(input, textarea, select, button)`,text:`input:is(:not([type!='']), [type=text])`},Kq={};function qq(e,t){return e===Z.default.falseFunc?Z.default.falseFunc:n=>t.isTag(n)&&e(n)}function Jq(e,t){let n=t.getSiblings(e);if(n.length<=1)return[];let r=n.indexOf(e);return r<0||r===n.length-1?[]:n.slice(r+1).filter(t.isTag)}function Yq(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}const Xq=(e,t,n,r,i)=>{let a=i(t,Yq(n),r);return a===Z.default.trueFunc?e:a===Z.default.falseFunc?Z.default.falseFunc:t=>a(t)&&e(t)},Zq={is:Xq,matches:Xq,where:Xq,not(e,t,n,r,i){let a=i(t,Yq(n),r);return a===Z.default.falseFunc?e:a===Z.default.trueFunc?Z.default.falseFunc:t=>!a(t)&&e(t)},has(e,t,n,r,i){let{adapter:a}=n,o=Yq(n);o.relativeSelector=!0;let s=t.some(e=>e.some(Dq))?[Kq]:void 0,c=i(t,o,s);if(c===Z.default.falseFunc)return Z.default.falseFunc;let l=qq(c,a);if(s&&c!==Z.default.trueFunc){let{shouldTestNextSiblings:t=!1}=c;return n=>{if(!e(n))return!1;s[0]=n;let r=a.getChildren(n),i=t?[...r,...Jq(n,a)]:r;return a.existsOne(l,i)}}return t=>e(t)&&a.existsOne(l,a.getChildren(t))}};function Qq(e,t,n,r,i){let{name:a,data:o}=t;if(Array.isArray(o)){if(!(a in Zq))throw Error(`Unknown pseudo-class :${a}(${o})`);return Zq[a](e,o,n,r,i)}let s=n.pseudos?.[a],c=typeof s==`string`?s:Gq[a];if(typeof c==`string`){if(o!=null)throw Error(`Pseudo ${a} doesn't have any arguments`);let t=wq(c);return Zq.is(e,t,n,r,i)}if(typeof s==`function`)return Wq(s,a,o,1),t=>s(t,o)&&e(t);if(a in Vq)return Vq[a](e,o,n,r);if(a in Uq){let t=Uq[a];return Wq(t,a,o,2),r=>t(r,n,o)&&e(r)}throw Error(`Unknown pseudo-class :${a}`)}function $q(e,t){let n=t.getParent(e);return n&&t.isTag(n)?n:null}function eJ(e,t,n,r,i){let{adapter:a,equals:o}=n;switch(t.type){case X.PseudoElement:throw Error(`Pseudo-elements are not supported by css-select`);case X.ColumnCombinator:throw Error(`Column combinators are not yet supported by css-select`);case X.Attribute:if(t.namespace!=null)throw Error(`Namespaced attributes are not yet supported by css-select`);return(!n.xmlMode||n.lowerCaseAttributeNames)&&(t.name=t.name.toLowerCase()),Fq[t.action](e,t,n);case X.Pseudo:return Qq(e,t,n,r,i);case X.Tag:{if(t.namespace!=null)throw Error(`Namespaced tag names are not yet supported by css-select`);let{name:r}=t;return(!n.xmlMode||n.lowerCaseTags)&&(r=r.toLowerCase()),function(t){return a.getName(t)===r&&e(t)}}case X.Descendant:{if(n.cacheResults===!1||typeof WeakSet>`u`)return function(t){let n=t;for(;n=$q(n,a);)if(e(n))return!0;return!1};let t=new WeakSet;return function(n){let r=n;for(;r=$q(r,a);)if(!t.has(r)){if(a.isTag(r)&&e(r))return!0;t.add(r)}return!1}}case`_flexibleDescendant`:return function(t){let n=t;do if(e(n))return!0;while(n=$q(n,a));return!1};case X.Parent:return function(t){return a.getChildren(t).some(t=>a.isTag(t)&&e(t))};case X.Child:return function(t){let n=a.getParent(t);return n!=null&&a.isTag(n)&&e(n)};case X.Sibling:return function(t){let n=a.getSiblings(t);for(let r=0;r<n.length;r++){let i=n[r];if(o(t,i))break;if(a.isTag(i)&&e(i))return!0}return!1};case X.Adjacent:return a.prevElementSibling?function(t){let n=a.prevElementSibling(t);return n!=null&&e(n)}:function(t){let n=a.getSiblings(t),r;for(let e=0;e<n.length;e++){let i=n[e];if(o(t,i))break;a.isTag(i)&&(r=i)}return!!r&&e(r)};case X.Universal:if(t.namespace!=null&&t.namespace!==`*`)throw Error(`Namespaced universal selectors are not yet supported by css-select`);return e}}function tJ(e,t,n){return qq(nJ(e,t,n),t.adapter)}function nJ(e,t,n){return cJ(typeof e==`string`?wq(e):e,t,n)}function rJ(e){return e.type===X.Pseudo&&(e.name===`scope`||Array.isArray(e.data)&&e.data.some(e=>e.some(rJ)))}const iJ={type:X.Descendant},aJ={type:`_flexibleDescendant`},oJ={type:X.Pseudo,name:`scope`,data:null};function sJ(e,{adapter:t},n){let r=!!n?.every(e=>{let n=t.isTag(e)&&t.getParent(e);return e===Kq||n&&t.isTag(n)});for(let t of e){if(!(t.length>0&&Dq(t[0])&&t[0].type!==X.Descendant))if(r&&!t.some(rJ))t.unshift(iJ);else continue;t.unshift(oJ)}}function cJ(e,t,n){e.forEach(kq),n=t.context??n;let r=Array.isArray(n),i=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==!1)sJ(e,t,i);else if(e.some(e=>e.length>0&&Dq(e[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let a=!1,o=e.map(e=>{if(e.length>=2){let[t,n]=e;t.type!==X.Pseudo||t.name!==`scope`||(r&&n.type===X.Descendant?e[1]=aJ:(n.type===X.Adjacent||n.type===X.Sibling)&&(a=!0))}return lJ(e,t,i)}).reduce(uJ,Z.default.falseFunc);return o.shouldTestNextSiblings=a,o}function lJ(e,t,n){return e.reduce((e,r)=>e===Z.default.falseFunc?Z.default.falseFunc:eJ(e,r,t,n,cJ),t.rootFunc??Z.default.trueFunc)}function uJ(e,t){return t===Z.default.falseFunc||e===Z.default.trueFunc?e:e===Z.default.falseFunc||t===Z.default.trueFunc?t:function(n){return e(n)||t(n)}}const dJ=(e,t)=>e===t,fJ={adapter:MG,equals:dJ};function pJ(e){let t=e??fJ;return t.adapter??=MG,t.equals??=t.adapter?.equals??dJ,t}function mJ(e){return function(t,n,r){return e(t,pJ(n),r)}}const hJ=mJ(tJ);function gJ(e,t,n){let r=pJ(n);return(typeof t==`function`?t:tJ(t,r))(e)}const{isArray:_J}=Array,vJ=({nodeType:e})=>e===1,yJ=(e,t)=>t.some(t=>vJ(t)&&(e(t)||yJ(e,xJ(t)))),bJ=(e,t)=>t===`class`?e.classList.value:e.getAttribute(t),xJ=({childNodes:e})=>e,SJ=e=>{let{localName:t}=e;return ZG(e)?t.toLowerCase():t},CJ=({parentNode:e})=>e,wJ=e=>{let{parentNode:t}=e;return t?xJ(t):e},TJ=e=>_J(e)?e.map(TJ).join(``):vJ(e)?TJ(xJ(e)):e.nodeType===3?e.data:``,EJ=(e,t)=>e.hasAttribute(t),DJ=e=>{let{length:t}=e;for(;t--;){let n=e[t];if(t&&-1<e.lastIndexOf(n,t-1)){e.splice(t,1);continue}for(let{parentNode:r}=n;r;r=r.parentNode)if(e.includes(r)){e.splice(t,1);break}}return e},OJ=(e,t)=>{let n=[];for(let r of t)vJ(r)&&(e(r)&&n.push(r),n.push(...OJ(e,xJ(r))));return n},kJ=(e,t)=>{for(let n of t)if(e(n)||(n=kJ(e,xJ(n))))return n;return null},AJ={isTag:vJ,existsOne:yJ,getAttributeValue:bJ,getChildren:xJ,getName:SJ,getParent:CJ,getSiblings:wJ,getText:TJ,hasAttrib:EJ,removeSubsets:DJ,findAll:OJ,findOne:kJ},jJ=(e,t)=>hJ(t,{context:t.includes(`:scope`)?e:void 0,xmlMode:!ZG(e),adapter:AJ}),MJ=(e,t)=>gJ(e,t,{strict:!0,context:t.includes(`:scope`)?e:void 0,xmlMode:!ZG(e),adapter:AJ});var NJ=class e extends lq{constructor(e,t=``){super(e,`#text`,3,t)}get wholeText(){let e=[],{previousSibling:t,nextSibling:n}=this;for(;t&&t.nodeType===3;)e.unshift(t[rU]),t=t.previousSibling;for(e.push(this[rU]);n&&n.nodeType===3;)e.push(n[rU]),n=n.nextSibling;return e.join(``)}cloneNode(){let{ownerDocument:t,[rU]:n}=this;return new e(t,n)}toString(){return YK(this[rU])}};const PJ=e=>e instanceof WK,FJ=(e,t,n)=>{let{ownerDocument:r}=e;for(let i of n)e.insertBefore(PJ(i)?i:new NJ(r,i),t)};var IJ=class extends WK{constructor(e,t,n){super(e,t,n),this[QH]=null,this[K]=this[G]={[K]:null,[ZH]:this,[eU]:this,nodeType:-1,ownerDocument:this.ownerDocument,parentNode:null}}get childNodes(){let e=new HK,{firstChild:t}=this;for(;t;)e.push(t),t=tq(t);return e}get children(){let e=new HK,{firstElementChild:t}=this;for(;t;)e.push(t),t=nq(t);return e}get firstChild(){let{[K]:e,[G]:t}=this;for(;e.nodeType===2;)e=e[K];return e===t?null:e}get firstElementChild(){let{firstChild:e}=this;for(;e;){if(e.nodeType===1)return e;e=tq(e)}return null}get lastChild(){let e=this[G][ZH];switch(e.nodeType){case-1:return e[eU];case 2:return null}return e===this?null:e}get lastElementChild(){let{lastChild:e}=this;for(;e;){if(e.nodeType===1)return e;e=eq(e)}return null}get childElementCount(){return this.children.length}prepend(...e){FJ(this,this.firstChild,e)}append(...e){FJ(this,this[G],e)}replaceChildren(...e){let{[K]:t,[G]:n}=this;for(;t!==n&&t.nodeType===2;)t=t[K];for(;t!==n;){let e=XG(t)[K];t.remove(),t=e}e.length&&FJ(this,n,e)}getElementsByClassName(e){let t=new HK,{[K]:n,[G]:r}=this;for(;n!==r;)n.nodeType===1&&n.hasAttribute(`class`)&&n.classList.has(e)&&t.push(n),n=n[K];return t}getElementsByTagName(e){let t=new HK,{[K]:n,[G]:r}=this;for(;n!==r;)n.nodeType===1&&(n.localName===e||nK(n)===e)&&t.push(n),n=n[K];return t}querySelector(e){let t=jJ(this,e),{[K]:n,[G]:r}=this;for(;n!==r;){if(n.nodeType===1&&t(n))return n;n=n.nodeType===1&&n.localName===`template`?n[G]:n[K]}return null}querySelectorAll(e){let t=jJ(this,e),n=new HK,{[K]:r,[G]:i}=this;for(;r!==i;)r.nodeType===1&&t(r)&&n.push(r),r=r.nodeType===1&&r.localName===`template`?r[G]:r[K];return n}appendChild(e){return this.insertBefore(e,this[G])}contains(e){let t=e;for(;t&&t!==this;)t=t.parentNode;return t===this}insertBefore(e,t=null){if(e===t)return e;if(e===this)throw Error(`unable to append a node to itself`);let n=t||this[G];switch(e.nodeType){case 1:e.remove(),e.parentNode=this,$G(n[ZH],e,n),jK(e,null),fK(e);break;case 11:{let{[QH]:t,firstChild:r,lastChild:i}=e;if(r){eK(n[ZH],r,i,n),QG(e,e[G]),t&&t.replaceChildren();do r.parentNode=this,jK(r,null),r.nodeType===1&&fK(r);while(r!==i&&(r=tq(r)))}break}case 3:case 8:case 4:e.remove();default:e.parentNode=this,tK(n[ZH],e,n),jK(e,null);break}return e}normalize(){let{[K]:e,[G]:t}=this;for(;e!==t;){let{[K]:t,[ZH]:n,nodeType:r}=e;r===3&&(e[rU]?n&&n.nodeType===3&&(n.textContent+=e.textContent,e.remove()):e.remove()),e=t}}removeChild(e){if(e.parentNode!==this)throw Error(`node is not a child`);return e.remove(),e}replaceChild(e,t){let n=XG(t)[K];return t.remove(),this.insertBefore(e,n),t}},LJ=class extends IJ{getElementById(e){let{[K]:t,[G]:n}=this;for(;t!==n;){if(t.nodeType===1&&t.id===e)return t;t=t[K]}return null}cloneNode(e){let{ownerDocument:t,constructor:n}=this,r=new n(t);if(e){let{[G]:t}=r;for(let n of this.childNodes)r.insertBefore(n.cloneNode(e),t)}return r}toString(){let{childNodes:e,localName:t}=this;return`<${t}>${e.join(``)}</${t}>`}toJSON(){let e=[];return TK(this,e),e}},RJ=class extends LJ{constructor(e){super(e,`#document-fragment`,11)}},zJ=class e extends WK{constructor(e,t,n=``,r=``){super(e,`#document-type`,10),this.name=t,this.publicId=n,this.systemId=r}cloneNode(){let{ownerDocument:t,name:n,publicId:r,systemId:i}=this;return new e(t,n,r,i)}toString(){let{name:e,publicId:t,systemId:n}=this,r=0<t.length,i=[e];return r&&i.push(`PUBLIC`,`"${t}"`),n.length&&(r||i.push(`SYSTEM`),i.push(`"${n}"`)),`<!DOCTYPE ${i.join(` `)}>`}toJSON(){let e=[];return EK(this,e),e}};const BJ=e=>e.childNodes.join(``),VJ=(e,t)=>{let{ownerDocument:n}=e,{constructor:r}=n,i=new r;i[BH]=n[BH];let{childNodes:a}=yK(i,ZG(e),t);e.replaceChildren(...a.map(HJ,n))};function HJ(e){switch(e.ownerDocument=this,e.nodeType){case 1:case 11:e.childNodes.forEach(HJ,this);break}return e}var UJ=e=>e.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z0-9]+)([A-Z]))/g,`$2$5-$3$6`).toLowerCase();const WJ=new WeakMap,GJ=e=>`data-${UJ(e)}`,KJ=e=>e.slice(5).replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),qJ={get(e,t){if(t in e)return WJ.get(e).getAttribute(GJ(t))},set(e,t,n){return e[t]=n,WJ.get(e).setAttribute(GJ(t),n),!0},deleteProperty(e,t){return t in e&&WJ.get(e).removeAttribute(GJ(t)),delete e[t]}};var JJ=class{constructor(e){for(let{name:t,value:n}of e.attributes)/^data-/.test(t)&&(this[KJ(t)]=n);return WJ.set(this,e),new Proxy(this,qJ)}};JG(JJ.prototype,null);const{add:YJ}=Set.prototype,XJ=(e,t)=>{for(let n of t)n&&YJ.call(e,n)},ZJ=({[XH]:e,value:t})=>{let n=e.getAttributeNode(`class`);n?n.value=t:PK(e,new ZK(e.ownerDocument,`class`,t))};var QJ=class extends Set{constructor(e){super(),this[XH]=e;let t=e.getAttributeNode(`class`);t&&XJ(this,t.value.split(/\s+/))}get length(){return this.size}get value(){return[...this].join(` `)}add(...e){XJ(this,e),ZJ(this)}contains(e){return this.has(e)}remove(...e){for(let t of e)this.delete(t);ZJ(this)}toggle(e,t){if(this.has(e)){if(t)return!0;this.delete(e),ZJ(this)}else if(t||arguments.length===1)return super.add(e),ZJ(this),!0;return!1}replace(e,t){return this.has(e)?(this.delete(e),super.add(t),ZJ(this),!0):!1}supports(){return!0}};const $J=new WeakMap,eY=e=>[...e.keys()].filter(e=>e!==QH),tY=e=>{let t=$J.get(e).getAttributeNode(`style`);if((!t||t[RH]||e.get(QH)!==t)&&(e.clear(),t)){e.set(QH,t);for(let n of t[rU].split(/\s*;\s*/)){let[t,...r]=n.split(`:`);if(r.length>0){t=t.trim();let n=r.join(`:`).trim();t&&n&&e.set(t,n)}}}return t},nY={get(e,t){return t in iY?e[t]:(tY(e),t===`length`?eY(e).length:/^\d+$/.test(t)?eY(e)[t]:e.get(UJ(t)))},set(e,t,n){if(t===`cssText`)e[t]=n;else{let r=tY(e);if(n==null?e.delete(UJ(t)):e.set(UJ(t),n),!r){let t=$J.get(e);r=t.ownerDocument.createAttribute(`style`),t.setAttributeNode(r),e.set(QH,r)}r[RH]=!1,r[rU]=e.toString()}return!0}};var rY=class extends Map{constructor(e){return super(),$J.set(this,e),new Proxy(this,nY)}get cssText(){return this.toString()}set cssText(e){$J.get(this).setAttribute(`style`,e)}getPropertyValue(e){let t=this[QH];return nY.get(t,e)}setProperty(e,t){let n=this[QH];nY.set(n,e,t)}removeProperty(e){let t=this[QH];nY.set(t,e,null)}[Symbol.iterator](){let e=this[QH];tY(e);let t=eY(e),{length:n}=t,r=0;return{next(){let e=r===n;return{done:e,value:e?null:t[r++]}}}}get[QH](){return this}toString(){let e=this[QH];tY(e);let t=[];return e.forEach(aY,t),t.join(`;`)}};const{prototype:iY}=rY;function aY(e,t){t!==QH&&this.push(`${t}:${e}`)}function oY(e){return e.currentTarget}var sY=class{static get BUBBLING_PHASE(){return 3}static get AT_TARGET(){return 2}static get CAPTURING_PHASE(){return 1}static get NONE(){return 0}constructor(e,t={}){this.type=e,this.bubbles=!!t.bubbles,this.cancelBubble=!1,this._stopImmediatePropagationFlag=!1,this.cancelable=!!t.cancelable,this.eventPhase=this.NONE,this.timeStamp=Date.now(),this.defaultPrevented=!1,this.originalTarget=null,this.returnValue=null,this.srcElement=null,this.target=null,this._path=[]}get BUBBLING_PHASE(){return 3}get AT_TARGET(){return 2}get CAPTURING_PHASE(){return 1}get NONE(){return 0}preventDefault(){this.defaultPrevented=!0}composedPath(){return this._path.map(oY)}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this.stopPropagation(),this._stopImmediatePropagationFlag=!0}},cY=class extends Array{constructor(e){super(),this.ownerElement=e}getNamedItem(e){return this.ownerElement.getAttributeNode(e)}setNamedItem(e){this.ownerElement.setAttributeNode(e),this.unshift(e)}removeNamedItem(e){let t=this.getNamedItem(e);this.ownerElement.removeAttribute(e),this.splice(this.indexOf(t),1)}item(e){return e<this.length?this[e]:null}getNamedItemNS(e,t){return this.getNamedItem(t)}setNamedItemNS(e,t){return this.setNamedItem(t)}removeNamedItemNS(e,t){return this.removeNamedItem(t)}},lY=class extends LJ{constructor(e){super(e.ownerDocument,`#shadow-root`,11),this.host=e}get innerHTML(){return BJ(this)}set innerHTML(e){VJ(this,e)}};const uY={get(e,t){return t in e?e[t]:e.find(({name:e})=>e===t)}},dY=(e,t,n)=>{if(`ownerSVGElement`in t){let r=e.createElementNS(VG,n);return r.ownerSVGElement=t.ownerSVGElement,r}return e.createElement(n)},fY=({localName:e,ownerDocument:t})=>t[JH].voidElements.test(e);var pY=class extends IJ{constructor(e,t){super(e,t,1),this[zH]=null,this[HH]=null,this[tU]=null}get isConnected(){return QK(this)}get parentElement(){return $K(this)}get previousSibling(){return eq(this)}get nextSibling(){return tq(this)}get namespaceURI(){return`http://www.w3.org/1999/xhtml`}get previousElementSibling(){return rq(this)}get nextElementSibling(){return nq(this)}before(...e){aq(this,e)}after(...e){oq(this,e)}replaceWith(...e){sq(this,e)}remove(){cq(this[ZH],this,this[G][K])}get id(){return Y.get(this,`id`)}set id(e){Y.set(this,`id`,e)}get className(){return this.classList.value}set className(e){let{classList:t}=this;t.clear(),t.add(...YG(e).split(/\s+/))}get nodeName(){return nK(this)}get tagName(){return nK(this)}get classList(){return this[zH]||(this[zH]=new QJ(this))}get dataset(){return this[HH]||(this[HH]=new JJ(this))}getBoundingClientRect(){return{x:0,y:0,bottom:0,height:0,left:0,right:0,top:0,width:0}}get nonce(){return Y.get(this,`nonce`)}set nonce(e){Y.set(this,`nonce`,e)}get style(){return this[tU]||(this[tU]=new rY(this))}get tabIndex(){return LK.get(this,`tabindex`)||-1}set tabIndex(e){LK.set(this,`tabindex`,e)}get slot(){return Y.get(this,`slot`)}set slot(e){Y.set(this,`slot`,e)}get innerText(){let e=[],{[K]:t,[G]:n}=this;for(;t!==n;)t.nodeType===3?e.push(t.textContent.replace(/\s+/g,` `)):e.length&&t[K]!=n&&BG.has(t.tagName)&&e.push(`
1222
- `),t=t[K];return e.join(``)}get textContent(){let e=[],{[K]:t,[G]:n}=this;for(;t!==n;){let n=t.nodeType;(n===3||n===4)&&e.push(t.textContent),t=t[K]}return e.join(``)}set textContent(e){this.replaceChildren(),e!=null&&e!==``&&this.appendChild(new NJ(this.ownerDocument,e))}get innerHTML(){return BJ(this)}set innerHTML(e){VJ(this,e)}get outerHTML(){return this.toString()}set outerHTML(e){let t=this.ownerDocument.createElement(``);t.innerHTML=e,this.replaceWith(...t.childNodes)}get attributes(){let e=new cY(this),t=this[K];for(;t.nodeType===2;)e.push(t),t=t[K];return new Proxy(e,uY)}focus(){this.dispatchEvent(new sY(`focus`))}getAttribute(e){if(e===`class`)return this.className;let t=this.getAttributeNode(e);return t&&(ZG(this)?t.value:YK(t.value))}getAttributeNode(e){let t=this[K];for(;t.nodeType===2;){if(t.name===e)return t;t=t[K]}return null}getAttributeNames(){let e=new HK,t=this[K];for(;t.nodeType===2;)e.push(t.name),t=t[K];return e}hasAttribute(e){return!!this.getAttributeNode(e)}hasAttributes(){return this[K].nodeType===2}removeAttribute(e){e===`class`&&this[zH]&&this[zH].clear();let t=this[K];for(;t.nodeType===2;){if(t.name===e){FK(this,t);return}t=t[K]}}removeAttributeNode(e){let t=this[K];for(;t.nodeType===2;){if(t===e){FK(this,t);return}t=t[K]}}setAttribute(e,t){if(e===`class`)this.className=t;else{let n=this.getAttributeNode(e);n?n.value=t:PK(this,new ZK(this.ownerDocument,e,t))}}setAttributeNode(e){let{name:t}=e,n=this.getAttributeNode(t);if(n!==e){n&&this.removeAttributeNode(n);let{ownerElement:t}=e;t&&t.removeAttributeNode(e),PK(this,e)}return n}toggleAttribute(e,t){return this.hasAttribute(e)?t?!0:(this.removeAttribute(e),!1):t||arguments.length===1?(this.setAttribute(e,``),!0):!1}get shadowRoot(){if(aK.has(this)){let{mode:e,shadowRoot:t}=aK.get(this);if(e===`open`)return t}return null}attachShadow(e){if(aK.has(this))throw Error(`operation not supported`);let t=new lY(this);return aK.set(this,{mode:e.mode,shadowRoot:t}),t}matches(e){return MJ(this,e)}closest(e){let t=this,n=jJ(t,e);for(;t&&!n(t);)t=t.parentElement;return t}insertAdjacentElement(e,t){let{parentElement:n}=this;switch(e){case`beforebegin`:if(n){n.insertBefore(t,this);break}return null;case`afterbegin`:this.insertBefore(t,this.firstChild);break;case`beforeend`:this.insertBefore(t,null);break;case`afterend`:if(n){n.insertBefore(t,this.nextSibling);break}return null}return t}insertAdjacentHTML(e,t){this.insertAdjacentElement(e,iK(this.ownerDocument,t))}insertAdjacentText(e,t){let n=this.ownerDocument.createTextNode(t);this.insertAdjacentElement(e,n)}cloneNode(e=!1){let{ownerDocument:t,localName:n}=this,r=e=>{e.parentNode=a,QG(o,e),o=e},i=dY(t,this,n),a=i,o=i,{[K]:s,[G]:c}=this;for(;s!==c&&(e||s.nodeType===2);){switch(s.nodeType){case-1:QG(o,a[G]),o=a[G],a=a.parentNode;break;case 1:{let e=dY(t,s,s.localName);r(e),a=e;break}case 2:{let t=s.cloneNode(e);t.ownerElement=a,r(t);break}case 3:case 8:case 4:r(s.cloneNode(e));break}s=s[K]}return QG(o,i[G]),i}toString(){let e=[],{[G]:t}=this,n={[K]:this},r=!1;do switch(n=n[K],n.nodeType){case 2:{let t=` `+n;switch(t){case` id`:case` class`:case` style`:break;default:e.push(t)}break}case-1:{let t=n[eU];r?(`ownerSVGElement`in t?e.push(` />`):fY(t)?e.push(ZG(t)?`>`:` />`):e.push(`></${t.localName}>`),r=!1):e.push(`</${t.localName}>`);break}case 1:r&&e.push(`>`),n.toString===this.toString?(e.push(`<${n.localName}`),r=!0):(e.push(n.toString()),n=n[G],r=!1);break;case 3:case 8:case 4:e.push((r?`>`:``)+n),r=!1;break}while(n!==t);return e.join(``)}toJSON(){let e=[];return DK(this,e),e}getAttributeNS(e,t){return this.getAttribute(t)}getElementsByTagNameNS(e,t){return this.getElementsByTagName(t)}hasAttributeNS(e,t){return this.hasAttribute(t)}removeAttributeNS(e,t){this.removeAttribute(t)}setAttributeNS(e,t,n){this.setAttribute(t,n)}setAttributeNodeNS(e){return this.setAttributeNode(e)}};const mY=new WeakMap,hY={get(e,t){return e[t]},set(e,t,n){return e[t]=n,!0}};var gY=class extends pY{constructor(e,t,n=null){super(e,t),this.ownerSVGElement=n}get className(){return mY.has(this)||mY.set(this,new Proxy({baseVal:``,animVal:``},hY)),mY.get(this)}set className(e){let{classList:t}=this;t.clear(),t.add(...YG(e).split(/\s+/))}get namespaceURI(){return`http://www.w3.org/2000/svg`}getAttribute(e){return e===`class`?[...this.classList].join(` `):super.getAttribute(e)}setAttribute(e,t){if(e===`class`)this.className=t;else if(e===`style`){let{className:e}=this;e.baseVal=e.animVal=t}super.setAttribute(e,t)}};const _Y=()=>{throw TypeError(`Illegal constructor`)};function vY(){_Y()}JG(vY,ZK),vY.prototype=ZK.prototype;function yY(){_Y()}JG(yY,uq),yY.prototype=uq.prototype;function bY(){_Y()}JG(bY,lq),bY.prototype=lq.prototype;function xY(){_Y()}JG(xY,dq),xY.prototype=dq.prototype;function SY(){_Y()}JG(SY,RJ),SY.prototype=RJ.prototype;function CY(){_Y()}JG(CY,zJ),CY.prototype=zJ.prototype;function wY(){_Y()}JG(wY,pY),wY.prototype=pY.prototype;function TY(){_Y()}JG(TY,WK),TY.prototype=WK.prototype;function EY(){_Y()}JG(EY,lY),EY.prototype=lY.prototype;function DY(){_Y()}JG(DY,NJ),DY.prototype=NJ.prototype;function OY(){_Y()}JG(OY,gY),OY.prototype=gY.prototype;const kY={Attr:vY,CDATASection:yY,CharacterData:bY,Comment:xY,DocumentFragment:SY,DocumentType:CY,Element:wY,Node:TY,ShadowRoot:EY,Text:DY,SVGElement:OY},AY=new WeakMap,Q={get(e,t){return AY.has(e)&&AY.get(e)[t]||null},set(e,t,n){AY.has(e)||AY.set(e,{});let r=AY.get(e),i=t.slice(2);r[t]&&e.removeEventListener(i,r[t],!1),(r[t]=n)&&e.addEventListener(i,n,!1)}};var $=class extends pY{static get observedAttributes(){return[]}constructor(e=null,t=``){super(e,t);let n=!e,r;if(n){let{constructor:n}=this;if(!sK.has(n))throw Error(`unable to initialize this Custom Element`);({ownerDocument:e,localName:t,options:r}=sK.get(n))}if(e[nU]){let{element:t,values:n}=e[nU];e[nU]=null;for(let[e,r]of n)t[e]=r;return t}n&&(this.ownerDocument=this[G].ownerDocument=e,this.localName=t,cK.set(this,{connected:!1}),r.is&&this.setAttribute(`is`,r.is))}blur(){this.dispatchEvent(new sY(`blur`))}click(){let e=new sY(`click`,{bubbles:!0,cancelable:!0});e.button=0,this.dispatchEvent(e)}get accessKeyLabel(){let{accessKey:e}=this;return e&&`Alt+Shift+${e}`}get isContentEditable(){return this.hasAttribute(`contenteditable`)}get contentEditable(){return IK.get(this,`contenteditable`)}set contentEditable(e){IK.set(this,`contenteditable`,e)}get draggable(){return IK.get(this,`draggable`)}set draggable(e){IK.set(this,`draggable`,e)}get hidden(){return IK.get(this,`hidden`)}set hidden(e){IK.set(this,`hidden`,e)}get spellcheck(){return IK.get(this,`spellcheck`)}set spellcheck(e){IK.set(this,`spellcheck`,e)}get accessKey(){return Y.get(this,`accesskey`)}set accessKey(e){Y.set(this,`accesskey`,e)}get dir(){return Y.get(this,`dir`)}set dir(e){Y.set(this,`dir`,e)}get lang(){return Y.get(this,`lang`)}set lang(e){Y.set(this,`lang`,e)}get title(){return Y.get(this,`title`)}set title(e){Y.set(this,`title`,e)}get onabort(){return Q.get(this,`onabort`)}set onabort(e){Q.set(this,`onabort`,e)}get onblur(){return Q.get(this,`onblur`)}set onblur(e){Q.set(this,`onblur`,e)}get oncancel(){return Q.get(this,`oncancel`)}set oncancel(e){Q.set(this,`oncancel`,e)}get oncanplay(){return Q.get(this,`oncanplay`)}set oncanplay(e){Q.set(this,`oncanplay`,e)}get oncanplaythrough(){return Q.get(this,`oncanplaythrough`)}set oncanplaythrough(e){Q.set(this,`oncanplaythrough`,e)}get onchange(){return Q.get(this,`onchange`)}set onchange(e){Q.set(this,`onchange`,e)}get onclick(){return Q.get(this,`onclick`)}set onclick(e){Q.set(this,`onclick`,e)}get onclose(){return Q.get(this,`onclose`)}set onclose(e){Q.set(this,`onclose`,e)}get oncontextmenu(){return Q.get(this,`oncontextmenu`)}set oncontextmenu(e){Q.set(this,`oncontextmenu`,e)}get oncuechange(){return Q.get(this,`oncuechange`)}set oncuechange(e){Q.set(this,`oncuechange`,e)}get ondblclick(){return Q.get(this,`ondblclick`)}set ondblclick(e){Q.set(this,`ondblclick`,e)}get ondrag(){return Q.get(this,`ondrag`)}set ondrag(e){Q.set(this,`ondrag`,e)}get ondragend(){return Q.get(this,`ondragend`)}set ondragend(e){Q.set(this,`ondragend`,e)}get ondragenter(){return Q.get(this,`ondragenter`)}set ondragenter(e){Q.set(this,`ondragenter`,e)}get ondragleave(){return Q.get(this,`ondragleave`)}set ondragleave(e){Q.set(this,`ondragleave`,e)}get ondragover(){return Q.get(this,`ondragover`)}set ondragover(e){Q.set(this,`ondragover`,e)}get ondragstart(){return Q.get(this,`ondragstart`)}set ondragstart(e){Q.set(this,`ondragstart`,e)}get ondrop(){return Q.get(this,`ondrop`)}set ondrop(e){Q.set(this,`ondrop`,e)}get ondurationchange(){return Q.get(this,`ondurationchange`)}set ondurationchange(e){Q.set(this,`ondurationchange`,e)}get onemptied(){return Q.get(this,`onemptied`)}set onemptied(e){Q.set(this,`onemptied`,e)}get onended(){return Q.get(this,`onended`)}set onended(e){Q.set(this,`onended`,e)}get onerror(){return Q.get(this,`onerror`)}set onerror(e){Q.set(this,`onerror`,e)}get onfocus(){return Q.get(this,`onfocus`)}set onfocus(e){Q.set(this,`onfocus`,e)}get oninput(){return Q.get(this,`oninput`)}set oninput(e){Q.set(this,`oninput`,e)}get oninvalid(){return Q.get(this,`oninvalid`)}set oninvalid(e){Q.set(this,`oninvalid`,e)}get onkeydown(){return Q.get(this,`onkeydown`)}set onkeydown(e){Q.set(this,`onkeydown`,e)}get onkeypress(){return Q.get(this,`onkeypress`)}set onkeypress(e){Q.set(this,`onkeypress`,e)}get onkeyup(){return Q.get(this,`onkeyup`)}set onkeyup(e){Q.set(this,`onkeyup`,e)}get onload(){return Q.get(this,`onload`)}set onload(e){Q.set(this,`onload`,e)}get onloadeddata(){return Q.get(this,`onloadeddata`)}set onloadeddata(e){Q.set(this,`onloadeddata`,e)}get onloadedmetadata(){return Q.get(this,`onloadedmetadata`)}set onloadedmetadata(e){Q.set(this,`onloadedmetadata`,e)}get onloadstart(){return Q.get(this,`onloadstart`)}set onloadstart(e){Q.set(this,`onloadstart`,e)}get onmousedown(){return Q.get(this,`onmousedown`)}set onmousedown(e){Q.set(this,`onmousedown`,e)}get onmouseenter(){return Q.get(this,`onmouseenter`)}set onmouseenter(e){Q.set(this,`onmouseenter`,e)}get onmouseleave(){return Q.get(this,`onmouseleave`)}set onmouseleave(e){Q.set(this,`onmouseleave`,e)}get onmousemove(){return Q.get(this,`onmousemove`)}set onmousemove(e){Q.set(this,`onmousemove`,e)}get onmouseout(){return Q.get(this,`onmouseout`)}set onmouseout(e){Q.set(this,`onmouseout`,e)}get onmouseover(){return Q.get(this,`onmouseover`)}set onmouseover(e){Q.set(this,`onmouseover`,e)}get onmouseup(){return Q.get(this,`onmouseup`)}set onmouseup(e){Q.set(this,`onmouseup`,e)}get onmousewheel(){return Q.get(this,`onmousewheel`)}set onmousewheel(e){Q.set(this,`onmousewheel`,e)}get onpause(){return Q.get(this,`onpause`)}set onpause(e){Q.set(this,`onpause`,e)}get onplay(){return Q.get(this,`onplay`)}set onplay(e){Q.set(this,`onplay`,e)}get onplaying(){return Q.get(this,`onplaying`)}set onplaying(e){Q.set(this,`onplaying`,e)}get onprogress(){return Q.get(this,`onprogress`)}set onprogress(e){Q.set(this,`onprogress`,e)}get onratechange(){return Q.get(this,`onratechange`)}set onratechange(e){Q.set(this,`onratechange`,e)}get onreset(){return Q.get(this,`onreset`)}set onreset(e){Q.set(this,`onreset`,e)}get onresize(){return Q.get(this,`onresize`)}set onresize(e){Q.set(this,`onresize`,e)}get onscroll(){return Q.get(this,`onscroll`)}set onscroll(e){Q.set(this,`onscroll`,e)}get onseeked(){return Q.get(this,`onseeked`)}set onseeked(e){Q.set(this,`onseeked`,e)}get onseeking(){return Q.get(this,`onseeking`)}set onseeking(e){Q.set(this,`onseeking`,e)}get onselect(){return Q.get(this,`onselect`)}set onselect(e){Q.set(this,`onselect`,e)}get onshow(){return Q.get(this,`onshow`)}set onshow(e){Q.set(this,`onshow`,e)}get onstalled(){return Q.get(this,`onstalled`)}set onstalled(e){Q.set(this,`onstalled`,e)}get onsubmit(){return Q.get(this,`onsubmit`)}set onsubmit(e){Q.set(this,`onsubmit`,e)}get onsuspend(){return Q.get(this,`onsuspend`)}set onsuspend(e){Q.set(this,`onsuspend`,e)}get ontimeupdate(){return Q.get(this,`ontimeupdate`)}set ontimeupdate(e){Q.set(this,`ontimeupdate`,e)}get ontoggle(){return Q.get(this,`ontoggle`)}set ontoggle(e){Q.set(this,`ontoggle`,e)}get onvolumechange(){return Q.get(this,`onvolumechange`)}set onvolumechange(e){Q.set(this,`onvolumechange`,e)}get onwaiting(){return Q.get(this,`onwaiting`)}set onwaiting(e){Q.set(this,`onwaiting`,e)}get onauxclick(){return Q.get(this,`onauxclick`)}set onauxclick(e){Q.set(this,`onauxclick`,e)}get ongotpointercapture(){return Q.get(this,`ongotpointercapture`)}set ongotpointercapture(e){Q.set(this,`ongotpointercapture`,e)}get onlostpointercapture(){return Q.get(this,`onlostpointercapture`)}set onlostpointercapture(e){Q.set(this,`onlostpointercapture`,e)}get onpointercancel(){return Q.get(this,`onpointercancel`)}set onpointercancel(e){Q.set(this,`onpointercancel`,e)}get onpointerdown(){return Q.get(this,`onpointerdown`)}set onpointerdown(e){Q.set(this,`onpointerdown`,e)}get onpointerenter(){return Q.get(this,`onpointerenter`)}set onpointerenter(e){Q.set(this,`onpointerenter`,e)}get onpointerleave(){return Q.get(this,`onpointerleave`)}set onpointerleave(e){Q.set(this,`onpointerleave`,e)}get onpointermove(){return Q.get(this,`onpointermove`)}set onpointermove(e){Q.set(this,`onpointermove`,e)}get onpointerout(){return Q.get(this,`onpointerout`)}set onpointerout(e){Q.set(this,`onpointerout`,e)}get onpointerover(){return Q.get(this,`onpointerover`)}set onpointerover(e){Q.set(this,`onpointerover`,e)}get onpointerup(){return Q.get(this,`onpointerup`)}set onpointerup(e){Q.set(this,`onpointerup`,e)}};const jY=`template`;var MY=class extends ${constructor(e){super(e,jY);let t=this.ownerDocument.createDocumentFragment();(this[VH]=t)[QH]=this}get content(){if(this.hasChildNodes()&&!this[VH].hasChildNodes())for(let e of this.childNodes)this[VH].appendChild(e.cloneNode(!0));return this[VH]}};xK(jY,MY);var NY=class extends ${constructor(e,t=`html`){super(e,t)}};const{toString:PY}=$.prototype;var FY=class extends ${get innerHTML(){return this.textContent}set innerHTML(e){this.textContent=e}toString(){return PY.call(this.cloneNode()).replace(`><`,()=>`>${this.textContent}<`)}};const IY=`script`;var LY=class extends FY{constructor(e,t=IY){super(e,t)}get type(){return Y.get(this,`type`)}set type(e){Y.set(this,`type`,e)}get src(){return Y.get(this,`src`)}set src(e){Y.set(this,`src`,e)}get defer(){return IK.get(this,`defer`)}set defer(e){IK.set(this,`defer`,e)}get crossOrigin(){return Y.get(this,`crossorigin`)}set crossOrigin(e){Y.set(this,`crossorigin`,e)}get nomodule(){return IK.get(this,`nomodule`)}set nomodule(e){IK.set(this,`nomodule`,e)}get referrerPolicy(){return Y.get(this,`referrerpolicy`)}set referrerPolicy(e){Y.set(this,`referrerpolicy`,e)}get nonce(){return Y.get(this,`nonce`)}set nonce(e){Y.set(this,`nonce`,e)}get async(){return IK.get(this,`async`)}set async(e){IK.set(this,`async`,e)}get text(){return this.textContent}set text(e){this.textContent=e}};xK(IY,LY);var RY=class extends ${constructor(e,t=`frame`){super(e,t)}};const zY=`iframe`;var BY=class extends ${constructor(e,t=zY){super(e,t)}get src(){return Y.get(this,`src`)}set src(e){Y.set(this,`src`,e)}get srcdoc(){return Y.get(this,`srcdoc`)}set srcdoc(e){Y.set(this,`srcdoc`,e)}get name(){return Y.get(this,`name`)}set name(e){Y.set(this,`name`,e)}get allow(){return Y.get(this,`allow`)}set allow(e){Y.set(this,`allow`,e)}get allowFullscreen(){return IK.get(this,`allowfullscreen`)}set allowFullscreen(e){IK.set(this,`allowfullscreen`,e)}get referrerPolicy(){return Y.get(this,`referrerpolicy`)}set referrerPolicy(e){Y.set(this,`referrerpolicy`,e)}get loading(){return Y.get(this,`loading`)}set loading(e){Y.set(this,`loading`,e)}};xK(zY,BY);var VY=class extends ${constructor(e,t=`object`){super(e,t)}},HY=class extends ${constructor(e,t=`head`){super(e,t)}},UY=class extends ${constructor(e,t=`body`){super(e,t)}},WY=s((e=>{var t={};t.StyleSheet=function(){this.parentStyleSheet=null},e.StyleSheet=t.StyleSheet})),GY=s((e=>{var t={};t.CSSRule=function(){this.parentRule=null,this.parentStyleSheet=null},t.CSSRule.UNKNOWN_RULE=0,t.CSSRule.STYLE_RULE=1,t.CSSRule.CHARSET_RULE=2,t.CSSRule.IMPORT_RULE=3,t.CSSRule.MEDIA_RULE=4,t.CSSRule.FONT_FACE_RULE=5,t.CSSRule.PAGE_RULE=6,t.CSSRule.KEYFRAMES_RULE=7,t.CSSRule.KEYFRAME_RULE=8,t.CSSRule.MARGIN_RULE=9,t.CSSRule.NAMESPACE_RULE=10,t.CSSRule.COUNTER_STYLE_RULE=11,t.CSSRule.SUPPORTS_RULE=12,t.CSSRule.DOCUMENT_RULE=13,t.CSSRule.FONT_FEATURE_VALUES_RULE=14,t.CSSRule.VIEWPORT_RULE=15,t.CSSRule.REGION_STYLE_RULE=16,t.CSSRule.prototype={constructor:t.CSSRule},e.CSSRule=t.CSSRule})),KY=s((e=>{var t={CSSStyleDeclaration:lX().CSSStyleDeclaration,CSSRule:GY().CSSRule};t.CSSStyleRule=function(){t.CSSRule.call(this),this.selectorText=``,this.style=new t.CSSStyleDeclaration,this.style.parentRule=this},t.CSSStyleRule.prototype=new t.CSSRule,t.CSSStyleRule.prototype.constructor=t.CSSStyleRule,t.CSSStyleRule.prototype.type=1,Object.defineProperty(t.CSSStyleRule.prototype,"cssText",{get:function(){return this.selectorText?this.selectorText+` {`+this.style.cssText+`}`:``},set:function(e){var n=t.CSSStyleRule.parse(e);this.style=n.style,this.selectorText=n.selectorText}}),t.CSSStyleRule.parse=function(e){for(var n=0,r=`selector`,i,a=n,o=``,s={selector:!0,value:!0},c=new t.CSSStyleRule,l,u=``,d;d=e.charAt(n);n++)switch(d){case` `:case` `:case`\r`:case`
1223
- `:case`\f`:if(s[r])switch(e.charAt(n-1)){case` `:case` `:case`\r`:case`
1224
- `:case`\f`:break;default:o+=` `;break}break;case`"`:if(a=n+1,i=e.indexOf(`"`,a)+1,!i)throw`" is missing`;o+=e.slice(n,i),n=i-1;break;case`'`:if(a=n+1,i=e.indexOf(`'`,a)+1,!i)throw`' is missing`;o+=e.slice(n,i),n=i-1;break;case`/`:if(e.charAt(n+1)===`*`){if(n+=2,i=e.indexOf(`*/`,n),i===-1)throw SyntaxError(`Missing */`);n=i+1}else o+=d;break;case`{`:r===`selector`&&(c.selectorText=o.trim(),o=``,r=`name`);break;case`:`:r===`name`?(l=o.trim(),o=``,r=`value`):o+=d;break;case`!`:r===`value`&&e.indexOf(`!important`,n)===n?(u=`important`,n+=9):o+=d;break;case`;`:r===`value`?(c.style.setProperty(l,o.trim(),u),u=``,o=``,r=`name`):o+=d;break;case`}`:if(r===`value`)c.style.setProperty(l,o.trim(),u),u=``,o=``;else if(r===`name`)break;else o+=d;r=`selector`;break;default:o+=d;break}return c},e.CSSStyleRule=t.CSSStyleRule})),qY=s((e=>{var t={StyleSheet:WY().StyleSheet,CSSStyleRule:KY().CSSStyleRule};t.CSSStyleSheet=function(){t.StyleSheet.call(this),this.cssRules=[]},t.CSSStyleSheet.prototype=new t.StyleSheet,t.CSSStyleSheet.prototype.constructor=t.CSSStyleSheet,t.CSSStyleSheet.prototype.insertRule=function(e,n){if(n<0||n>this.cssRules.length)throw RangeError(`INDEX_SIZE_ERR`);var r=t.parse(e).cssRules[0];return r.parentStyleSheet=this,this.cssRules.splice(n,0,r),n},t.CSSStyleSheet.prototype.deleteRule=function(e){if(e<0||e>=this.cssRules.length)throw RangeError(`INDEX_SIZE_ERR`);this.cssRules.splice(e,1)},t.CSSStyleSheet.prototype.toString=function(){for(var e=``,t=this.cssRules,n=0;n<t.length;n++)e+=t[n].cssText+`
1225
- `;return e},e.CSSStyleSheet=t.CSSStyleSheet,t.parse=cX().parse})),JY=s((e=>{var t={};t.MediaList=function(){this.length=0},t.MediaList.prototype={constructor:t.MediaList,get mediaText(){return Array.prototype.join.call(this,`, `)},set mediaText(e){for(var t=e.split(`,`),n=this.length=t.length,r=0;r<n;r++)this[r]=t[r].trim()},appendMedium:function(e){Array.prototype.indexOf.call(this,e)===-1&&(this[this.length]=e,this.length++)},deleteMedium:function(e){var t=Array.prototype.indexOf.call(this,e);t!==-1&&Array.prototype.splice.call(this,t,1)}},e.MediaList=t.MediaList})),YY=s((e=>{var t={CSSRule:GY().CSSRule,CSSStyleSheet:qY().CSSStyleSheet,MediaList:JY().MediaList};t.CSSImportRule=function(){t.CSSRule.call(this),this.href=``,this.media=new t.MediaList,this.styleSheet=new t.CSSStyleSheet},t.CSSImportRule.prototype=new t.CSSRule,t.CSSImportRule.prototype.constructor=t.CSSImportRule,t.CSSImportRule.prototype.type=3,Object.defineProperty(t.CSSImportRule.prototype,"cssText",{get:function(){var e=this.media.mediaText;return`@import url(`+this.href+`)`+(e?` `+e:``)+`;`},set:function(e){for(var t=0,n=``,r=``,i,a;a=e.charAt(t);t++)switch(a){case` `:case` `:case`\r`:case`
1226
- `:case`\f`:n===`after-import`?n=`url`:r+=a;break;case`@`:!n&&e.indexOf(`@import`,t)===t&&(n=`after-import`,t+=6,r=``);break;case`u`:if(n===`url`&&e.indexOf(`url(`,t)===t){if(i=e.indexOf(`)`,t+1),i===-1)throw t+`: ")" not found`;t+=4;var o=e.slice(t,i);o[0]===o[o.length-1]&&(o[0]===`"`||o[0]===`'`)&&(o=o.slice(1,-1)),this.href=o,t=i,n=`media`}break;case`"`:if(n===`url`){if(i=e.indexOf(`"`,t+1),!i)throw t+`: '"' not found`;this.href=e.slice(t+1,i),t=i,n=`media`}break;case`'`:if(n===`url`){if(i=e.indexOf(`'`,t+1),!i)throw t+`: "'" not found`;this.href=e.slice(t+1,i),t=i,n=`media`}break;case`;`:n===`media`&&r&&(this.media.mediaText=r.trim());break;default:n===`media`&&(r+=a);break}}}),e.CSSImportRule=t.CSSImportRule})),XY=s((e=>{var t={CSSRule:GY().CSSRule};t.CSSGroupingRule=function(){t.CSSRule.call(this),this.cssRules=[]},t.CSSGroupingRule.prototype=new t.CSSRule,t.CSSGroupingRule.prototype.constructor=t.CSSGroupingRule,t.CSSGroupingRule.prototype.insertRule=function(e,n){if(n<0||n>this.cssRules.length)throw RangeError(`INDEX_SIZE_ERR`);var r=t.parse(e).cssRules[0];return r.parentRule=this,this.cssRules.splice(n,0,r),n},t.CSSGroupingRule.prototype.deleteRule=function(e){if(e<0||e>=this.cssRules.length)throw RangeError(`INDEX_SIZE_ERR`);this.cssRules.splice(e,1)[0].parentRule=null},e.CSSGroupingRule=t.CSSGroupingRule})),ZY=s((e=>{var t={CSSRule:GY().CSSRule,CSSGroupingRule:XY().CSSGroupingRule};t.CSSConditionRule=function(){t.CSSGroupingRule.call(this),this.cssRules=[]},t.CSSConditionRule.prototype=new t.CSSGroupingRule,t.CSSConditionRule.prototype.constructor=t.CSSConditionRule,t.CSSConditionRule.prototype.conditionText=``,t.CSSConditionRule.prototype.cssText=``,e.CSSConditionRule=t.CSSConditionRule})),QY=s((e=>{var t={CSSRule:GY().CSSRule,CSSGroupingRule:XY().CSSGroupingRule,CSSConditionRule:ZY().CSSConditionRule,MediaList:JY().MediaList};t.CSSMediaRule=function(){t.CSSConditionRule.call(this),this.media=new t.MediaList},t.CSSMediaRule.prototype=new t.CSSConditionRule,t.CSSMediaRule.prototype.constructor=t.CSSMediaRule,t.CSSMediaRule.prototype.type=4,Object.defineProperties(t.CSSMediaRule.prototype,{conditionText:{get:function(){return this.media.mediaText},set:function(e){this.media.mediaText=e},configurable:!0,enumerable:!0},cssText:{get:function(){for(var e=[],t=0,n=this.cssRules.length;t<n;t++)e.push(this.cssRules[t].cssText);return`@media `+this.media.mediaText+` {`+e.join(``)+`}`},configurable:!0,enumerable:!0}}),e.CSSMediaRule=t.CSSMediaRule})),$Y=s((e=>{var t={CSSRule:GY().CSSRule,CSSGroupingRule:XY().CSSGroupingRule,CSSConditionRule:ZY().CSSConditionRule};t.CSSSupportsRule=function(){t.CSSConditionRule.call(this)},t.CSSSupportsRule.prototype=new t.CSSConditionRule,t.CSSSupportsRule.prototype.constructor=t.CSSSupportsRule,t.CSSSupportsRule.prototype.type=12,Object.defineProperty(t.CSSSupportsRule.prototype,"cssText",{get:function(){for(var e=[],t=0,n=this.cssRules.length;t<n;t++)e.push(this.cssRules[t].cssText);return`@supports `+this.conditionText+` {`+e.join(``)+`}`}}),e.CSSSupportsRule=t.CSSSupportsRule})),eX=s((e=>{var t={CSSStyleDeclaration:lX().CSSStyleDeclaration,CSSRule:GY().CSSRule};t.CSSFontFaceRule=function(){t.CSSRule.call(this),this.style=new t.CSSStyleDeclaration,this.style.parentRule=this},t.CSSFontFaceRule.prototype=new t.CSSRule,t.CSSFontFaceRule.prototype.constructor=t.CSSFontFaceRule,t.CSSFontFaceRule.prototype.type=5,Object.defineProperty(t.CSSFontFaceRule.prototype,"cssText",{get:function(){return`@font-face {`+this.style.cssText+`}`}}),e.CSSFontFaceRule=t.CSSFontFaceRule})),tX=s((e=>{var t={CSSRule:GY().CSSRule};t.CSSHostRule=function(){t.CSSRule.call(this),this.cssRules=[]},t.CSSHostRule.prototype=new t.CSSRule,t.CSSHostRule.prototype.constructor=t.CSSHostRule,t.CSSHostRule.prototype.type=1001,Object.defineProperty(t.CSSHostRule.prototype,"cssText",{get:function(){for(var e=[],t=0,n=this.cssRules.length;t<n;t++)e.push(this.cssRules[t].cssText);return`@host {`+e.join(``)+`}`}}),e.CSSHostRule=t.CSSHostRule})),nX=s((e=>{var t={CSSRule:GY().CSSRule,CSSStyleDeclaration:lX().CSSStyleDeclaration};t.CSSKeyframeRule=function(){t.CSSRule.call(this),this.keyText=``,this.style=new t.CSSStyleDeclaration,this.style.parentRule=this},t.CSSKeyframeRule.prototype=new t.CSSRule,t.CSSKeyframeRule.prototype.constructor=t.CSSKeyframeRule,t.CSSKeyframeRule.prototype.type=8,Object.defineProperty(t.CSSKeyframeRule.prototype,"cssText",{get:function(){return this.keyText+` {`+this.style.cssText+`} `}}),e.CSSKeyframeRule=t.CSSKeyframeRule})),rX=s((e=>{var t={CSSRule:GY().CSSRule};t.CSSKeyframesRule=function(){t.CSSRule.call(this),this.name=``,this.cssRules=[]},t.CSSKeyframesRule.prototype=new t.CSSRule,t.CSSKeyframesRule.prototype.constructor=t.CSSKeyframesRule,t.CSSKeyframesRule.prototype.type=7,Object.defineProperty(t.CSSKeyframesRule.prototype,"cssText",{get:function(){for(var e=[],t=0,n=this.cssRules.length;t<n;t++)e.push(` `+this.cssRules[t].cssText);return`@`+(this._vendorPrefix||``)+`keyframes `+this.name+` {
1227
- `+e.join(`
1228
- `)+`
1229
- }`}}),e.CSSKeyframesRule=t.CSSKeyframesRule})),iX=s((e=>{var t={};t.CSSValue=function(){},t.CSSValue.prototype={constructor:t.CSSValue,set cssText(e){var t=this._getConstructorName();throw Error(`DOMException: property "cssText" of "`+t+`" is readonly and can not be replaced with "`+e+`"!`)},get cssText(){var e=this._getConstructorName();throw Error(`getter "cssText" of "`+e+`" is not implemented!`)},_getConstructorName:function(){return this.constructor.toString().match(/function\s([^\(]+)/)[1]}},e.CSSValue=t.CSSValue})),aX=s((e=>{var t={CSSValue:iX().CSSValue};t.CSSValueExpression=function(e,t){this._token=e,this._idx=t},t.CSSValueExpression.prototype=new t.CSSValue,t.CSSValueExpression.prototype.constructor=t.CSSValueExpression,t.CSSValueExpression.prototype.parse=function(){for(var e=this._token,t=this._idx,n=``,r=``,i=``,a,o=[];;++t){if(n=e.charAt(t),n===``){i=`css expression error: unfinished expression!`;break}switch(n){case`(`:o.push(n),r+=n;break;case`)`:o.pop(n),r+=n;break;case`/`:(a=this._parseJSComment(e,t))?a.error?i=`css expression error: unfinished comment in expression!`:t=a.idx:(a=this._parseJSRexExp(e,t))?(t=a.idx,r+=a.text):r+=n;break;case`'`:case`"`:a=this._parseJSString(e,t,n),a?(t=a.idx,r+=a.text):r+=n;break;default:r+=n;break}if(i||o.length===0)break}return i?{error:i}:{idx:t,expression:r}},t.CSSValueExpression.prototype._parseJSComment=function(e,t){var n=e.charAt(t+1),r;if(n===`/`||n===`*`){var i=t,a,o;return n===`/`?o=`
1230
- `:n===`*`&&(o=`*/`),a=e.indexOf(o,i+1+1),a===-1?{error:`css expression error: unfinished comment in expression!`}:(a=a+o.length-1,r=e.substring(t,a+1),{idx:a,text:r})}else return!1},t.CSSValueExpression.prototype._parseJSString=function(e,t,n){var r=this._findMatchedIdx(e,t,n),i;return r===-1?!1:(i=e.substring(t,r+n.length),{idx:r,text:i})},t.CSSValueExpression.prototype._parseJSRexExp=function(e,t){var n=e.substring(0,t).replace(/\s+$/,``);return[/^$/,/\($/,/\[$/,/\!$/,/\+$/,/\-$/,/\*$/,/\/\s+/,/\%$/,/\=$/,/\>$/,/<$/,/\&$/,/\|$/,/\^$/,/\~$/,/\?$/,/\,$/,/delete$/,/in$/,/instanceof$/,/new$/,/typeof$/,/void$/].some(function(e){return e.test(n)})?this._parseJSString(e,t,`/`):!1},t.CSSValueExpression.prototype._findMatchedIdx=function(e,t,n){for(var r=t,i,a=-1;;)if(i=e.indexOf(n,r+1),i===-1){i=a;break}else{var o=e.substring(t+1,i).match(/\\+$/);if(!o||o[0]%2==0)break;r=i}return e.indexOf(`
1231
- `,t+1)<i&&(i=a),i},e.CSSValueExpression=t.CSSValueExpression})),oX=s((e=>{var t={};t.MatcherList=function(){this.length=0},t.MatcherList.prototype={constructor:t.MatcherList,get matcherText(){return Array.prototype.join.call(this,`, `)},set matcherText(e){for(var t=e.split(`,`),n=this.length=t.length,r=0;r<n;r++)this[r]=t[r].trim()},appendMatcher:function(e){Array.prototype.indexOf.call(this,e)===-1&&(this[this.length]=e,this.length++)},deleteMatcher:function(e){var t=Array.prototype.indexOf.call(this,e);t!==-1&&Array.prototype.splice.call(this,t,1)}},e.MatcherList=t.MatcherList})),sX=s((e=>{var t={CSSRule:GY().CSSRule,MatcherList:oX().MatcherList};t.CSSDocumentRule=function(){t.CSSRule.call(this),this.matcher=new t.MatcherList,this.cssRules=[]},t.CSSDocumentRule.prototype=new t.CSSRule,t.CSSDocumentRule.prototype.constructor=t.CSSDocumentRule,t.CSSDocumentRule.prototype.type=10,Object.defineProperty(t.CSSDocumentRule.prototype,"cssText",{get:function(){for(var e=[],t=0,n=this.cssRules.length;t<n;t++)e.push(this.cssRules[t].cssText);return`@-moz-document `+this.matcher.matcherText+` {`+e.join(``)+`}`}}),e.CSSDocumentRule=t.CSSDocumentRule})),cX=s((e=>{var t={};t.parse=function(e){for(var n=0,r=`before-selector`,i,a=``,o=0,s={selector:!0,value:!0,"value-parenthesis":!0,atRule:!0,"importRule-begin":!0,importRule:!0,atBlock:!0,conditionBlock:!0,"documentRule-begin":!0},c=new t.CSSStyleSheet,l=c,u,d=[],f=!1,p,m,h=``,g,_,ee,v,y,te,b,ne,x=/@(-(?:\w+-)+)?keyframes/g,re=function(t){var r=e.substring(0,n).split(`
1232
- `),i=r.length,a=r.pop().length+1,o=Error(t+` (line `+i+`, char `+a+`)`);throw o.line=i,o.char=a,o.styleSheet=c,o},ie;ie=e.charAt(n);n++)switch(ie){case` `:case` `:case`\r`:case`
1233
- `:case`\f`:s[r]&&(a+=ie);break;case`"`:i=n+1;do i=e.indexOf(`"`,i)+1,i||re(`Unmatched "`);while(e[i-2]===`\\`);switch(a+=e.slice(n,i),n=i-1,r){case`before-value`:r=`value`;break;case`importRule-begin`:r=`importRule`;break}break;case`'`:i=n+1;do i=e.indexOf(`'`,i)+1,i||re(`Unmatched '`);while(e[i-2]===`\\`);switch(a+=e.slice(n,i),n=i-1,r){case`before-value`:r=`value`;break;case`importRule-begin`:r=`importRule`;break}break;case`/`:e.charAt(n+1)===`*`?(n+=2,i=e.indexOf(`*/`,n),i===-1?re(`Missing */`):n=i+1):a+=ie,r===`importRule-begin`&&(a+=` `,r=`importRule`);break;case`@`:if(e.indexOf(`@-moz-document`,n)===n){r=`documentRule-begin`,b=new t.CSSDocumentRule,b.__starts=n,n+=13,a=``;break}else if(e.indexOf(`@media`,n)===n){r=`atBlock`,_=new t.CSSMediaRule,_.__starts=n,n+=5,a=``;break}else if(e.indexOf(`@supports`,n)===n){r=`conditionBlock`,ee=new t.CSSSupportsRule,ee.__starts=n,n+=8,a=``;break}else if(e.indexOf(`@host`,n)===n){r=`hostRule-begin`,n+=4,ne=new t.CSSHostRule,ne.__starts=n,a=``;break}else if(e.indexOf(`@import`,n)===n){r=`importRule-begin`,n+=6,a+=`@import`;break}else if(e.indexOf(`@font-face`,n)===n){r=`fontFaceRule-begin`,n+=9,y=new t.CSSFontFaceRule,y.__starts=n,a=``;break}else{x.lastIndex=n;var ae=x.exec(e);if(ae&&ae.index===n){r=`keyframesRule-begin`,te=new t.CSSKeyframesRule,te.__starts=n,te._vendorPrefix=ae[1],n+=ae[0].length-1,a=``;break}else r===`selector`&&(r=`atRule`)}a+=ie;break;case`{`:r===`selector`||r===`atRule`?(g.selectorText=a.trim(),g.style.__starts=n,a=``,r=`before-name`):r===`atBlock`?(_.media.mediaText=a.trim(),u&&d.push(u),l=u=_,_.parentStyleSheet=c,a=``,r=`before-selector`):r===`conditionBlock`?(ee.conditionText=a.trim(),u&&d.push(u),l=u=ee,ee.parentStyleSheet=c,a=``,r=`before-selector`):r===`hostRule-begin`?(u&&d.push(u),l=u=ne,ne.parentStyleSheet=c,a=``,r=`before-selector`):r===`fontFaceRule-begin`?(u&&(y.parentRule=u),y.parentStyleSheet=c,g=y,a=``,r=`before-name`):r===`keyframesRule-begin`?(te.name=a.trim(),u&&(d.push(u),te.parentRule=u),te.parentStyleSheet=c,l=u=te,a=``,r=`keyframeRule-begin`):r===`keyframeRule-begin`?(g=new t.CSSKeyframeRule,g.keyText=a.trim(),g.__starts=n,a=``,r=`before-name`):r===`documentRule-begin`&&(b.matcher.matcherText=a.trim(),u&&(d.push(u),b.parentRule=u),l=u=b,b.parentStyleSheet=c,a=``,r=`before-selector`);break;case`:`:r===`name`?(m=a.trim(),a=``,r=`before-value`):a+=ie;break;case`(`:if(r===`value`)if(a.trim()===`expression`){var oe=new t.CSSValueExpression(e,n).parse();oe.error?re(oe.error):(a+=oe.expression,n=oe.idx)}else r=`value-parenthesis`,o=1,a+=ie;else r===`value-parenthesis`&&o++,a+=ie;break;case`)`:r===`value-parenthesis`&&(o--,o===0&&(r=`value`)),a+=ie;break;case`!`:r===`value`&&e.indexOf(`!important`,n)===n?(h=`important`,n+=9):a+=ie;break;case`;`:switch(r){case`value`:g.style.setProperty(m,a.trim(),h),h=``,a=``,r=`before-name`;break;case`atRule`:a=``,r=`before-selector`;break;case`importRule`:v=new t.CSSImportRule,v.parentStyleSheet=v.styleSheet.parentStyleSheet=c,v.cssText=a+ie,c.cssRules.push(v),a=``,r=`before-selector`;break;default:a+=ie;break}break;case`}`:switch(r){case`value`:g.style.setProperty(m,a.trim(),h),h=``;case`before-name`:case`name`:g.__ends=n+1,u&&(g.parentRule=u),g.parentStyleSheet=c,l.cssRules.push(g),a=``,r=l.constructor===t.CSSKeyframesRule?`keyframeRule-begin`:`before-selector`;break;case`keyframeRule-begin`:case`before-selector`:case`selector`:for(u||re(`Unexpected }`),f=d.length>0;d.length>0;){if(u=d.pop(),u.constructor.name===`CSSMediaRule`||u.constructor.name===`CSSSupportsRule`){p=l,l=u,l.cssRules.push(p);break}d.length===0&&(f=!1)}f||(l.__ends=n+1,c.cssRules.push(l),l=c,u=null),a=``,r=`before-selector`;break}break;default:switch(r){case`before-selector`:r=`selector`,g=new t.CSSStyleRule,g.__starts=n;break;case`before-name`:r=`name`;break;case`before-value`:r=`value`;break;case`importRule-begin`:r=`importRule`;break}a+=ie;break}return c},e.parse=t.parse,t.CSSStyleSheet=qY().CSSStyleSheet,t.CSSStyleRule=KY().CSSStyleRule,t.CSSImportRule=YY().CSSImportRule,t.CSSGroupingRule=XY().CSSGroupingRule,t.CSSMediaRule=QY().CSSMediaRule,t.CSSConditionRule=ZY().CSSConditionRule,t.CSSSupportsRule=$Y().CSSSupportsRule,t.CSSFontFaceRule=eX().CSSFontFaceRule,t.CSSHostRule=tX().CSSHostRule,t.CSSStyleDeclaration=lX().CSSStyleDeclaration,t.CSSKeyframeRule=nX().CSSKeyframeRule,t.CSSKeyframesRule=rX().CSSKeyframesRule,t.CSSValueExpression=aX().CSSValueExpression,t.CSSDocumentRule=sX().CSSDocumentRule})),lX=s((e=>{var t={};t.CSSStyleDeclaration=function(){this.length=0,this.parentRule=null,this._importants={}},t.CSSStyleDeclaration.prototype={constructor:t.CSSStyleDeclaration,getPropertyValue:function(e){return this[e]||``},setProperty:function(e,t,n){this[e]?Array.prototype.indexOf.call(this,e)<0&&(this[this.length]=e,this.length++):(this[this.length]=e,this.length++),this[e]=t+``,this._importants[e]=n},removeProperty:function(e){if(!(e in this))return``;var t=Array.prototype.indexOf.call(this,e);if(t<0)return``;var n=this[e];return this[e]=``,Array.prototype.splice.call(this,t,1),n},getPropertyCSSValue:function(){},getPropertyPriority:function(e){return this._importants[e]||``},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){for(var e=[],t=0,n=this.length;t<n;++t){var r=this[t],i=this.getPropertyValue(r),a=this.getPropertyPriority(r);a&&=` !`+a,e[t]=r+`: `+i+a+`;`}return e.join(` `)},set cssText(e){var n,r;for(n=this.length;n--;)r=this[n],this[r]=``;Array.prototype.splice.call(this,0,this.length),this._importants={};var i=t.parse(`#bogus{`+e+`}`).cssRules[0].style,a=i.length;for(n=0;n<a;++n)r=i[n],this.setProperty(i[n],i.getPropertyValue(r),i.getPropertyPriority(r))}},e.CSSStyleDeclaration=t.CSSStyleDeclaration,t.parse=cX().parse})),uX=s((e=>{var t={CSSStyleSheet:qY().CSSStyleSheet,CSSRule:GY().CSSRule,CSSStyleRule:KY().CSSStyleRule,CSSGroupingRule:XY().CSSGroupingRule,CSSConditionRule:ZY().CSSConditionRule,CSSMediaRule:QY().CSSMediaRule,CSSSupportsRule:$Y().CSSSupportsRule,CSSStyleDeclaration:lX().CSSStyleDeclaration,CSSKeyframeRule:nX().CSSKeyframeRule,CSSKeyframesRule:rX().CSSKeyframesRule};t.clone=function e(n){var r=new t.CSSStyleSheet,i=n.cssRules;if(!i)return r;for(var a=0,o=i.length;a<o;a++){var s=i[a],c=r.cssRules[a]=new s.constructor,l=s.style;if(l){for(var u=c.style=new t.CSSStyleDeclaration,d=0,f=l.length;d<f;d++){var p=u[d]=l[d];u[p]=l[p],u._importants[p]=l.getPropertyPriority(p)}u.length=l.length}s.hasOwnProperty(`keyText`)&&(c.keyText=s.keyText),s.hasOwnProperty(`selectorText`)&&(c.selectorText=s.selectorText),s.hasOwnProperty(`mediaText`)&&(c.mediaText=s.mediaText),s.hasOwnProperty(`conditionText`)&&(c.conditionText=s.conditionText),s.hasOwnProperty(`cssRules`)&&(c.cssRules=e(s).cssRules)}return r},e.clone=t.clone})),dX=s((e=>{e.CSSStyleDeclaration=lX().CSSStyleDeclaration,e.CSSRule=GY().CSSRule,e.CSSGroupingRule=XY().CSSGroupingRule,e.CSSConditionRule=ZY().CSSConditionRule,e.CSSStyleRule=KY().CSSStyleRule,e.MediaList=JY().MediaList,e.CSSMediaRule=QY().CSSMediaRule,e.CSSSupportsRule=$Y().CSSSupportsRule,e.CSSImportRule=YY().CSSImportRule,e.CSSFontFaceRule=eX().CSSFontFaceRule,e.CSSHostRule=tX().CSSHostRule,e.StyleSheet=WY().StyleSheet,e.CSSStyleSheet=qY().CSSStyleSheet,e.CSSKeyframesRule=rX().CSSKeyframesRule,e.CSSKeyframeRule=nX().CSSKeyframeRule,e.MatcherList=oX().MatcherList,e.CSSDocumentRule=sX().CSSDocumentRule,e.CSSValue=iX().CSSValue,e.CSSValueExpression=aX().CSSValueExpression,e.parse=cX().parse,e.clone=uX().clone}))();const fX=`style`;var pX=class extends FY{constructor(e,t=fX){super(e,t),this[$H]=null}get sheet(){let e=this[$H];return e===null?this[$H]=(0,dX.parse)(this.textContent):e}get innerHTML(){return super.innerHTML||``}set innerHTML(e){super.textContent=e,this[$H]=null}get innerText(){return super.innerText||``}set innerText(e){super.textContent=e,this[$H]=null}get textContent(){return super.textContent||``}set textContent(e){super.textContent=e,this[$H]=null}};xK(fX,pX);var mX=class extends ${constructor(e,t=`time`){super(e,t)}get dateTime(){return Y.get(this,`datetime`)}set dateTime(e){Y.set(this,`datetime`,e)}};xK(`time`,mX);var hX=class extends ${constructor(e,t=`fieldset`){super(e,t)}},gX=class extends ${constructor(e,t=`embed`){super(e,t)}},_X=class extends ${constructor(e,t=`hr`){super(e,t)}},vX=class extends ${constructor(e,t=`progress`){super(e,t)}},yX=class extends ${constructor(e,t=`p`){super(e,t)}},bX=class extends ${constructor(e,t=`table`){super(e,t)}},xX=class extends ${constructor(e,t=`frameset`){super(e,t)}},SX=class extends ${constructor(e,t=`li`){super(e,t)}},CX=class extends ${constructor(e,t=`base`){super(e,t)}},wX=class extends ${constructor(e,t=`datalist`){super(e,t)}};const TX=`input`;var EX=class extends ${constructor(e,t=TX){super(e,t)}get autofocus(){return IK.get(this,`autofocus`)||-1}set autofocus(e){IK.set(this,`autofocus`,e)}get disabled(){return IK.get(this,`disabled`)}set disabled(e){IK.set(this,`disabled`,e)}get name(){return this.getAttribute(`name`)}set name(e){this.setAttribute(`name`,e)}get placeholder(){return this.getAttribute(`placeholder`)}set placeholder(e){this.setAttribute(`placeholder`,e)}get type(){return this.getAttribute(`type`)}set type(e){this.setAttribute(`type`,e)}get value(){return Y.get(this,`value`)}set value(e){Y.set(this,`value`,e)}};xK(TX,EX);var DX=class extends ${constructor(e,t=`param`){super(e,t)}},OX=class extends ${constructor(e,t=`media`){super(e,t)}},kX=class extends ${constructor(e,t=`audio`){super(e,t)}},AX=class extends ${constructor(e,t=`h1`){super(e,t)}};xK([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],AX);var jX=class extends ${constructor(e,t=`dir`){super(e,t)}},MX=class extends ${constructor(e,t=`quote`){super(e,t)}},NX=c({default:()=>PX}),PX,FX=o((()=>{throw PX={},Error(`Could not resolve "canvas" imported by "linkedom". Is it installed?`)})),IX=s(((e,t)=>{var n=class{constructor(e,t){this.width=e,this.height=t}getContext(){return null}toDataURL(){return``}};t.exports={createCanvas:(e,t)=>new n(e,t)}}));const{createCanvas:LX}=u(s(((e,t)=>{try{t.exports=(FX(),d(NX))}catch{t.exports=IX()}}))(),1).default,RX=`canvas`;var zX=class extends ${constructor(e,t=RX){super(e,t),this[qH]=LX(300,150)}get width(){return this[qH].width}set width(e){LK.set(this,`width`,e),this[qH].width=e}get height(){return this[qH].height}set height(e){LK.set(this,`height`,e),this[qH].height=e}getContext(e){return this[qH].getContext(e)}toDataURL(...e){return this[qH].toDataURL(...e)}};xK(RX,zX);var BX=class extends ${constructor(e,t=`legend`){super(e,t)}};const VX=`option`;var HX=class extends ${constructor(e,t=VX){super(e,t)}get value(){return Y.get(this,`value`)}set value(e){Y.set(this,`value`,e)}get selected(){return IK.get(this,`selected`)}set selected(e){let t=this.parentElement?.querySelector(`option[selected]`);t&&t!==this&&(t.selected=!1),IK.set(this,`selected`,e)}};xK(VX,HX);var UX=class extends ${constructor(e,t=`span`){super(e,t)}},WX=class extends ${constructor(e,t=`meter`){super(e,t)}},GX=class extends ${constructor(e,t=`video`){super(e,t)}},KX=class extends ${constructor(e,t=`td`){super(e,t)}};const qX=`title`;var JX=class extends FY{constructor(e,t=qX){super(e,t)}};xK(qX,JX);var YX=class extends ${constructor(e,t=`output`){super(e,t)}},XX=class extends ${constructor(e,t=`tr`){super(e,t)}},ZX=class extends ${constructor(e,t=`data`){super(e,t)}},QX=class extends ${constructor(e,t=`menu`){super(e,t)}};const $X=`select`;var eZ=class extends ${constructor(e,t=$X){super(e,t)}get options(){let e=new HK,{firstElementChild:t}=this;for(;t;)t.tagName===`OPTGROUP`?e.push(...t.children):e.push(t),t=t.nextElementSibling;return e}get disabled(){return IK.get(this,`disabled`)}set disabled(e){IK.set(this,`disabled`,e)}get name(){return this.getAttribute(`name`)}set name(e){this.setAttribute(`name`,e)}get value(){return this.querySelector(`option[selected]`)?.value}};xK($X,eZ);var tZ=class extends ${constructor(e,t=`br`){super(e,t)}};const nZ=`button`;var rZ=class extends ${constructor(e,t=nZ){super(e,t)}get disabled(){return IK.get(this,`disabled`)}set disabled(e){IK.set(this,`disabled`,e)}get name(){return this.getAttribute(`name`)}set name(e){this.setAttribute(`name`,e)}get type(){return this.getAttribute(`type`)}set type(e){this.setAttribute(`type`,e)}};xK(nZ,rZ);var iZ=class extends ${constructor(e,t=`map`){super(e,t)}},aZ=class extends ${constructor(e,t=`optgroup`){super(e,t)}},oZ=class extends ${constructor(e,t=`dl`){super(e,t)}};const sZ=`textarea`;var cZ=class extends FY{constructor(e,t=sZ){super(e,t)}get disabled(){return IK.get(this,`disabled`)}set disabled(e){IK.set(this,`disabled`,e)}get name(){return this.getAttribute(`name`)}set name(e){this.setAttribute(`name`,e)}get placeholder(){return this.getAttribute(`placeholder`)}set placeholder(e){this.setAttribute(`placeholder`,e)}get type(){return this.getAttribute(`type`)}set type(e){this.setAttribute(`type`,e)}get value(){return this.textContent}set value(e){this.textContent=e}};xK(sZ,cZ);var lZ=class extends ${constructor(e,t=`font`){super(e,t)}},uZ=class extends ${constructor(e,t=`div`){super(e,t)}};const dZ=`link`;var fZ=class extends ${constructor(e,t=dZ){super(e,t)}get disabled(){return IK.get(this,`disabled`)}set disabled(e){IK.set(this,`disabled`,e)}get href(){return Y.get(this,`href`).trim()}set href(e){Y.set(this,`href`,e)}get hreflang(){return Y.get(this,`hreflang`)}set hreflang(e){Y.set(this,`hreflang`,e)}get media(){return Y.get(this,`media`)}set media(e){Y.set(this,`media`,e)}get rel(){return Y.get(this,`rel`)}set rel(e){Y.set(this,`rel`,e)}get type(){return Y.get(this,`type`)}set type(e){Y.set(this,`type`,e)}};xK(dZ,fZ);const pZ=`slot`;var mZ=class extends ${constructor(e,t=pZ){super(e,t)}get name(){return this.getAttribute(`name`)}set name(e){this.setAttribute(`name`,e)}assign(){}assignedNodes(e){let t=!!this.name,n=this.getRootNode().host?.childNodes??[],r;if(r=t?[...n].filter(e=>e.slot===this.name):[...n].filter(e=>!e.slot),e?.flatten){let e=[];for(let t of r)t.localName===`slot`?e.push(...t.assignedNodes({flatten:!0})):e.push(t);r=e}return r.length?r:[...this.childNodes]}assignedElements(e){let t=this.assignedNodes(e).filter(e=>e.nodeType===1);return t.length?t:[...this.children]}};xK(pZ,mZ);var hZ=class extends ${constructor(e,t=`form`){super(e,t)}},gZ=class extends ${constructor(e,t=`img`){super(e,t)}get alt(){return Y.get(this,`alt`)}set alt(e){Y.set(this,`alt`,e)}get sizes(){return Y.get(this,`sizes`)}set sizes(e){Y.set(this,`sizes`,e)}get src(){return Y.get(this,`src`)}set src(e){Y.set(this,`src`,e)}get srcset(){return Y.get(this,`srcset`)}set srcset(e){Y.set(this,`srcset`,e)}get title(){return Y.get(this,`title`)}set title(e){Y.set(this,`title`,e)}get width(){return LK.get(this,`width`)}set width(e){LK.set(this,`width`,e)}get height(){return LK.get(this,`height`)}set height(e){LK.set(this,`height`,e)}};xK(`img`,gZ);var _Z=class extends ${constructor(e,t=`pre`){super(e,t)}},vZ=class extends ${constructor(e,t=`ul`){super(e,t)}};const yZ=`meta`;var bZ=class extends ${constructor(e,t=yZ){super(e,t)}get name(){return Y.get(this,`name`)}set name(e){Y.set(this,`name`,e)}get httpEquiv(){return Y.get(this,`http-equiv`)}set httpEquiv(e){Y.set(this,`http-equiv`,e)}get content(){return Y.get(this,`content`)}set content(e){Y.set(this,`content`,e)}get charset(){return Y.get(this,`charset`)}set charset(e){Y.set(this,`charset`,e)}get media(){return Y.get(this,`media`)}set media(e){Y.set(this,`media`,e)}};xK(yZ,bZ);var xZ=class extends ${constructor(e,t=`picture`){super(e,t)}},SZ=class extends ${constructor(e,t=`area`){super(e,t)}},CZ=class extends ${constructor(e,t=`ol`){super(e,t)}},wZ=class extends ${constructor(e,t=`caption`){super(e,t)}},TZ=class extends ${constructor(e,t=`a`){super(e,t)}get href(){return encodeURI(decodeURI(Y.get(this,`href`))).trim()}set href(e){Y.set(this,`href`,decodeURI(e))}get download(){return encodeURI(decodeURI(Y.get(this,`download`)))}set download(e){Y.set(this,`download`,decodeURI(e))}get target(){return Y.get(this,`target`)}set target(e){Y.set(this,`target`,e)}get type(){return Y.get(this,`type`)}set type(e){Y.set(this,`type`,e)}get rel(){return Y.get(this,`rel`)}set rel(e){Y.set(this,`rel`,e)}};xK(`a`,TZ);var EZ=class extends ${constructor(e,t=`label`){super(e,t)}},DZ=class extends ${constructor(e,t=`unknown`){super(e,t)}},OZ=class extends ${constructor(e,t=`mod`){super(e,t)}},kZ=class extends ${constructor(e,t=`details`){super(e,t)}};const AZ=`source`;var jZ=class extends ${constructor(e,t=AZ){super(e,t)}get src(){return Y.get(this,`src`)}set src(e){Y.set(this,`src`,e)}get srcset(){return Y.get(this,`srcset`)}set srcset(e){Y.set(this,`srcset`,e)}get sizes(){return Y.get(this,`sizes`)}set sizes(e){Y.set(this,`sizes`,e)}get type(){return Y.get(this,`type`)}set type(e){Y.set(this,`type`,e)}};xK(AZ,jZ);const MZ={HTMLElement:$,HTMLTemplateElement:MY,HTMLHtmlElement:NY,HTMLScriptElement:LY,HTMLFrameElement:RY,HTMLIFrameElement:BY,HTMLObjectElement:VY,HTMLHeadElement:HY,HTMLBodyElement:UY,HTMLStyleElement:pX,HTMLTimeElement:mX,HTMLFieldSetElement:hX,HTMLEmbedElement:gX,HTMLHRElement:_X,HTMLProgressElement:vX,HTMLParagraphElement:yX,HTMLTableElement:bX,HTMLFrameSetElement:xX,HTMLLIElement:SX,HTMLBaseElement:CX,HTMLDataListElement:wX,HTMLInputElement:EX,HTMLParamElement:DX,HTMLMediaElement:OX,HTMLAudioElement:kX,HTMLHeadingElement:AX,HTMLDirectoryElement:jX,HTMLQuoteElement:MX,HTMLCanvasElement:zX,HTMLLegendElement:BX,HTMLOptionElement:HX,HTMLSpanElement:UX,HTMLMeterElement:WX,HTMLVideoElement:GX,HTMLTableCellElement:KX,HTMLTitleElement:JX,HTMLOutputElement:YX,HTMLTableRowElement:XX,HTMLDataElement:ZX,HTMLMenuElement:QX,HTMLSelectElement:eZ,HTMLBRElement:tZ,HTMLButtonElement:rZ,HTMLMapElement:iZ,HTMLOptGroupElement:aZ,HTMLDListElement:oZ,HTMLTextAreaElement:cZ,HTMLFontElement:lZ,HTMLDivElement:uZ,HTMLLinkElement:fZ,HTMLSlotElement:mZ,HTMLFormElement:hZ,HTMLImageElement:gZ,HTMLPreElement:_Z,HTMLUListElement:vZ,HTMLMetaElement:bZ,HTMLPictureElement:xZ,HTMLAreaElement:SZ,HTMLOListElement:CZ,HTMLTableCaptionElement:wZ,HTMLAnchorElement:TZ,HTMLLabelElement:EZ,HTMLUnknownElement:DZ,HTMLModElement:OZ,HTMLDetailsElement:kZ,HTMLSourceElement:jZ,HTMLTrackElement:class extends ${constructor(e,t=`track`){super(e,t)}},HTMLMarqueeElement:class extends ${constructor(e,t=`marquee`){super(e,t)}}},NZ={test:()=>!0},PZ={"text/html":{docType:`<!DOCTYPE html>`,ignoreCase:!0,voidElements:/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i},"image/svg+xml":{docType:`<?xml version="1.0" encoding="utf-8"?>`,ignoreCase:!1,voidElements:NZ},"text/xml":{docType:`<?xml version="1.0" encoding="utf-8"?>`,ignoreCase:!1,voidElements:NZ},"application/xml":{docType:`<?xml version="1.0" encoding="utf-8"?>`,ignoreCase:!1,voidElements:NZ},"application/xhtml+xml":{docType:`<?xml version="1.0" encoding="utf-8"?>`,ignoreCase:!1,voidElements:NZ}};var FZ=class extends sY{constructor(e,t={}){super(e,t),this.detail=t.detail}},IZ=class extends sY{constructor(e,t={}){super(e,t),this.inputType=t.inputType,this.data=t.data,this.dataTransfer=t.dataTransfer,this.isComposing=t.isComposing||!1,this.ranges=t.ranges}};const LZ=e=>class extends gZ{constructor(t,n){switch(super(e),arguments.length){case 1:this.height=t,this.width=t;break;case 2:this.height=n,this.width=t;break}}},RZ=({[eU]:e,[G]:t},n=null)=>{rK(e[ZH],t[K]);do{let r=XG(e),i=r===t?r:r[K];n?n.insertBefore(e,n[G]):e.remove(),e=i}while(e!==t)};var zZ=class e{constructor(){this[eU]=null,this[G]=null,this.commonAncestorContainer=null}insertNode(e){this[G].parentNode.insertBefore(e,this[eU])}selectNode(e){this[eU]=e,this[G]=XG(e)}selectNodeContents(e){this.selectNode(e),this.commonAncestorContainer=e}surroundContents(e){e.replaceChildren(this.extractContents())}setStartBefore(e){this[eU]=e}setStartAfter(e){this[eU]=e.nextSibling}setEndBefore(e){this[G]=XG(e.previousSibling)}setEndAfter(e){this[G]=XG(e)}cloneContents(){let{[eU]:e,[G]:t}=this,n=e.ownerDocument.createDocumentFragment();for(;e!==t;)n.insertBefore(e.cloneNode(!0),n[G]),e=XG(e),e!==t&&(e=e[K]);return n}deleteContents(){RZ(this)}extractContents(){let e=this[eU].ownerDocument.createDocumentFragment();return RZ(this,e),e}createContextualFragment(e){let{commonAncestorContainer:t}=this,n=`ownerSVGElement`in t,r=n?t.ownerDocument:t,i=iK(r,e);if(n){let e=[...i.childNodes];i=r.createDocumentFragment(),Object.setPrototypeOf(i,gY.prototype),i.ownerSVGElement=r;for(let t of e)Object.setPrototypeOf(t,gY.prototype),t.ownerSVGElement=r,i.appendChild(t)}else this.selectNode(i);return i}cloneRange(){let t=new e;return t[eU]=this[eU],t[G]=this[G],t}};const BZ=({nodeType:e},t)=>{switch(e){case 1:return t&1;case 3:return t&4;case 8:return t&128;case 4:return t&8}return 0};var VZ=class{constructor(e,t=-1){this.root=e,this.currentNode=e,this.whatToShow=t;let{[K]:n,[G]:r}=e;if(e.nodeType===9){let{documentElement:t}=e;n=t,r=t[G]}let i=[];for(;n&&n!==r;)BZ(n,t)&&i.push(n),n=n[K];this[QH]={i:0,nodes:i}}nextNode(){let e=this[QH];return this.currentNode=e.i<e.nodes.length?e.nodes[e.i++]:null,this.currentNode}};const HZ=(e,t,n)=>{let{[K]:r,[G]:i}=t;return e.call({ownerDocument:t,[K]:r,[G]:i},n)},UZ=HG({},kY,MZ,{CustomEvent:FZ,Event:sY,EventTarget:VK,InputEvent:IZ,NamedNodeMap:cY,NodeList:HK}),WZ=new WeakMap;var GZ=class extends LJ{constructor(e){super(null,`#document`,9),this[BH]={active:!1,registry:null},this[YH]={active:!1,class:null},this[JH]=PZ[e],this[UH]=null,this[WH]=null,this[KH]=null,this[qH]=null,this[nU]=null}get defaultView(){return WZ.has(this)||WZ.set(this,new Proxy(globalThis,{set:(e,t,n)=>{switch(t){case`addEventListener`:case`removeEventListener`:case`dispatchEvent`:this[GH][t]=n;break;default:e[t]=n;break}return!0},get:(e,t)=>{switch(t){case`addEventListener`:case`removeEventListener`:case`dispatchEvent`:if(!this[GH]){let e=this[GH]=new VK;e.dispatchEvent=e.dispatchEvent.bind(e),e.addEventListener=e.addEventListener.bind(e),e.removeEventListener=e.removeEventListener.bind(e)}return this[GH][t];case`document`:return this;case`navigator`:return{userAgent:`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36`};case`window`:return WZ.get(this);case`customElements`:return this[BH].registry||(this[BH]=new hK(this)),this[BH];case`performance`:return e.performance;case`DOMParser`:return this[WH];case`Image`:return this[qH]||(this[qH]=LZ(this)),this[qH];case`MutationObserver`:return this[YH].class||(this[YH]=new MK(this)),this[YH].class}return this[KH]&&this[KH][t]||UZ[t]||e[t]}})),WZ.get(this)}get doctype(){let e=this[UH];if(e)return e;let{firstChild:t}=this;return t&&t.nodeType===10?this[UH]=t:null}set doctype(e){if(/^([a-z:]+)(\s+system|\s+public(\s+"([^"]+)")?)?(\s+"([^"]+)")?/i.test(e)){let{$1:e,$4:t,$6:n}=RegExp;this[UH]=new zJ(this,e,t,n),tK(this,this[UH],this[K])}}get documentElement(){return this.firstElementChild}get isConnected(){return!0}_getParent(){return this[GH]}createAttribute(e){return new ZK(this,e)}createCDATASection(e){return new uq(this,e)}createComment(e){return new dq(this,e)}createDocumentFragment(){return new RJ(this)}createDocumentType(e,t,n){return new zJ(this,e,t,n)}createElement(e){return new pY(this,e)}createRange(){let e=new zZ;return e.commonAncestorContainer=this,e}createTextNode(e){return new NJ(this,e)}createTreeWalker(e,t=-1){return new VZ(e,t)}createNodeIterator(e,t=-1){return this.createTreeWalker(e,t)}createEvent(e){let t=UG(e===`Event`?new sY(``):new FZ(``));return t.initEvent=t.initCustomEvent=(e,n=!1,r=!1,i)=>{t.bubbles=!!n,WG(t,{type:{value:e},canBubble:{value:n},cancelable:{value:r},detail:{value:i}})},t}cloneNode(e=!1){let{constructor:t,[BH]:n,[UH]:r}=this,i=new t;if(i[BH]=n,e){let e=i[G],{childNodes:t}=this;for(let{length:n}=t,r=0;r<n;r++)i.insertBefore(t[r].cloneNode(!0),e);r&&(i[UH]=t[0])}return i}importNode(e){let t=1<arguments.length&&!!arguments[1],n=e.cloneNode(t),{[BH]:r}=this,{active:i}=r,a=e=>{let{ownerDocument:t,nodeType:n}=e;e.ownerDocument=this,i&&t!==this&&n===1&&r.upgrade(e)};if(a(n),t)switch(n.nodeType){case 1:case 11:{let{[K]:e,[G]:t}=n;for(;e!==t;)e.nodeType===1&&a(e),e=e[K];break}}return n}toString(){return this.childNodes.join(``)}querySelector(e){return HZ(super.querySelector,this,e)}querySelectorAll(e){return HZ(super.querySelectorAll,this,e)}getElementsByTagNameNS(e,t){return this.getElementsByTagName(t)}createAttributeNS(e,t){return this.createAttribute(t)}createElementNS(e,t,n){return e===`http://www.w3.org/2000/svg`?new gY(this,t,null):this.createElement(t,n)}};JG(UZ.Document=function(){_Y()},GZ).prototype=GZ.prototype;const KZ=(e,t,n,r)=>{if(!t&&bK.has(n))return new(bK.get(n))(e,n);let{[BH]:{active:i,registry:a}}=e;if(i){let i=t?r.is:n;if(a.has(i)){let{Class:t}=a.get(i),r=new t(e,n);return cK.set(r,{connected:!1}),r}}return new $(e,n)};var qZ=class extends GZ{constructor(){super(`text/html`)}get all(){let e=new HK,{[K]:t,[G]:n}=this;for(;t!==n;){switch(t.nodeType){case 1:e.push(t);break}t=t[K]}return e}get head(){let{documentElement:e}=this,{firstElementChild:t}=e;return(!t||t.tagName!==`HEAD`)&&(t=this.createElement(`head`),e.prepend(t)),t}get body(){let{head:e}=this,{nextElementSibling:t}=e;return(!t||t.tagName!==`BODY`)&&(t=this.createElement(`body`),e.after(t)),t}get title(){let{head:e}=this;return e.getElementsByTagName(`title`).at(0)?.textContent||``}set title(e){let{head:t}=this,n=t.getElementsByTagName(`title`).at(0);n?n.textContent=e:t.insertBefore(this.createElement(`title`),t.firstChild).textContent=e}createElement(e,t){let n=!!(t&&t.is),r=KZ(this,n,e,t);return n&&r.setAttribute(`is`,t.is),r}},JZ=class extends GZ{constructor(){super(`image/svg+xml`)}toString(){return this[JH].docType+super.toString()}},YZ=class extends GZ{constructor(){super(`text/xml`)}toString(){return this[JH].docType+super.toString()}},XZ=class e{parseFromString(t,n,r=null){let i=!1,a;return n===`text/html`?(i=!0,a=new qZ):a=n===`image/svg+xml`?new JZ:new YZ,a[WH]=e,r&&(a[KH]=r),i&&t===`...`&&(t=`<!doctype html><html><head></head><body></body></html>`),t?yK(a,i,t):a}};const{parse:ZZ}=JSON,QZ=(e,t=null)=>new XZ().parseFromString(e,`text/html`,t).defaultView;function $Z(){_Y()}JG($Z,GZ).prototype=GZ.prototype;const eQ=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,tQ=new Set,nQ=typeof process==`object`&&process?process:{},rQ=(e,t,n,r)=>{typeof nQ.emitWarning==`function`?nQ.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let iQ=globalThis.AbortController,aQ=globalThis.AbortSignal;if(iQ===void 0){aQ=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},iQ=class{constructor(){t()}signal=new aQ;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=nQ.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,rQ("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}const oQ=e=>!tQ.has(e),sQ=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),cQ=e=>sQ(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?lQ:null:null;var lQ=class extends Array{constructor(e){super(e),this.fill(0)}},uQ=class e{heap;length;static#e=!1;static create(t){let n=cQ(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},dQ=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#B(t),backgroundFetch:(t,n,r,i)=>e.#z(t,n,r,i),moveToTail:t=>e.#H(t),indexes:t=>e.#F(t),rindexes:t=>e.#I(t),isStale:t=>e.#A(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:h=0,sizeCalculation:g,fetchMethod:_,memoMethod:ee,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:te,allowStaleOnFetchAbort:b,ignoreFetchAbort:ne,perf:x}=t;if(x!==void 0&&typeof x?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=x??eQ,n!==0&&!sQ(n))throw TypeError(`max option must be a nonnegative integer`);let re=n?cQ(n):Array;if(!re)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=m,this.maxEntrySize=h||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ee!==void 0&&typeof ee!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=ee,_!==void 0&&typeof _!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=_,this.#C=!!_,this.#u=new Map,this.#d=Array(n).fill(void 0),this.#f=Array(n).fill(void 0),this.#p=new re(n),this.#m=new re(n),this.#h=0,this.#g=0,this.#_=uQ.create(n),this.#c=0,this.#l=0,typeof l==`function`&&(this.#n=l),typeof u==`function`&&(this.#r=u),typeof d==`function`?(this.#i=d,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#S=!!this.#n,this.#T=!!this.#r,this.#w=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!te,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!ne,this.maxEntrySize!==0){if(this.#t!==0&&!sQ(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!sQ(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#j()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=sQ(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!sQ(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#E()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;oQ(t)&&(tQ.add(t),rQ(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#E(){let e=new lQ(this.#e),t=new lQ(this.#e);this.#x=e,this.#b=t,this.#k=(n,r,i=this.#s.now())=>{if(t[n]=r===0?0:i,e[n]=r,r!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#A(n)&&this.#U(this.#d[n],`expire`)},r+1);e.unref&&e.unref()}},this.#D=n=>{t[n]=e[n]===0?0:this.#s.now()},this.#O=(i,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;i.ttl=o,i.start=s,i.now=n||r(),i.remainingTTL=o-(i.now-s)}};let n=0,r=()=>{let e=this.#s.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#u.get(i);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((n||r())-s)},this.#A=i=>{let a=t[i],o=e[i];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#O=()=>{};#k=()=>{};#A=()=>!1;#j(){let e=new lQ(this.#e);this.#l=0,this.#y=e,this.#M=t=>{this.#l-=e[t],e[t]=0},this.#P=(e,t,n,r)=>{if(this.#B(t))return 0;if(!sQ(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!sQ(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#N=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#R(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#M=e=>{};#N=(e,t,n)=>{};#P=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;!(!this.#L(t)||((e||!this.#A(t))&&(yield t),t===this.#h));)t=this.#m[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;!(!this.#L(t)||((e||!this.#A(t))&&(yield t),t===this.#g));)t=this.#p[t]}#L(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#F())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#B(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#B(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#B(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#B(this.#f[e])&&(yield t)}}*values(){for(let e of this.#F())this.#f[e]!==void 0&&!this.#B(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#B(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#F()){let r=this.#f[n],i=this.#B(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.get(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#F()){let r=this.#f[n],i=this.#B(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#B(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#A(t)&&(this.#U(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#B(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#F({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#B(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#P(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#U(e,`set`),this;let u=this.#c===0?void 0:this.#u.get(e);if(u===void 0)u=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#R(!1):this.#c:this.#_.pop(),this.#d[u]=e,this.#f[u]=t,this.#u.set(e,u),this.#p[this.#g]=u,this.#m[u]=this.#g,this.#g=u,this.#c++,this.#N(u,l,s),s&&(s.set=`add`),c=!1,this.#T&&this.#r?.(t,e,`add`);else{this.#H(u);let n=this.#f[u];if(t!==n){if(this.#C&&this.#B(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#S&&this.#n?.(t,e,`set`),this.#w&&this.#v?.push([t,e,`set`]))}else a||(this.#S&&this.#n?.(n,e,`set`),this.#w&&this.#v?.push([n,e,`set`]));if(this.#M(u),this.#N(u,l,s),this.#f[u]=t,s){s.set=`replace`;let e=n&&this.#B(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#T&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#x&&this.#E(),this.#x&&(c||this.#k(u,r,i),s&&this.#O(s,u)),!a&&this.#w&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#R(!0),this.#B(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#w&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#R(e){let t=this.#h,n=this.#d[t],r=this.#f[t];return this.#C&&this.#B(r)?r.__abortController.abort(Error(`evicted`)):(this.#S||this.#w)&&(this.#S&&this.#n?.(r,n,`evict`),this.#w&&this.#v?.push([r,n,`evict`])),this.#M(t),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#B(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#A(i))r&&(r.has=`stale`,this.#O(r,i));else return n&&this.#D(i),r&&(r.has=`hit`,this.#O(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#A(r))return;let i=this.#f[r];return this.#B(i)?i.__staleWhileFetching:i}#z(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#B(i))return i;let a=new iQ,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason);let l=f;return this.#f[t]===f&&(r===void 0?l.__staleWhileFetching===void 0?this.#U(e,`fetch`):this.#f[t]=l.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)),u=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=f;if(this.#f[t]===f&&(!c||l.__staleWhileFetching===void 0?this.#U(e,`fetch`):o||(this.#f[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#B(e){if(!this.#C)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof iQ}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#C)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let ee={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},v=this.#u.get(e);if(v===void 0){g&&(g.fetch=`miss`);let t=this.#z(e,v,ee,m);return t.__returned=t}else{let t=this.#f[v];if(this.#B(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#A(v);if(!h&&!i)return g&&(g.fetch=`hit`),this.#H(v),r&&this.#D(v),g&&this.#O(g,v),t;let a=this.#z(e,v,ee,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o!==void 0){let t=this.#f[o],s=this.#B(t);return a&&this.#O(a,o),this.#A(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#U(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#H(o),r&&this.#D(o),t))}else a&&(a.get=`miss`)}#V(e,t){this.#m[t]=e,this.#p[e]=t}#H(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#V(this.#m[e],this.#p[e]),this.#V(this.#g,e),this.#g=e)}delete(e){return this.#U(e,`delete`)}#U(e,t){let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0)if(n=!0,this.#c===1)this.#W(t);else{this.#M(r);let n=this.#f[r];if(this.#B(n)?n.__abortController.abort(Error(`deleted`)):(this.#S||this.#w)&&(this.#S&&this.#n?.(n,e,t),this.#w&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}if(this.#w&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#W(`delete`)}#W(e){for(let t of this.#I({allowStale:!0})){let n=this.#f[t];if(this.#B(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#S&&this.#n?.(n,r,e),this.#w&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b&&(this.#x.fill(0),this.#b.fill(0)),this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#w&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}};const{window:fQ}=QZ(`<!DOCTYPE html><html><body></body></html>`),pQ=LH(fQ),mQ=new dQ({max:1e3}),hQ=new dQ({max:1e3}),gQ=new dQ({max:1e3}),_Q=e=>{let t=gQ.get(e);if(t)return t;let n=mV.parse(e,{async:!1});return gQ.set(e,n),pQ.sanitize(n)},vQ=e=>{let{document:t}=QZ(`<!DOCTYPE html><html><body>${e}</body></html>`);return{innerHTML:t.body?.innerHTML??e,textContent:t.body?.textContent??e}},yQ=e=>{let t=mQ.get(e);if(t)return t;let n=_Q(e),{innerHTML:r,textContent:i}=vQ(n);return hQ.set(e,i),mQ.set(e,r),r},bQ=e=>{let t=hQ.get(e);if(t)return t;let n=_Q(e),{innerHTML:r,textContent:i}=vQ(n);return hQ.set(e,i),mQ.set(e,r),i},xQ=Wv,SQ=HR(`app`),CQ={Query:{},Mutation:{},Subscription:{media:{resolve:e=>e,subscribe:async function*(e,t,n){let r=QS(t.input.uri??void 0);if(!r||!(KS(r)||ZS(r))){console.warn(`media: refused '${t.input.uri}', which names no uri`);return}let{subscriptions:i,close:a,askOrigins:o,root:s}=iz(n,`MEDIA`),c=nL([`media:changed`,`episode:changed`],{abortSignal:n.request.signal}),l=new Set(eC(r)),u=e=>{let t=eC(e).filter(e=>!l.has(e));if(!t.length)return;for(let e of t)l.add(e);let r=n.params.variables;o(t,{...r,input:{...r?.input,uri:e}})},d=async()=>{let e=await zL(r);if(!e.length)return;let t=gR(e,location.origin);return u(t.uri),hz(e,s,{ask:SQ,implemented:VR}),t};try{let e=await d();e&&(yield e);for await(let e of c){let e=await d();e&&(yield e)}}finally{a(),await Promise.allSettled(i.map(e=>e.unsubscribe()))}}},mediaPage:{resolve:e=>({nodes:e}),subscribe:async function*(e,t,n){let{subscriptions:r,insertedUris:i,close:a}=iz(n,`MEDIA_PAGE`,e=>e?.data?.mediaPage?.nodes?.map(({uri:e})=>e)),o=rL([`media:changed`],100,{abortSignal:n.request.signal}),s=async()=>{let e=[...i],n=await BL(e.length?e:void 0);await zz(n)&&(n=await BL(e.length?e:void 0)),n=VL(n);let r=n.map(e=>gR(e,location.origin));r=_z(r,t.input);let a=t.input.search;a&&(r=(await Promise.all(r.map(async e=>({media:e,score:await tT(a,(e.titles??[]).map(e=>e.title))})))).filter(e=>e.score>=.7).sort((e,t)=>t.score-e.score||(t.media.popularity??0)-(e.media.popularity??0)).map(e=>e.media));let o=t.input.sorts??[];for(let e of o)e===`POPULARITY`?r.sort((e,t)=>(t.popularity??0)-(e.popularity??0)):e===`POPULARITY_DESC`&&r.sort((e,t)=>(e.popularity??0)-(t.popularity??0));return r};try{yield await s();for await(let e of o)yield await s()}finally{a(),await Promise.allSettled(r.map(e=>e.unsubscribe()))}}}},Media:{_id:e=>e._id,categories:e=>e.categories??[],episodes:async e=>{let t=oR(e.handles);if(!t.length)return e.episodes??[];let n=[];for(let e of t)if(n=await PL(e),n.length)break;let r=n.length?await UL(n):await WL(t);if(!r.length)return e.episodes??[];let i=r.flat().filter(e=>e.episodeNumber!=null),a=new Map;for(let e of i)a.has(e.episodeNumber)||a.set(e.episodeNumber,[]),a.get(e.episodeNumber).push(e);return[...a.values()].map(e=>_R(e,location.origin)).sort((e,t)=>(e.episodeNumber??0)-(t.episodeNumber??0))},descriptions:(e,t)=>e.descriptions?.slice(0,t.input?.count?t.input.count:void 0).map(e=>{let n=t.input?.type===LS.Html?yQ(e.description):(t.input?.type,LS.Text,bQ(e.description));return{...e,shortDescription:n}}),shortDescriptions:(e,t)=>e.shortDescriptions?.slice(0,t.input?.count?t.input.count:void 0)?.map(e=>{let n=t.input?.type===LS.Html?yQ(e.shortDescription):(t.input?.type,LS.Text,bQ(e.shortDescription));return{...e,shortDescription:n}}).filter(e=>!!e),handles:e=>e.handles??[]}},wQ={Query:{},Mutation:{},Subscription:{},Episode:{handles:e=>e.handles??[],descriptions:(e,t)=>e.descriptions?.slice(0,t.input?.count?t.input.count:void 0).map(e=>{let n=t.input?.type===IS.Html?yQ(e.description):(t.input?.type,IS.Text,bQ(e.description));return{...e,shortDescription:n}}),shortDescriptions:(e,t)=>e.shortDescriptions?.slice(0,t.input?.count?t.input.count:void 0)?.map(e=>{let n=t.input?.type===IS.Html?yQ(e.shortDescription):(t.input?.type,IS.Text,bQ(e.shortDescription));return{...e,shortDescription:n}}).filter(e=>!!e)}},TQ={Query:{},Mutation:{},Subscription:{}},EQ={Query:{},Mutation:{},Subscription:{origin:{resolve:e=>e,subscribe:async function*(e,t,n){if(!t.input.id)return;let r=GR.map(e=>e.client.subscription(n.params.query,n.params.variables).subscribe(()=>{})),i=await qL(t.input.id);i&&(yield i);let a=tL(`origin:changed`,{abortSignal:n.request.signal});try{for await(let e of a){let e=await qL(t.input.id);e&&(yield e)}}finally{await Promise.allSettled(r.map(e=>e.unsubscribe()));let e=await qL(t.input.id);if(e)return yield e}}},originPage:{resolve:e=>({nodes:e}),subscribe:async function*(e,t,n){if(!t.input.ids||t.input.ids.length===0)return;let r=GR.map(e=>e.client.subscription(n.params.query,n.params.variables).subscribe(()=>{})),i=t.input.filters?.map(e=>e)??void 0;yield await JL(t.input.ids,i);let a=tL(`origin:changed`,{abortSignal:n.request.signal});try{for await(let e of a)yield await JL(t.input.ids,i)}finally{return await Promise.allSettled(r.map(e=>e.unsubscribe())),yield await JL(t.input.ids,i)}}}},Origin:{id:e=>e.id,url:e=>e.url,name:e=>e.name,icon:e=>e.icon,color:e=>e.color,isApiOnly:e=>e.isApiOnly}};[Uv,`
1234
- type Episode {
1235
- """Stable unique identifier that persists across URI changes and source additions"""
1236
- _id: String!
1237
- """Uri consists of the \`origin\` and \`id\` fields in the format \`origin:id\`"""
1238
- uri: String!
1239
- """String that is used to target a specific origin, e.g \`google\` or \`yt\` for youtube"""
1240
- origin: String!
1241
- """An id that references a specific resource within the origin space"""
1242
- id: String!
1243
- """An url to the media resource"""
1244
- url: String
1245
- """Uri to the media resource"""
1246
- mediaUri: String!
1247
- """Every other row this episode is related to. See \`MediaHandle\` for why the relation is explicit."""
1248
- handles: [EpisodeHandle!]!
1249
- score: Float
1250
- titles: [EpisodeTitle!]!
1251
- shortDescriptions(input: EpisodeShortDescriptionInput): [EpisodeShortDescription!]!
1252
- descriptions(input: EpisodeDescriptionInput): [EpisodeDescription!]!
1253
- releaseDate: Date
1254
- relativeNumber: Int
1255
- absoluteNumber: Int
1256
- thumbnails: [EpisodeThumbnail!]!
1257
- # playbackSources: [PlaybackSource!]!
1258
- """URL for an embeddable player iframe"""
1259
- embedUrl: String
1260
- seasonNumber: Int
1261
- episodeNumber: Int
1262
- absoluteEpisodeNumber: Int
1263
- """Runtime in minutes"""
1264
- runtime: Int
1265
- }
1266
-
1267
- type EpisodeTitle {
1268
- language: String!
1269
- title: String!
1270
- score: Float
1271
- }
1272
-
1273
- input EpisodeShortDescriptionInput {
1274
- type: EpisodeDescriptionContentType = TEXT
1275
- count: Int
1276
- }
1277
-
1278
- type EpisodeShortDescription {
1279
- language: String!
1280
- shortDescription: String!
1281
- score: Float
1282
- }
1283
-
1284
- enum EpisodeDescriptionContentType {
1285
- HTML
1286
- TEXT
1287
- }
1288
-
1289
- input EpisodeDescriptionInput {
1290
- type: EpisodeDescriptionContentType = TEXT
1291
- count: Int
1292
- }
1293
-
1294
- type EpisodeDescription {
1295
- language: String!
1296
- description: String!
1297
- score: Float
1298
- }
1299
-
1300
-
1301
- type EpisodeThumbnail {
1302
- language: String
1303
- url: String!
1304
- height: Int
1305
- width: Int
1306
- """Average #hex color of cover image"""
1307
- color: String
1308
- score: Float
1309
- }
1310
-
1311
- """
1312
- One edge out of an episode. Shares \`MediaHandleRelation\` with media on purpose: the two questions are
1313
- the same question, and a second enum with the same two values would drift.
1314
- """
1315
- type EpisodeHandle {
1316
- """The related row. Carries its own uri, origin, id and url."""
1317
- node: Episode!
1318
- """What this edge asserts. Only SAME_AS unions clusters."""
1319
- relation: MediaHandleRelation!
1320
- }
1321
- `,`
1322
- enum PlaybackSourceType {
1323
- IFRAME
1324
- CUSTOM
1325
- OTHER
1326
- }
1327
-
1328
- type PlaybackSource {
1329
- """Uri consists of the \`origin\` and \`id\` fields in the format \`origin:id\`"""
1330
- uri: String!
1331
- """String that is used to target a specific origin, e.g \`google\` or \`yt\` for youtube"""
1332
- origin: String!
1333
- """An id that references a specific resource within the origin space"""
1334
- id: String!
1335
- """An url to the media resource"""
1336
- url: String
1337
- type: PlaybackSourceType!
1338
- """JSON data for custom players"""
1339
- data: JSON
1340
- Episode: Episode
1341
- }
1342
- `,xQ,`
1343
- type Origin {
1344
- """An id to references the origin"""
1345
- id: String!
1346
- """An url to the origin"""
1347
- url: String
1348
- """The name of the origin"""
1349
- name: String!
1350
- """The origin's icon"""
1351
- icon: String
1352
- """The origin's color"""
1353
- color: String
1354
- """If the origin is an api only origin"""
1355
- isApiOnly: Boolean!
1356
- }
1357
-
1358
- input OriginInput {
1359
- id: ID!
1360
- }
1361
-
1362
- enum OriginFilter {
1363
- IS_API_ONLY
1364
- IS_NOT_API_ONLY
1365
- }
1366
-
1367
- input OriginPageInput {
1368
- ids: [ID!]!
1369
- filters: [OriginFilter!]
1370
- }
1371
-
1372
- type OriginPage {
1373
- """The current page"""
1374
- firstPageCursor: Id
1375
- """The current page"""
1376
- previousPageCursor: Id
1377
- """The current page"""
1378
- currentPageCursor: Id
1379
- """The first page"""
1380
- nextPageCursor: Id
1381
- """The last page cursor"""
1382
- lastPageCursor: Id
1383
- """Total number of items on the current page"""
1384
- currentPageNodeCount: Int
1385
- """The total number of items. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
1386
- totalNodeCount: Int
1387
- """Total number of items before the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
1388
- beforeCurrentPageNodeCount: Int
1389
- """Total number of items after the current page. Note: This value is not guaranteed to be accurate, do not rely on this for logic"""
1390
- afterCurrentPageNodeCount: Int
1391
- """The media page nodes"""
1392
- nodes: [Origin!]!
1393
- }
1394
-
1395
- extend type Subscription {
1396
- origin(input: OriginInput!): Origin
1397
- originPage(input: OriginPageInput!): OriginPage!
1398
- }
1399
- `].join(`
1400
-
1401
- `);const DQ={...CQ,...wQ,...TQ,...EQ,Query:{...CQ.Query,...wQ.Query,...TQ.Query,...EQ.Query},Mutation:{...CQ.Mutation,...wQ.Mutation,...TQ.Mutation,...EQ.Mutation},Subscription:{...CQ.Subscription,...wQ.Subscription,...TQ.Subscription,...EQ.Subscription}},OQ=e=>e.slice(0,e.indexOf(`:`)),kQ=(e,t)=>e.uri<t.uri?-1:+(e.uri>t.uri),AQ=async({excludeOrigins:e,passThroughOrigins:t,uris:n})=>{let r=new Set(e),i=new Set(t??[]),a=U.labeled(`media`),o=U.labeled(`episode`),s=e=>a.has(e)&&!r.has(OQ(e)),c=e=>!i.has(OQ(e)),l=new Set,u=[];for(let e of[...a].sort()){if(l.has(e)||!s(e))continue;l.add(e);let t=[],n=[e];for(;n.length;){let e=n.shift(),r=U.get(e);r&&t.push(r);for(let t of U.neighbours(e,_L.RUN))l.has(t)||!s(t)||(l.add(t),n.push(t))}let i=t.map(e=>e.uri),a=t.filter(e=>c(e.uri));if(!a.some(e=>e.scope!==`CONTAINER`))continue;let d=[],f=new Set;for(let e of t)for(let t of U.targets(e.uri,_L.PART_OF)){let e=[t];for(;e.length;){let t=e.shift();if(f.has(t)||!s(t))continue;f.add(t);let n=U.get(t);n&&c(t)&&d.push(n);for(let n of U.neighbours(t,_L.CONTAINER))e.push(n)}}let p=[],m=new Set;for(let e of t)for(let t of U.targets(e.uri,`has_episode`)){if(m.has(t)||!o.has(t)||r.has(OQ(t))||!c(t))continue;m.add(t);let e=U.get(t);e&&p.push(e)}u.push({walked:i,members:a.sort(kQ),partOf:d.sort(kQ),episodes:p.sort(kQ)})}let d=n&&new Set(n);return{exportedAt:new Date().toISOString(),excludedOrigins:[...r].sort(),clusters:(d?u.filter(e=>e.walked.some(e=>d.has(e))):u).sort((e,t)=>kQ(e.members[0],t.members[0])).map(({walked:e,...t})=>t)}},jQ=fp({schema:Ol({typeDefs:Hv,resolvers:DQ}),maskedErrors:!1,plugins:[Ql(({errors:e,context:t})=>{for(let n of e)console.error(Error(`GQLError occurred on request: ${t.operationName}`,{cause:n}))}),Bp(),pp()]});Vv({handleRequest:(e,t)=>jQ.handleRequest(new Request(e,t),{}),setUserKeys:e=>OR(e),registerRemoteSource:async(e,t)=>{try{return{ok:await $R(e,t)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},unregisterRemoteSource:e=>ez(e),exportStore:e=>AQ({...e,passThroughOrigins:e?.passThroughOrigins??[],excludeOrigins:[...e?.excludeOrigins??[],...GR.filter(e=>e.pluginUri).map(e=>e.extractor.origin)]}),remotePicker:e=>YR(e),remotePlayer:e=>QR(e),selectRemoteRelease:(e,t)=>XR(e,t)},{transport:globalThis,key:`yoga`});