@banou/stub 0.0.19 → 0.0.21
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.
- package/build/.well-known/fkn.json +1 -1
- package/build/assets/embed-VjpeLPHx.js +1461 -0
- package/build/assets/index-Cq0deG16.js +1964 -0
- package/build/assets/lib-DHuurgWT.js +71 -0
- package/build/assets/{lib-account-BuVN6Bsx.js → lib-account-B_rZrj_U.js} +1 -1
- package/build/assets/lib-account-ZA7I4UZl.js +2 -0
- package/build/assets/lib-api-0oE17Lze.js +2 -0
- package/build/assets/{lib-build-DEOZ3A7n.js → lib-api-DLvscoll-INenJIDp.js} +863 -556
- package/build/assets/lib-worker-B7p9HUJX.js +2 -0
- package/build/assets/lib-worker-C6VkH7Kf.js +9006 -0
- package/build/assets/lib-worker-index-DCktGn3b.js +1964 -0
- package/build/assets/main-DZ0Ws1xk.css +1 -0
- package/build/assets/main-JLaHac0l.js +3844 -0
- package/build/assets/uri-CY1i0hlC.js +1 -0
- package/build/assets/worker-CaEIruuB.js +1 -0
- package/build/assets/worker-juGKbgx7.js +1 -0
- package/build/embed.html +4 -8
- package/build/fkn.json +1 -1
- package/build/index.html +5 -8
- package/build/index.js +23838 -35935
- package/fkn.json +1 -1
- package/package.json +6 -3
- package/build/assets/Preview-DG9nqCV0.js +0 -1
- package/build/assets/compat-CusyxzKh.js +0 -1
- package/build/assets/custom-media-element-BDICDseJ.js +0 -43
- package/build/assets/dash.all.min-Dbg8AB-J.js +0 -19
- package/build/assets/dist-BgIerfpp.js +0 -3136
- package/build/assets/dist-BrpV89uJ.js +0 -1
- package/build/assets/dist-D-OKiX-f.js +0 -1
- package/build/assets/dist-D_XB-JLn.js +0 -40
- package/build/assets/embed-DBjG5JMH.js +0 -1
- package/build/assets/index-BHgdalnH.js +0 -1401
- package/build/assets/lib-Preview-B6uZKyhl.js +0 -82
- package/build/assets/lib-account-Cw8yCZtf.js +0 -2
- package/build/assets/lib-api-DLvscoll-DhlBp9Wz.js +0 -312
- package/build/assets/lib-api-DVwR-22s.js +0 -2
- package/build/assets/lib-compat-D8G4_Lzi.js +0 -860
- package/build/assets/lib-custom-media-element-CnANKrGl.js +0 -217
- package/build/assets/lib-dash.all.min-CDvdorbj.js +0 -27251
- package/build/assets/lib-dist-Dv8d3Kr0.js +0 -7
- package/build/assets/lib-dist-S8Gxnnq-.js +0 -12468
- package/build/assets/lib-dist-T0QlKbbk.js +0 -18578
- package/build/assets/lib-dist-xBHT3Lfz.js +0 -911
- package/build/assets/lib-react-BEg4mBBK.js +0 -112
- package/build/assets/lib-react-C0OCUIWX.js +0 -434
- package/build/assets/lib-react-CAkOlDha.js +0 -367
- package/build/assets/lib-react-CGlZXIjl.js +0 -2187
- package/build/assets/lib-react-CLVoi_ZM.js +0 -334
- package/build/assets/lib-react-DUxKSzCt.js +0 -311
- package/build/assets/lib-react-QvmpnEVK.js +0 -334
- package/build/assets/lib-react-WTnxAo6F.js +0 -202
- package/build/assets/lib-remote-DeY2A2G7.js +0 -416
- package/build/assets/lib-remote-DxEZmpd0.js +0 -2
- package/build/assets/lib-worker-index-C7ynIZYg.js +0 -1401
- package/build/assets/main-q4eQ72Te.js +0 -3349
- package/build/assets/players-BIbP12aF.js +0 -1530
- package/build/assets/preload-helper-D2XUqLHy.js +0 -1
- package/build/assets/react-BDr8Ag8b.js +0 -19
- package/build/assets/react-BTju4bmn.js +0 -22
- package/build/assets/react-CLMfdUXR.js +0 -2
- package/build/assets/react-CjmRCHoG.js +0 -34
- package/build/assets/react-Cs34a503.js +0 -19
- package/build/assets/react-DKSDz1wJ.js +0 -6
- package/build/assets/react-bkM_mQGd.js +0 -17
- package/build/assets/react-kPj0f67l.js +0 -21
- package/build/assets/rolldown-runtime-CNC7AqOf.js +0 -1
- /package/build/assets/{players-3a7RYKgR.css → embed-3a7RYKgR.css} +0 -0
|
@@ -0,0 +1,3844 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/worker-juGKbgx7.js","assets/worker-CaEIruuB.js","assets/lib-DHuurgWT.js","assets/build-BuC_lDPE.js","assets/account-DQlY5DdH.js","assets/api-DLvscoll-DBsLjsEb.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,m as n,n as r,p as i,r as a,u as o}from"./lib-DHuurgWT.js";import{$ as s,A as c,B as l,C as u,D as d,E as f,F as p,G as m,H as h,J as g,K as _,L as v,N as y,O as b,Q as x,R as S,S as C,T as w,U as T,V as E,W as D,X as O,Y as k,Z as A,_ as j,a as M,at as N,b as P,c as F,d as I,et as L,g as ee,h as te,i as R,it as z,j as B,k as ne,l as V,m as re,n as ie,nt as ae,o as oe,ot as se,p as ce,r as le,rt as ue,s as de,st as fe,t as pe,u as H,v as me,w as he,x as ge,y as U,z as _e}from"./uri-CY1i0hlC.js";import{_ as ve,a as ye,c as be,g as xe,h as Se,i as Ce,l as we,m as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./worker-CaEIruuB.js";import{r as Ne}from"./account-DQlY5DdH.js";import{t as Pe}from"./remote-CW2xewp5.js";N();var Fe={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`},Ie=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`}},W,G;function Le(e){return new Ie(`Syntax Error: Unexpected token at ${G} in ${e}`)}function Re(e){if(e.lastIndex=G,e.test(W))return W.slice(G,G=e.lastIndex)}var ze=/ +(?=[^\s])/y;function Be(e){for(var t=e.split(`
|
|
3
|
+
`),n=``,r=0,i=0,a=t.length-1,o=0;o<t.length;o++)ze.lastIndex=0,ze.test(t[o])&&(o&&(!r||ze.lastIndex<r)&&(r=ze.lastIndex),i||=o,a=o);for(var s=i;s<=a;s++)s!==i&&(n+=`
|
|
4
|
+
`),n+=t[s].slice(r).replace(/\\"""/g,`"""`);return n}function K(){for(var e=0|W.charCodeAt(G++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|W.charCodeAt(G++))if(e===35)for(;(e=0|W.charCodeAt(G++))&&e!==10&&e!==13;);G--}function Ve(){for(var e=G,t=0|W.charCodeAt(G++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|W.charCodeAt(G++));if(e===G-1)throw Le(`Name`);var n=W.slice(e,--G);return K(),n}function He(){return{kind:`Name`,value:Ve()}}var Ue=/(?:"""|(?:[\s\S]*?[^\\])""")/y,We=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function Ge(e){var t;switch(W.charCodeAt(G)){case 91:G++,K();for(var n=[];W.charCodeAt(G)!==93;)n.push(Ge(e));return G++,K(),{kind:`ListValue`,values:n};case 123:G++,K();for(var r=[];W.charCodeAt(G)!==125;){var i=He();if(W.charCodeAt(G++)!==58)throw Le(`ObjectField`);K(),r.push({kind:`ObjectField`,name:i,value:Ge(e)})}return G++,K(),{kind:`ObjectValue`,fields:r};case 36:if(e)throw Le(`Variable`);return G++,{kind:`Variable`,name:He()};case 34:if(W.charCodeAt(G+1)===34&&W.charCodeAt(G+2)===34){if(G+=3,(t=Re(Ue))==null)throw Le(`StringValue`);return K(),{kind:`StringValue`,value:Be(t.slice(0,-3)),block:!0}}else{var a=G,o;G++;var s=!1;for(o=0|W.charCodeAt(G++);o===92&&(G++,s=!0)||o!==10&&o!==13&&o!==34&&o;o=0|W.charCodeAt(G++));if(o!==34)throw Le(`StringValue`);return t=W.slice(a,G),K(),{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=G++,l;(l=0|W.charCodeAt(G++))>=48&&l<=57;);var u=W.slice(c,--G);if((l=W.charCodeAt(G))===46||l===69||l===101){if((t=Re(We))==null)throw Le(`FloatValue`);return K(),{kind:`FloatValue`,value:u+t}}else return K(),{kind:`IntValue`,value:u};case 110:if(W.charCodeAt(G+1)===117&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===108)return G+=4,K(),{kind:`NullValue`};break;case 116:if(W.charCodeAt(G+1)===114&&W.charCodeAt(G+2)===117&&W.charCodeAt(G+3)===101)return G+=4,K(),{kind:`BooleanValue`,value:!0};break;case 102:if(W.charCodeAt(G+1)===97&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===115&&W.charCodeAt(G+4)===101)return G+=5,K(),{kind:`BooleanValue`,value:!1};break}return{kind:`EnumValue`,value:Ve()}}function Ke(e){if(W.charCodeAt(G)===40){var t=[];G++,K();do{var n=He();if(W.charCodeAt(G++)!==58)throw Le(`Argument`);K(),t.push({kind:`Argument`,name:n,value:Ge(e)})}while(W.charCodeAt(G)!==41);return G++,K(),t}}function qe(e){if(W.charCodeAt(G)===64){var t=[];do G++,t.push({kind:`Directive`,name:He(),arguments:Ke(e)});while(W.charCodeAt(G)===64);return t}}function Je(){for(var e=0;W.charCodeAt(G)===91;)e++,G++,K();var t={kind:`NamedType`,name:He()};do if(W.charCodeAt(G)===33&&(G++,K(),t={kind:`NonNullType`,type:t}),e){if(W.charCodeAt(G++)!==93)throw Le(`NamedType`);K(),t={kind:`ListType`,type:t}}while(e--);return t}function Ye(){if(W.charCodeAt(G++)!==123)throw Le(`SelectionSet`);return K(),Xe()}function Xe(){var e=[];do if(W.charCodeAt(G)===46){if(W.charCodeAt(++G)!==46||W.charCodeAt(++G)!==46)throw Le(`SelectionSet`);switch(G++,K(),W.charCodeAt(G)){case 64:e.push({kind:`InlineFragment`,typeCondition:void 0,directives:qe(!1),selectionSet:Ye()});break;case 111:W.charCodeAt(G+1)===110?(G+=2,K(),e.push({kind:`InlineFragment`,typeCondition:{kind:`NamedType`,name:He()},directives:qe(!1),selectionSet:Ye()})):e.push({kind:`FragmentSpread`,name:He(),directives:qe(!1)});break;case 123:G++,K(),e.push({kind:`InlineFragment`,typeCondition:void 0,directives:void 0,selectionSet:Xe()});break;default:e.push({kind:`FragmentSpread`,name:He(),directives:qe(!1)})}}else{var t=He(),n=void 0;W.charCodeAt(G)===58&&(G++,K(),n=t,t=He());var r=Ke(!1),i=qe(!1),a=void 0;W.charCodeAt(G)===123&&(G++,K(),a=Xe()),e.push({kind:`Field`,alias:n,name:t,arguments:r,directives:i,selectionSet:a})}while(W.charCodeAt(G)!==125);return G++,K(),{kind:`SelectionSet`,selections:e}}function Ze(){if(K(),W.charCodeAt(G)===40){var e=[];G++,K();do{var t=void 0;if(W.charCodeAt(G)===34&&(t=Ge(!0)),W.charCodeAt(G++)!==36)throw Le(`Variable`);var n=He();if(W.charCodeAt(G++)!==58)throw Le(`VariableDefinition`);K();var r=Je(),i=void 0;W.charCodeAt(G)===61&&(G++,K(),i=Ge(!0)),K();var a={kind:`VariableDefinition`,variable:{kind:`Variable`,name:n},type:r,defaultValue:i,directives:qe(!0)};t&&(a.description=t),e.push(a)}while(W.charCodeAt(G)!==41);return G++,K(),e}}function Qe(e){var t=He();if(W.charCodeAt(G++)!==111||W.charCodeAt(G++)!==110)throw Le(`FragmentDefinition`);K();var n={kind:`FragmentDefinition`,name:t,typeCondition:{kind:`NamedType`,name:He()},directives:qe(!1),selectionSet:Ye()};return e&&(n.description=e),n}function $e(){var e=[];do{var t=void 0;if(W.charCodeAt(G)===34&&(t=Ge(!0)),W.charCodeAt(G)===123){if(t)throw Le(`Document`);G++,K(),e.push({kind:`OperationDefinition`,operation:`query`,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:Xe()})}else{var n=Ve();switch(n){case`fragment`:e.push(Qe(t));break;case`query`:case`mutation`:case`subscription`:var r,i=void 0;(r=W.charCodeAt(G))!==40&&r!==64&&r!==123&&(i=He());var a={kind:`OperationDefinition`,operation:n,name:i,variableDefinitions:Ze(),directives:qe(!1),selectionSet:Ye()};t&&(a.description=t),e.push(a);break;default:throw Le(`Document`)}}}while(G<W.length);return e}function et(e,t){return W=e.body?e.body:e,G=0,K(),t&&t.noLocation?{kind:`Document`,definitions:$e()}:{kind:`Document`,definitions:$e(),loc:{start:0,end:W.length,startToken:void 0,endToken:void 0,source:{body:W,name:`graphql.web`,locationOffset:{line:1,column:1}}}}}function tt(e,t,n){for(var r=``,i=0;i<e.length;i++)i&&(r+=t),r+=n(e[i]);return r}function nt(e){return JSON.stringify(e)}function rt(e){return`"""
|
|
5
|
+
`+e.replace(/"""/g,`\\"""`)+`
|
|
6
|
+
"""`}var it=`
|
|
7
|
+
`,at={OperationDefinition(e){var t=``;e.description&&(t+=at.StringValue(e.description)+`
|
|
8
|
+
`),t+=e.operation,e.name&&(t+=` `+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(t+=` `),t+=`(`+tt(e.variableDefinitions,`, `,at.VariableDefinition)+`)`),e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.Directive));var n=at.SelectionSet(e.selectionSet);return t===`query`?n:t+` `+n},VariableDefinition(e){var t=``;return e.description&&(t+=at.StringValue(e.description)+` `),t+=at.Variable(e.variable)+`: `+ot(e.type),e.defaultValue&&(t+=` = `+ot(e.defaultValue)),e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.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=tt(e.arguments,`, `,at.Argument);t.length+n.length+2>80?t+=`(`+(it+=` `)+tt(e.arguments,it,at.Argument)+(it=it.slice(0,-2))+`)`:t+=`(`+n+`)`}return e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.Directive)),e.selectionSet&&e.selectionSet.selections.length&&(t+=` `+at.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?rt(e.value).replace(/\n/g,it):nt(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=>`[`+tt(e.values,`, `,ot)+`]`,ObjectValue:e=>`{`+tt(e.fields,`, `,at.ObjectField)+`}`,ObjectField:e=>e.name.value+`: `+ot(e.value),Document(e){return!e.definitions||!e.definitions.length?``:tt(e.definitions,`
|
|
9
|
+
|
|
10
|
+
`,ot)},SelectionSet:e=>`{`+(it+=` `)+tt(e.selections,it,ot)+(it=it.slice(0,-2))+`}`,Argument:e=>e.name.value+`: `+ot(e.value),FragmentSpread(e){var t=`...`+e.name.value;return e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.Directive)),t},InlineFragment(e){var t=`...`;return e.typeCondition&&(t+=` on `+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.Directive)),t+=` `+at.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t=``;return e.description&&(t+=at.StringValue(e.description)+`
|
|
11
|
+
`),t+=`fragment `+e.name.value,t+=` on `+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=` `+tt(e.directives,` `,at.Directive)),t+` `+at.SelectionSet(e.selectionSet)},Directive(e){var t=`@`+e.name.value;return e.arguments&&e.arguments.length&&(t+=`(`+tt(e.arguments,`, `,at.Argument)+`)`),t},NamedType:e=>e.name.value,ListType:e=>`[`+ot(e.type)+`]`,NonNullType:e=>ot(e.type)+`!`},ot=e=>at[e.kind](e);function st(e){return it=`
|
|
12
|
+
`,at[e.kind]?at[e.kind](e):``}function ct(e,t){switch(e.kind){case`NullValue`:return null;case`IntValue`:return parseInt(e.value,10);case`FloatValue`:return parseFloat(e.value);case`StringValue`:case`EnumValue`:case`BooleanValue`:return e.value;case`ListValue`:for(var n=[],r=0,i=e.values.length;r<i;r++)n.push(ct(e.values[r],t));return n;case`ObjectValue`:for(var a=Object.create(null),o=0,s=e.fields.length;o<s;o++){var c=e.fields[o];a[c.name.value]=ct(c.value,t)}return a;case`Variable`:return t&&t[e.name.value]}}var lt=()=>{},ut=lt;function dt(e){return{tag:0,0:e}}function ft(e){return{tag:1,0:e}}var pt=()=>typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`,mt=e=>e;function ht(e){return t=>n=>{var r=ut;t((t=>{t===0?n(0):t.tag===0?(r=t[0],n(t)):e(t[0])?n(t):r(0)}))}}function gt(e){return t=>n=>t((t=>{t===0||t.tag===0?n(t):n(ft(e(t[0])))}))}function _t(e){return t=>n=>{var r=[],i=ut,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=ut;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(dt((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 vt(e){return _t(mt)(e)}function yt(e){return vt(jt(e))}function bt(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(dt((t=>{t===1?(r=!0,i(1),e()):i(t)})))}else n(t)}))}}function xt(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(dt((e=>{e===1&&(r=!0),i(e)})))}else e(t[0]),n(t)}))}}function St(e){return t=>n=>t((t=>{t===0?n(0):t.tag===0?(n(t),e()):n(t)}))}function Ct(e){var t=[],n=ut,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(dt((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 wt(e){return t=>n=>{var r=ut,i=ut,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=ut),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(dt((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 Tt(e){return t=>n=>{var r=ut,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(dt((t=>{t===1&&!i?(i=!0,r(1)):t===0&&!i&&a<e&&r(0)})))}}function Et(e){return t=>n=>{var r=ut,i=ut,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(dt((e=>{e===1&&!a?(a=!0,r(1),i(1)):a||r(0)})))}}function Dt(e,t){return n=>r=>{var i=ut,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 Ot(e){return t=>e()(t)}function kt(e){return t=>{var n=e[pt()]&&e[pt()]()||e,r=!1,i=!1,a=!1,o;t(dt((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(ft(o.value))}catch(e){if(n.throw)(r=!!(await n.throw(e)).done)&&t(0);else throw e}i=!1}})))}}function At(e){return e[Symbol.asyncIterator]?kt(e):t=>{var n=e[Symbol.iterator](),r=!1,i=!1,a=!1,o;t(dt((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(ft(o.value))}catch(e){if(n.throw)(r=!!n.throw(e).done)&&t(0);else throw e}i=!1}})))}}var jt=At;function Mt(e){return t=>{var n=!1;t(dt((r=>{r===1?n=!0:n||(n=!0,t(ft(e)),t(0))})))}}function Nt(e){return t=>{var n=!1,r=e({next(e){n||t(ft(e))},complete(){n||(n=!0,t(0))}});t(dt((e=>{e===1&&!n&&(n=!0,r())})))}}function Pt(){var e,t;return{source:Ct(Nt((n=>(e=n.next,t=n.complete,lt)))),next(t){e&&e(t)},complete(){t&&t()}}}var Ft=e=>{var t=!1;e(dt((n=>{n===1?t=!0:t||(t=!0,e(0))})))};function It(e){return Nt((t=>(e.then((e=>{Promise.resolve(e).then((()=>{t.next(e),t.complete()}))})),lt)))}function Lt(e){return t=>{var n=ut,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 Rt(e){Lt((e=>{}))(e)}function zt(e){return new Promise((t=>{var n=ut,r;e((e=>{e===0?Promise.resolve(r).then(t):e.tag===0?(n=e[0])(0):(r=e[0],n(0))}))}))}var Bt=(...e)=>{for(var t=e[0],n=1,r=e.length;n<r;n++)t=e[n](t);return t},Vt=e=>e&&typeof e.message==`string`&&(e.extensions||e.name===`GraphQLError`)?e:typeof e==`object`&&typeof e.message==`string`?new Ie(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new Ie(e),Ht=class extends Error{constructor(e){var t=(e.graphQLErrors||[]).map(Vt),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+=`
|
|
13
|
+
`),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}},Ut=(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},Wt=new Set,Gt=new WeakMap,Kt=(e,t)=>{if(e===null||Wt.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return Kt(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=Kt(e[r],t)||`null`;return n+=`]`}else if(!t&&(Xt!==Yt&&e instanceof Xt||Zt!==Yt&&e instanceof Zt))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=Gt.get(e)||Math.random().toString(36).slice(2);return Gt.set(e,o),Kt({__key:o},t)}Wt.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=Kt(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=Kt(a[c],t)+`:`+u)}return Wt.delete(e),s+=`}`},qt=(e,t,n)=>{if(!(typeof n!=`object`||!n||n.toJSON||Wt.has(n)))if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)qt(e,`${t}.${r}`,n[r]);else if(n instanceof Xt||n instanceof Zt)e.set(t,n);else for(var a in Wt.add(n),n)qt(e,`${t}.${a}`,n[a])},Jt=(e,t)=>(Wt.clear(),Kt(e,t||!1)),Yt=class{},Xt=typeof File<`u`?File:Yt,Zt=typeof Blob<`u`?Blob:Yt,Qt=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,$t=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,en=(e,t)=>t%2==0?e.replace($t,`
|
|
14
|
+
`):e,tn=e=>e.split(Qt).map(en).join(``).trim(),nn=new Map,rn=new Map,an=e=>{var t;return typeof e==`string`?t=tn(e):e.loc&&rn.get(e.__key)===e?t=e.loc.source.body:(t=nn.get(e)||tn(st(e)),nn.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},on=e=>{var t;if(e.documentId)t=Ut(e.documentId);else if(t=Ut(an(e)),e.definitions){var n=ln(e);n&&(t=Ut(`\n# ${n}`,t))}return t},sn=e=>{var t,n;return typeof e==`string`?(t=on(e),n=rn.get(t)||et(e,{noLocation:!0})):(t=e.__key||on(e),n=rn.get(t)||e),n.loc||an(n),n.__key=t,rn.set(t,n),n},cn=(e,t,n)=>{var r=t||{},i=sn(e),a=Jt(r,!0),o=i.__key;return a!==`{}`&&(o=Ut(a,o)),{key:o,query:i,variables:r,extensions:n}},ln=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===Fe.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},un=(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 Ht({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},dn=(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]=dn(e[n],t[n]);return e}if(!e.constructor||e.constructor===Object){for(var i in e={...e},t)e[i]=dn(e[i],t[i]);return e}}return t},fn=(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]=dn(n[m+h],e.items[h]);else e.data!==void 0&&(n[t]=dn(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 Ht({graphQLErrors:i,response:n}):void 0,extensions:a?o:void 0,hasNext:t.hasNext==null?e.hasNext:t.hasNext,stale:!1}},pn=(e,t,n)=>({operation:e,data:void 0,error:new Ht({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function mn(e){var t={query:void 0,documentId:void 0,operationName:ln(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=an(e.query)),t}var hn=(e,t)=>{var n=e.kind===`query`&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=gn(e.context.url);for(var i in t){var a=t[i];a&&r[1].set(i,typeof a==`object`?Jt(a):a)}var o=r.join(`?`);return o.length>2047&&n!==`force`?(e.context.preferGetMethod=!1,e.context.url):o},gn=e=>{var t=e.indexOf(`?`);return t>-1?[e.slice(0,t),new URLSearchParams(e.slice(t+1))]:[e,new URLSearchParams]},_n=(e,t)=>{if(t&&!(e.kind===`query`&&e.context.preferGetMethod)){var n=Jt(t),r=(e=>{var t=new Map;return(Xt!==Yt||Zt!==Yt)&&(Wt.clear(),qt(t,`variables`,e)),t})(t.variables);if(r.size){var i=new FormData;i.append(`operations`,n),i.append(`map`,Jt({...[...r.keys()].map((e=>[e]))}));var a=0;for(var o of r.values())i.append(``+a++,o);return i}return n}},vn=(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=_n(e,t);return typeof a==`string`&&!n[`content-type`]&&(n[`content-type`]=`application/json`),{...r,method:a?`POST`:`GET`,body:a,headers:n}},yn=/boundary="?([^=";]+)"?/i,bn=/data: ?([^\n]+)/;async function*xn(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*Sn(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*Cn(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(yn),r=`--`+(n?n[1]:`-`),i=!0,a;for await(var o of Sn(xn(t),`\r
|
|
15
|
+
`+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
|
|
16
|
+
\r
|
|
17
|
+
`)+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 Sn(xn(e),`
|
|
18
|
+
|
|
19
|
+
`)){var r=n.match(bn);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?fn(i,l,a,c):un(e,l,a),r=!1,yield i,r=!0;i||(yield i=un(e,{},a))}catch(t){if(!r)throw t;yield pn(e,a&&(a.status<200||a.status>=300)&&a.statusText?Error(a.statusText):t,a)}}function wn(e,t,n){var r;return typeof AbortController<`u`&&(n.signal=(r=new AbortController).signal),bt((()=>{r&&r.abort()}))(ht((e=>!!e))(kt(Cn(e,t,n))))}function Tn(e){var t=t=>e(t);return t.toPromise=()=>zt(Tt(1)(ht((e=>!e.stale&&!e.hasNext))(t))),t.then=(e,n)=>t.toPromise().then(e,n),t.subscribe=e=>Lt(e)(t),t}function En(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Dn=()=>{},On=({forward:e,dispatchDebug:t})=>t=>yt([_t((e=>{var n=mn(e),r=hn(e,n),i=vn(e,n);return Et(ht((t=>t.kind===`teardown`&&t.key===e.key))(t))(wn(e,r,i))}))(ht((e=>e.kind!==`teardown`&&(e.kind!==`subscription`||!!e.context.fetchSubscriptions)))(t)),e(ht((e=>e.kind===`teardown`||e.kind===`subscription`&&!e.context.fetchSubscriptions))(t))]),kn=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight(((e,n)=>n({client:t,forward(t){return Ct(e(Ct(t)))},dispatchDebug(e){}})),n),An=({onOperation:e,onResult:t,onError:n})=>({forward:r})=>i=>_t((e=>{n&&e.error&&n(e.error,e.operation);var r=t&&t(e)||e;return`then`in r?It(r):Mt(r)}))(r(_t((t=>{var n=e&&e(t)||t;return`then`in n?It(n):Mt(n)}))(i))),jn=({dispatchDebug:e})=>e=>ht((e=>!1))(e),Mn=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=Pt();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=Et(ht((t=>t.kind===`teardown`&&t.key===e.key))(c.source))(ht((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`?wt((t=>{var n=Mt(t);return t.stale||t.hasNext?n:yt([n,gt((()=>(t.stale=!0,t)))(Tt(1)(ht((t=>t.key===e.key))(c.source)))])}))(t):Dt((e=>!!e.hasNext),!0)(t),t=e.kind===`mutation`?St((()=>{l(e)}))(t):bt((()=>{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(En(`teardown`,e,e.context))}))(xt((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)),Ct(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||={},En(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`?Tn(f(e)):Tn(Ot((()=>{var t=i.get(e.key);t||i.set(e.key,t=f(e)),t=St((()=>{d(e)}))(t);var n=r.get(e.key);return e.kind===`query`&&n&&(n.stale||n.hasNext)?wt(Mt)(yt([t,ht((t=>t===r.get(e.key)))(Mt(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 Lt((e=>{r=e}))(m.query(e,t,n)).unsubscribe(),r},query:(e,t,n)=>m.executeQuery(cn(e,t),n),subscription:(e,t,n)=>m.executeSubscription(cn(e,t),n),mutation:(e,t,n)=>m.executeMutation(cn(e,t),n)}),h=Dn,g=Ct(kn(t.exchanges)({client:m,dispatchDebug:h,forward:jn({dispatchDebug:h})})(c.source));return Rt(g),m};h();var Nn=ue({}),Pn=Nn.Provider;Nn.Consumer,Nn.displayName=`UrqlContext`;var Fn=()=>s(Nn),In={fetching:!1,stale:!1,hasNext:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0},Ln=(e,t)=>e===t||!(!e||!t||e.key!==t.key),Rn=(e,t)=>{var n={...e,...t,data:t.data!==void 0||t.error?t.data:e.data,fetching:!!t.fetching,stale:!!t.stale};return((e,t)=>{for(var n in e)if(!(n in t))return!0;for(var r in t)if(r===`operation`?!Ln(e[r],t[r]):e[r]!==t[r])return!0;return!1})(e,n)?n:e},zn=(e,t)=>{for(var n=0,r=t.length;n<r;n++)if(e[n]!==t[n])return!0;return!1};function Bn(e,t){e(t)}function Vn(e,t){var n=_(void 0);return L((()=>{var r=cn(e,t);return n.current!==void 0&&n.current.key===r.key?n.current:(n.current=r,r)}),[e,t])}function Hn(e,t){var n=Fn(),r=Vn(e.query,e.variables),i=_(t);i.current=t;var a=L((()=>e.pause?null:n.executeSubscription(r,e.context)),[n,r,e.pause,e.context]),o=[n,r,e.context,e.pause],[s,c]=A((()=>[a,{...In,fetching:!!a},o])),l=s[1];a!==s[0]&&zn(s[2],o)&&c([a,l=Rn(s[1],{fetching:!!a}),o]),k((()=>{var e=e=>{Bn(c,(t=>{var n=Rn(t[1],e);return t[1]===n?t:(i.current&&n.data!=null&&t[1].data!==n.data&&(n.data=i.current(t[1].data,n.data)),[t[0],n,t[2]])}))};if(s[0])return Lt(e)(bt((()=>{e({fetching:!!a})}))(s[0])).unsubscribe;e({fetching:!1})}),[s[0]]);var u=O((t=>{var i=n.executeSubscription(r,{...e.context,...t});Bn(c,(e=>[i,e[1],o]))}),[n,r,e.context,e.pause]);return[l,u]}x();var Un=`stub-source@1`,Wn=`stub-enabled-plugins`,Gn=3e3,Kn=new Map,qn=new Set,Jn=()=>qn.forEach(e=>{try{e()}catch{}}),Yn=e=>(qn.add(e),()=>{qn.delete(e)}),Xn=()=>Qn().map(e=>Kn.get(e)??{uri:e,state:`connecting`}),Zn=()=>Qn(),Qn=()=>{try{let e=JSON.parse(localStorage.getItem(Wn)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}},$n=e=>{try{localStorage.setItem(Wn,JSON.stringify(e))}catch{}},er=(e,t)=>{Kn.set(e,{uri:e,...t}),Jn()},tr=45e3,nr=(e,t)=>Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(t)),tr))]),rr=new Set,ir=new Map,ar=3e4,or=(e,t)=>{if(!Qn().includes(e)||rr.has(e)||ir.has(e))return;Kn.get(e)?.state!==`error`&&er(e,{state:`connecting`});let n=Math.min(Gn*t,ar),r=setTimeout(()=>{ir.delete(e),sr(e,t+1).catch(()=>{})},n);ir.set(e,r)},sr=async(e,n=1)=>{if(!rr.has(e)){rr.add(e),er(e,{state:`connecting`});try{let{port:n,closed:r}=await nr(t.connect(e,{protocol:Un,raw:!0}),`connecting to '${e}' timed out`);r.then(()=>{rr.delete(e),Oe(e),or(e,1)});let i=await nr(Promise.race([De(n,e),r.then(()=>({error:`the package closed before the source registered`}))]),`'${e}' connected but never registered its source`);if(`error`in i)throw Error(i.error);er(e,{state:`connected`,sources:i.ok.sources,rejected:i.ok.rejected})}catch(t){rr.delete(e);let r=t instanceof Error?t.message:String(t);throw console.warn(`Plugin '${e}' failed to connect:`,t),er(e,{state:`error`,error:r}),or(e,n+1),t}}},cr=e=>{let t=ir.get(e);t!==void 0&&(clearTimeout(t),ir.delete(e))},lr=async(e,n)=>{let r=await t.install(e,n);return r?($n([...new Set([...Qn(),r.uri])]),await sr(r.uri),r.uri):null},ur=async e=>{$n(Qn().filter(t=>t!==e)),cr(e),rr.delete(e),Kn.delete(e),Oe(e),await t.uninstall(e).catch(()=>{}),Jn()},dr=async()=>{let e=await t.pick({type:`plugin`,id:`stub`},{multiple:!0,title:`Add stub sources`});for(let t of e)await lr(t.uri).catch(()=>{})};for(let e of Qn())sr(e).catch(()=>{});function fr(e){var t=e.forward;return function(e){return Bt(e,t)}}var pr=function(){return typeof navigator<`u`&&(navigator==null||navigator.product),fr}(),mr=(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},hr=new Set,gr=new WeakMap,_r=(e,t)=>{if(e===null||hr.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return _r(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=_r(e[r],t)||`null`;return n+=`]`}else if(!t&&(br!==yr&&e instanceof br||xr!==yr&&e instanceof xr))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=gr.get(e)||Math.random().toString(36).slice(2);return gr.set(e,o),_r({__key:o},t)}hr.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=_r(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=_r(a[c],t)+`:`+u)}return hr.delete(e),s+=`}`},vr=(e,t)=>(hr.clear(),_r(e,t||!1)),yr=class{},br=typeof File<`u`?File:yr,xr=typeof Blob<`u`?Blob:yr,Sr=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,Cr=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,wr=(e,t)=>t%2==0?e.replace(Cr,`
|
|
20
|
+
`):e,Tr=e=>e.split(Sr).map(wr).join(``).trim(),Er=new Map,Dr=new Map,Or=e=>{var t;return typeof e==`string`?t=Tr(e):e.loc&&Dr.get(e.__key)===e?t=e.loc.source.body:(t=Er.get(e)||Tr(st(e)),Er.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},kr=e=>{var t;if(e.documentId)t=mr(e.documentId);else if(t=mr(Or(e)),e.definitions){var n=Mr(e);n&&(t=mr(`\n# ${n}`,t))}return t},Ar=e=>{var t,n;return typeof e==`string`?(t=kr(e),n=Dr.get(t)||et(e,{noLocation:!0})):(t=e.__key||kr(e),n=Dr.get(t)||e),n.loc||Or(n),n.__key=t,Dr.set(t,n),n},jr=(e,t,n)=>{var r=t||{},i=Ar(e),a=vr(r,!0),o=i.__key;return a!==`{}`&&(o=mr(a,o)),{key:o,query:i,variables:r,extensions:n}},Mr=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===Fe.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},Nr=e=>{if(`definitions`in e){for(var t=[],n=0,r=e.definitions.length;n<r;n++){var i=Nr(e.definitions[n]);t.push(i)}return{...e,definitions:t}}if(`directives`in e&&e.directives&&e.directives.length){for(var a=[],o={},s=0,c=e.directives.length;s<c;s++){var l=e.directives[s],u=l.name.value;u[0]===`_`?u=u.slice(1):a.push(l),o[u]=l}e={...e,directives:a,_directives:o}}if(`selectionSet`in e){var d=[],f=e.kind===Fe.OPERATION_DEFINITION;if(e.selectionSet){for(var p=0,m=e.selectionSet.selections.length;p<m;p++){var h=e.selectionSet.selections[p];f||=h.kind===Fe.FIELD&&h.name.value===`__typename`&&!h.alias;var g=Nr(h);d.push(g)}return f||d.push({kind:Fe.FIELD,name:{kind:Fe.NAME,value:`__typename`},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:d}}}}return e},Pr=new Map,Fr=e=>{var t=Ar(e),n=Pr.get(t.__key);return n||(Pr.set(t.__key,n=Nr(t)),Object.defineProperty(n,"__key",{value:t.__key,enumerable:!1})),n};function Ir(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Lr=`
|
|
21
|
+
https://bit.ly/2XbVrpR#`;function Rr(e,t,n){if(!e){var r=t||`Minfied Error #`+n+`
|
|
22
|
+
`,i=Error(r+Lr+n);throw i.name=`Graphcache Error`,i}}var zr={},Br=e=>e._directives||zr,Vr=e=>e.name.value,Hr=e=>e.typeCondition.name.value,Ur=e=>e.alias?e.alias.value:e.name.value,Wr=[],Gr=e=>e.selectionSet?e.selectionSet.selections:Wr,Kr=e=>e.typeCondition?e.typeCondition.name.value:null,qr=(e,t)=>{var n=null;if(e.arguments)for(var r=0,i=e.arguments.length;r<i;r++){var a=e.arguments[r],o=ct(a.value,t);o!=null&&(n||={},n[Vr(a)]=o)}return n},Jr=(e,t)=>{if(!(!t||!e.variableDefinitions)){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=Vr(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},Yr=(e,t)=>{var n={};if(!t)return n;if(e.variableDefinitions)for(var r=0,i=e.variableDefinitions.length;r<i;r++){var a=e.variableDefinitions[r],o=Vr(a.variable);n[o]=t[o]===void 0&&a.defaultValue?ct(a.defaultValue,t):t[o]}for(var s in t)s in n||(n[s]=t[s]);return n};function Xr(e){for(var t=0;t<e.definitions.length;t++)if(e.definitions[t].kind===Fe.OPERATION_DEFINITION)return e.definitions[t];Rr(!1,``,1)}var Zr=e=>{for(var t={},n=0;n<e.definitions.length;n++){var r=e.definitions[n];r.kind===Fe.FRAGMENT_DEFINITION&&(t[Vr(r)]=r)}return t},Qr=(e,t)=>{var n=Br(e);if(n.include||n.skip)for(var r in n){var i=n[r];if(i&&(r===`include`||r===`skip`)&&i.arguments&&i.arguments[0]&&Vr(i.arguments[0])===`if`){var a=ct(i.arguments[0].value,t);return r===`include`?!!a:!a}}return!0},$r=(e,t)=>{var{defer:n}=Br(e);if(n){for(var r of n.arguments||[])if(Vr(r)===`if`)return!!ct(r.value,t);return!0}return!1},ei=e=>{var{optional:t,required:n}=Br(e);if(n)return!1;if(t)return!0},ti=`__`,ni=(e,t,n,r)=>{var i=ai(e,t,n,r);return!!i&&i.type.kind!==`NON_NULL`},ri=(e,t,n,r)=>{var i=ai(e,t,n,r);if(!i)return!1;var a=i.type.kind===`NON_NULL`?i.type.ofType:i.type;return a.kind===`LIST`&&a.ofType.kind!==`NON_NULL`},ii=(e,t,n)=>{if(!n)return!1;var r=Kr(t);return!r||n===r?!0:e.types.has(r)&&e.types.get(r).kind===`OBJECT`?r===n:((function(e,t){Rr(e.types.has(t)&&(e.types.get(t).kind===`INTERFACE`||e.types.get(t).kind===`UNION`),``,5)})(e,r),oi(e,n),e.isSubType(r,n))},ai=(e,t,n,r)=>{if(!(n.indexOf(ti)===0||t.indexOf(ti)===0))return oi(e,t),e.types.get(t).fields()[n]};function oi(e,t){Rr(e.types.has(t)&&e.types.get(t).kind===`OBJECT`,``,3)}var si=(e,t)=>t?`${e}(${vr(t)})`:e,ci=(e,t)=>`${e}.${t}`,li=e=>{var t=e.indexOf(`(`);return t>-1?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},ui=e=>{var t=e.indexOf(`.`);return{entityKey:e.slice(0,t).replace(/%2e/g,`.`),fieldKey:e.slice(t+1)}},di=null,fi=null,q=null,pi=null,mi=null,hi=null,gi=!1,_i=!1;function vi(e,t){var n;if(e){if(di.has(e))return e;n=fi.get(e)}return n??=t?[]:{},e&&fi.set(e,n),di.add(n),n}var yi=e=>!!e&&di.has(e),bi=(e,t,n,r,i)=>{di=new WeakSet,fi=new WeakMap,mi=e,q=t,hi=new Set,_i=!!r,gi=!!i,n?mi===`read`?pi=n:r||t.hydrating||t.optimisticOrder.length>1?(!r&&!t.commutativeKeys.has(n)?zi(t,n):r&&(t.optimisticOrder.indexOf(n)!==-1&&!t.commutativeKeys.has(n)&&t.optimisticOrder.splice(t.optimisticOrder.indexOf(n),1),t.commutativeKeys.delete(n)),pi=n,Bi(t,n)):(pi=null,Hi(t,n)):pi=null},xi=()=>{var e=q,t=pi;if(_i=!1,pi=null,!e.hydrating&&t&&e.optimisticOrder.indexOf(t)>-1)for(var n=e.optimisticOrder.length;--n>=0&&e.dirtyKeys.has(e.optimisticOrder[n])&&e.commutativeKeys.has(e.optimisticOrder[n]);)Ui(e.optimisticOrder[n]);di=null,fi=null,mi=null,q=null,hi=null,!e.defer&&(e.storage||!e.optimisticOrder.length)&&(e.defer=!0,setTimeout((()=>{bi(`read`,e,null),Ai(),Gi(),xi(),e.defer=!1})))},Si=(e,t,n)=>{t&&!n&&e.deferredKeys.delete(t),bi(`write`,e,t,n),xi()},Ci=new Set,wi=(e,t,n,r)=>{var i=pi?e.optimistic.get(pi):e.base,a=i.get(t);a===void 0&&i.set(t,a=Object.create(null)),r===void 0&&!pi?delete a[n]:a[n]=r},Ti=(e,t,n)=>{for(var r,i=!_i&&mi===`read`&&pi&&q.commutativeKeys.has(pi),a=0,o=q.optimisticOrder.length;a<o;a++){var s=q.optimisticOrder[a],c=e.optimistic.get(s);if(i&&=s!==pi,c&&(!i||!q.commutativeKeys.has(s))&&(!_i||mi===`write`||q.commutativeKeys.has(s))&&(r=c.get(t))!==void 0&&n in r)return r[n]}return(r=e.base.get(t))===void 0?void 0:r[n]};function Ei(e){return q.refCount.get(e)||0}var Di=(e,t)=>{if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)Di(e[n],t);else typeof e==`string`&&((e,t)=>{var n=Ei(e),r=n+t>0?n+t:0;q.refCount.set(e,r),r?!n&&r&&q.gc.delete(e):q.gc.add(e)})(e,t)},Oi=(e,t,n)=>{if(n!==void 0)for(var r in n)t.has(r)||(e.push(li(r)),t.add(r))},ki=(e,t,n,r)=>{Oi(e,t,r.base.get(n));for(var i=0,a=q.optimisticOrder.length;i<a;i++){var o=r.optimistic.get(q.optimisticOrder[i]);o!==void 0&&Oi(e,t,o.get(n))}},Ai=()=>{if(!q.optimisticOrder.length){for(var e of q.gc.keys())if(q.gc.delete(e),!(Ei(e)>0)){var t=q.records.base.get(e);q.refCount.delete(e),q.records.base.delete(e);var n=t&&t.__typename;if(n){var r=q.types.get(n);r&&r.delete(e)}var i=q.links.base.get(e);if(i)for(var a in q.links.base.delete(e),i)Di(i[a],-1)}}},ji=(e,t)=>{e===q.queryRootKey?t!==void 0&&t!==`__typename`&&hi.add(ci(e,t)):hi.add(e)},Mi=(e,t)=>{!_i&&q.storage&&q.persist.add(((e,t)=>`${e.replace(/\./g,`%2e`)}.${t}`)(e,t))},Ni=(e,t)=>(mi===`read`&&ji(e,t),Ti(q.records,e,t)),Pi=(e,t)=>(mi===`read`&&ji(e,t),Ti(q.links,e,t)),Fi=(e,t)=>{var n=q.abstractToConcreteMap.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.abstractToConcreteMap.set(e,r)}},Ii=(e,t,n)=>{Ki(Ti(q.records,e,t),n)||(ji(e,t),Mi(e,t)),wi(q.records,e,t,n)},Li=(e,t)=>Ni(e,t)!==void 0||Pi(e,t)!==void 0,Ri=(e,t,n)=>{var r=pi?q.links.optimistic.get(pi):q.links.base;if(!pi){var i=r&&r.get(e);Di(i&&i[t],-1),Di(n,1)}Ki(Ti(q.links,e,t),n)||(ji(e,t),Mi(e,t)),wi(q.links,e,t,n)},zi=(e,t,n)=>{var r=e.optimisticOrder.indexOf(t);if(r>-1&&e.optimisticOrder.splice(r,1),n)for(e.deferredKeys.add(t),r=r>-1?r:0;r<e.optimisticOrder.length&&!e.deferredKeys.has(e.optimisticOrder[r])&&(!e.dirtyKeys.has(e.optimisticOrder[r])||!e.commutativeKeys.has(e.optimisticOrder[r]));r++);else e.deferredKeys.delete(t),r>-1&&!e.commutativeKeys.has(t)&&Vi(e,t),r=0;e.optimisticOrder.splice(r,0,t),e.commutativeKeys.add(t)},Bi=(e,t)=>{e.optimisticOrder.indexOf(t)===-1&&e.optimisticOrder.unshift(t),e.dirtyKeys.has(t)||(e.dirtyKeys.add(t),e.links.optimistic.set(t,new Map),e.records.optimistic.set(t,new Map))},Vi=(e,t)=>{e.dirtyKeys.has(t)&&(e.dirtyKeys.delete(t),e.records.optimistic.delete(t),e.links.optimistic.delete(t),e.deferredKeys.delete(t))},Hi=(e,t)=>{var n=e.optimisticOrder.indexOf(t);n>-1&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),Vi(e,t)},Ui=e=>{var t=hi;hi=new Set,mi=`write`;var n=q.links.optimistic.get(e);if(n)for(var r of n.entries()){var i=r[0],a=r[1];for(var o in a)Ri(i,o,a[o])}var s=q.records.optimistic.get(e);if(s)for(var c of s.entries()){var l=c[0],u=c[1];for(var d in u)Ii(l,d,u[d])}hi=t,Hi(q,e)},Wi=e=>{var{links:t,records:n}=q,r=[],i=new Set;return ji(e),ki(r,i,e,t),ki(r,i,e,n),r},Gi=()=>{if(q.storage){_i=!0,mi=`read`;var e={};for(var t of q.persist.keys()){var{entityKey:n,fieldKey:r}=ui(t),i=void 0;(i=Pi(n,r))===void 0?(i=Ni(n,r))===void 0?e[t]=void 0:e[t]=vr(i):e[t]=`:${vr(i)}`}_i=!1,q.storage.writeData(e),q.persist.clear()}};function Ki(e,t){return typeof e!=typeof t||e!==t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length?!e.some(((e,n)=>e!==t[n])):!1:!0}var qi=null,Ji=!1,Yi=void 0,Xi=e=>e.__internal.path.length>0&&e.__internal.errorMap?e.__internal.errorMap[e.__internal.path.join(`.`)]:void 0,Zi=(e,t,n,r,i,a)=>{var o={store:e,variables:t,fragments:n,parent:{__typename:r},parentTypeName:r,parentKey:i,parentFieldKey:``,fieldName:``,error:void 0,partial:!1,hasNext:!1,optimistic:_i,__internal:{path:[],errorMap:void 0}};if(a&&a.graphQLErrors)for(var s=0;s<a.graphQLErrors.length;s++){var c=a.graphQLErrors[s];c.path&&c.path.length&&(o.__internal.errorMap||(o.__internal.errorMap=Object.create(null)),o.__internal.errorMap[c.path.join(`.`)]=c)}return o},Qi=(e,t,n,r,i,a)=>{qi=e,e.parent=t,e.parentTypeName=n,e.parentKey=r,e.parentFieldKey=i,e.fieldName=a,e.error=Xi(e)},$i=(e,t,n,r,i)=>{if(!t)return!1;var a=Kr(e);return!a||t===a?!0:!Gr(e).some((e=>e.kind===Fe.FIELD?!Li(n,si(Vr(e),qr(e,r))):!1))},ea=class{constructor(e,t,n,r,i,a){this.typename=e,this.entityKey=t,this.ctx=a,this.stack=[{selectionSet:i,index:0,defer:n,optional:r}]}next(){for(;this.stack.length>0;){for(var e=this.stack[this.stack.length-1];e.index<e.selectionSet.length;){var t=e.selectionSet[e.index++];if(Qr(t,this.ctx.variables)){if(t.kind!==Fe.FIELD){var n=t.kind===Fe.INLINE_FRAGMENT?t:this.ctx.fragments[Vr(t)];if(n){var r=!n.typeCondition||(this.ctx.store.schema?ii(this.ctx.store.schema,n,this.typename):this.ctx.store.possibleTypeMap?ta(this.ctx.store.possibleTypeMap,n.typeCondition.name.value,this.typename):mi===`read`&&na(n.typeCondition.name.value,this.typename)||$i(n,this.typename,this.entityKey,this.ctx.variables,this.ctx.store.logger));if(r||mi===`write`&&!this.ctx.store.schema){var i=ei(t);r&&n.typeCondition&&this.typename!==n.typeCondition.name.value&&Fi(n.typeCondition.name.value,this.typename),this.stack.push(e={selectionSet:Gr(n),index:0,defer:e.defer||$r(t,this.ctx.variables),optional:i===void 0?e.optional:i})}}}else if(mi===`write`||!t._generated)return Ji=e.defer,Yi=e.optional,t}}this.stack.pop()}}},ta=(e,t,n)=>{if(!n)return!1;if(t===n)return!0;var r=e.get(t);return r&&r.has(n)},na=(e,t)=>{if(!t)return!1;if(e===t)return!0;if((e=>q.types.has(e))(e))return!1;var n=(e=>q.abstractToConcreteMap.get(e)||Ci)(e);return n.size&&n.has(t)},ra=e=>e??null,ia=(e,t)=>{if(!t)return t||null;if(Array.isArray(t)){for(var n=Array(t.length),r=0,i=n.length;r<i;r++)n[r]=ia(e,t[r]);return n}return e.keyOfEntity(t)},aa=(e,t,n,r)=>{var i=Fr(t.query),a=Xr(i),o=e.rootFields[a.operation],s=Gr(a),c=Zi(e,Yr(a,t.variables),Zr(i),o,o,r),l=o===c.store.rootFields.query?la(c,o,s,n||vi()):oa(c,o,s,n||vi());return{dependencies:hi,partial:c.partial||!l,hasNext:c.hasNext,data:l||null}},oa=(e,t,n,r)=>{if(typeof(e.store.rootNames[t]?t:r.__typename)!=`string`)return r;for(var i=new ea(t,t,!1,void 0,n,e),a,o=gi,s=vi(r);a=i.next();){var c=Ur(a),l=r[c];e.__internal.path.push(c);var u=void 0;u=a.selectionSet&&l!==null?sa(e,Gr(a),ra(l)):l,o||=u!==l,u!==void 0&&(s[c]=u),e.__internal.path.pop()}return o?s:r},sa=(e,t,n)=>{if(Array.isArray(n)){for(var r=Array(n.length),i=gi,a=0,o=n.length;a<o;a++)e.__internal.path.push(a),r[a]=sa(e,t,n[a]),i||=r[a]!==n[a],e.__internal.path.pop();return i?r:n}else if(n===null)return null;var s=e.store.keyOfEntity(n);return s===null?oa(e,n.__typename,t,n):la(e,s,t,n)||null};function ca(e,t,n,r){var i=r.store.resolvers[t],a=i&&i[n],o;for(var s in e){var c=e[s];if(c&&s!==`include`&&s!==`skip`&&r.store.directives[s])return o=r.store.directives[s](qr(c,r.variables)),o}return o||a}var la=(e,t,n,r,i)=>{var{store:a}=e,o=t===a.rootFields.query,s=i&&a.keyOfEntity(i)||t,c=o?t:Ni(s,`__typename`)||i&&i.__typename;if(typeof c==`string`&&!(i&&c!==i.__typename)){for(var l=new ea(c,s,!1,void 0,n,e),u=!1,d=!1,f=gi,p,m=e.partial,h=vi(r);(p=l.next())!==void 0;){var g=Vr(p),_=qr(p,e.variables),v=Ur(p),y=Br(p),b=ca(y,c,g,e),x=si(g,_),S=ci(s,x),C=Ni(s,x),w=i?i[g]:void 0;e.__internal.path.push(v);var T=void 0;if(g===`__typename`)T=c;else if(w!==void 0&&p.selectionSet===void 0)T=w;else if(mi===`read`&&b){var E=h;if(p.selectionSet===void 0&&C!==void 0&&(E={...h,[v]:C,[g]:C}),Qi(e,E,c,s,x,g),T=b(E,_||{},a,e),p.selectionSet&&(T=ua(e,c,g,S,Gr(p),h[v]===void 0?r[v]:h[v],T,yi(r))),a.schema&&T===null&&!ni(a.schema,c,g,e.store.logger))return}else if(!p.selectionSet)T=C;else if(w!==void 0)T=ua(e,c,g,S,Gr(p),h[v]===void 0?r[v]:h[v],w,yi(r));else{var D=Pi(s,x);D===void 0?typeof C==`object`&&C&&(T=C):T=da(e,D,c,g,Gr(p),h[v]===void 0?r[v]:h[v],yi(r))}if(!Ji&&T===void 0&&(y.optional||Yi&&!y.required||Xi(e)||!y.required&&a.schema&&ni(a.schema,c,g,e.store.logger))?(e.partial=!0,T=null):T===null&&(y.required||!1===Yi)?(e.store.logger,T=void 0):u||=g!==`__typename`,e.__internal.path.pop(),f||=T!==r[v],T!==void 0)h[v]=T;else if(Ji)d=!0;else{e.store.logger,e.partial=m;return}}return e.partial=e.partial||m,e.hasNext=e.hasNext||d,o&&e.partial&&!u?void 0:f?h:r}},ua=(e,t,n,r,i,a,o,s)=>{if(Array.isArray(o)){for(var{store:c}=e,l=c.schema?ri(c.schema,t,n,e.store.logger):!1,u=e.partial,d=vi(a,!0),f=gi||!Array.isArray(a)||o.length!==a.length,p=0,m=o.length;p<m;p++){e.__internal.path.push(p);var h=ua(e,t,n,ci(r,`${p}`),i,a?.[p],o[p],s);if(e.__internal.path.pop(),h===void 0&&!l){e.partial=u;return}else e.partial=e.partial||h===void 0&&l,d[p]=h??null,f||=d[p]!==a[p]}return f?d:a}else if(o==null)return o;else if(s&&a===null)return null;else if(fa(o)){var g=a||vi(a);return typeof o==`string`?la(e,o,i,g):la(e,r,i,g,o)}else return},da=(e,t,n,r,i,a,o)=>{if(Array.isArray(t)){for(var{store:s}=e,c=s.schema?ri(s.schema,n,r,e.store.logger):!1,l=vi(a,!0),u=e.partial,d=gi||!Array.isArray(a)||t.length!==a.length,f=0,p=t.length;f<p;f++){e.__internal.path.push(f);var m=da(e,t[f],n,r,i,a?.[f],o);if(e.__internal.path.pop(),m===void 0&&!c){e.partial=u;return}else e.partial=e.partial||m===void 0&&c,l[f]=m||null,d||=l[f]!==a[f]}return d?l:a}else if(t===null||a===null&&o)return null;return la(e,t,i,a||vi(a))},fa=e=>typeof e==`string`||typeof e==`object`&&typeof e.__typename==`string`,pa=(e,t,n)=>{for(var r=t?[{fieldKey:si(t,n)}]:Wi(e),i=0,a=r.length;i<a;i++){var{fieldKey:o}=r[i];Pi(e,o)===void 0?Ii(e,o,void 0):Ri(e,o,void 0)}},ma=(e,t)=>{for(var n of(e=>q.types.get(e)||Ci)(e))t.includes(n)||pa(n)},ha=(e,t,n,r)=>{var i=Fr(t.query),a=Xr(i),o={data:n||vi(),dependencies:hi},s=e.rootFields[a.operation];return ga(Zi(e,Yr(a,t.variables),Zr(i),s,s,r),s,Gr(a),o.data),o},ga=(e,t,n,r)=>{var i=e.store.rootNames[t]||`query`,a=!!e.store.rootNames[t],o=a?t:r.__typename;if(!o&&t&&e.optimistic&&(o=Ni(t,`__typename`)),o)!a&&t&&(Ii(t,`__typename`,o),((e,t)=>{var n=q.types.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.types.set(e,r)}})(o,t));else return;for(var s=e.store.updates[o],c=new ea(o,t||o,!1,void 0,n,e),l;l=c.next();){var u=Vr(l),d=qr(l,e.variables),f=si(u,d),p=Ur(l),m=r[e.optimistic?u:p];if(!(u===`__typename`||m===void 0&&(Ji||e.optimistic&&i===`query`))){e.__internal.path.push(p);var h=void 0;if(e.optimistic&&i===`mutation`){if(!(h=e.store.optimisticMutations[u]))continue}else e.optimistic&&typeof m==`function`&&(h=m);if(h&&(Qi(e,r,o,t||o,f,u),m=ra(h(d||{},e.store,e))),m!==void 0){if(l.selectionSet)if(t&&i===`query`){var g=ci(t,f),_=_a(e,Gr(l),ra(m),g,e.optimistic?Pi(t||o,f):void 0);Ri(t||o,f,_)}else _a(e,Gr(l),ra(m));else t&&i===`query`&&Ii(t||o,f,m!==null||!Xi(e)?m:void 0);var v=s&&s[u];if(v)Qi(e,r,o,t||o,f,u),r[u]=m,v(r,d||{},e.store,e);else if(o===e.store.rootFields.mutation&&!e.optimistic){if(m&&Array.isArray(m))for(var y=m.map((t=>e.store.keyOfEntity(t)||``)),b=0,x=m.length;b<x;b++){var S=y[b];if(S&&m[b].__typename){var C=Ni(S,`__typename`),w=Ei(S);C&&!w&&ma(m[b].__typename,y)}}else if(m&&typeof m==`object`){var T=e.store.keyOfEntity(m);if(T){var E=Ni(T,`__typename`),D=Ei(T);(!E||!D)&&m.__typename&&ma(m.__typename,[T])}}}e.__internal.path.pop()}}}},_a=(e,t,n,r,i)=>{if(Array.isArray(n)){for(var a=Array(n.length),o=0,s=n.length;o<s;o++){e.__internal.path.push(o);var c=r?ci(r,`${o}`):void 0;a[o]=_a(e,t,n[o],c,i?.[o]),e.__internal.path.pop()}return a}else if(n===null)return Xi(e)?void 0:null;var l=e.store.keyOfEntity(n)||(typeof i==`string`?i:null);n.__typename;var u=l||r;return ga(e,u,t,n),u||null},va=class{constructor(e){e||={},this.logger=e.logger,this.resolvers=e.resolvers||{},this.directives=e.directives||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.globalIDs=Array.isArray(e.globalIDs)?new Set(e.globalIDs):!!e.globalIDs;var t=`Query`,n=`Mutation`,r=`Subscription`;if(e.schema){var i=(({__schema:e})=>{var t=new Map,n=e=>{var t;return()=>{if(!t){t={};for(var n=0;n<e.length;n++)t[e[n].name]=e[n]}return t}},r=e=>{switch(e.kind){case`OBJECT`:case`INTERFACE`:return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map((e=>({name:e.name,type:e.type,args:n(e.args)}))))};case`UNION`:return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},i={query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:void 0,isSubType(e,n){var r=t.get(e),i=t.get(n);return!r||!i?!1:r.kind===`UNION`?!!r.types()[n]:r.kind!==`OBJECT`&&i.kind===`OBJECT`?!!i.interfaces()[e]:e===n}};if(e.types){i.types=t;for(var a=0;a<e.types.length;a++){var o=e.types[a];if(o&&o.name){var s=r(o);s&&t.set(o.name,s)}}}return i})(e.schema);t=i.query||t,n=i.mutation||n,r=i.subscription||r,i.types&&(this.schema=i)}if(!this.schema&&e.possibleTypes){this.possibleTypeMap=new Map;for(var a of Object.entries(e.possibleTypes)){var[o,s]=a;this.possibleTypeMap.set(o,new Set(s))}}this.updates=e.updates||{},this.rootFields={query:t,mutation:n,subscription:r},this.rootNames={[t]:`query`,[n]:`mutation`,[r]:`subscription`},this.data=(c=t,{hydrating:!1,defer:!1,gc:new Set,types:new Map,persist:new Set,queryRootKey:c,refCount:new Map,links:{optimistic:new Map,base:new Map},abstractToConcreteMap:new Map,records:{optimistic:new Map,base:new Map},deferredKeys:new Set,commutativeKeys:new Set,dirtyKeys:new Set,optimisticOrder:[],storage:null});var c;this.schema}keyOfField(e,t){return si(e,t)}keyOfEntity(e){if(qi&&e===qi.parent)return qi.parentKey;if(e==null||typeof e==`string`)return e||null;if(!e.__typename)return null;if(this.rootNames[e.__typename])return e.__typename;var t=null;this.keys[e.__typename]?t=this.keys[e.__typename](e)||null:e.id==null?e._id!=null&&(t=`${e._id}`):t=`${e.id}`;var n=e.__typename;return!0===this.globalIDs||this.globalIDs&&this.globalIDs.has(n)||!t?t:`${n}:${t}`}resolve(e,t,n){var r=this.keyOfEntity(e);if(r){var i=si(t,n),a=Ni(r,i);if(a!==void 0)return a;var o=Pi(r,i);return o!==void 0&&(o=ia(this,o)),o}}invalidate(e,t,n){var r=this.keyOfEntity(e);e&&typeof e==`string`&&!t&&!n&&!this.resolve(e,`__typename`)?ma(e,[]):(Rr(r,``,19),pa(r,t,n))}inspectFields(e){var t=this.keyOfEntity(e);return t?Wi(t):[]}updateQuery(e,t){var n=jr(e.query,e.variables),r=t(this.readQuery(n));r!==null&&ha(this,n,r,void 0)}readQuery(e){var t=jr(e.query,e.variables);return aa(this,t,void 0,void 0).data}readFragment(e,t,n,r){return((e,t,n,r,i)=>{var a=Zr(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Hr(o);typeof n!=`string`&&!n.__typename&&(n.__typename=s);var c=e.keyOfEntity(n);return c&&la(Zi(e,r||{},a,s,c,void 0),c,Gr(o),vi())||null})(this,Fr(e),t,n,r)}writeFragment(e,t,n,r){((e,t,n,r,i)=>{var a=Zr(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Hr(o),c={__typename:s,...n},l=e.keyOfEntity(c);l&&ga(Zi(e,r||{},a,s,l,void 0),l,Gr(o),c)})(this,Fr(e),t,n,r)}link(e,t,...n){var r=n.length===2?n[0]:null,i=n.length===2?n[1]:n[0],a=this.keyOfEntity(e);a&&Ri(a,si(t,r),ia(this,i))}},ya=(e,t)=>Ir(e.kind,e,{...e.context,meta:{...e.context.meta,...t}}),ba=(e,t)=>Ir(e.kind,e,{...e.context,requestPolicy:t}),xa=(e=>({forward:t,client:n,dispatchDebug:r})=>{var i=new va(e);e&&e.storage&&(i.data.hydrating=!0,e.storage.readData().then((t=>{((e,t,n)=>{for(var r in bi(`write`,e,null),n){var i=n[r];if(i!==void 0){var{entityKey:a,fieldKey:o}=ui(r);i[0]===`:`?Pi(a,o)===void 0&&Ri(a,o,JSON.parse(i.slice(1))):Ni(a,o)===void 0&&Ii(a,o,JSON.parse(i))}}e.storage=t,e.hydrating=!1,xi()})(i.data,e.storage,t),e.storage.onCacheHydrated&&e.storage.onCacheHydrated()})));var a=new Map,o=[],s=new Map,c=new Map,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=e=>{for(var t of e.values())if(l.has(t))return!0;return!1},h=(e,t)=>{if(t)for(var n of t.values()){var r=d.get(n);if(r)for(var i of r.values())e.add(i)}},g=(e,t,r)=>{for(var i of t.values())if(i!==e.key){var a=s.get(i);if(a){e.kind===`query`&&p.add(i);var o=`cache-first`;u.has(i)&&(u.delete(i),o=`cache-and-network`),n.reexecuteOperation(ba(a,o))}}if(!r){var c=f;f=p,e.kind===`query`&&f.add(e.key),(p=c).clear()}},_=e=>{var t=!1;if(e.kind===`query`)zi(i.data,e.key),s.set(e.key,e);else if(e.kind===`teardown`)return s.delete(e.key),c.delete(e.key),f.delete(e.key),Si(i.data,e.key),e;else if(e.kind===`mutation`&&e.context.requestPolicy!==`network-only`){s.set(e.key,e),bi(`write`,i.data,e.key,!0,!1);var{dependencies:n}=ha(i,e,void 0,void 0);if(xi(),n.size){for(var r of n.values())l.add(r);a.set(e.key,n);var o=new Set;h(o,n),g(e,o,!0),t=!0}}return Ir(e.kind,{key:e.key,query:Fr(e.query),variables:e.variables?Jr(Xr(e.query),e.variables):e.variables},{...e.context,optimistic:t})},v=(e,t)=>{for(var n of t.values()){var r=d.get(n);r||d.set(n,r=new Set),r.add(e.key)}},y=e=>{bi(`read`,i.data,void 0,!1,!1);var t=aa(i,e,c.get(e.key),void 0);xi();var n=t.data?!t.partial&&!t.hasNext?`hit`:`partial`:`miss`;return c.set(e.key,t.data),s.set(e.key,e),v(e,t.dependencies),{outcome:n,operation:e,data:t.data,dependencies:t.dependencies,hasNext:t.hasNext}},b=(e,t)=>{var n=s.get(e.operation.key)||e.operation;n.kind===`mutation`&&(h(t,a.get(n.key)),a.delete(n.key)),(n.kind===`subscription`||e.hasNext)&&zi(i.data,n.key,!0);var r,o=e.data;if(o){bi(`write`,i.data,n.key,!1,!1);var l=ha(i,n,o,e.error).dependencies;xi(),h(t,l);var u=n.kind===`query`?c.get(n.key):null;bi(`read`,i.data,n.key,!1,u!==o);var d=aa(i,n,u||o,e.error);xi(),o=d.data,n.kind===`query`&&(h(t,r=d.dependencies),c.set(n.key,o))}else Si(i.data,n.key);return r&&v(e.operation,r),{operation:n,data:o,error:e.error,extensions:e.extensions,hasNext:e.hasNext,stale:e.stale}};return e=>{var r=Ct(gt(y)(ht((e=>e.kind===`query`&&e.context.requestPolicy!==`network-only`))(e))),c=ht((e=>e.kind!==`query`||e.context.requestPolicy===`network-only`))(e),d=gt((e=>ya(e.operation,{cacheOutcome:`miss`})))(ht((e=>e.outcome===`miss`&&e.operation.context.requestPolicy!==`cache-only`&&!m(e.dependencies)&&!f.has(e.operation.key)))(r)),p=gt((e=>{var{requestPolicy:t}=e.operation.context,r=t!==`cache-only`&&(e.hasNext||t===`cache-and-network`||t===`cache-first`&&e.outcome===`partial`&&!f.has(e.operation.key)),a=t!==`cache-only`&&(r||e.outcome===`partial`&&f.has(e.operation.key)&&((o=i.data).commutativeKeys.has(c=e.operation.key)||o.optimisticOrder.indexOf(c)>-1)),o,c,l={operation:ya(e.operation,{cacheOutcome:e.outcome}),data:e.data,error:e.error,extensions:e.extensions,stale:a&&!e.hasNext,hasNext:r&&e.hasNext};return r&&(m(e.dependencies)?t===`cache-and-network`&&u.add(e.operation.key):n.reexecuteOperation(ba(s.get(e.operation.key)||e.operation,`network-only`))),l}))(ht((e=>e.outcome!==`miss`||e.operation.context.requestPolicy===`cache-only`))(r)),h=t(gt(_)(yt([c,d])));return yt([gt((e=>{var t=new Set,n=b(e,t);return g(e.operation,t,!1),n}))(ht((e=>!a.has(e.operation.key)))(h)),_t((e=>{if(o.push(e)<a.size)return Ft;for(var t=0;t<o.length;t++)zi(i.data,o[t].operation.key);l.clear();for(var n=[],r=new Set,s;s=o.shift();)n.push(b(s,r));return g(e.operation,r,!1),jt(n)}))(ht((e=>a.has(e.operation.key)))(h)),p])}})({schema:{__schema:JSON.parse(`{"queryType":{"name":"Query","kind":"OBJECT"},"mutationType":{"name":"Mutation","kind":"OBJECT"},"subscriptionType":{"name":"Subscription","kind":"OBJECT"},"types":[{"kind":"OBJECT","name":"Episode","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"absoluteEpisodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"absoluteNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"embedUrl","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"mediaUri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relativeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"releaseDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"runtime","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"thumbnails","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeThumbnail","ofType":null}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeHandle","fields":[{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeThumbnail","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Media","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"anomalies","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAnomaly","ofType":null}}},"args":[]},{"name":"averageScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"banners","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaBanner","ofType":null}}}},"args":[]},{"name":"categories","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"endDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}}}},"args":[]},{"name":"franchise","type":{"kind":"OBJECT","name":"MediaFranchise","ofType":null},"args":[]},{"name":"genres","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isAdult","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"kind","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextAiringEpisode","type":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"popularity","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"provenance","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFieldProvenance","ofType":null}}},"args":[]},{"name":"relations","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRelationEdge","ofType":null}}}},"args":[]},{"name":"scope","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"season","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonYear","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tags","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"trailers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTrailer","ofType":null}}}},"args":[]},{"name":"type","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAiringEpisode","fields":[{"name":"airingAt","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"episodeNumber","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAnomaly","fields":[{"name":"detail","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaBanner","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCover","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFieldProvenance","fields":[{"name":"answerSeq","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"field","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tier","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uris","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"witnesses","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchise","fields":[{"name":"edges","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseEdge","ofType":null}}}},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseNode","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseEdge","fields":[{"name":"from","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"to","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseNode","fields":[{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaHandle","fields":[{"name":"by","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"provenance","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"via","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRelationEdge","fields":[{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTrailer","fields":[{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"thumbnail","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Mutation","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Origin","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isApiOnly","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"OriginPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Origin","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"PlaybackSource","fields":[{"name":"Episode","type":{"kind":"OBJECT","name":"Episode","ofType":null},"args":[]},{"name":"data","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"type","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Query","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Subscription","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"containingMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"media","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"mediaPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"origin","type":{"kind":"OBJECT","name":"Origin","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"originPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"OriginPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"similarMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"SCALAR","name":"Any"}],"directives":[]}`)},keys:{Media:e=>e._id,MediaHandle:()=>null,MediaRelationEdge:()=>null,MediaFranchise:()=>null,MediaFranchiseNode:()=>null,MediaFranchiseEdge:()=>null,EpisodeHandle:()=>null,MediaTitle:()=>null,MediaDescription:()=>null,MediaShortDescription:()=>null,MediaCover:()=>null,MediaBanner:()=>null,MediaAiringEpisode:()=>null,MediaFieldProvenance:()=>null,MediaAnomaly:()=>null,MediaTrailer:e=>e.uri,Episode:e=>e._id,EpisodeTitle:()=>null,EpisodeDescription:()=>null,EpisodeShortDescription:()=>null,EpisodeThumbnail:()=>null,PlaybackSource:e=>e.uri},resolvers:{}}),Sa=new Mn({url:`http://d/graphql`,exchanges:[An({onError(e,t){for(let n of e.graphQLErrors)console.error(Error(n.message,{cause:`GQL Error originated from ${t.query.definitions.find(e=>e.kind===`OperationDefinition`)?.name?.value}`}))}}),pr,xa,On],fetchSubscriptions:!0,fetch:async(e,t)=>ye(e,t)});function Ca(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var wa=o((e=>{var t=(h(),i(l));function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function u(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,d(i)&&l({inst:i})},[e,n,t]),o(function(){return d(i)&&l({inst:i}),e(function(){d(i)&&l({inst:i})})},[e]),c(n),n}function d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function f(e,t){return t()}var p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?f:u;e.useSyncExternalStore=t.useSyncExternalStore===void 0?p:t.useSyncExternalStore})),Ta=o(((e,t)=>{t.exports=wa()}));h();var Ea=Ta(),Da=D,Oa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?m:k,ka=Da||Oa,Aa=e=>{let t=_([e,(...e)=>t[0](...e)]).current;return ka(()=>{t[0]=e}),t[1]},ja=`popstate`,Ma=`pushState`,Na=`replaceState`,Pa=[ja,Ma,Na,`hashchange`],Fa=e=>{for(let t of Pa)addEventListener(t,e);return()=>{for(let t of Pa)removeEventListener(t,e)}},Ia=(e,t)=>(0,Ea.useSyncExternalStore)(Fa,e,t),La=()=>location.search,Ra=({ssrSearch:e=``}={})=>Ia(La,()=>e),za=()=>location.pathname,Ba=({ssrPath:e}={})=>Ia(za,e?()=>e:za),Va=(e,{replace:t=!1,state:n=null}={})=>history[t?Na:Ma](n,``,e),Ha=(e={})=>[Ba(e),Va],Ua=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Ua]===void 0){for(let e of[Ma,Na]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Ua,{value:!0})}var Wa=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Ga=(e=``)=>e===`/`?``:e,Ka=(e,t)=>e[0]===`~`?e.slice(1):Ga(t)+e,qa=(e=``,t)=>Wa(Ya(Ga(e)),Ya(t)),Ja=e=>e[0]===`?`?e.slice(1):e,Ya=e=>{try{return decodeURI(e)}catch{return e}},Xa=e=>Ya(Ja(e)),Za={hook:Ha,searchHook:Ra,parser:Ca,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},Qa=ue(Za),$a=()=>s(Qa),eo={},to=ue(eo),no=()=>s(to),ro=e=>{let[t,n]=e.hook(e);return[qa(e.base,t),Aa((t,r)=>n(Ka(t,e.base),r))]},io=()=>ro($a()),ao=()=>{let e=$a();return Xa(e.searchHook(e))},oo=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},so=e=>oo($a().parser,e,io()[0]),co=({children:e,...t})=>{let n=$a(),r=t.hook?Za:n,i=r,[a,o]=t.ssrPath?.split(`?`)??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=_({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]||``):t[e]||r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return z(Qa.Provider,{value:i,children:e})},lo=({children:e,component:t},n)=>t?z(t,{params:n}):typeof e==`function`?e(n):e,uo=e=>{let t=_(eo),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},fo=({path:e,nest:t,match:n,...r})=>{let i=$a(),[a]=ro(i),[o,s,c]=n??oo(i.parser,e,a,t),l=uo({...no(),...s});if(!o)return null;let u=c?z(co,{base:c},lo(r,l)):lo(r,l);return z(to.Provider,{value:l,children:u})},po=S((e,t)=>{let n=$a(),[r,i]=ro(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,...p}=e,m=Aa(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),h=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&T(l)?E(l,{onClick:m,href:h}):z(`a`,{...p,onClick:m,href:h,className:u?.call?u(r===o):u,children:l,ref:t})}),mo=e=>Array.isArray(e)?e.flatMap(e=>mo(e&&e.type===se?e.props.children:e)):[e],ho=({children:e,location:t})=>{let n=$a(),[r]=ro(n);for(let i of mo(e)){let e=0;if(T(i)&&(e=oo(n.parser,i.props.path,t||r,i.props.nest))[0])return E(i,{match:e})}return null},go=e=>{let{to:t,href:n=t}=e,r=$a(),[,i]=ro(r),a=Aa(()=>i(t||n,e)),{ssrContext:o}=r;return Oa(()=>{a()},[]),o&&(o.redirectTo=t),null},J=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.DEBUG_TRACE=`DEBUG_TRACE`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({}),_o={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`,DEBUG_TRACE:()=>`/debug/trace`,LOGIN_CALLBACK:()=>`/login/callback`},vo={HOME:`/`,MEDIA:`/media/:uri`,MEDIA_EPISODE:`/media/:uri/:mediaUri`,SEARCH:`/search`,SEARCH_LEGACY:`/search/:query`,LEGAL:`/legal`,PRIVACY:`/privacy`,SETTINGS:`/settings`,WATCH:`/watch/:mediaUri/:episodeUri/:sourceUri?`,PARTY:`/party`,DEBUG_TRACE:`/debug/trace`,LOGIN_CALLBACK:`/login/callback`},yo=e=>vo[e],Y=(e,t)=>_o[e](t),bo=function(e){return e.Anime=`ANIME`,e.Movie=`MOVIE`,e.Series=`SERIES`,e}({}),xo=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),So=function(e){return e.Fall=`FALL`,e.Spring=`SPRING`,e.Summer=`SUMMER`,e.Winter=`WINTER`,e}({}),Co=function(e){return e.Popularity=`POPULARITY`,e.PopularityDesc=`POPULARITY_DESC`,e}({}),wo=function(e){return e.Cancelled=`CANCELLED`,e.Finished=`FINISHED`,e.Hiatus=`HIATUS`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Releasing=`RELEASING`,e}({}),To=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}({}),Eo=function(e){return e.IsApiOnly=`IS_API_ONLY`,e.IsNotApiOnly=`IS_NOT_API_ONLY`,e}({}),Do={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Oo={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},ko={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},Ao={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetReleasingMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},jo={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModal`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`description`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`categories`}},{kind:`Field`,name:{kind:`Name`,value:`franchise`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`edges`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`from`}},{kind:`Field`,name:{kind:`Name`,value:`to`}},{kind:`Field`,name:{kind:`Name`,value:`relation`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`relations`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Mo={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModalOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`OriginFragment`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},No={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetTheatherMedia`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Po={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`SearchMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`genres`}},{kind:`Field`,name:{kind:`Name`,value:`tags`}},{kind:`Field`,name:{kind:`Name`,value:`averageScore`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`season`}},{kind:`Field`,name:{kind:`Name`,value:`seasonYear`}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Fo={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchMedia`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`embedUrl`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}}]}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Io={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]}}]}}]},Lo={query:`q`,category:`category`,status:`status`,season:`season`,year:`year`,format:`format`,genre:`genre`,tag:`tag`},Ro=[{value:To.Tv,label:`TV Show`},{value:To.Movie,label:`Movie`},{value:To.TvShort,label:`TV Short`},{value:To.Special,label:`Special`},{value:To.Ova,label:`OVA`},{value:To.Ona,label:`ONA`}],zo=[{value:wo.Releasing,label:`Airing`},{value:wo.Finished,label:`Finished`},{value:wo.NotYetReleased,label:`Not yet aired`},{value:wo.Cancelled,label:`Cancelled`},{value:wo.Hiatus,label:`Hiatus`}],Bo=[{value:So.Winter,label:`Winter`},{value:So.Spring,label:`Spring`},{value:So.Summer,label:`Summer`},{value:So.Fall,label:`Fall`}],Vo=[{value:bo.Anime,label:`Anime`},{value:bo.Series,label:`Series`},{value:bo.Movie,label:`Movies`}],Ho=[`Action`,`Adventure`,`Comedy`,`Drama`,`Ecchi`,`Fantasy`,`Horror`,`Mahou Shoujo`,`Mecha`,`Music`,`Mystery`,`Psychological`,`Romance`,`Sci-Fi`,`Slice of Life`,`Sports`,`Supernatural`,`Thriller`],Uo=new Set(Ho.map(e=>e.toLowerCase())),Wo=e=>Uo.has(e.trim().toLowerCase()),Go=(e,t)=>e.find(e=>e===t)??null,Ko=(e,t)=>t.map(t=>Go(e,t)).filter(e=>e!==null),qo=e=>Bo.map(e=>e.value).find(t=>t===e)??null,Jo=Ro.map(e=>e.value),Yo=zo.map(e=>e.value),Xo=Bo.map(e=>e.value),Zo=Vo.map(e=>e.value),Qo=1917,$o=(e=new Date)=>e.getFullYear()+5,es=(e,t=new Date)=>{if(!e||!/^\d{4}$/.test(e))return null;let n=Number(e);return n>=1917&&n<=$o(t)?n:null},ts=(e,t=new Date)=>{let n=new URLSearchParams(e);return{query:(n.get(Lo.query)??``).trim(),category:Go(Zo,n.get(Lo.category)),status:Go(Yo,n.get(Lo.status)),season:Go(Xo,n.get(Lo.season)),year:es(n.get(Lo.year),t),formats:Ko(Jo,n.getAll(Lo.format)),genres:ns(n.getAll(Lo.genre)),tags:ns(n.getAll(Lo.tag))}},ns=e=>{let t=new Set,n=[];for(let r of e){let e=r.trim(),i=e.toLowerCase();!e||t.has(i)||(t.add(i),n.push(e))}return n},rs=e=>{let t=new URLSearchParams,n=e.query?.trim();n&&t.set(Lo.query,n),e.category&&t.set(Lo.category,e.category),e.status&&t.set(Lo.status,e.status),e.season&&t.set(Lo.season,e.season),e.year&&t.set(Lo.year,String(e.year));for(let n of e.formats??[])t.append(Lo.format,n);for(let n of e.genres??[])t.append(Lo.genre,n);for(let n of e.tags??[])t.append(Lo.tag,n);return t.toString()},is=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return e}},as=(e={})=>{let t=rs(e);return t?`/search?${t}`:`/search`},os=e=>{if(e.query)return`Results for \u201C${e.query}\u201D`;let t=Bo.find(t=>t.value===e.season)?.label;return t&&e.year?`${t} ${e.year}`:t?`${t} seasons`:e.year?String(e.year):us(e)?`Browsing`:`Search`},ss=e=>Ro.find(t=>t.value===e)?.label,cs=e=>zo.find(t=>t.value===e)?.label,ls=(e,t)=>{let n=Bo.find(t=>t.value===e)?.label;return n&&t?`${n} ${t}`:t?String(t):void 0},us=e=>!!(e.query||e.category||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),ds=e=>!!(e.query||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),fs=`plugins`,ps=`plugin`,ms=(e,t)=>{try{return new URL(e,t)}catch{return}},hs=e=>{let t=new Set;return e.filter(e=>{let n=gs(e);return!n||t.has(n)?!1:(t.add(n),!0)})},gs=e=>e.trim().replace(/\/+$/,``).replace(/@\d[^@/]*$/,``),_s=(e,t)=>{let n=ms(e,t);return n?hs([...n.searchParams].filter(([e])=>e===`plugins`||e===ps).map(([,e])=>e.trim())):[]},vs=e=>encodeURIComponent(e).replace(/%3A/g,`:`).replace(/%2F/g,`/`).replace(/%40/g,`@`),ys=(e,t,n)=>{let r=ms(e,n),i=ms(n);return!r||!i||r.origin!==i.origin?e:(r.searchParams.delete(fs),r.searchParams.delete(ps),r.search=[r.searchParams.toString(),hs(t.map(e=>e.trim())).sort().map(e=>`${fs}=${vs(e)}`).join(`&`)].filter(Boolean).join(`&`),r.href)},bs=new Map,xs=new Set,Ss=new Set,Cs=()=>Ss.forEach(e=>{try{e()}catch{}}),ws=e=>(Ss.add(e),()=>{Ss.delete(e)}),Ts=()=>[...bs.values()],Es=()=>[...bs.keys()],Ds=e=>{let t=new Set(Zn().map(gs)),n=!1;for(let r of e){let e=gs(r);!e||t.has(e)||xs.has(e)||bs.has(r)||(bs.set(r,{uri:r,state:`offered`}),n=!0)}n&&Cs()},Os=()=>{if(bs.size){for(let e of bs.keys())xs.add(gs(e));bs.clear(),Cs()}},ks=async()=>{let e=[...bs.keys()];if(e.length){for(let t of e)bs.set(t,{uri:t,state:`installing`});Cs();for(let t of e){try{await lr(t,{noConfirm:!0})||xs.add(gs(t)),bs.delete(t)}catch(e){bs.set(t,{uri:t,state:`error`,error:e instanceof Error?e.message:String(e)})}Cs()}}},As=e=>{bs.delete(e)&&(xs.add(gs(e)),Cs())},js=()=>[...Zn(),...Es()],Ms=()=>{let e=ys(location.href,js(),location.href);e!==location.href&&history.replaceState(history.state,``,e)},Ns=()=>Ds(_s(location.href)),Ps=e=>{let t=ys(e,js(),location.href);return t.startsWith(location.origin)?t.slice(location.origin.length):t},Fs=e=>{let t=history[e];history[e]=function(e,n,r){let i=r==null?location.href:String(r);return t.call(this,e,n,ys(i,js(),location.href))}},Is=Symbol.for(`stub_plugin_url`);Is in globalThis||(Object.defineProperty(globalThis,Is,{value:!0}),Fs(`pushState`),Fs(`replaceState`),addEventListener(`popstate`,()=>{Ns(),Ms()}),Yn(Ms),ws(Ms),Ns(),Ms());var Ls=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Rs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),zs=e=>{let t=Rs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Bs=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Vs=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Hs={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};h();var Us=S(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>z(`svg`,{ref:c,...Hs,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Bs(`lucide`,i),...!a&&!Vs(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>z(e,t)),...Array.isArray(a)?a:[a]]));h();var X=(e,t)=>{let n=S(({className:n,...r},i)=>z(Us,{ref:i,iconNode:t,className:Bs(`lucide-${Ls(zs(e))}`,`lucide-${e}`,n),...r}));return n.displayName=zs(e),n},Ws=X(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Gs=X(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ks=X(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),qs=X(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Js=X(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ys=X(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Xs=X(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Zs=X(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Qs=X(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),$s=X(`grid-3x2`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ec=X(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),tc=X(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),nc=X(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),rc=X(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),ic=X(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),ac=X(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),oc=X(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),sc=X(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),cc=X(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),lc=X(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),uc=X(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),dc=X(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),fc=X(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),pc=X(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),mc=X(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),hc=X(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),gc=X(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),_c=X(`volume`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}]]),vc=X(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),yc=e=>e===`/`||e===`/media`||e.startsWith(`/media/`),bc=({from:e,to:t,kind:n,asked:r=!1})=>r?!0:n===`pop`||yc(e.pathname)&&yc(t.pathname)?!1:n===`replace`?e.pathname!==t.pathname:!0,xc=()=>{window.scrollTo({top:0,left:0,behavior:`instant`})},Sc=0,Cc=()=>{wc(),Sc=requestAnimationFrame(()=>{Sc=0,xc()})},wc=()=>{cancelAnimationFrame(Sc),Sc=0},Tc=!1,Ec=()=>{Tc=!0},Dc=()=>{let e=Tc;return Tc=!1,e},Oc=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`].join(`,`),kc=typeof Element>`u`,Ac=kc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,jc=!kc&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Mc=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},Nc=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Pc=function(e,t,n){if(Mc(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Oc));return t&&Ac.call(e,Oc)&&r.unshift(e),r=r.filter(n),r},Fc=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!Mc(o,!1))if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{Ac.call(o,Oc)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!Mc(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}return i},Ic=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Lc=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Nc(e))&&!Ic(e)?0:e.tabIndex},Rc=function(e,t){var n=Lc(e);return n<0&&t&&!Ic(e)?0:n},zc=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Bc=function(e){return e.tagName===`INPUT`},Vc=function(e){return Bc(e)&&e.type===`hidden`},Hc=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Uc=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Wc=function(e){if(!e.name)return!0;var t=e.form||jc(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Uc(r,e.form);return!i||i===e},Gc=function(e){return Bc(e)&&e.type===`radio`},Kc=function(e){return Gc(e)&&!Wc(e)},qc=function(e){var t=e&&jc(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=jc(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Jc=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Yc=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Ac.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Ac.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=jc(e);if(o&&!o.shadowRoot&&r(o)===!0)return Jc(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(qc(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Jc(e);return!1},Xc=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Ac.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Zc=function(e,t){return!(t.disabled||Mc(t)||Vc(t)||Yc(t,e)||Hc(t)||Xc(t))},Qc=function(e,t){return!(Kc(t)||Lc(t)<0||!Zc(e,t))},$c=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},el=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=Rc(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(zc).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},tl=function(e,t){return t||={},el(t.getShadowRoot?Fc([e],t.includeContainer,{filter:Qc.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:$c}):Pc(e,t.includeContainer,Qc.bind(null,t)))},nl=function(e,t){return t||={},t.getShadowRoot?Fc([e],t.includeContainer,{filter:Zc.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Pc(e,t.includeContainer,Zc.bind(null,t))},rl=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Ac.call(e,Oc)===!1?!1:Qc(t,e)};h();function il(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function al(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function ol(){return/apple/i.test(navigator.vendor)}function sl(){let e=/android/i;return e.test(il())||e.test(al())}function cl(){return al().includes(`jsdom/`)}var ll=`data-floating-ui-focusable`,ul=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function dl(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function fl(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&b(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pl(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ml(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function hl(e){return e.matches(`html,body`)}function gl(e){return e?.ownerDocument||document}function _l(e){return w(e)&&e.matches(ul)}function vl(e){return e?e.getAttribute(`role`)===`combobox`&&_l(e):!1}function yl(e){return e?e.hasAttribute(ll)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function bl(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...bl(e,t.id,n)])}function xl(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Sl(e){e.preventDefault(),e.stopPropagation()}function Cl(e){return`nativeEvent`in e}function wl(e){return e.mozInputSource===0&&e.isTrusted?!0:sl()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Tl(e){return cl()?!1:!sl()&&e.width===0&&e.height===0||sl()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function El(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Dl=typeof document<`u`?m:function(){},Ol={...l};function kl(e){let t=_(e);return Dl(()=>{t.current=e}),t}var Al=Ol.useInsertionEffect||(e=>e());function jl(e){let t=_(()=>{});return Al(()=>{t.current=e}),O(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var Ml=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Nl(e,t){let n=tl(e,Ml()),r=n.length;if(r===0)return;let i=dl(gl(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Pl(e){return Nl(gl(e).body,1)||e}function Fl(e){return Nl(gl(e).body,-1)||e}function Il(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!fl(n,r)}function Ll(e){tl(e,Ml()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Rl(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}h();var zl=typeof document<`u`?m:function(){};function Bl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Bl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hl(e,t){let n=Vl(e);return Math.round(t*n)/n}function Ul(e){let t=_(e);return zl(()=>{t.current=e}),t}function Wl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=A({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=A(r);Bl(f,r)||p(r);let[m,h]=A(null),[g,v]=A(null),y=O(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=O(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_(null),w=_(null),T=_(u),E=c!=null,D=Ul(c),k=Ul(i),j=Ul(l),M=O(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),re(C.current,w.current,e).then(e=>{let t={...e,isPositioned:j.current!==!1};N.current&&!Bl(T.current,t)&&(T.current=t,_e(()=>{d(t)}))})},[f,t,n,k,j]);zl(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let N=_(!1);zl(()=>(N.current=!0,()=>{N.current=!1}),[]),zl(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,M);M()}},[x,S,M,D,E]);let P=L(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),F=L(()=>({reference:x,floating:S}),[x,S]),I=L(()=>{let e={position:n,left:0,top:0};if(!F.floating)return e;let t=Hl(F.floating,u.x),r=Hl(F.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vl(F.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,F.floating,u.x,u.y]);return L(()=>({...u,update:M,refs:P,elements:F,floatingStyles:I}),[u,M,P,F,I])}var Gl=(e,t)=>({...ee(e),options:[e,t]}),Kl=(e,t)=>({...j(e),options:[e,t]}),ql=(e,t)=>({...te(e),options:[e,t]}),Jl=(e,t)=>({...me(e),options:[e,t]});h(),N();var Yl=`data-floating-ui-focusable`,Xl=`active`,Zl=`selected`,Ql=`ArrowLeft`,$l=`ArrowRight`,eu=`ArrowUp`,tu=`ArrowDown`,nu=[Ql,$l],ru=[eu,tu];[...nu,...ru];var iu={...l},au=!1,ou=0,su=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ou++;function cu(){let[e,t]=A(()=>au?su():void 0);return Dl(()=>{e??t(su())},[]),k(()=>{au=!0},[]),e}var lu=iu.useId||cu;function uu(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var du=ue(null),fu=ue(null),pu=()=>s(du)?.id||null,mu=()=>s(fu);function hu(e){return`data-floating-ui-`+e}function gu(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var _u=hu(`safe-polygon`);function vu(e,t,n){if(n&&!El(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function yu(e){return typeof e==`function`?e():e}function bu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=mu(),m=pu(),h=kl(l),g=kl(c),v=kl(n),y=kl(d),b=_(),x=_(-1),S=_(),C=_(-1),w=_(!0),T=_(!1),E=_(()=>{}),D=_(!1),A=jl(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});k(()=>{if(!s)return;function e(e){let{open:t}=e;t||(gu(x),gu(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),k(()=>{if(!s||!h.current||!n)return;function e(e){A()&&r(!1,e,`hover`)}let t=gl(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,A]);let j=O(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=vu(g.current,`close`,b.current);i&&!S.current?(gu(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(gu(x),r(!1,e,n))},[g,r]),M=jl(()=>{E.current(),S.current=void 0}),N=jl(()=>{if(T.current){let e=gl(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(_u),T.current=!1}}),P=jl(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);k(()=>{if(!s)return;function e(e){if(gu(x),w.current=!1,u&&!El(b.current)||yu(y.current)>0&&!vu(g.current,`open`))return;let t=vu(g.current,`open`,b.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(P()){N();return}E.current();let t=gl(o.floating);if(gu(C),D.current=!1,h.current&&i.current.floatingContext){n||gu(x),S.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),M(),P()||j(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(b.current!==`touch`||!fl(o.floating,e.relatedTarget))&&j(e)}function a(e){P()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),M(),P()||j(e)}})(e))}function c(){gu(x)}function l(e){P()||j(e,!1)}if(he(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,j,M,N,r,n,v,p,g,h,i,P,y]),Dl(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&A()){T.current=!0;let e=o.floating;if(he(o.domReference)&&e){var t;let n=gl(o.floating).body;n.setAttribute(_u,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,A]),Dl(()=>{n||(b.current=void 0,D.current=!1,M(),N())},[n,M,N]),k(()=>()=>{M(),gu(x),gu(C),N()},[s,o.domReference,M,N]);let F=L(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!v.current&&r(!0,t,`hover`)}u&&!El(b.current)||n||yu(y.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(gu(C),b.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,yu(y.current))))}}},[u,r,n,v,y]);return L(()=>s?{reference:F}:{},[s,F])}var xu=0;function Su(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(xu);let a=()=>e?.focus({preventScroll:n});i?a():xu=requestAnimationFrame(a)}function Cu(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&b(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wu(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Tu(e){return e?.ownerDocument||document}var Eu={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Du(e){return e===`inert`?Eu.inert:e===`aria-hidden`?Eu[`aria-hidden`]:Eu.none}var Ou=new WeakSet,ku={},Au=0,ju=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,Mu=e=>e&&(e.host||Mu(e.parentNode)),Nu=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Mu(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Pu(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Nu(t,e),s=new Set,c=new Set(o),l=[];ku[i]||(ku[i]=new WeakMap);let u=ku[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(ge(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Du(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Ou.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Au++,()=>{l.forEach(e=>{let t=Du(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Ou.has(e)&&a&&e.removeAttribute(a),Ou.delete(e)),r||e.removeAttribute(i)}),Au--,Au||(Eu.inert=new WeakMap,Eu[`aria-hidden`]=new WeakMap,Eu.none=new WeakMap,Ou=new WeakSet,ku={})}}function Fu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Tu(e[0]).body;return Pu(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var Iu={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Lu=S(function(e,t){let[n,r]=A();Dl(()=>{ol()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[hu(`focus-guard`)]:``,style:Iu};return U(`span`,{...e,...i})}),Ru=ue(null),zu=hu(`portal`);function Bu(e){e===void 0&&(e={});let{id:t,root:n}=e,r=lu(),i=Hu(),[a,o]=A(null),s=_(null);return Dl(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Dl(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(zu,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Dl(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!d(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(zu,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Vu(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Bu({id:n,root:r}),[o,s]=A(null),c=_(null),l=_(null),u=_(null),d=_(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return k(()=>{if(!a||!i||f)return;function e(e){a&&Il(e)&&(e.type===`focusin`?Rl:Ll)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),k(()=>{a&&(p||Rl(a))},[p,a]),U(Ru.Provider,{value:L(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&U(Lu,{"data-type":`outside`,ref:c,onFocus:e=>{if(Il(e,a)){var t;(t=u.current)==null||t.focus()}else Fl(o?o.domReference:null)?.focus()}}),m&&a&&U(`span`,{"aria-owns":a.id,style:Iu}),a&&v(t,a),m&&a&&U(Lu,{"data-type":`outside`,ref:l,onFocus:e=>{if(Il(e,a)){var t;(t=d.current)==null||t.focus()}else Pl(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Hu=()=>s(Ru);function Uu(e){return L(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Wu=20,Gu=[];function Ku(){Gu=Gu.filter(e=>e.isConnected)}function qu(e){Ku(),e&&ge(e)!==`body`&&(Gu.push(e),Gu.length>Wu&&(Gu=Gu.slice(-20)))}function Ju(){return Ku(),Gu[Gu.length-1]}function Yu(e){let t=Ml();return rl(e,t)?e:tl(e,t)[0]||e}function Xu(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Ml(),i=nl(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return rl(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Zu=S(function(e,t){return U(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Iu})});function Qu(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:h,events:g,dataRef:v,elements:{domReference:y,floating:b}}=t,x=jl(()=>v.current.floatingContext?.nodeId),S=jl(p),C=typeof o==`number`&&o<0,T=vl(y)&&C,E=ju(),D=E?a:!0,O=!D||E&&f,A=kl(i),j=kl(o),M=kl(s),N=mu(),P=Hu(),F=_(null),I=_(null),L=_(!1),ee=_(!1),te=_(-1),R=_(-1),z=P!=null,B=yl(b),ne=jl(function(e){return e===void 0&&(e=B),e?tl(e,Ml()):[]}),V=jl(e=>{let t=ne(e);return A.current.map(e=>y&&e===`reference`?y:B&&e===`floating`?B:t).filter(Boolean).flat()});k(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){fl(B,dl(gl(B)))&&ne().length===0&&!T&&Sl(e);let t=V(),n=pl(e);A.current[0]===`reference`&&n===y&&(Sl(e),e.shiftKey?Su(t[t.length-1]):Su(t[1])),A.current[1]===`floating`&&n===B&&e.shiftKey&&(Sl(e),Su(t[0]))}}let t=gl(B);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,B,l,A,T,ne,V]),k(()=>{if(r||!b)return;function e(e){let t=pl(e),n=ne().indexOf(t);n!==-1&&(te.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,ne]),k(()=>{if(r||!d)return;function e(){ee.current=!0,setTimeout(()=>{ee.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=pl(e);queueMicrotask(()=>{let i=x(),a=!(fl(y,t)||fl(b,t)||fl(t,b)||fl(P?.portalNode,t)||t!=null&&t.hasAttribute(hu(`focus-guard`))||N&&(bl(N.nodesRef.current,i).find(e=>fl(e.context?.elements.floating,t)||fl(e.context?.elements.domReference,t))||xl(N.nodesRef.current,i).find(e=>[e.context?.elements.floating,yl(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&B&&Xu(B,A),c&&n!==y&&!(r!=null&&r.isConnected)&&dl(gl(B))===gl(B).body){w(B)&&B.focus();let e=te.current,t=ne(),n=t[e]||t[t.length-1]||B;w(n)&&n.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(T||!l)&&t&&a&&!ee.current&&t!==Ju()&&(L.current=!0,h(!1,e,`focus-out`))})}let n=!!(!N&&P);function i(){gu(R),v.current.insideReactTree=!0,R.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&w(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,B,l,N,P,h,d,c,ne,T,x,A,v]);let re=_(null),ie=_(null),ae=Uu([re,P?.beforeInsideRef]),oe=Uu([ie,P?.afterInsideRef]);k(()=>{var e,t;if(r||!b)return;let n=Array.from((P==null||(e=P.portalNode)==null?void 0:e.querySelectorAll(`[`+hu(`portal`)+`]`))||[]),i=(t=(N?xl(N.nodesRef.current,x()):[]).find(e=>vl(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[b,i,...n,...S(),F.current,I.current,re.current,ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,A.current.includes(`reference`)||T?y:null].filter(e=>e!=null),o=l||T?Fu(a,!O,O):Fu(a);return()=>{o()}},[r,y,b,l,A,P,T,D,O,N,x,S]),Dl(()=>{if(r||!w(B))return;let e=dl(gl(B));queueMicrotask(()=>{let t=V(B),n=j.current,r=(typeof n==`number`?t[n]:n.current)||B,i=fl(B,e);!C&&!i&&m&&Su(r,{preventScroll:r===B})})},[r,m,B,C,V,j]),Dl(()=>{if(r||!B)return;let e=gl(B);qu(dl(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(L.current=!0),t===`outside-press`)if(r)L.current=!1;else if(wl(n)||Tl(n))L.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?L.current=!1:L.current=!0}}g.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Iu),z&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof M.current==`boolean`){let e=y||Ju();return e&&e.isConnected?e:n}return M.current.current||n}return()=>{g.off(`openchange`,t);let r=dl(e),a=fl(b,r)||N&&bl(N.nodesRef.current,x(),!1).some(e=>fl(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Yu(o);M.current&&!L.current&&w(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,B,M,v,g,N,z,y,x]),k(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(Ku)}),[r]),Dl(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:d,open:m,onOpenChange:h,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,l,m,h,d,y]),Dl(()=>{r||B&&Xu(B,A)},[r,B,A]);function ce(e){return r||!u||!l?null:U(Zu,{ref:e===`start`?F:I,onClick:e=>h(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let le=!r&&D&&(l?!T:!0)&&(z||l);return U(se,{children:[le&&U(Lu,{"data-type":`inside`,ref:ae,onFocus:e=>{if(l){let e=V();Su(i[0]===`reference`?e[0]:e[e.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(L.current=!1,Il(e,P.portalNode))Pl(y)?.focus();else{var t;(t=P.beforeOutsideRef.current)==null||t.focus()}}}),!T&&ce(`start`),n,ce(`end`),le&&U(Lu,{"data-type":`inside`,ref:oe,onFocus:e=>{if(l)Su(V()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(d&&(L.current=!0),Il(e,P.portalNode))Fl(y)?.focus();else{var t;(t=P.afterOutsideRef.current)==null||t.focus()}}})]})}var $u=0,ed=`--floating-ui-scrollbar-width`;function td(){let e=il(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(ed,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(ed),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var nd=()=>{},rd=S(function(e,t){let{lockScroll:n=!1,...r}=e;return Dl(()=>{if(n)return $u++,$u===1&&(nd=td()),()=>{$u--,$u===0&&nd()}},[n]),U(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function id(e){return w(e.target)&&e.target.tagName===`BUTTON`}function ad(e){return w(e.target)&&e.target.tagName===`A`}function od(e){return _l(e)}function sd(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=_(),p=_(!1),m=L(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current;e.button===0&&s!==`click`&&(El(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=f.current;if(s===`mousedown`&&f.current){f.current=void 0;return}El(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){f.current=void 0,!(e.defaultPrevented||!u||id(e))&&(e.key===` `&&!od(a)&&(e.preventDefault(),p.current=!0),!ad(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||id(e)||od(a)||e.key===` `&&p.current&&(p.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,d,c]);return L(()=>o?{reference:m}:{},[o,m])}var cd={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},ld={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},ud=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function dd(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:d=!1,referencePressEvent:p=`pointerdown`,ancestorScroll:m=!1,bubbles:h,capture:g}=t,v=mu(),y=jl(typeof c==`function`?c:()=>!1),b=typeof c==`function`?y:c,x=_(!1),{escapeKey:S,outsidePress:T}=ud(h),{escapeKey:E,outsidePress:D}=ud(g),O=_(!1),A=jl(e=>{if(!n||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=v?bl(v.nodesRef.current,t):[];if(!S&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Cl(e)?e.nativeEvent:e,`escape-key`)}),j=jl(e=>{var t;let n=()=>{var t;A(e),(t=pl(e))==null||t.removeEventListener(`keydown`,n)};(t=pl(e))==null||t.addEventListener(`keydown`,n)}),M=jl(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=x.current;if(x.current=!1,l===`click`&&n||t||typeof b==`function`&&!b(e))return;let o=pl(e),s=`[`+hu(`inert`)+`]`,c=gl(i.floating).querySelectorAll(s),d=he(o)?o:null;for(;d&&!f(d);){let e=u(d);if(f(e)||!he(e))break;d=e}if(c.length&&he(o)&&!hl(o)&&!fl(o,i.floating)&&Array.from(c).every(e=>!fl(d,e)))return;if(w(o)&&I){let t=f(o),n=P(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let p=a.current.floatingContext?.nodeId,m=v&&bl(v.nodesRef.current,p).some(t=>ml(e,t.context?.elements.floating));if(ml(e,i.floating)||ml(e,i.domReference)||m)return;let h=v?bl(v.nodesRef.current,p):[];if(h.length>0){let e=!0;if(h.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),N=jl(e=>{var t;let n=()=>{var t;M(e),(t=pl(e))==null||t.removeEventListener(l,n)};(t=pl(e))==null||t.addEventListener(l,n)});k(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=T;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),O.current=!0}function u(){e=window.setTimeout(()=>{O.current=!1},ne()?5:0)}let d=gl(i.floating);s&&(d.addEventListener(`keydown`,E?j:A,E),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),b&&d.addEventListener(l,D?N:M,D);let f=[];return m&&(he(i.domReference)&&(f=C(i.domReference)),he(i.floating)&&(f=f.concat(C(i.floating))),!he(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(C(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,E?j:A,E),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),b&&d.removeEventListener(l,D?N:M,D),f.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,b,l,n,r,m,o,S,T,A,E,j,M,D,N]),k(()=>{a.current.insideReactTree=!1},[a,b,l]);let F=L(()=>({onKeyDown:A,...d&&{[cd[p]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...p!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[A,r,d,p]),I=L(()=>({onKeyDown:A,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[ld[l]]:()=>{a.current.insideReactTree=!0}}),[A,l,a]);return L(()=>o?{reference:F,floating:I}:{},[o,F,I])}function fd(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=lu(),a=_({}),[o]=A(()=>uu()),s=pu()!=null,[c,l]=A(r.reference),u=jl((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=L(()=>({setPositionReference:l}),[]),f=L(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return L(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function pd(e){e===void 0&&(e={});let{nodeId:t}=e,n=fd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=A(null),[s,c]=A(null),l=i?.domReference||a,u=_(null),d=mu();Dl(()=>{l&&(u.current=l)},[l]);let f=Wl({...e,elements:{...i,...s&&{reference:s}}}),p=O(e=>{let t=he(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=O(e=>{(he(e)||e===null)&&(u.current=e,o(e)),(he(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!he(e))&&f.refs.setReference(e)},[f.refs]),h=L(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=L(()=>({...f.elements,domReference:l}),[f.elements,l]),v=L(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Dl(()=>{r.dataRef.current.floatingContext=v;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),L(()=>({...f,context:v,refs:h,elements:g}),[f,h,g,v])}function md(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Xl]:t,[Zl]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Yl]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Xl,Zl].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function hd(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=O(t=>md(t,e,`reference`),t),a=O(t=>md(t,e,`floating`),n),o=O(t=>md(t,e,`item`),r);return L(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var gd=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function _d(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=lu(),c=r.domReference?.id||s,l=L(()=>yl(r.floating)?.id||i,[r.floating,i]),u=gd.get(o)??o,d=pu()!=null,f=L(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=L(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=O(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return L(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var vd=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function yd(e,t){return typeof e==`function`?e(t):e}function bd(e,t){let[n,r]=A(e);return e&&!n&&r(!0),k(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function xd(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=A(`unmounted`),c=bd(n,a);return!c&&o===`close`&&s(`unmounted`),Dl(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{_e(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Sd(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=L(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=A(()=>({...yd(a,l),...yd(n,l)})),{isMounted:h,status:g}=xd(e,{duration:o}),_=kl(n),v=kl(r),y=kl(i),b=kl(a);return Dl(()=>{let e=yd(_.current,l),t=yd(y.current,l),n=yd(b.current,l),r=yd(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(vd).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(vd).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function Cd(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Cd(e,t.id,n)])}function wd(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Td(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ed(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){gu(i),u()}if(gu(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=wu(e),v=e.type===`mouseleave`,y=Cu(c.floating,_),b=Cu(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Td(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&he(e.relatedTarget)&&Cu(c.floating,e.relatedTarget)||f&&Cd(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]];break}function P(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!wd([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}wd([m,h],P([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}h();var Dd=({className:e,style:t}={})=>z(`iframe`,{src:r(),title:`Connect your FKN account`,className:e,style:{border:`none`,width:150,height:40,background:`transparent`,colorScheme:`normal`,...t}}),Od=8e3,kd=async(e,t=Od)=>{let n,r=new Promise(e=>{n=setTimeout(()=>e(`timeout`),t)});try{return await Promise.race([Promise.resolve().then(e).then(()=>`settled`,()=>`settled`),r])}finally{clearTimeout(n)}},Ad=()=>Promise.race([Ne.info(),new Promise(e=>setTimeout(()=>e(null),4e3))]),jd=()=>{let[e,t]=A(null),[n,r]=A(!1),i=O(()=>Ad().then(e=>{t(e),r(!0)}).catch(()=>r(!0)),[]);return k(()=>{let e=!1,t=Ne.onChange(()=>{e||i()});i();let n=window.setInterval(()=>{e||i()},3e4);return()=>{e=!0,window.clearInterval(n),t.then(e=>e()).catch(()=>{})}},[i]),{info:e,ready:n,logout:O(async()=>{let e=await kd(()=>Ne.logout());return await i(),e},[i])}},Md={categoryBar:1,hoverCard:150,sourcePopup:300,filterMenu:500,mediaModal:1e3,header:1100,headerPopup:1150,franchiseDialog:1200,pluginPrompt:2e3,partyCursor:3e3};x();var Nd=`https://fkn.app/account`,Pd=150,Fd=40,Id=B`
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.8rem;
|
|
26
|
+
padding: 0.4rem 0.6rem 0.4rem 1.2rem;
|
|
27
|
+
height: 4rem;
|
|
28
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
29
|
+
border-radius: 2rem;
|
|
30
|
+
background: transparent;
|
|
31
|
+
color: rgba(255, 255, 255, 0.6);
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
transition: all 0.15s;
|
|
35
|
+
|
|
36
|
+
&:hover, &[aria-expanded='true'] {
|
|
37
|
+
color: rgba(255, 255, 255, 0.9);
|
|
38
|
+
border-color: rgba(255, 255, 255, 0.35);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.who {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: flex-end;
|
|
45
|
+
gap: 0.1rem;
|
|
46
|
+
line-height: 1.15;
|
|
47
|
+
min-width: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.name {
|
|
51
|
+
max-width: 18rem;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
font-size: 1.4rem;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
color: rgba(255, 255, 255, 0.85);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tier {
|
|
61
|
+
font-size: 1rem;
|
|
62
|
+
font-weight: 700;
|
|
63
|
+
text-transform: uppercase;
|
|
64
|
+
letter-spacing: 0.06em;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tier.premium { color: #7dd3a0; }
|
|
68
|
+
.tier.free { color: rgba(255, 255, 255, 0.45); }
|
|
69
|
+
|
|
70
|
+
.chevron { flex-shrink: 0; }
|
|
71
|
+
`,Ld=B`
|
|
72
|
+
z-index: ${Md.headerPopup};
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
min-width: 18rem;
|
|
76
|
+
padding: 0.6rem;
|
|
77
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
78
|
+
border-radius: 0.8rem;
|
|
79
|
+
background: rgba(25, 25, 25, 0.97);
|
|
80
|
+
backdrop-filter: blur(8px);
|
|
81
|
+
box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.5);
|
|
82
|
+
|
|
83
|
+
.item {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 0.9rem;
|
|
87
|
+
padding: 0.9rem 1.1rem;
|
|
88
|
+
border: none;
|
|
89
|
+
border-radius: 0.5rem;
|
|
90
|
+
background: transparent;
|
|
91
|
+
color: rgba(255, 255, 255, 0.7);
|
|
92
|
+
font-family: inherit;
|
|
93
|
+
font-size: 1.4rem;
|
|
94
|
+
text-align: left;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: background 0.15s, color 0.15s;
|
|
98
|
+
|
|
99
|
+
&:hover:not(:disabled) {
|
|
100
|
+
background: rgba(255, 255, 255, 0.08);
|
|
101
|
+
color: #fff;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:disabled {
|
|
105
|
+
opacity: 0.6;
|
|
106
|
+
cursor: default;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
svg { flex-shrink: 0; }
|
|
110
|
+
}
|
|
111
|
+
`,Rd=B`
|
|
112
|
+
width: ${Pd}px;
|
|
113
|
+
height: ${Fd}px;
|
|
114
|
+
`,zd=()=>{let{info:e,ready:t,logout:n}=jd(),[r,i]=A(!1),[a,o]=A(!1),{refs:s,floatingStyles:c,context:l}=pd({open:r,onOpenChange:i,placement:`bottom-end`,middleware:[Gl(8),ql(),Kl({padding:8})],whileElementsMounted:ce}),{getReferenceProps:u,getFloatingProps:d}=hd([sd(l),dd(l),_d(l,{role:`menu`})]);k(()=>{e||(i(!1),o(!1))},[e]);let f=async()=>{o(!0);try{await n()}finally{o(!1),i(!1)}};return t?e?I(V,{children:[I(`button`,{ref:s.setReference,css:Id,type:`button`,"aria-label":`FKN account: ${e.name||`Account`}`,...u(),children:[I(`span`,{className:`who`,children:[H(`span`,{className:`name`,children:e.name||`Account`}),H(`span`,{className:`tier ${e.premium?`premium`:`free`}`,children:e.premium?`Premium`:`Free`})]}),H(Ks,{size:16,className:`chevron`})]}),r?H(Vu,{children:H(Qu,{context:l,modal:!1,children:I(`div`,{ref:s.setFloating,style:c,css:Ld,...d(),children:[I(`a`,{className:`item`,href:Nd,target:`_blank`,rel:`noreferrer`,children:[H(Xs,{size:16}),`Manage account`]}),I(`button`,{className:`item`,type:`button`,disabled:a,onClick:f,children:[H(tc,{size:16}),a?`Disconnecting...`:`Disconnect`]})]})})}):void 0]}):H(Dd,{style:{flex:`none`,width:Pd,height:Fd}}):H(`div`,{css:Rd})},Bd=new Set([`nav`,`scroll`,`cursor`,`playback`,`state`,`pong`]),Vd=e=>Bd.has(e.t),Hd=e=>e.trim().slice(0,500)||void 0,Ud=e=>e.trim().replace(/\s+/g,` `).slice(0,32)||void 0,Wd=e=>JSON.stringify({v:1,...e}),Gd=e=>{let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;let n=t;if(n.v===1)switch(n.t){case`nav`:return Kd(n.path)?{t:`nav`,path:n.path}:void 0;case`scroll`:return Jd(n.y)?{t:`scroll`,y:n.y}:void 0;case`cursor`:return Jd(n.x)&&Jd(n.y)?{t:`cursor`,x:n.x,y:n.y}:void 0;case`chat`:{let e=typeof n.text==`string`?Hd(n.text):void 0;return e?{t:`chat`,text:e}:void 0}case`name`:{let e=typeof n.name==`string`?Ud(n.name):void 0;return e?{t:`name`,name:e}:void 0}case`ping`:return qd(n.n)&&qd(n.at)?{t:`ping`,n:n.n,at:n.at}:void 0;case`pong`:return qd(n.n)&&qd(n.at)&&qd(n.host)?{t:`pong`,n:n.n,at:n.at,host:n.host}:void 0;case`playback`:return Yd(n.s)?{t:`playback`,s:n.s}:void 0;case`state`:return!Kd(n.path)||!Jd(n.y)||n.s!==void 0&&!Yd(n.s)?void 0:{t:`state`,path:n.path,y:n.y,...n.s?{s:n.s}:{}};default:return}},Kd=e=>typeof e==`string`&&e.length>0&&e.length<=2048&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!/[\r\n\t]/.test(e),qd=e=>typeof e==`number`&&Number.isFinite(e),Jd=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1,Yd=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.paused==`boolean`&&typeof t.time==`number`&&Number.isFinite(t.time)&&t.time>=0&&typeof t.rate==`number`&&Number.isFinite(t.rate)&&t.rate>0&&t.rate<=16&&typeof t.at==`number`&&Number.isFinite(t.at)},Xd=1.05,Zd=5e3,Qd=(e,t,n=!1)=>{if(e.paused)return e.time;let r=Math.max(t-e.at,0),i=(n?r:Math.min(r,$d))/1e3;return e.time+i*e.rate},$d=2e3,ef=(e,t,n,r=!1)=>{let i={},a=Qd(t,n,r),o=a-e.time;Math.abs(o)>.5&&(i.seek=a),t.paused&&!e.paused&&(i.pause=!0),!t.paused&&e.paused&&(i.play=!0);let s=!t.paused&&i.seek===void 0&&Math.abs(o)>=.05?t.rate*(o>0?Xd:1/Xd):t.rate;return Math.abs(e.rate-s)>.001&&(i.rate=s),i},tf=(e,t,n)=>({...e,time:e.paused?e.time:e.time+Math.max(0,n-t)/1e3*e.rate,at:n}),nf=(e,t,n)=>({rtt:n-e,offset:t-(e+n)/2}),rf=e=>e.length?e.reduce((e,t)=>t.rtt<e.rtt?t:e):void 0,af=(e,t)=>e-t,of=4e3,sf=`stub-party-invite`,cf=`stub-party-name`,lf=1e4,uf=3e4,df=6e4,ff=()=>{try{return globalThis.sessionStorage}catch{return}},pf=e=>e instanceof Error&&typeof e.code==`string`,mf=(e,t=ff())=>{let n={status:`idle`},r,i,a={path:`/`,y:0},o=new Set,s=new Set,c,l,u=new Map,d=new Map,f=[],p,m,h,g=new Map,_=1,v=(()=>{try{return t?.getItem(`stub-party-name`)??void 0}catch{return}})(),y=e=>{n=e;for(let e of o)e(n)},b=e=>{try{t?.setItem(sf,e)}catch{}},x=()=>{try{t?.removeItem(sf)}catch{}},S=()=>{try{return t?.getItem(`stub-party-invite`)??void 0}catch{return}},C=e=>e.owner===e.self.id?`host`:`guest`,w=(e,t)=>{for(let n of s)n(e,t)},T=async e=>{let t=await e.members().catch(()=>void 0);r!==e||n.status!==`active`||t&&y({...n,members:t.length})},E=e=>{!r||n.status!==`active`||Vd(e)&&n.role!==`host`||r.send(Wd(e)).catch(()=>{})},D=()=>{if(!r||n.status!==`active`||n.role!==`guest`)return;let e=r,t=[];m=t;for(let n=0;n<5;n++)setTimeout(()=>{if(m!==t||r!==e)return;let n=Date.now(),i=_++;g.set(i,n),setTimeout(()=>g.delete(i),of),E({t:`ping`,n:i,at:n})},n*400);setTimeout(()=>{if(m!==t||r!==e)return;m=void 0;let n=rf(t);n&&(p=n)},5*400+of)},O=()=>({t:`state`,path:a.path,y:a.y,...a.playback?{s:tf(a.playback,a.playbackAt??Date.now(),Date.now())}:{}}),k=()=>{let e=u.get(`state`),t=u.get(`scroll`);if(e?.t!==`state`||t?.t!==`scroll`)return e;let n=[...u.keys()];return n.indexOf(`scroll`)>n.indexOf(`state`)?{...e,y:t.y}:e},A=()=>{i?.(),i=void 0,r=void 0,c&&clearInterval(c),c=void 0,l&&clearInterval(l),l=void 0,h&&clearInterval(h),h=void 0,m=void 0,p=void 0,g.clear()},j=async e=>{r=e;let t=C(e);if(d.clear(),f.length=0,y({status:`active`,role:t,invite:e.invite,members:1,self:e.self.id,owner:e.owner}),b(e.invite),i=await e.on(n=>{if(r===e)switch(n.type){case`message`:{let r=Gd(n.message.text);if(!r)return;let i=n.message.from,a=i===e.self.id;if(r.t===`ping`){t===`host`&&!a&&E({t:`pong`,n:r.n,at:r.at,host:Date.now()});return}if(r.t===`pong`){if(t!==`guest`||i!==e.owner)return;let n=g.get(r.n);if(n===void 0||n!==r.at)return;g.delete(r.n);let a=nf(n,r.host,Date.now());if(a.rtt>4e3)return;m?.push(a),p||=a;return}if(Vd(r)){if(i!==e.owner||t===`host`)return;u.delete(r.t),u.set(r.t,r),w(r,{replayed:!1,from:i,self:a});return}r.t===`name`&&d.set(i,r.name),r.t===`chat`&&(f.push({seq:n.message.seq,from:i,name:d.get(i),text:r.text,at:n.message.at,self:a}),f.length>200&&f.splice(0,f.length-200)),w(r,{replayed:!1,from:i,self:a});return}case`joined`:t===`host`&&E(O()),v&&E({t:`name`,name:v}),T(e);return;case`left`:if(t===`guest`&&n.id===e.owner){M(`host-left`);return}T(e);return}}),r!==e){i(),i=void 0;return}t===`host`&&(c=setInterval(()=>E(O()),lf)),t===`guest`&&(D(),h=setInterval(D,df)),l=setInterval(()=>{v&&E({t:`name`,name:v})},uf),v&&E({t:`name`,name:v}),T(e),e.closed.then(({reason:t})=>{r===e&&(A(),x(),y({status:`ended`,reason:t}))})},M=async e=>{let t=r;A(),x(),y({status:`ended`,reason:e}),await t?.leave().catch(()=>{})},N=(e,t)=>{if(x(),t){y({status:`idle`});return}y({status:`failed`,code:pf(e)?e.code:`unknown`})},P=async(e,t,n=!1)=>{r&&await M(`left`),u.clear(),y({status:`joining`,invite:e??``});try{let e=await t();await j(e)}catch(e){N(e,n)}};return{getState:()=>n,subscribe:e=>(o.add(e),()=>{o.delete(e)}),onMessage:e=>(s.add(e),()=>{s.delete(e)}),create:()=>P(void 0,()=>e.create()),join:t=>P(t,()=>e.join(t)),resume:async()=>{let t=S();!t||r||await P(t,()=>e.join(t),!0)},leave:async()=>{r&&await M(`left`)},send:E,setLocation:(e,t)=>{a.path=e,a.y=t},setPlayback:e=>{a.playback=e,a.playbackAt=Date.now()},invite:()=>n.status===`active`?n.invite:void 0,hostClock:()=>p,hostPath:()=>[...u.values()].filter(e=>`path`in e).at(-1)?.path,replay:()=>{for(let e of[`state`,`nav`,`scroll`,`playback`]){let t=e===`state`?k():u.get(e);t&&r&&w(t,{replayed:!0,from:r.owner,self:!1})}},nameOf:e=>d.get(e),roster:async()=>{if(!r)return[];let e=r;return(await e.members().catch(()=>[])).map(t=>({id:t.id,name:d.get(t.id),host:t.id===e.owner,self:t.id===e.self.id}))},chat:()=>f.slice(),setName:e=>{v=e;try{e?t?.setItem(cf,e):t?.removeItem(cf)}catch{}e&&E({t:`name`,name:e})},name:()=>v,kick:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.remove(e)},ban:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.block(e)},playing:()=>!!(a.playback&&!a.playback.paused),dismiss:()=>{(n.status===`ended`||n.status===`failed`)&&y({status:`idle`})}}},hf=`/party`,gf=(e,t)=>`${e}${hf}#${vf(e,t)}`,_f=(e,t)=>{let n=e.startsWith(`#`)?e.slice(1):e,r;try{r=decodeURIComponent(n).trim()}catch{return}if(xf.test(r))return r;if(!Sf.test(r))return;let i=r.indexOf(`.`),a=`${r.slice(0,i)}.${t}/${r.slice(i+1)}`;return xf.test(a)?a:void 0},vf=(e,t)=>{let n=t.indexOf(`.`),r=t.slice(n+1),i=r.lastIndexOf(`/`);return i>0&&r.slice(0,i)===e?`${t.slice(0,n)}.${r.slice(i+1)}`:t},yf=`[A-Za-z0-9_-]{43}`,bf=`[a-z0-9][a-z0-9._-]{0,63}`,xf=RegExp(`^${yf}\\.[\\x21-\\x7e]{1,256}\\/${bf}$`),Sf=RegExp(`^${yf}\\.${bf}$`),Z=mf(a);x();var Cf=()=>{let[e,t]=A(Z.getState);return k(()=>Z.subscribe(t),[]),e},wf=e=>{let[t]=A(()=>({current:e}));t.current=e,k(()=>Z.onMessage((e,n)=>t.current(e,n)),[])};x();var Tf=B`
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: 0.6rem;
|
|
118
|
+
height: 4rem;
|
|
119
|
+
padding: 0 1.2rem;
|
|
120
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
121
|
+
border-radius: 2rem;
|
|
122
|
+
background: transparent;
|
|
123
|
+
color: rgba(255, 255, 255, 0.6);
|
|
124
|
+
font-family: inherit;
|
|
125
|
+
font-size: 1.3rem;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
transition: all 0.15s;
|
|
130
|
+
|
|
131
|
+
&:hover, &[aria-expanded='true'] {
|
|
132
|
+
color: rgba(255, 255, 255, 0.9);
|
|
133
|
+
border-color: rgba(255, 255, 255, 0.35);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.live {
|
|
137
|
+
border-color: rgba(74, 222, 128, 0.5);
|
|
138
|
+
color: #4ade80;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&.live:hover, &.live[aria-expanded='true'] {
|
|
142
|
+
border-color: #4ade80;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&.over {
|
|
146
|
+
border-color: rgba(251, 146, 60, 0.5);
|
|
147
|
+
color: #fb923c;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.count {
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
opacity: 0.8;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@media (max-width: 768px) {
|
|
156
|
+
padding: 0 1rem;
|
|
157
|
+
.label { display: none; }
|
|
158
|
+
}
|
|
159
|
+
`,Ef=B`
|
|
160
|
+
width: 30rem;
|
|
161
|
+
padding: 1.2rem;
|
|
162
|
+
border-radius: 0.8rem;
|
|
163
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
164
|
+
background: #1a1a1a;
|
|
165
|
+
color: rgba(255, 255, 255, 0.85);
|
|
166
|
+
font-size: 1.3rem;
|
|
167
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
|
|
168
|
+
z-index: ${Md.headerPopup};
|
|
169
|
+
|
|
170
|
+
.title {
|
|
171
|
+
font-size: 1.4rem;
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
color: #fff;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.hint {
|
|
177
|
+
margin-top: 0.4rem;
|
|
178
|
+
color: rgba(255, 255, 255, 0.5);
|
|
179
|
+
line-height: 1.4;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.link {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: 0.6rem;
|
|
186
|
+
margin-top: 1rem;
|
|
187
|
+
padding: 0.6rem 0.8rem;
|
|
188
|
+
border-radius: 0.5rem;
|
|
189
|
+
background: rgba(255, 255, 255, 0.06);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link input {
|
|
193
|
+
flex: 1;
|
|
194
|
+
min-width: 0;
|
|
195
|
+
border: none;
|
|
196
|
+
background: transparent;
|
|
197
|
+
color: rgba(255, 255, 255, 0.85);
|
|
198
|
+
font-family: inherit;
|
|
199
|
+
font-size: 1.2rem;
|
|
200
|
+
outline: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.actions {
|
|
204
|
+
display: flex;
|
|
205
|
+
gap: 0.6rem;
|
|
206
|
+
margin-top: 1rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
button {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
gap: 0.5rem;
|
|
213
|
+
padding: 0.6rem 1rem;
|
|
214
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
215
|
+
border-radius: 0.5rem;
|
|
216
|
+
background: transparent;
|
|
217
|
+
color: rgba(255, 255, 255, 0.85);
|
|
218
|
+
font-family: inherit;
|
|
219
|
+
font-size: 1.2rem;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
button:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
|
|
224
|
+
button.primary { background: rgba(255, 255, 255, 0.1); }
|
|
225
|
+
`,Df={"not-found":`That party has ended.`,"bad-key":`That invite link is not valid.`,invalid:`That invite link is broken.`,full:`That party is full.`,blocked:`You cannot join that party.`,unavailable:`Parties are not available right now. Is FKN connected?`,"rate-limited":`Too many attempts. Try again in a moment.`},Of={"host-left":`The host left the party.`,removed:`You were removed from the party.`,blocked:`You were removed from the party.`,ended:`The party ended.`,unavailable:`The party was lost. Parties are unavailable right now.`,left:`You left the party.`},kf=()=>{let e=Cf(),[t,n]=A(!1),[r,i]=A(!1),[,a]=io(),o=()=>{n(!1),a(Y(J.PARTY))},{refs:s,floatingStyles:c,context:l}=pd({open:t,onOpenChange:n,placement:`bottom-end`,whileElementsMounted:ce,middleware:[Gl(8),ql(),Kl({padding:12})]}),{getReferenceProps:u,getFloatingProps:d}=hd([sd(l),dd(l),_d(l,{role:`dialog`})]);k(()=>{if(!r)return;let e=setTimeout(()=>i(!1),1500);return()=>clearTimeout(e)},[r]),k(()=>{(e.status===`ended`||e.status===`failed`)&&n(!0)},[e.status]);let f=e.status===`active`?gf(location.origin,e.invite):void 0,p=async()=>{if(f)try{await navigator.clipboard.writeText(f),i(!0)}catch{}};if(e.status===`idle`)return I(`button`,{type:`button`,css:Tf,onClick:()=>{Z.create()},title:`Watch together`,children:[H(pc,{size:16}),H(`span`,{className:`label`,children:`Watch together`})]});let m=e.status===`active`,h=e.status===`joining`?`Joining…`:e.status===`active`?e.role===`host`?`Hosting`:`Following`:e.status===`ended`?`Party over`:`Party failed`;return I(V,{children:[I(`button`,{type:`button`,ref:s.setReference,css:Tf,className:m?`live`:e.status===`joining`?void 0:`over`,...u(),children:[m&&e.role===`host`?H(sc,{size:16}):H(pc,{size:16}),H(`span`,{className:`label`,children:h}),m&&H(`span`,{className:`count`,children:e.members})]}),t&&H(Vu,{children:H(Qu,{context:l,modal:!1,children:I(`div`,{ref:s.setFloating,css:Ef,style:c,...d(),children:[e.status===`joining`&&H(`div`,{className:`title`,children:`Joining the party…`}),e.status===`active`&&e.role===`host`&&I(V,{children:[H(`div`,{className:`title`,children:`You are hosting`}),I(`div`,{className:`hint`,children:[e.members===1?`Nobody has joined yet.`:`${e.members-1} ${e.members===2?`person is`:`people are`} following you.`,` `,`Everyone who opens this link follows you around and watches what you play.`]}),I(`div`,{className:`link`,children:[H(`input`,{readOnly:!0,value:f,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),H(`button`,{type:`button`,onClick:()=>{p()},"aria-label":`Copy invite link`,children:H(r?Gs:Ys,{size:14})})]}),I(`div`,{className:`actions`,children:[I(`button`,{type:`button`,className:`primary`,onClick:o,children:[H(pc,{size:14}),` Party`]}),I(`button`,{type:`button`,onClick:()=>{Z.leave(),n(!1)},children:[H(tc,{size:14}),` End party`]})]})]}),e.status===`active`&&e.role===`guest`&&I(V,{children:[H(`div`,{className:`title`,children:`You are following the host`}),I(`div`,{className:`hint`,children:[e.members,` in the party. The host decides where the party goes and what plays. Wander off if you like, and catch up when you want back.`]}),I(`div`,{className:`actions`,children:[H(`button`,{type:`button`,className:`primary`,onClick:()=>{Z.replay(),n(!1)},children:`Catch up`}),I(`button`,{type:`button`,onClick:o,children:[H(pc,{size:14}),` Party`]}),I(`button`,{type:`button`,onClick:()=>{Z.leave(),n(!1)},children:[H(tc,{size:14}),` Leave`]})]})]}),(e.status===`ended`||e.status===`failed`)&&I(V,{children:[H(`div`,{className:`title`,children:e.status===`ended`?Of[e.reason]??`The party ended.`:Df[e.code]??`The party could not start.`}),H(`div`,{className:`actions`,children:H(`button`,{type:`button`,className:`primary`,onClick:()=>{Z.dismiss(),n(!1)},children:`OK`})})]})]})})})]})};x();var Af=B`
|
|
226
|
+
position: fixed;
|
|
227
|
+
/* the FKN broker's docked bar reserves the page's top strip with a root margin, which cannot
|
|
228
|
+
move a fixed element; the variable is its half of the contract and reads 0 everywhere else */
|
|
229
|
+
top: var(--fkn-inset-top, 0px);
|
|
230
|
+
left: 0;
|
|
231
|
+
right: 0;
|
|
232
|
+
/* the bar itself; what its controls OPEN is layer.headerPopup, since a portalled menu inherits
|
|
233
|
+
nothing from this one */
|
|
234
|
+
z-index: ${Md.header};
|
|
235
|
+
/* three tracks rather than a flex row: the search field stays centred on the VIEWPORT whatever the
|
|
236
|
+
wordmark and the action cluster happen to measure, which auto margins on a flex item cannot promise */
|
|
237
|
+
display: grid;
|
|
238
|
+
grid-template-columns: 1fr minmax(0, 32rem) 1fr;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 2rem;
|
|
241
|
+
/* an explicit height rather than padding, so --stub-header-height IS the bar rather than a number
|
|
242
|
+
kept in sync with one */
|
|
243
|
+
height: var(--stub-header-height);
|
|
244
|
+
padding: 0 3rem;
|
|
245
|
+
background: linear-gradient(180deg, rgba(15, 15, 15, 0.95) 0%, rgba(15, 15, 15, 0.55) 55%, rgba(15, 15, 15, 0) 100%);
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
|
|
248
|
+
& > * {
|
|
249
|
+
pointer-events: auto;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Docked rather than floating: /watch reserves this strip with its own top padding, so the bar sits
|
|
253
|
+
ON the page instead of over it and the gradient has nothing left to fade across. It stays fixed,
|
|
254
|
+
because "docked" here is about what is underneath it, not about scrolling away. Opaque and edged,
|
|
255
|
+
since the thing below is the source's own player chrome and the two need a seam.
|
|
256
|
+
|
|
257
|
+
The border costs no height: box-sizing is border-box globally, so --stub-header-height still IS
|
|
258
|
+
the bar, which is what the pages reserving it measure. */
|
|
259
|
+
&.docked {
|
|
260
|
+
background: #0f0f0f;
|
|
261
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
262
|
+
pointer-events: auto;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.logo {
|
|
266
|
+
justify-self: start;
|
|
267
|
+
font-size: 2.4rem;
|
|
268
|
+
font-weight: 800;
|
|
269
|
+
letter-spacing: 0.05em;
|
|
270
|
+
color: #fff;
|
|
271
|
+
|
|
272
|
+
&:hover {
|
|
273
|
+
color: #fff;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.actions {
|
|
278
|
+
justify-self: end;
|
|
279
|
+
display: flex;
|
|
280
|
+
align-items: center;
|
|
281
|
+
gap: 1.2rem;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.icon-button {
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
justify-content: center;
|
|
288
|
+
flex-shrink: 0;
|
|
289
|
+
width: 4rem;
|
|
290
|
+
height: 4rem;
|
|
291
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
292
|
+
border-radius: 50%;
|
|
293
|
+
background: transparent;
|
|
294
|
+
color: rgba(255, 255, 255, 0.6);
|
|
295
|
+
transition: all 0.15s;
|
|
296
|
+
|
|
297
|
+
&:hover {
|
|
298
|
+
color: rgba(255, 255, 255, 0.9);
|
|
299
|
+
border-color: rgba(255, 255, 255, 0.35);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* The whole pill is the field. The inset belongs to the INPUT rather than to this box: padding here
|
|
304
|
+
is the form's own, so a click landing in it hits the form and sets no caret, and the field only
|
|
305
|
+
took 19px of the bar's 38 that way. The glyph is drawn over the field instead of beside it, so
|
|
306
|
+
the space it occupies stays part of the target. */
|
|
307
|
+
.search {
|
|
308
|
+
position: relative;
|
|
309
|
+
display: flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
width: 100%;
|
|
312
|
+
background: rgba(35, 35, 35, 0.85);
|
|
313
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
314
|
+
border-radius: 0.8rem;
|
|
315
|
+
backdrop-filter: blur(8px);
|
|
316
|
+
transition: border-color 0.2s ease, background 0.2s ease;
|
|
317
|
+
|
|
318
|
+
&:focus-within {
|
|
319
|
+
border-color: rgba(255, 255, 255, 0.35);
|
|
320
|
+
background: rgba(35, 35, 35, 0.95);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
svg {
|
|
324
|
+
position: absolute;
|
|
325
|
+
left: 1.4rem;
|
|
326
|
+
top: 50%;
|
|
327
|
+
transform: translateY(-50%);
|
|
328
|
+
/* it labels the field, it is not a target of its own: a click on it belongs to the input under it */
|
|
329
|
+
pointer-events: none;
|
|
330
|
+
color: rgba(255, 255, 255, 0.6);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
input {
|
|
334
|
+
width: 100%;
|
|
335
|
+
/* left clears the glyph: 1.4rem to it, its own 2rem, then the 0.8rem the flex gap used to give */
|
|
336
|
+
padding: 0.8rem 1.4rem 0.8rem 4.2rem;
|
|
337
|
+
background: transparent;
|
|
338
|
+
border: none;
|
|
339
|
+
outline: none;
|
|
340
|
+
color: #fff;
|
|
341
|
+
font-family: inherit;
|
|
342
|
+
font-size: 1.5rem;
|
|
343
|
+
|
|
344
|
+
&::placeholder {
|
|
345
|
+
color: rgba(255, 255, 255, 0.4);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
@media (max-width: 768px) {
|
|
351
|
+
/* the outer tracks collapse to their content and the search takes what is left: centring it on
|
|
352
|
+
the viewport costs more width than the viewport has */
|
|
353
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
354
|
+
gap: 1rem;
|
|
355
|
+
padding: 0 1.5rem;
|
|
356
|
+
|
|
357
|
+
.logo {
|
|
358
|
+
font-size: 2rem;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.actions {
|
|
362
|
+
gap: 0.8rem;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.icon-button {
|
|
366
|
+
width: 3.4rem;
|
|
367
|
+
height: 3.4rem;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.search {
|
|
371
|
+
svg {
|
|
372
|
+
left: 1rem;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
input {
|
|
376
|
+
padding: 0.6rem 1rem 0.6rem 3.8rem;
|
|
377
|
+
font-size: 1.4rem;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
`,jf=()=>{let[,e]=io(),[t]=so(yo(J.LOGIN_CALLBACK)),[n]=so(yo(J.WATCH)),r=ts(ao()),i=r.query,a=_(r);a.current=r;let[o,s]=A(i),c=_(null),l=_(void 0);k(()=>{document.activeElement!==c.current&&i!==o&&s(i)},[i]);let u=(t,n)=>{let r=t.trim();r&&e(as({...a.current,query:r}),{replace:n})};return t?null:I(`header`,{css:Af,className:n?`docked`:void 0,children:[H(po,{to:Y(J.HOME),className:`logo`,onClick:Ec,children:`stub`}),I(`form`,{className:`search`,onSubmit:e=>{e.preventDefault(),l.current&&clearTimeout(l.current),u(o,!1),c.current?.blur()},children:[H(cc,{size:20}),H(`input`,{ref:c,type:`text`,value:o,placeholder:`Search anime, shows, movies…`,"aria-label":`Search`,onInput:e=>{let t=e.currentTarget.value;s(t),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>u(t,!0),350)}})]}),I(`div`,{className:`actions`,children:[H(kf,{}),H(po,{to:Y(J.SETTINGS),className:`icon-button`,"aria-label":`Settings`,title:`Settings`,children:H(uc,{size:20})}),H(zd,{})]})]})},Mf=B`
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
gap: 2rem;
|
|
385
|
+
margin-top: 4rem;
|
|
386
|
+
padding: 2.5rem 3rem;
|
|
387
|
+
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
388
|
+
|
|
389
|
+
.wordmark {
|
|
390
|
+
font-size: 1.8rem;
|
|
391
|
+
font-weight: 800;
|
|
392
|
+
letter-spacing: 0.05em;
|
|
393
|
+
color: rgba(255, 255, 255, 0.8);
|
|
394
|
+
|
|
395
|
+
&:hover {
|
|
396
|
+
color: #fff;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.version {
|
|
401
|
+
margin-left: auto;
|
|
402
|
+
font-size: 1.2rem;
|
|
403
|
+
font-variant-numeric: tabular-nums;
|
|
404
|
+
color: rgba(255, 255, 255, 0.35);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.commit {
|
|
408
|
+
/* dimmer than the version: it identifies a build for a bug report, it is not a thing to read */
|
|
409
|
+
font-family: ui-monospace, monospace;
|
|
410
|
+
color: rgba(255, 255, 255, 0.25);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.nav-link {
|
|
414
|
+
font-size: 1.4rem;
|
|
415
|
+
white-space: nowrap;
|
|
416
|
+
color: rgba(255, 255, 255, 0.55);
|
|
417
|
+
|
|
418
|
+
&:hover {
|
|
419
|
+
color: #fff;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
@media (max-width: 768px) {
|
|
424
|
+
gap: 1.2rem;
|
|
425
|
+
padding: 2rem 1.5rem;
|
|
426
|
+
}
|
|
427
|
+
`,Nf=()=>{let[e]=so(yo(J.WATCH)),[t]=so(yo(J.LOGIN_CALLBACK));return e||t?null:I(`footer`,{css:Mf,children:[H(po,{to:Y(J.HOME),className:`wordmark`,onClick:Ec,children:`stub`}),H(po,{to:Y(J.LEGAL),className:`nav-link`,children:`Legal`}),H(po,{to:Y(J.PRIVACY),className:`nav-link`,children:`Privacy`}),I(`span`,{className:`version`,title:`stub v0.0.21, commit 4bf2623`,children:[`v`,`0.0.21`,` `,H(`span`,{className:`commit`,children:`4bf2623`})]})]})};x();var Pf=B`
|
|
428
|
+
position: fixed;
|
|
429
|
+
inset: 0;
|
|
430
|
+
/* a sibling of the modal's portal rather than a child of it, so it competes at the root and 200
|
|
431
|
+
put it behind the modal on any /media route */
|
|
432
|
+
z-index: ${Md.pluginPrompt};
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: center;
|
|
435
|
+
justify-content: center;
|
|
436
|
+
padding: 2rem;
|
|
437
|
+
background: rgba(0, 0, 0, 0.6);
|
|
438
|
+
backdrop-filter: blur(4px);
|
|
439
|
+
|
|
440
|
+
.dialog {
|
|
441
|
+
width: 100%;
|
|
442
|
+
max-width: 44rem;
|
|
443
|
+
padding: 2.4rem;
|
|
444
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
445
|
+
border-radius: 0.8rem;
|
|
446
|
+
background: #171717;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
h2 {
|
|
450
|
+
font-size: 1.9rem;
|
|
451
|
+
margin-bottom: 0.6rem;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.intro {
|
|
455
|
+
font-size: 1.4rem;
|
|
456
|
+
line-height: 1.55;
|
|
457
|
+
color: rgba(255, 255, 255, 0.7);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.list {
|
|
461
|
+
display: flex;
|
|
462
|
+
flex-direction: column;
|
|
463
|
+
gap: 0.6rem;
|
|
464
|
+
margin: 1.8rem 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.invite {
|
|
468
|
+
display: flex;
|
|
469
|
+
align-items: center;
|
|
470
|
+
gap: 1rem;
|
|
471
|
+
padding: 0.9rem 1.1rem;
|
|
472
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
473
|
+
border-radius: 0.5rem;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.invite .uri {
|
|
477
|
+
font-family: monospace;
|
|
478
|
+
font-size: 1.3rem;
|
|
479
|
+
overflow-wrap: anywhere;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.invite .state {
|
|
483
|
+
margin-left: auto;
|
|
484
|
+
font-size: 1.2rem;
|
|
485
|
+
white-space: nowrap;
|
|
486
|
+
color: rgba(255, 255, 255, 0.55);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.invite .state.error {
|
|
490
|
+
color: #f87171;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.invite .dismiss {
|
|
494
|
+
padding: 0.3rem 0.7rem;
|
|
495
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
496
|
+
border-radius: 0.4rem;
|
|
497
|
+
background: none;
|
|
498
|
+
color: inherit;
|
|
499
|
+
font-size: 1.2rem;
|
|
500
|
+
cursor: pointer;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.actions {
|
|
504
|
+
display: flex;
|
|
505
|
+
align-items: center;
|
|
506
|
+
justify-content: flex-end;
|
|
507
|
+
gap: 1rem;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
button {
|
|
511
|
+
padding: 0.7rem 1.5rem;
|
|
512
|
+
border: none;
|
|
513
|
+
border-radius: 0.4rem;
|
|
514
|
+
background: #fff;
|
|
515
|
+
color: #000;
|
|
516
|
+
font-weight: 600;
|
|
517
|
+
font-size: 1.4rem;
|
|
518
|
+
cursor: pointer;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
button:disabled {
|
|
522
|
+
opacity: 0.5;
|
|
523
|
+
cursor: default;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.decline {
|
|
527
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
528
|
+
background: none;
|
|
529
|
+
color: inherit;
|
|
530
|
+
font-weight: 400;
|
|
531
|
+
}
|
|
532
|
+
`,Ff=e=>e.state===`installing`?`adding…`:e.state===`error`?e.error??`failed`:``,If=()=>{let[e,t]=A(Ts);if(k(()=>(t(Ts()),ws(()=>t(Ts()))),[]),!e.length)return null;let n=e.some(e=>e.state===`installing`);return H(`div`,{css:Pf,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`plugin-prompt-title`,children:I(`div`,{className:`dialog`,children:[H(`h2`,{id:`plugin-prompt-title`,children:e.length>1?`Add these sources?`:`Add this source?`}),I(`p`,{className:`intro`,children:[`This link was shared with `,e.length>1?`sources`:`a source`,` you have not added.`,` `,`Sources are community-made, installed through FKN, and run isolated from stub.`]}),H(`div`,{className:`list`,children:e.map(e=>I(`div`,{className:`invite`,children:[H(`span`,{className:`uri`,children:e.uri}),H(`span`,{className:`state${e.state===`error`?` error`:``}`,children:Ff(e)}),e.state===`error`&&H(`button`,{type:`button`,className:`dismiss`,onClick:()=>As(e.uri),children:`Dismiss`})]},e.uri))}),I(`div`,{className:`actions`,children:[H(`button`,{type:`button`,className:`decline`,disabled:n,onClick:()=>Os(),children:`Not now`}),H(`button`,{type:`button`,disabled:n,onClick:()=>{ks()},children:e.length>1?`Add sources`:`Add source`})]})]})})},Lf={"\n subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n }\n }\n }\n":Ao,"\n subscription GetMediaModal($input: MediaInput!, $descriptionInput: MediaDescriptionInput!) {\n media(input: $input) {\n ...MediaFragment\n titles {\n language\n title\n score\n }\n descriptions(input: $descriptionInput) {\n language\n description\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n categories\n franchise {\n nodes {\n uri\n format\n status\n episodeCount\n startDate\n titles {\n title\n }\n }\n edges {\n from\n to\n relation\n }\n }\n relations {\n relation\n format\n node {\n _id\n uri\n origin\n id\n url\n status\n episodeCount\n startDate\n titles {\n title\n }\n covers {\n url\n color\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodeCount\n }\n }\n":jo,"\n subscription GetMediaModalOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n ...OriginFragment\n }\n }\n }\n":Mo,"\n subscription GetTheatherMedia($input: MediaInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n media(input: $input) {\n ...MediaFragment\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n }\n }\n":No,"\n subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n color\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n genres\n tags\n averageScore\n status\n type\n season\n seasonYear\n nextAiringEpisode {\n episodeNumber\n airingAt\n }\n }\n }\n }\n":Po,"\n subscription GetWatchMedia($input: MediaInput!) {\n media(input: $input) {\n _id\n uri\n origin\n id\n titles {\n title\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n titles {\n title\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n embedUrl\n mediaUri\n episodeNumber\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n }\n }\n }\n }\n }\n":Fo,"\n subscription GetWatchOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n }\n }\n":Io,"\n fragment EpisodeFragment on Episode {\n _id\n uri\n origin\n id\n url\n mediaUri\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n mediaUri\n }\n }\n }\n":Do,"\n fragment MediaFragment on Media {\n _id\n uri\n origin\n id\n url\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n }\n }\n }\n":Oo,"\n fragment OriginFragment on Origin {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n":ko};function Rf(e){return Lf[e]??{}}var zf=e=>{let t;try{t=new URL(e)}catch{return null}let n=t.hostname.replace(/^(?:www|m)\./,``);return n===`youtu.be`?t.pathname.split(`/`)[1]||null:n!==`youtube.com`&&n!==`youtube-nocookie.com`?null:t.pathname===`/watch`?t.searchParams.get(`v`)||null:t.pathname.match(/^\/(?:embed|v|shorts)\/([^/?#]+)/)?.[1]??null};h();var Bf=`https://www.youtube.com`,Vf=0,Hf=250,Uf=40,Wf=B`
|
|
533
|
+
position: absolute;
|
|
534
|
+
top: 0;
|
|
535
|
+
left: 0;
|
|
536
|
+
width: 100%;
|
|
537
|
+
height: 100%;
|
|
538
|
+
overflow: hidden;
|
|
539
|
+
`,Gf=B`
|
|
540
|
+
grid-area: container;
|
|
541
|
+
height: 140vh !important;
|
|
542
|
+
width: 100% !important;
|
|
543
|
+
margin-top: -20vh;
|
|
544
|
+
pointer-events: none;
|
|
545
|
+
border: 0;
|
|
546
|
+
display: block;
|
|
547
|
+
`,Kf=e=>typeof e==`object`&&e&&typeof e.playerState==`number`?e.playerState:null,qf=e=>{let t=new URLSearchParams({enablejsapi:`1`,controls:`0`,disablekb:`1`,modestbranding:`1`,rel:`0`,playsinline:`1`,iv_load_policy:`3`,autoplay:`1`,mute:`1`,loop:`1`,playlist:e,origin:location.origin});return`${Bf}/embed/${encodeURIComponent(e)}?${t.toString()}`},Jf=({url:e,redirectTo:t,volume:n=1,paused:r=!1,onError:i,...a})=>{let o=_(null),[s,c]=A(!1),l=zf(e),u=O((e,t=[])=>{o.current?.contentWindow?.postMessage(JSON.stringify({event:`command`,func:e,args:t}),Bf)},[]);if(k(()=>{l||i?.()},[l,i]),k(()=>{if(c(!1),!l)return;let e=e=>{if(e.origin!==Bf||e.source!==o.current?.contentWindow)return;let t;try{t=typeof e.data==`string`?JSON.parse(e.data):e.data}catch{return}if(t?.event===`onReady`){c(!0);return}if(t?.event===`onError`){i?.();return}(t?.event===`onStateChange`&&typeof t.info==`number`?t.info:Kf(t?.info))===Vf&&u(`playVideo`)};addEventListener(`message`,e);let t=0,n=setInterval(()=>{if(t+=1,t>Uf){clearInterval(n);return}o.current?.contentWindow?.postMessage(JSON.stringify({event:`listening`,id:1,channel:`widget`}),Bf)},Hf);return()=>{removeEventListener(`message`,e),clearInterval(n)}},[l,i,u]),k(()=>{s&&(n===0?u(`mute`):(u(`unMute`),u(`setVolume`,[Math.round(Math.min(Math.max(n,0),1)*100)])))},[s,n,u]),k(()=>{s&&u(r?`pauseVideo`:`playVideo`)},[s,r,u]),!l)return null;let d=H(`iframe`,{ref:o,css:Gf,src:qf(l),title:`Trailer`,allow:`autoplay; encrypted-media; picture-in-picture`,referrerPolicy:`strict-origin-when-cross-origin`,loading:`eager`,style:{display:s?``:`none`}});return H(`div`,{css:Wf,...a,children:t?H(po,{to:t,children:d}):d})};h();var Yf=({element:e,defaultValue:t})=>{let[n,r]=A(t),[i,a]=A(!1),o=O(t=>{if(a(!0),!e)return;let{clientX:n}=t,{left:i,right:o}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(o-i),0),1))},[e]);return k(()=>{if(!i)return;let t=()=>a(!1),n=t=>{if(!e)return;let{clientX:n}=t,{left:i,right:a}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(a-i),0),1))};return document.addEventListener(`mousemove`,n),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,t)}},[e,i]),{value:n,scrubbing:i,scrubHandler:o}};x();var Xf=B`
|
|
548
|
+
display: flex;
|
|
549
|
+
align-items: center;
|
|
550
|
+
justify-content: center;
|
|
551
|
+
gap: 0.5rem;
|
|
552
|
+
|
|
553
|
+
& > button.volume-icon {
|
|
554
|
+
position: relative;
|
|
555
|
+
width: 3rem;
|
|
556
|
+
height: 3rem;
|
|
557
|
+
cursor: pointer;
|
|
558
|
+
background-color: transparent;
|
|
559
|
+
border: none;
|
|
560
|
+
outline: none;
|
|
561
|
+
.icon-body {
|
|
562
|
+
position: absolute;
|
|
563
|
+
top: 50%;
|
|
564
|
+
left: 50%;
|
|
565
|
+
transform: translate(-50%, -50%);
|
|
566
|
+
}
|
|
567
|
+
.icon-outline {
|
|
568
|
+
position: absolute;
|
|
569
|
+
top: 50%;
|
|
570
|
+
left: 50%;
|
|
571
|
+
transform: translate(-50%, -50%);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.volume-area {
|
|
576
|
+
display: flex;
|
|
577
|
+
cursor: pointer;
|
|
578
|
+
color: #fff;
|
|
579
|
+
|
|
580
|
+
.mute-button {
|
|
581
|
+
color: #fff;
|
|
582
|
+
border: none;
|
|
583
|
+
background: none;
|
|
584
|
+
height: 100%;
|
|
585
|
+
width: 4.8rem;
|
|
586
|
+
cursor: pointer;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.volume-panel {
|
|
590
|
+
display: inline-block;
|
|
591
|
+
width: 0;
|
|
592
|
+
/* width: 100%; */
|
|
593
|
+
/* width: 12rem; */
|
|
594
|
+
height: 100%;
|
|
595
|
+
-webkit-transition: margin .2s cubic-bezier(0.4,0,1,1),width .2s cubic-bezier(0.4,0,1,1);
|
|
596
|
+
transition: margin .2s cubic-bezier(0.4,0,1,1),width .2s cubic-bezier(0.4,0,1,1);
|
|
597
|
+
cursor: pointer;
|
|
598
|
+
outline: 0;
|
|
599
|
+
|
|
600
|
+
&.volume-control-hover {
|
|
601
|
+
width: 6rem;
|
|
602
|
+
/* width: 52px; */
|
|
603
|
+
margin-right: 3px;
|
|
604
|
+
-webkit-transition: margin .2s cubic-bezier(0,0,0.2,1),width .2s cubic-bezier(0,0,0.2,1);
|
|
605
|
+
transition: margin .2s cubic-bezier(0,0,0.2,1),width .2s cubic-bezier(0,0,0.2,1);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.slider {
|
|
609
|
+
height: 100%;
|
|
610
|
+
min-height: 36px;
|
|
611
|
+
position: relative;
|
|
612
|
+
overflow: hidden;
|
|
613
|
+
|
|
614
|
+
.slider-handle {
|
|
615
|
+
/* left: 40px; */
|
|
616
|
+
position: absolute;
|
|
617
|
+
top: 50%;
|
|
618
|
+
width: 12px;
|
|
619
|
+
height: 12px;
|
|
620
|
+
border-radius: 6px;
|
|
621
|
+
margin-top: -6px;
|
|
622
|
+
margin-left: -5px;
|
|
623
|
+
/* background: #fff; */
|
|
624
|
+
}
|
|
625
|
+
.slider-handle::before, .slider-handle::after {
|
|
626
|
+
content: "";
|
|
627
|
+
position: absolute;
|
|
628
|
+
display: block;
|
|
629
|
+
top: 50%;
|
|
630
|
+
left: 0;
|
|
631
|
+
height: 3px;
|
|
632
|
+
margin-top: -2px;
|
|
633
|
+
width: 64px;
|
|
634
|
+
}
|
|
635
|
+
.slider-handle::before {
|
|
636
|
+
left: -58px;
|
|
637
|
+
background: #fff;
|
|
638
|
+
border: 0.1rem solid #000;
|
|
639
|
+
}
|
|
640
|
+
.slider-handle::after {
|
|
641
|
+
left: 6px;
|
|
642
|
+
background: rgba(255,255,255,.2);
|
|
643
|
+
border: 0.1rem solid #000;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
`,Zf=({defaultMuted:e=!0,defaultVolume:t=1,onMutedUpdate:n,onVolumeUpdate:r})=>{let[i,a]=A(t),[o,s]=A(e),[c,l]=A(null),[u,d]=A(!0),{scrubHandler:f,value:p}=Yf({element:c,defaultValue:i});k(()=>{p!==void 0&&(a(p),r(p**2,p))},[a,p]);let m=O(()=>{p!==void 0&&(s(e=>!e),n(!o))},[s,a,p,o]),h=O(()=>{d(!1)},[d]),g=O(e=>{d(!0)},[d]),_=o?gc:(i??0)>.66?hc:(i??0)>.33?mc:(i??0)>0?_c:gc;return I(`div`,{css:Xf,onMouseLeave:g,children:[H(`button`,{className:`volume-icon`,onClick:m,onMouseOver:h,children:I(V,{children:[H(_,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`}),H(_,{className:`icon-body`,size:30})]})}),H(`div`,{className:`volume-area`,onMouseOver:h,children:H(`div`,{ref:e=>l(e),className:`volume-panel${u?``:` volume-control-hover`}`,onMouseDown:f,children:H(`div`,{className:`slider`,children:H(`div`,{className:`slider-handle`,style:{left:`${(i??0)*100}%`}})})})})]})};x();var Qf=B`
|
|
650
|
+
display: -webkit-box;
|
|
651
|
+
-webkit-box-orient: vertical;
|
|
652
|
+
overflow: hidden;
|
|
653
|
+
text-overflow: ellipsis;
|
|
654
|
+
width: 100%;
|
|
655
|
+
height: 100%;
|
|
656
|
+
`,$f=({children:e,...t})=>{let[n,r]=A(null),[i,a]=A(0),[o,s]=A(0);return k(()=>{if(!n)return;let e=0,t=()=>{let e=window.getComputedStyle(n),t;t=e.lineHeight===`normal`?parseFloat(e.fontSize)*1.2:parseFloat(e.lineHeight);let r=n.clientHeight;if(a(e=>e===t?e:t),t&&r){let e=Math.max(1,Math.floor(r/t));s(t=>t===e?t:e)}},r=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(t)});return r.observe(n),()=>{cancelAnimationFrame(e),r.disconnect()}},[n]),H(`div`,{...t,ref:r,css:Qf,style:{...typeof t.style==`object`?t.style:void 0,WebkitLineClamp:o,height:i&&o?o*i:void 0},children:e})},ep=e=>e._id??e.uri??``,tp=e=>{let t=e.filter(e=>e.titles?.length&&e.shortDescriptions?.length),n=t.filter(e=>e.trailers?.length);return n.length?n:t},np=(e,t,n=[],r=e=>Math.floor(Math.random()*e))=>{let i=e.slice(0,10).filter(e=>!n.includes(ep(e))),a=t&&i.find(e=>ep(e)===t);if(a)return a;if(i.length)return i[Math.min(i.length-1,Math.max(0,r(i.length)))]};h();var rp=B`
|
|
657
|
+
height: 70vh;
|
|
658
|
+
.player-wrapper {
|
|
659
|
+
position: absolute;
|
|
660
|
+
width: 100%;
|
|
661
|
+
height: calc(100vh - 5rem);
|
|
662
|
+
user-select: none;
|
|
663
|
+
|
|
664
|
+
youtube-video {
|
|
665
|
+
height: 250vh !important;
|
|
666
|
+
width: 100% !important;
|
|
667
|
+
margin-top: -75vh;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.shadow {
|
|
671
|
+
position: absolute;
|
|
672
|
+
bottom: 0;
|
|
673
|
+
left: 0;
|
|
674
|
+
right: 0;
|
|
675
|
+
width: 100%;
|
|
676
|
+
height: 30vh;
|
|
677
|
+
|
|
678
|
+
background:
|
|
679
|
+
linear-gradient(
|
|
680
|
+
0deg,
|
|
681
|
+
rgba(15, 15, 15, 1) 0%,
|
|
682
|
+
rgba(15, 15, 15, 0.5) calc(100% - 10rem),
|
|
683
|
+
rgba(15, 15, 15, 0) 100%
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.information {
|
|
689
|
+
position: absolute;
|
|
690
|
+
inset: 0;
|
|
691
|
+
left: 10rem;
|
|
692
|
+
max-width: 75rem;
|
|
693
|
+
display: flex;
|
|
694
|
+
flex-direction: column;
|
|
695
|
+
align-items: start;
|
|
696
|
+
justify-content: center;
|
|
697
|
+
text-shadow: rgb(0 0 0 / 80%) -1px -1px 0, rgb(0 0 0 / 80%) -1px 1px 0, rgb(0 0 0 / 80%) 1px -1px 0, rgb(0 0 0 / 80%) 1px 1px 0;
|
|
698
|
+
|
|
699
|
+
.player-controls {
|
|
700
|
+
padding: 2.5rem 0;
|
|
701
|
+
display: flex;
|
|
702
|
+
align-items: center;
|
|
703
|
+
gap: 1rem;
|
|
704
|
+
|
|
705
|
+
& > span {
|
|
706
|
+
position: relative;
|
|
707
|
+
width: 3rem;
|
|
708
|
+
height: 3rem;
|
|
709
|
+
cursor: pointer;
|
|
710
|
+
|
|
711
|
+
.icon-body {
|
|
712
|
+
position: absolute;
|
|
713
|
+
top: 50%;
|
|
714
|
+
left: 50%;
|
|
715
|
+
transform: translate(-50%, -50%);
|
|
716
|
+
}
|
|
717
|
+
.icon-outline {
|
|
718
|
+
position: absolute;
|
|
719
|
+
top: 50%;
|
|
720
|
+
left: 50%;
|
|
721
|
+
transform: translate(-50%, -50%);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.title {
|
|
727
|
+
font-size: 4rem;
|
|
728
|
+
font-weight: bold;
|
|
729
|
+
margin-bottom: 1rem;
|
|
730
|
+
cursor: default;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.short-description {
|
|
734
|
+
font-size: 2rem;
|
|
735
|
+
margin-bottom: 1rem;
|
|
736
|
+
cursor: default;
|
|
737
|
+
overflow: hidden;
|
|
738
|
+
max-height: 10rem;
|
|
739
|
+
white-space: pre-wrap;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
@media (max-width: 768px) {
|
|
744
|
+
height: 56vh;
|
|
745
|
+
|
|
746
|
+
.information {
|
|
747
|
+
left: 1.5rem;
|
|
748
|
+
right: 1.5rem;
|
|
749
|
+
max-width: none;
|
|
750
|
+
|
|
751
|
+
.player-controls {
|
|
752
|
+
padding: 1.5rem 0;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.title {
|
|
756
|
+
font-size: 2.6rem;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.short-description {
|
|
760
|
+
font-size: 1.5rem;
|
|
761
|
+
max-height: 8rem;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
`,ip=Rf(`
|
|
766
|
+
subscription GetTheatherMedia($input: MediaInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
|
|
767
|
+
media(input: $input) {
|
|
768
|
+
...MediaFragment
|
|
769
|
+
titles {
|
|
770
|
+
language
|
|
771
|
+
title
|
|
772
|
+
score
|
|
773
|
+
}
|
|
774
|
+
shortDescriptions(input: $shortDescriptionInput) {
|
|
775
|
+
language
|
|
776
|
+
shortDescription
|
|
777
|
+
}
|
|
778
|
+
covers {
|
|
779
|
+
language
|
|
780
|
+
url
|
|
781
|
+
}
|
|
782
|
+
banners {
|
|
783
|
+
language
|
|
784
|
+
url
|
|
785
|
+
}
|
|
786
|
+
trailers {
|
|
787
|
+
uri
|
|
788
|
+
origin
|
|
789
|
+
id
|
|
790
|
+
url
|
|
791
|
+
thumbnail
|
|
792
|
+
}
|
|
793
|
+
popularity
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
`),ap=({mediaNodes:e})=>{let[t]=so(yo(J.MEDIA)),[n,r]=A([]),i=L(()=>tp(e),[e]),a=_(void 0),o=L(()=>{let e=np(i,a.current,n);return a.current=e?ep(e):void 0,e},[i,n]),[{data:s}]=Hn({query:ip,variables:{input:{uri:o?.uri},shortDescriptionInput:{count:1}},pause:!o}),c=s?.media??o,l=L(()=>c?.titles?.at(0)?.title,[c]),u=L(()=>c?.shortDescriptions?.at(0)?.shortDescription,[c]),d=L(()=>c?.trailers?.at(0),[c]),[f,p]=A(!1),[m,h]=A(!0),[g,v]=A(.25),y=O(()=>{let e=o&&ep(o);e&&r(t=>t.includes(e)?t:[...t,e])},[o]);return I(`div`,{css:rp,className:`theater`,children:[I(`div`,{className:`player-wrapper`,children:[d?.url&&H(Jf,{url:d.url,paused:f||t,onError:y,volume:m?0:g,className:`player`}),H(`div`,{className:`shadow`})]}),I(`div`,{className:`information`,css:rp,children:[I(`div`,{className:`player-controls`,children:[I(`span`,{className:`playback`,children:[f?H(oc,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>p(!1)}):H(ac,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>p(!0)}),f?H(oc,{className:`icon-body`,size:30,onClick:()=>p(!1)}):H(ac,{className:`icon-body`,size:30,onClick:()=>p(!0)})]}),H(Zf,{defaultMuted:m,onMutedUpdate:h,defaultVolume:g,onVolumeUpdate:e=>v(e)})]}),H(`div`,{className:`title`,children:l}),H($f,{className:`short-description`,children:u})]})]})};h();function op(e){let t=e;for(;t;){if(t.dir)return t.dir===`rtl`;t=t.parentElement}return!1}function sp(e,t){let[n,r]=A(t===`rtl`);return m(()=>{e&&(t||r(op(e)))},[t,e]),n}var cp=typeof window<`u`?m:k;function lp(e){if(e!==void 0)switch(typeof e){case`number`:return e;case`string`:if(e.endsWith(`px`))return parseFloat(e);break}}function up({box:e,defaultHeight:t,defaultWidth:n,disabled:r,element:i,mode:a,style:o}){let{styleHeight:s,styleWidth:c}=L(()=>({styleHeight:lp(o?.height),styleWidth:lp(o?.width)}),[o?.height,o?.width]),[l,u]=A({height:t,width:n}),d=r||a===`only-height`&&s!==void 0||a===`only-width`&&c!==void 0||s!==void 0&&c!==void 0;return cp(()=>{if(i===null||d)return;let t=new ResizeObserver(e=>{for(let t of e){let{contentRect:e,target:n}=t;i===n&&u(t=>t.height===e.height&&t.width===e.width?t:{height:e.height,width:e.width})}});return t.observe(i,{box:e}),()=>{t?.unobserve(i)}},[e,d,i,s,c]),L(()=>({height:s??l.height,width:c??l.width}),[l,s,c])}function dp(e){let t=_(()=>{throw Error(`Cannot call an event handler while rendering.`)});return cp(()=>{t.current=e},[e]),O(e=>t.current?.(e),[t])}var fp=null;function pp(e=!1){if(fp===null||e){let e=document.createElement(`div`),t=e.style;t.width=`50px`,t.height=`50px`,t.overflow=`scroll`,t.direction=`rtl`;let n=document.createElement(`div`),r=n.style;return r.width=`100px`,r.height=`100px`,e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?fp=`positive-descending`:(e.scrollLeft=1,fp=e.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(e),fp}return fp}function mp({containerElement:e,direction:t,isRtl:n,scrollOffset:r}){if(t===`horizontal`&&n)switch(pp()){case`negative`:return-r;case`positive-descending`:if(e){let{clientWidth:t,scrollLeft:n,scrollWidth:r}=e;return r-t-n}break}return r}function hp(e,t=`Assertion error`){if(!e)throw console.error(t),Error(t)}function gp({cachedBounds:e,itemCount:t,itemSize:n}){if(t===0)return 0;if(typeof n==`number`)return t*n;{let n=e.get(e.size===0?0:e.size-1);return hp(n!==void 0,`Unexpected bounds cache miss`),t*((n.scrollOffset+n.size)/e.size)}}function _p({align:e,cachedBounds:t,index:n,itemCount:r,itemSize:i,containerScrollOffset:a,containerSize:o}){let s=gp({cachedBounds:t,itemCount:r,itemSize:i}),c=t.get(n),l=Math.max(0,Math.min(s-o,c.scrollOffset)),u=Math.max(0,c.scrollOffset-o+c.size);switch(e===`smart`&&(e=a>=u&&a<=l?`auto`:`center`),e){case`start`:return l;case`end`:return u;case`center`:return c.scrollOffset<=o/2?0:c.scrollOffset+c.size/2>=s-o/2?s-o:c.scrollOffset+c.size/2-o/2;default:return a>=u&&a<=l?a:a<u?u:l}}function vp({cachedBounds:e,containerScrollOffset:t,containerSize:n,itemCount:r,overscanCount:i}){let a=r-1,o=0,s=-1,c=0;for(;c<a;){let n=e.get(c);if(n.scrollOffset+n.size>t)break;c++}for(o=c,o=Math.max(0,o-i);c<a;){let r=e.get(c);if(r.scrollOffset+r.size>=t+n)break;c++}return s=Math.min(a,c),s=Math.min(r-1,s+i),o<0?[0,-1]:[o,s]}function yp({itemCount:e,itemProps:t,itemSize:n}){let r=new Map;return{get(i){for(hp(i<e,`Invalid index ${i}`);r.size-1<i;){let e=r.size,a;switch(typeof n){case`function`:a=n(e,t);break;case`number`:a=n;break}if(e===0)r.set(e,{size:a,scrollOffset:0});else{let t=r.get(e-1);hp(t!==void 0,`Unexpected bounds cache miss for index ${i}`),r.set(e,{scrollOffset:t.scrollOffset+t.size,size:a})}}let a=r.get(i);return hp(a!==void 0,`Unexpected bounds cache miss for index ${i}`),a},set(e,t){r.set(e,t)},get size(){return r.size}}}function bp({itemCount:e,itemProps:t,itemSize:n}){return L(()=>yp({itemCount:e,itemProps:t,itemSize:n}),[e,t,n])}function xp({containerSize:e,itemSize:t}){let n;switch(typeof t){case`string`:hp(t.endsWith(`%`),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),hp(e!==void 0,`Container size must be defined if a percentage item size is specified`),n=e*parseInt(t)/100;break;default:n=t;break}return n}function Sp({containerElement:e,containerStyle:t,defaultContainerSize:n=0,direction:r,isRtl:i=!1,itemCount:a,itemProps:o,itemSize:s,onResize:c,overscanCount:l}){let[u,d]=A([0,-1]),[f,p]=[Math.min(a-1,u[0]),Math.min(a-1,u[1])],{height:h=n,width:g=n}=up({defaultHeight:r===`vertical`?n:void 0,defaultWidth:r===`horizontal`?n:void 0,element:e,mode:r===`vertical`?`only-height`:`only-width`,style:t}),v=_({height:0,width:0}),y=r===`vertical`?h:g,b=xp({containerSize:y,itemSize:s});m(()=>{if(typeof c==`function`){let e=v.current;(e.height!==h||e.width!==g)&&(c({height:h,width:g},{...e}),e.height=h,e.width=g)}},[h,c,g]);let x=bp({itemCount:a,itemProps:o,itemSize:b}),S=O(e=>x.get(e),[x]),C=O(()=>gp({cachedBounds:x,itemCount:a,itemSize:b}),[x,a,b]),w=O(t=>{let n=mp({containerElement:e,direction:r,isRtl:i,scrollOffset:t});return vp({cachedBounds:x,containerScrollOffset:n,containerSize:y,itemCount:a,overscanCount:l})},[x,e,y,r,i,a,l]);return cp(()=>{let t=(r===`vertical`?e?.scrollTop:e?.scrollLeft)??0;d(w(t))},[e,r,w]),cp(()=>{if(!e)return;let t=()=>{d(t=>{let{scrollLeft:n,scrollTop:o}=e,s=mp({containerElement:e,direction:r,isRtl:i,scrollOffset:r===`vertical`?o:n}),c=vp({cachedBounds:x,containerScrollOffset:s,containerSize:y,itemCount:a,overscanCount:l});return c[0]===t[0]&&c[1]===t[1]?t:c})};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t)}},[x,e,y,r,a,l]),{getCellBounds:S,getEstimatedSize:C,scrollToIndex:dp(({align:t=`auto`,behavior:n=`auto`,containerScrollOffset:o,index:s})=>{let c=_p({align:t,cachedBounds:x,containerScrollOffset:o,containerSize:y,index:s,itemCount:a,itemSize:b});if(e)if(c=mp({containerElement:e,direction:r,isRtl:i,scrollOffset:c}),typeof e.scrollTo==`function`)r===`horizontal`?e.scrollTo({left:c,behavior:n||void 0}):e.scrollTo({behavior:n||void 0,top:c});else{let e=w(c);(e[0]!==f||e[1]!==p)&&d(e)}}),startIndex:f,stopIndex:p}}function Cp(e){return L(()=>e,Object.values(e))}function wp(e,t){if(e===t)return!0;if(!!e!=!!t||(hp(e!==void 0),hp(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(let n in e)if(!Object.is(t[n],e[n]))return!1;return!0}function Tp(e,t){let{style:n,...r}=e,{style:i,...a}=t;return wp(n,i)&&wp(r,a)}function Ep({cellComponent:e,cellProps:t,className:n,columnCount:r,columnWidth:i,defaultHeight:a=0,defaultWidth:o=0,dir:s,gridRef:c,onCellsRendered:l,onResize:u,overscanCount:d=3,rowCount:f,rowHeight:p,style:m,...h}){let _=Cp(t),v=L(()=>y(e,Tp),[e]),[b,x]=A(null),S=sp(b,s),{getCellBounds:C,getEstimatedSize:w,startIndex:T,scrollToIndex:E,stopIndex:D}=Sp({containerElement:b,defaultContainerSize:o,direction:`horizontal`,isRtl:S,itemCount:r,itemProps:_,itemSize:i,onResize:u,overscanCount:d}),{getCellBounds:O,getEstimatedSize:j,startIndex:M,scrollToIndex:N,stopIndex:P}=Sp({containerElement:b,defaultContainerSize:a,direction:`vertical`,itemCount:f,itemProps:_,itemSize:p,onResize:u,overscanCount:d});g(c,()=>({get element(){return b},scrollToCell({behavior:e=`auto`,columnAlign:t=`auto`,columnIndex:n,rowAlign:r=`auto`,rowIndex:i}){N({align:r,behavior:e,containerScrollOffset:b?.scrollTop??0,index:i}),E({align:t,behavior:e,containerScrollOffset:b?.scrollLeft??0,index:n})},scrollToColumn({align:e=`auto`,behavior:t=`auto`,index:n}){E({align:e,behavior:t,containerScrollOffset:b?.scrollLeft??0,index:n})},scrollToRow({align:e=`auto`,behavior:t=`auto`,index:n}){N({align:e,behavior:t,containerScrollOffset:b?.scrollTop??0,index:n})}}),[b,E,N]),k(()=>{T>=0&&D>=0&&M>=0&&P>=0&&l&&l({columnStartIndex:T,columnStopIndex:D,rowStartIndex:M,rowStopIndex:P})},[l,T,D,M,P]);let F=L(()=>{let e=[];if(r>0&&f>0)for(let t=M;t<=P;t++){let n=O(t);for(let r=T;r<=D;r++){let i=C(r);e.push(z(v,{..._,columnIndex:r,key:`${t}-${r}`,rowIndex:t,style:{position:`absolute`,left:S?void 0:0,right:S?0:void 0,transform:`translate(${S?-i.scrollOffset:i.scrollOffset}px, ${n.scrollOffset}px)`,height:f>1?n.size:`100%`,width:i.size}}))}}return e},[v,_,r,T,D,C,O,S,f,M,P]);return U(`div`,{...h,className:n,dir:s,ref:x,style:{width:`100%`,height:`100%`,...m,maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`},children:U(`div`,{className:n,style:{position:`relative`,height:j(),width:w()},children:F})})}var Dp=_;x();var Op=new Map,kp=3e4,Ap=e=>{let t=Op.get(e);if(t)return t;let n=new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>{setTimeout(()=>Op.delete(e),kp),t(!1)},n.src=e});return Op.set(e,n),n},jp=e=>{let t=(e??[]).map(e=>e?.url).filter(e=>!!e),n=t.join(`|`),[r,i]=A(t[0]);return k(()=>{let e=!1;return i(t[0]),(async()=>{for(let n of t){let t=await Ap(n);if(e)return;if(t){i(n);return}}})(),()=>{e=!0}},[n]),r},Mp=B`
|
|
797
|
+
&.card, .card {
|
|
798
|
+
position: relative;
|
|
799
|
+
display: flex;
|
|
800
|
+
flex-direction: column;
|
|
801
|
+
justify-content: flex-end;
|
|
802
|
+
font-size: 2.5rem;
|
|
803
|
+
overflow: hidden;
|
|
804
|
+
border-radius: 1rem;
|
|
805
|
+
|
|
806
|
+
height: 35rem;
|
|
807
|
+
width: 25rem;
|
|
808
|
+
|
|
809
|
+
&.link {
|
|
810
|
+
position: absolute;
|
|
811
|
+
inset: 0;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.information {
|
|
815
|
+
width: 100%;
|
|
816
|
+
text-shadow: rgb(0 0 0 / 80%) 1px 1px 0;
|
|
817
|
+
background:
|
|
818
|
+
linear-gradient(
|
|
819
|
+
0deg,
|
|
820
|
+
rgba(0,0,0,0.5) 0%,
|
|
821
|
+
rgba(0,0,0,0.5) calc(100% - 1rem),
|
|
822
|
+
rgba(0,0,0,0) 100%
|
|
823
|
+
);
|
|
824
|
+
|
|
825
|
+
display: flex;
|
|
826
|
+
flex-direction: column;
|
|
827
|
+
justify-content: center;
|
|
828
|
+
align-items: center;
|
|
829
|
+
text-align: center;
|
|
830
|
+
padding: 1rem 2rem 0rem 2rem;
|
|
831
|
+
color: white;
|
|
832
|
+
font-size: 2.5rem;
|
|
833
|
+
overflow: hidden;
|
|
834
|
+
pointer-events: none;
|
|
835
|
+
max-height: 10rem;
|
|
836
|
+
|
|
837
|
+
.title {
|
|
838
|
+
width: 100%;
|
|
839
|
+
max-height: 10rem;
|
|
840
|
+
|
|
841
|
+
font-size: 2.2rem;
|
|
842
|
+
font-weight: bold;
|
|
843
|
+
margin: .5rem 0;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.title-text {
|
|
847
|
+
color: white;
|
|
848
|
+
position: relative;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
&.full-title .information,
|
|
853
|
+
&.full-title .information .title {
|
|
854
|
+
max-height: none;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/* On mobile the search grid wants fluid cards (it sets no inline size); the home
|
|
859
|
+
carousel pins each cell with an inline width+height from react-window, which wins
|
|
860
|
+
over these, so it's unaffected. */
|
|
861
|
+
@media (max-width: 768px) {
|
|
862
|
+
&.card {
|
|
863
|
+
width: 100%;
|
|
864
|
+
height: auto;
|
|
865
|
+
aspect-ratio: 5 / 7;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
`,Np=({media:e,to:t,ellipsis:n=!0,...r})=>{let i=e.titles?.at(0)?.title,a=jp(e.covers);return I(`div`,{...r,css:Mp,className:`card category-item${n?``:` full-title`}`,style:{...typeof r.style==`object`?r.style:void 0,backgroundImage:`url(${a})`,backgroundSize:`cover`},children:[H(po,{tabIndex:-1,to:t,className:`card link`}),H(`div`,{className:`information`,children:H(`div`,{className:`title`,children:H(po,{to:t,className:`title-text`,children:n?H($f,{children:i}):i})})})]})};h();var Pp=B`
|
|
869
|
+
cursor: grab;
|
|
870
|
+
&:active {
|
|
871
|
+
cursor: grabbing;
|
|
872
|
+
}
|
|
873
|
+
&.active * {
|
|
874
|
+
pointer-events: none;
|
|
875
|
+
}
|
|
876
|
+
`,Fp=({children:e,isDragging:t,setIsDragging:n})=>{if(`ontouchstart`in document.documentElement)return H(V,{children:e});let[r,i]=A(null),[a,o]=A(!1),[s,c]=A(),l=_({startX:0,startY:0,scrollLeft:0,scrollTop:0}),u=L(()=>globalThis,[]),d=O(e=>{if(!(e.target instanceof HTMLElement)||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||!r||!r.contains(e.target))return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=t.scrollLeft,a=t.scrollTop;l.current={startX:n,startY:r,scrollLeft:i,scrollTop:a}}o(!0)},[o,n,c,r]),f=O(e=>{o(!1),n(!1),u.removeEventListener(`mousemove`,p),s&&clearTimeout(s),c(globalThis.setTimeout(()=>n(!1),50))},[o,n,c,s,r]),p=O(e=>{if(!a||!r)return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=n-l.current.startX,a=r-l.current.startY;t.scrollLeft=l.current.scrollLeft-i,t.scrollTop=l.current.scrollTop-a}n(!0)},[a,r]);return k(()=>{if(r)return u.addEventListener(`mousedown`,d),u.addEventListener(`mouseup`,f),u.addEventListener(`mousemove`,p),()=>{u.removeEventListener(`mousedown`,d),u.removeEventListener(`mouseup`,f),u.removeEventListener(`mousemove`,p)}},[r,a,n,s,d,f,p]),H(`div`,{ref:e=>i(e),className:`draggable ${t?`active`:``}`,css:Pp,children:e})};x();var Ip=B`
|
|
877
|
+
display: grid;
|
|
878
|
+
background-color: rgb(35, 35, 35);
|
|
879
|
+
border-radius: 1rem;
|
|
880
|
+
user-select: none;
|
|
881
|
+
|
|
882
|
+
width: 70rem;
|
|
883
|
+
|
|
884
|
+
a {
|
|
885
|
+
color: #fff;
|
|
886
|
+
text-decoration: none;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.content {
|
|
890
|
+
padding: 2rem;
|
|
891
|
+
width: 70rem;
|
|
892
|
+
|
|
893
|
+
.title {
|
|
894
|
+
margin-bottom: .5rem;
|
|
895
|
+
font-size: 2rem;
|
|
896
|
+
font-weight: 600;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.top {
|
|
900
|
+
display: flex;
|
|
901
|
+
justify-content: space-between;
|
|
902
|
+
align-items: center;
|
|
903
|
+
margin-bottom: 1rem;
|
|
904
|
+
font-size: 1.5rem;
|
|
905
|
+
font-weight: 600;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.description {
|
|
909
|
+
overflow: hidden;
|
|
910
|
+
text-overflow: ellipsis;
|
|
911
|
+
font-size: 1.25rem;
|
|
912
|
+
font-weight: 500;
|
|
913
|
+
max-height: 5rem;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.title-hovercard-player {
|
|
918
|
+
position: relative;
|
|
919
|
+
display: grid;
|
|
920
|
+
grid-template: "container";
|
|
921
|
+
background-color: #000;
|
|
922
|
+
overflow: hidden;
|
|
923
|
+
border-top-left-radius: 1rem;
|
|
924
|
+
border-top-right-radius: 1rem;
|
|
925
|
+
user-select: none;
|
|
926
|
+
overflow: hidden;
|
|
927
|
+
height: 39.25rem;
|
|
928
|
+
width: 70rem;
|
|
929
|
+
|
|
930
|
+
& youtube-video {
|
|
931
|
+
grid-area: container;
|
|
932
|
+
pointer-events: none;
|
|
933
|
+
margin-top: -10.3rem;
|
|
934
|
+
height: 60rem !important;
|
|
935
|
+
width: 70rem !important;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.trailer-fallback-cover {
|
|
940
|
+
position: relative;
|
|
941
|
+
display: grid;
|
|
942
|
+
grid-template: "container";
|
|
943
|
+
background-color: #000;
|
|
944
|
+
overflow: hidden;
|
|
945
|
+
border-top-left-radius: 1rem;
|
|
946
|
+
border-top-right-radius: 1rem;
|
|
947
|
+
user-select: none;
|
|
948
|
+
overflow: hidden;
|
|
949
|
+
height: 39.25rem;
|
|
950
|
+
width: 70rem;
|
|
951
|
+
background-size: cover;
|
|
952
|
+
background-position: center;
|
|
953
|
+
}
|
|
954
|
+
`,Lp=({ref:e,media:t,...n})=>{let r=L(()=>t?.titles?.at(0)?.title,[t]),i=L(()=>t?.shortDescriptions?.at(0)?.shortDescription,[t]),a=jp(t?.covers),[o,s]=A([]),c=L(()=>t?.trailers.filter(e=>!o.includes(e.uri)).at(0),[o]),l=O(()=>{c&&s([...o,c.uri])},[c,o]);return I(`div`,{ref:e,className:`title-hovercard`,css:Ip,...n,children:[c?.url?H(Jf,{volume:0,url:c?.url,onError:l,redirectTo:Y(J.MEDIA,{uri:t.uri}),className:`title-hovercard-player`}):a?H(po,{className:`trailer-fallback-cover`,style:{backgroundImage:`url(${a})`},to:Y(J.MEDIA,{uri:t.uri})}):void 0,H(po,{to:Y(J.MEDIA,{uri:t.uri}),children:I(`div`,{className:`content`,children:[H(`div`,{className:`title`,children:r}),H(`div`,{className:`top`,children:I(`span`,{className:`episodes`,children:[t.episodeCount??`?`,` Episodes`]})}),H($f,{className:`description`,children:i})]})})]})};h();var Rp=B`
|
|
955
|
+
display: flex;
|
|
956
|
+
flex-direction: column;
|
|
957
|
+
position: relative;
|
|
958
|
+
--card-gutter: 100px;
|
|
959
|
+
& > .title {
|
|
960
|
+
position: relative;
|
|
961
|
+
/* The section is a flex COLUMN, which blockifies this <a> and stretches it across the viewport,
|
|
962
|
+
so the heading's box (and its hover and focus ring) ran the full width of the screen for a few
|
|
963
|
+
words of text. Cross-axis start keeps the box the size of the words in it. */
|
|
964
|
+
align-self: flex-start;
|
|
965
|
+
margin-left: 10rem;
|
|
966
|
+
font-size: 4rem;
|
|
967
|
+
font-weight: bold;
|
|
968
|
+
color: rgb(255, 255, 255);
|
|
969
|
+
text-shadow: rgba(0, 0, 0, 0.8) -1px -1px 0px, rgba(0, 0, 0, 0.8) -1px 1px 0px, rgba(0, 0, 0, 0.8) 1px -1px 0px, rgba(0, 0, 0, 0.8) 1px 1px 0px;
|
|
970
|
+
padding-bottom: 0.5rem;
|
|
971
|
+
user-select: none;
|
|
972
|
+
}
|
|
973
|
+
& > .list-container {
|
|
974
|
+
position: relative;
|
|
975
|
+
& > .scroll-button {
|
|
976
|
+
position: absolute;
|
|
977
|
+
top: 50%;
|
|
978
|
+
transform: translateY(-50%);
|
|
979
|
+
width: 60px;
|
|
980
|
+
height: 60px;
|
|
981
|
+
background: rgba(0, 0, 0, 0.7);
|
|
982
|
+
border: none;
|
|
983
|
+
border-radius: 2.5rem;
|
|
984
|
+
color: white;
|
|
985
|
+
font-size: 24px;
|
|
986
|
+
cursor: pointer;
|
|
987
|
+
display: flex;
|
|
988
|
+
align-items: center;
|
|
989
|
+
justify-content: center;
|
|
990
|
+
transition: background 0.2s ease;
|
|
991
|
+
&:hover {
|
|
992
|
+
background: rgba(0, 0, 0, 0.9);
|
|
993
|
+
}
|
|
994
|
+
&.left {
|
|
995
|
+
left: 20px;
|
|
996
|
+
}
|
|
997
|
+
&.right {
|
|
998
|
+
right: 20px;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
& > div > .virtual-list {
|
|
1003
|
+
display: grid;
|
|
1004
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
1005
|
+
grid-gap: 1rem;
|
|
1006
|
+
padding-bottom: 0.5rem;
|
|
1007
|
+
scrollbar-width: thin;
|
|
1008
|
+
scrollbar-color: rgb(134, 132, 141) rgb(15, 15, 15);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
@media (max-width: 768px) {
|
|
1013
|
+
--card-gutter: 1.5rem;
|
|
1014
|
+
|
|
1015
|
+
& > .title {
|
|
1016
|
+
margin-left: 1.5rem;
|
|
1017
|
+
font-size: 2.4rem;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
& > .list-container > .scroll-button {
|
|
1021
|
+
display: none;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
`,zp=({style:e,mediaNodes:t,columnIndex:n})=>{let r=t[n];if(!r)return null;let[i,a]=A(!1),{x:o,y:s,strategy:c,refs:l,context:u}=pd({open:i,onOpenChange:a,whileElementsMounted:ce,placement:`top`,middleware:[Gl(({rects:e})=>-e.reference.height/2-e.floating.height/2),Kl({crossAxis:!0,padding:25})]}),d=bu(u,{restMs:400,handleClose:Ed()}),{styles:f}=Sd(u,{initial:{opacity:0,transform:`scale(0.8)`},open:{opacity:1,transform:`scale(1)`},duration:150}),{getReferenceProps:p,getFloatingProps:m}=hd([d]);return I(V,{children:[i&&H(Vu,{children:H(Lp,{media:r,ref:l.setFloating,style:{...f,position:c,top:s??0,left:o??0,zIndex:Md.hoverCard},...m()})}),H(Np,{media:r,to:Y(J.MEDIA,{uri:r.uri}),style:{...e,width:250,marginLeft:`var(--card-gutter, 100px)`},onMouseEnter:e=>{e.target instanceof HTMLElement&&l.setReference(e.target)},...p()},r._id)]})},Bp=({title:e,titleTo:t,mediaNodes:n})=>{let[r,i]=A(0),[a,o]=A(0),[s,c]=A(!1),l=Dp(null),u=O(e=>{let t=l.current;t&&t.scrollToColumn({index:e===`left`?r<=0?0:r:a+1>=n.length?n.length-1:a,behavior:`smooth`})},[r,a,n.length,l]);return I(`div`,{css:Rp,children:[t?H(po,{to:t,className:`title`,children:e}):H(`span`,{className:`title`,children:e}),I(`div`,{className:`list-container`,children:[H(Fp,{isDragging:s,setIsDragging:c,children:H(Ep,{gridRef:l,className:`virtual-list`,cellComponent:zp,cellProps:{mediaNodes:n},columnCount:n.length,columnWidth:260,rowCount:1,rowHeight:350,overscanCount:5,onCellsRendered:({columnStartIndex:e,columnStopIndex:t})=>{i(e),o(t)}})}),H(`button`,{className:`scroll-button left`,onClick:()=>u(`left`),children:H(qs,{})}),H(`button`,{className:`scroll-button right`,onClick:()=>u(`right`),children:H(Js,{})})]})]})};x();var Vp=B`
|
|
1025
|
+
position: relative;
|
|
1026
|
+
overflow: hidden;
|
|
1027
|
+
transition: max-height 0.3s ease-in-out;
|
|
1028
|
+
|
|
1029
|
+
& > .content {
|
|
1030
|
+
padding-bottom: 5rem;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
&.collapsed {
|
|
1034
|
+
position: relative;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
.fade-overlay {
|
|
1038
|
+
position: absolute;
|
|
1039
|
+
bottom: 2.5rem;
|
|
1040
|
+
left: 0;
|
|
1041
|
+
right: 0;
|
|
1042
|
+
height: 10rem;
|
|
1043
|
+
background: linear-gradient(to bottom, transparent, rgba(35, 35, 35, 1));
|
|
1044
|
+
pointer-events: none;
|
|
1045
|
+
transition: opacity 0.3s ease-in-out;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.toggle-button {
|
|
1049
|
+
font-size: 2.5rem;
|
|
1050
|
+
position: absolute;
|
|
1051
|
+
bottom: 0;
|
|
1052
|
+
left: 50%;
|
|
1053
|
+
transform: translateX(-50%);
|
|
1054
|
+
padding: 1rem;
|
|
1055
|
+
border: none;
|
|
1056
|
+
font-weight: 500;
|
|
1057
|
+
cursor: pointer;
|
|
1058
|
+
width: 100%;
|
|
1059
|
+
background-color: rgb(35, 35, 35);
|
|
1060
|
+
}
|
|
1061
|
+
`,Hp=({children:e,collapsedHeight:t=200,...n})=>{let[r,i]=A(!1),[a,o]=A(!1),s=_(null),[c,l]=A(0);k(()=>{if(!s.current)return;let e=new ResizeObserver(()=>{if(s.current){let e=s.current.scrollHeight;l(e),o(e>t)}});return e.observe(s.current),()=>e.disconnect()},[t]);let u=()=>i(!r);return I(`div`,{...n,ref:s,css:Vp,className:`${n.className||``} ${!r&&a?`collapsed`:`expanded`}`,children:[H(`div`,{className:`content`,children:e}),a&&!r?H(`div`,{className:`fade-overlay`}):void 0,a?H(`button`,{className:`toggle-button`,onClick:u,children:r?`Collapse`:`Expand`}):void 0]})},Up=`this build of the worker exposes no traceGraph, so there is nothing to read a trace from`,Wp=async()=>await e(()=>import(`./worker-juGKbgx7.js`),__vite__mapDeps([0,1,2,3,4,5])),Gp=async e=>{let t=await Wp();if(typeof t.traceGraph!=`function`)throw Error(Up);return t.traceGraph(e)},Kp=async e=>{let t=await Wp();if(typeof t.traceAnswer!=`function`)throw Error(Up);return t.traceAnswer(e)},qp=[`graph`,`store`],Jp=({uri:e,search:t}={})=>{let n=Y(J.DEBUG_TRACE),r=new URLSearchParams;e&&r.set(`uri`,e);let i=Qp(t??``);for(let e of qp)for(let t of i.getAll(e))r.append(e,t);let a=r.toString();return a?`${n}?${a}`:n},Yp=e=>{let t=Qp(em(e)),n=new URLSearchParams;for(let e of qp)for(let r of t.getAll(e))n.append(e,r);let r=n.toString();return r?`?${r}`:``},Xp=(e,t=`graph`)=>{let n=Qp(e);return n.set(t,`1`),`${Y(J.DEBUG_TRACE)}?${n.toString()}`},Zp=e=>{let t=Qp(e);t.delete(`store`);let n=t.toString();return`${Y(J.DEBUG_TRACE)}${n?`?${n}`:``}`},Qp=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),$p=typeof location>`u`?``:location.search,em=(e=``)=>{let t=Qp($p);for(let[n,r]of Qp(e))t.set(n,r);return t.toString()},tm=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e).get(`uri`)??``,nm={PREQUEL:`SEQUEL`,ADAPTATION:`SOURCE`,COMPILATION:`CONTAINS`,SIDE_STORY:`PARENT`},rm=e=>{let t=new Set,n=[];for(let r of e){if(!r?.from||!r?.to||r.from===r.to)continue;let e=nm[r.relation],i=e?{from:r.to,to:r.from,relation:e}:r,a=`${i.from}\u0000${i.to}\u0000${i.relation}`;t.has(a)||(t.add(a),n.push(i))}return n},im=new Set([`TV`,`TV_SHORT`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`,`MUSIC`]),am=e=>!e||im.has(e),om=e=>[...new Set((e.nodes??[]).map(e=>e.format??``).filter(Boolean))].sort(),sm=(e,t)=>{let n=(e.nodes??[]).filter(t),r=new Set(n.map(e=>e.uri));return{nodes:n,edges:(e.edges??[]).filter(e=>r.has(e.from)&&r.has(e.to))}},cm=e=>`${e.from}\u0000${e.to}\u0000${e.relation}`,lm=(e,t)=>{if(!e)return{nodes:new Set,edges:new Set};if(e.kind===`node`){let n=t.filter(t=>t.from===e.uri||t.to===e.uri);return{nodes:new Set([e.uri]),edges:new Set(n.map(cm))}}let n=t.find(t=>cm(t)===e.key);return n?{nodes:new Set([n.from,n.to]),edges:new Set([e.key])}:{nodes:new Set,edges:new Set}},um=e=>e.titles?.[0]?.title||e.uri,dm=e=>[...e].sort((e,t)=>(e.startDate??`9999`).localeCompare(t.startDate??`9999`)||um(e).localeCompare(um(t))),fm=(e,t)=>{let n=new Map(e.map(e=>[e.uri,0]));for(let r=0;r<e.length;r++){let e=!1;for(let r of t){let t=n.get(r.from),i=n.get(r.to);t===void 0||i===void 0||i<t+1&&(n.set(r.to,t+1),e=!0)}if(!e)break}let r=[...new Set(n.values())].sort((e,t)=>e-t),i=new Map(r.map((e,t)=>[e,t]));for(let[e,t]of n)n.set(e,i.get(t)??0);return n},pm=(e,t=`story`)=>{let n=rm(e.edges??[]),r=new Set((e.nodes??[]).map(e=>e.uri)),i=n.filter(e=>r.has(e.from)&&r.has(e.to)),a=dm(e.nodes??[]),o=t===`graph`?fm(a,i):void 0,s=[...new Set(a.map(e=>e.startDate??``))],c=new Map(s.map((e,t)=>[e,t])),l=new Map,u=a.map(e=>{let t=o?o.get(e.uri)??0:c.get(e.startDate??``)??0,n=l.get(t)??0;return l.set(t,n+1),{...e,column:t,row:n}}),d=[];if(t===`story`)for(let e=0;e<u.length-1;e++){let t=u[e],n=u[e+1];n.column>t.column&&d.push({from:t.uri,to:n.uri})}return{nodes:u,edges:i,chain:d,columns:Math.max(0,...u.map(e=>e.column+1)),rows:Math.max(0,...l.values())}},mm={ADAPTATION:`Adaptation`,PREQUEL:`Prequel`,SEQUEL:`Sequel`,PARENT:`Parent story`,SIDE_STORY:`Side story`,CHARACTER:`Character`,SUMMARY:`Summary`,ALTERNATIVE:`Alternative`,SPIN_OFF:`Spin off`,SOURCE:`Source`,COMPILATION:`Compilation`,CONTAINS:`Contains`,OTHER:`Related`},hm=[`SOURCE`,`PREQUEL`,`SEQUEL`,`PARENT`,`SIDE_STORY`,`SPIN_OFF`,`ALTERNATIVE`,`ADAPTATION`,`SUMMARY`,`COMPILATION`,`CONTAINS`,`CHARACTER`,`OTHER`],gm=e=>{let t=hm.indexOf(e);return t===-1?hm.length:t},_m=e=>e&&mm[e]||mm.OTHER,vm={TV:`TV`,TV_SHORT:`TV Short`,MOVIE:`Movie`,SPECIAL:`Special`,OVA:`OVA`,ONA:`ONA`,MUSIC:`Music`,MANGA:`Manga`,NOVEL:`Light Novel`,ONE_SHOT:`One Shot`},ym=e=>e?vm[e]||e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):void 0,bm=e=>[...e].sort((e,t)=>gm(e.relation)-gm(t.relation)),xm=e=>e.filter(e=>am(e.format)),Sm=e=>{let t=bm(e);return{before:t.filter(e=>e.relation===`PREQUEL`),middle:t.filter(e=>e.relation!==`PREQUEL`&&e.relation!==`SEQUEL`),after:t.filter(e=>e.relation===`SEQUEL`)}},Cm=B`
|
|
1062
|
+
margin-top: 4rem;
|
|
1063
|
+
|
|
1064
|
+
& > .heading {
|
|
1065
|
+
display: flex;
|
|
1066
|
+
align-items: center;
|
|
1067
|
+
/* the graph button sits beside the word, not across the modal, so the two read as one control */
|
|
1068
|
+
gap: 1.5rem;
|
|
1069
|
+
font-size: 1.8rem;
|
|
1070
|
+
font-weight: 600;
|
|
1071
|
+
color: rgba(255, 255, 255, 0.9);
|
|
1072
|
+
margin-bottom: 1.5rem;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
& > .grid {
|
|
1076
|
+
display: flex;
|
|
1077
|
+
flex-wrap: wrap;
|
|
1078
|
+
gap: 1.2rem;
|
|
1079
|
+
align-items: stretch;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
/* The two outer lanes take an EQUAL share of the free space, which is what centres the middle one
|
|
1083
|
+
on the modal rather than on whatever is left over beside a sequel. An empty lane still takes its
|
|
1084
|
+
share, so a row with no prequel keeps its side story centred instead of sliding left. */
|
|
1085
|
+
& > .grid > .lane {
|
|
1086
|
+
display: flex;
|
|
1087
|
+
flex-wrap: wrap;
|
|
1088
|
+
gap: 1.2rem;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
& > .grid > .before { flex: 1 1 0; justify-content: flex-start; }
|
|
1092
|
+
& > .grid > .middle { flex: 0 1 auto; justify-content: center; }
|
|
1093
|
+
& > .grid > .after { flex: 1 1 0; justify-content: flex-end; }
|
|
1094
|
+
|
|
1095
|
+
/* Below this the lanes cannot sit side by side, so they wrap onto their own lines and the timeline
|
|
1096
|
+
stops being readable as one: a lone sequel pushed to the right edge of its own line is just a
|
|
1097
|
+
card in a strange place. Measured at a 500px viewport, where the row is 458px and three 28rem
|
|
1098
|
+
cards cannot share it. Stack them and let them read top to bottom instead. */
|
|
1099
|
+
@media (max-width: 768px) {
|
|
1100
|
+
& > .grid > .lane { flex: 1 1 100%; justify-content: flex-start; }
|
|
1101
|
+
}
|
|
1102
|
+
`,wm=B`
|
|
1103
|
+
/* A card sized itself off the grid track until the lanes replaced it, so it needs its own basis
|
|
1104
|
+
now. 28rem is the track's old minimum, and shrinking is left on so a narrow modal wraps rather
|
|
1105
|
+
than overflows. */
|
|
1106
|
+
flex: 0 1 28rem;
|
|
1107
|
+
display: flex;
|
|
1108
|
+
align-items: stretch;
|
|
1109
|
+
gap: 1.2rem;
|
|
1110
|
+
padding: 0;
|
|
1111
|
+
border-radius: 0.6rem;
|
|
1112
|
+
background: rgba(255, 255, 255, 0.05);
|
|
1113
|
+
overflow: hidden;
|
|
1114
|
+
color: inherit;
|
|
1115
|
+
text-decoration: none;
|
|
1116
|
+
transition: background 0.15s ease;
|
|
1117
|
+
|
|
1118
|
+
&:hover {
|
|
1119
|
+
background: rgba(255, 255, 255, 0.1);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
& > .cover {
|
|
1123
|
+
flex-shrink: 0;
|
|
1124
|
+
width: 6rem;
|
|
1125
|
+
/* the aspect every cover in this app is, so a missing image leaves a hole the right shape */
|
|
1126
|
+
aspect-ratio: 2 / 3;
|
|
1127
|
+
object-fit: cover;
|
|
1128
|
+
background-color: rgb(35, 35, 35);
|
|
1129
|
+
pointer-events: none;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
& > .body {
|
|
1133
|
+
display: flex;
|
|
1134
|
+
flex-direction: column;
|
|
1135
|
+
justify-content: center;
|
|
1136
|
+
gap: 0.4rem;
|
|
1137
|
+
padding: 1rem 1.2rem 1rem 0;
|
|
1138
|
+
min-width: 0;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
& .relation {
|
|
1142
|
+
font-size: 1.3rem;
|
|
1143
|
+
font-weight: 700;
|
|
1144
|
+
/* the one accented thing on the card: it is what the reader is scanning for */
|
|
1145
|
+
color: rgb(61, 180, 242);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
& .title {
|
|
1149
|
+
font-size: 1.5rem;
|
|
1150
|
+
font-weight: 600;
|
|
1151
|
+
color: rgba(255, 255, 255, 0.95);
|
|
1152
|
+
/* two lines then ellipsis: a light novel title runs long and a ragged card height is worse */
|
|
1153
|
+
display: -webkit-box;
|
|
1154
|
+
-webkit-line-clamp: 2;
|
|
1155
|
+
-webkit-box-orient: vertical;
|
|
1156
|
+
overflow: hidden;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
& .meta {
|
|
1160
|
+
font-size: 1.25rem;
|
|
1161
|
+
color: rgba(255, 255, 255, 0.55);
|
|
1162
|
+
}
|
|
1163
|
+
`,Tm=({edge:e,search:t})=>{let n=jp(e.node.covers),r=e.node.titles?.at(0)?.title,i=[ym(e.format),cs(e.node.status)].filter(Boolean).join(` · `);return I(po,{className:`relation-card`,css:wm,to:`${Y(J.MEDIA,{uri:pe(e.node.uri)})}${t}`,children:[n?H(`img`,{className:`cover`,src:n,alt:``}):H(`div`,{className:`cover`}),I(`div`,{className:`body`,children:[H(`div`,{className:`relation`,children:_m(e.relation)}),H(`div`,{className:`title`,children:r??e.node.uri}),i?H(`div`,{className:`meta`,children:i}):void 0]})]})},Em=({relations:e,action:t})=>{let n=Yp(ao()),r=xm(e);if(!r.length)return null;let i=Sm(r);return I(`div`,{css:Cm,"data-relations":!0,children:[I(`div`,{className:`heading`,children:[H(`span`,{children:`Relations`}),t]}),H(`div`,{className:`grid`,children:[`before`,`middle`,`after`].map(e=>H(`div`,{className:`lane ${e}`,children:i[e].map(e=>H(Tm,{edge:e,search:n},`${e.relation}:${e.node.uri}`))},e))})]})};function Dm(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Dm(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Om={value:()=>{}};function km(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Am(n)}function Am(e){this._=e}function jm(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Am.prototype=km.prototype={constructor:Am,on:function(e,t){var n=this._,r=jm(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Mm(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Nm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Nm(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Am(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Mm(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Nm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Om,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Pm={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Fm(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Pm.hasOwnProperty(t)?{space:Pm[t],local:e}:e}function Im(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Lm(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Rm(e){var t=Fm(e);return(t.local?Lm:Im)(t)}function zm(){}function Bm(e){return e==null?zm:function(){return this.querySelector(e)}}function Vm(e){typeof e!=`function`&&(e=Bm(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new kg(r,this._parents)}function Hm(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Um(){return[]}function Wm(e){return e==null?Um:function(){return this.querySelectorAll(e)}}function Gm(e){return function(){return Hm(e.apply(this,arguments))}}function Km(e){e=typeof e==`function`?Gm(e):Wm(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new kg(r,i)}function qm(e){return function(){return this.matches(e)}}function Jm(e){return function(t){return t.matches(e)}}var Ym=Array.prototype.find;function Xm(e){return function(){return Ym.call(this.children,e)}}function Zm(){return this.firstElementChild}function Qm(e){return this.select(e==null?Zm:Xm(typeof e==`function`?e:Jm(e)))}var $m=Array.prototype.filter;function eh(){return Array.from(this.children)}function th(e){return function(){return $m.call(this.children,e)}}function nh(e){return this.selectAll(e==null?eh:th(typeof e==`function`?e:Jm(e)))}function rh(e){typeof e!=`function`&&(e=qm(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new kg(r,this._parents)}function ih(e){return Array(e.length)}function ah(){return new kg(this._enter||this._groups.map(ih),this._parents)}function oh(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}oh.prototype={constructor:oh,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function sh(e){return function(){return e}}function ch(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new oh(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function lh(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new oh(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function uh(e){return e.__data__}function dh(e,t){if(!arguments.length)return Array.from(this,uh);var n=t?lh:ch,r=this._parents,i=this._groups;typeof e!=`function`&&(e=sh(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=fh(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new kg(o,r),o._enter=s,o._exit=c,o}function fh(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ph(){return new kg(this._exit||this._groups.map(ih),this._parents)}function mh(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function hh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new kg(s,this._parents)}function gh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function _h(e){e||=vh;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new kg(i,this._parents).order()}function vh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bh(){return Array.from(this)}function xh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Sh(){let e=0;for(let t of this)++e;return e}function Ch(){return!this.node()}function wh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Th(e){return function(){this.removeAttribute(e)}}function Eh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dh(e,t){return function(){this.setAttribute(e,t)}}function Oh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ah(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function jh(e,t){var n=Fm(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Eh:Th:typeof t==`function`?n.local?Ah:kh:n.local?Oh:Dh)(n,t))}function Mh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Nh(e){return function(){this.style.removeProperty(e)}}function Ph(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Fh(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ih(e,t,n){return arguments.length>1?this.each((t==null?Nh:typeof t==`function`?Fh:Ph)(e,t,n??``)):Lh(this.node(),e)}function Lh(e,t){return e.style.getPropertyValue(t)||Mh(e).getComputedStyle(e,null).getPropertyValue(t)}function Rh(e){return function(){delete this[e]}}function zh(e,t){return function(){this[e]=t}}function Bh(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vh(e,t){return arguments.length>1?this.each((t==null?Rh:typeof t==`function`?Bh:zh)(e,t)):this.node()[e]}function Hh(e){return e.trim().split(/^|\s+/)}function Uh(e){return e.classList||new Wh(e)}function Wh(e){this._node=e,this._names=Hh(e.getAttribute(`class`)||``)}Wh.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Gh(e,t){for(var n=Uh(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Kh(e,t){for(var n=Uh(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qh(e){return function(){Gh(this,e)}}function Jh(e){return function(){Kh(this,e)}}function Yh(e,t){return function(){(t.apply(this,arguments)?Gh:Kh)(this,e)}}function Xh(e,t){var n=Hh(e+``);if(arguments.length<2){for(var r=Uh(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Yh:t?qh:Jh)(n,t))}function Zh(){this.textContent=``}function Qh(e){return function(){this.textContent=e}}function $h(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function eg(e){return arguments.length?this.each(e==null?Zh:(typeof e==`function`?$h:Qh)(e)):this.node().textContent}function tg(){this.innerHTML=``}function ng(e){return function(){this.innerHTML=e}}function rg(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function ig(e){return arguments.length?this.each(e==null?tg:(typeof e==`function`?rg:ng)(e)):this.node().innerHTML}function ag(){this.nextSibling&&this.parentNode.appendChild(this)}function og(){return this.each(ag)}function sg(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cg(){return this.each(sg)}function lg(e){var t=typeof e==`function`?e:Rm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ug(){return null}function dg(e,t){var n=typeof e==`function`?e:Rm(e),r=t==null?ug:typeof t==`function`?t:Bm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function fg(){var e=this.parentNode;e&&e.removeChild(this)}function pg(){return this.each(fg)}function mg(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function hg(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gg(e){return this.select(e?hg:mg)}function _g(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function vg(e){return function(t){e.call(this,t,this.__data__)}}function yg(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function bg(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function xg(e,t,n){return function(){var r=this.__on,i,a=vg(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Sg(e,t,n){var r=yg(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?xg:bg,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Cg(e,t,n){var r=Mh(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function wg(e,t){return function(){return Cg(this,e,t)}}function Tg(e,t){return function(){return Cg(this,e,t.apply(this,arguments))}}function Eg(e,t){return this.each((typeof t==`function`?Tg:wg)(e,t))}function*Dg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Og=[null];function kg(e,t){this._groups=e,this._parents=t}function Ag(){return new kg([[document.documentElement]],Og)}function jg(){return this}kg.prototype=Ag.prototype={constructor:kg,select:Vm,selectAll:Km,selectChild:Qm,selectChildren:nh,filter:rh,data:dh,enter:ah,exit:ph,join:mh,merge:hh,selection:jg,order:gh,sort:_h,call:yh,nodes:bh,node:xh,size:Sh,empty:Ch,each:wh,attr:jh,style:Ih,property:Vh,classed:Xh,text:eg,html:ig,raise:og,lower:cg,append:lg,insert:dg,remove:pg,clone:gg,datum:_g,on:Sg,dispatch:Eg,[Symbol.iterator]:Dg};function Mg(e){return typeof e==`string`?new kg([[document.querySelector(e)]],[document.documentElement]):new kg([[e]],Og)}function Ng(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pg(e,t){if(e=Ng(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Fg={passive:!1},Ig={capture:!0,passive:!1};function Lg(e){e.stopImmediatePropagation()}function Rg(e){e.preventDefault(),e.stopImmediatePropagation()}function zg(e){var t=e.document.documentElement,n=Mg(e).on(`dragstart.drag`,Rg,Ig);`onselectstart`in t?n.on(`selectstart.drag`,Rg,Ig):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Bg(e,t){var n=e.document.documentElement,r=Mg(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Rg,Ig),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Vg=e=>()=>e;function Hg(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Hg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ug(e){return!e.ctrlKey&&!e.button}function Wg(){return this.parentNode}function Gg(e,t){return t??{x:e.x,y:e.y}}function Kg(){return navigator.maxTouchPoints||`ontouchstart`in this}function qg(){var e=Ug,t=Wg,n=Gg,r=Kg,i={},a=km(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Fg).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Mg(n.view).on(`mousemove.drag`,m,Ig).on(`mouseup.drag`,h,Ig),zg(n.view),Lg(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Rg(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Mg(e.view).on(`mousemove.drag mouseup.drag`,null),Bg(e.view,l),Rg(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Lg(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(Rg(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Lg(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Pg(l||r,t),p,m,h;if((h=n.call(e,new Hg(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Pg(l||a,t),_=o;break}u.call(r,e,new Hg(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Vg(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Vg(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Vg(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Vg(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Jg(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xg(){}var Zg=.7,Qg=1/Zg,$g=`\\s*([+-]?\\d+)\\s*`,e_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,t_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,n_=/^#([0-9a-f]{3,8})$/,r_=RegExp(`^rgb\\(${$g},${$g},${$g}\\)$`),i_=RegExp(`^rgb\\(${t_},${t_},${t_}\\)$`),a_=RegExp(`^rgba\\(${$g},${$g},${$g},${e_}\\)$`),o_=RegExp(`^rgba\\(${t_},${t_},${t_},${e_}\\)$`),s_=RegExp(`^hsl\\(${e_},${t_},${t_}\\)$`),c_=RegExp(`^hsla\\(${e_},${t_},${t_},${e_}\\)$`),l_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jg(Xg,m_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:u_,formatHex:u_,formatHex8:d_,formatHsl:f_,formatRgb:p_,toString:p_});function u_(){return this.rgb().formatHex()}function d_(){return this.rgb().formatHex8()}function f_(){return D_(this).formatHsl()}function p_(){return this.rgb().formatRgb()}function m_(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=n_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?h_(t):n===3?new y_(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?g_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?g_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=r_.exec(e))?new y_(t[1],t[2],t[3],1):(t=i_.exec(e))?new y_(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a_.exec(e))?g_(t[1],t[2],t[3],t[4]):(t=o_.exec(e))?g_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=s_.exec(e))?E_(t[1],t[2]/100,t[3]/100,1):(t=c_.exec(e))?E_(t[1],t[2]/100,t[3]/100,t[4]):l_.hasOwnProperty(e)?h_(l_[e]):e===`transparent`?new y_(NaN,NaN,NaN,0):null}function h_(e){return new y_(e>>16&255,e>>8&255,e&255,1)}function g_(e,t,n,r){return r<=0&&(e=t=n=NaN),new y_(e,t,n,r)}function __(e){return e instanceof Xg||(e=m_(e)),e?(e=e.rgb(),new y_(e.r,e.g,e.b,e.opacity)):new y_}function v_(e,t,n,r){return arguments.length===1?__(e):new y_(e,t,n,r??1)}function y_(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jg(y_,v_,Yg(Xg,{brighter(e){return e=e==null?Qg:Qg**+e,new y_(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zg:Zg**+e,new y_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new y_(w_(this.r),w_(this.g),w_(this.b),C_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:b_,formatHex:b_,formatHex8:x_,formatRgb:S_,toString:S_}));function b_(){return`#${T_(this.r)}${T_(this.g)}${T_(this.b)}`}function x_(){return`#${T_(this.r)}${T_(this.g)}${T_(this.b)}${T_((isNaN(this.opacity)?1:this.opacity)*255)}`}function S_(){let e=C_(this.opacity);return`${e===1?`rgb(`:`rgba(`}${w_(this.r)}, ${w_(this.g)}, ${w_(this.b)}${e===1?`)`:`, ${e})`}`}function C_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function w_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function T_(e){return e=w_(e),(e<16?`0`:``)+e.toString(16)}function E_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new k_(e,t,n,r)}function D_(e){if(e instanceof k_)return new k_(e.h,e.s,e.l,e.opacity);if(e instanceof Xg||(e=m_(e)),!e)return new k_;if(e instanceof k_)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new k_(o,s,c,e.opacity)}function O_(e,t,n,r){return arguments.length===1?D_(e):new k_(e,t,n,r??1)}function k_(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jg(k_,O_,Yg(Xg,{brighter(e){return e=e==null?Qg:Qg**+e,new k_(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zg:Zg**+e,new k_(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new y_(M_(e>=240?e-240:e+120,i,r),M_(e,i,r),M_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new k_(A_(this.h),j_(this.s),j_(this.l),C_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=C_(this.opacity);return`${e===1?`hsl(`:`hsla(`}${A_(this.h)}, ${j_(this.s)*100}%, ${j_(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function A_(e){return e=(e||0)%360,e<0?e+360:e}function j_(e){return Math.max(0,Math.min(1,e||0))}function M_(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var N_=e=>()=>e;function P_(e,t){return function(n){return e+n*t}}function F_(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function I_(e){return(e=+e)==1?L_:function(t,n){return n-t?F_(t,n,e):N_(isNaN(t)?n:t)}}function L_(e,t){var n=t-e;return n?P_(e,n):N_(isNaN(e)?t:e)}var R_=(function e(t){var n=I_(t);function r(e,t){var r=n((e=v_(e)).r,(t=v_(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=L_(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function z_(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function B_(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function V_(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=X_(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function H_(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function U_(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function W_(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=X_(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var G_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,K_=new RegExp(G_.source,`g`);function q_(e){return function(){return e}}function J_(e){return function(t){return e(t)+``}}function Y_(e,t){var n=G_.lastIndex=K_.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=G_.exec(e))&&(i=K_.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:U_(r,i)})),n=K_.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?J_(c[0].x):q_(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function X_(e,t){var n=typeof t,r;return t==null||n===`boolean`?N_(t):(n===`number`?U_:n===`string`?(r=m_(t))?(t=r,R_):Y_:t instanceof m_?R_:t instanceof Date?H_:B_(t)?z_:Array.isArray(t)?V_:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?W_:U_)(e,t)}var Z_=180/Math.PI,Q_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $_(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Z_,skewX:Math.atan(c)*Z_,scaleX:o,scaleY:s}}var ev;function tv(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Q_:$_(t.a,t.b,t.c,t.d,t.e,t.f)}function nv(e){return e==null||(ev||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ev.setAttribute(`transform`,e),!(e=ev.transform.baseVal.consolidate()))?Q_:(e=e.matrix,$_(e.a,e.b,e.c,e.d,e.e,e.f))}function rv(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:U_(e,i)},{i:c-2,x:U_(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:U_(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:U_(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:U_(e,n)},{i:s-2,x:U_(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var iv=rv(tv,`px, `,`px)`,`deg)`),av=rv(nv,`, `,`)`,`)`),ov=1e-12;function sv(e){return((e=Math.exp(e))+1/e)/2}function cv(e){return((e=Math.exp(e))-1/e)/2}function lv(e){return((e=Math.exp(2*e))-1)/(e+1)}var uv=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<ov)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=sv(y),c=s/(n*g)*(i*lv(t*r+y)-cv(y));return[a+c*d,o+c*f,s*i/sv(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),dv=0,fv=0,pv=0,mv=1e3,hv,gv,_v=0,vv=0,yv=0,bv=typeof performance==`object`&&performance.now?performance:Date,xv=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sv(){return vv||=(xv(Cv),bv.now()+yv)}function Cv(){vv=0}function wv(){this._call=this._time=this._next=null}wv.prototype=Tv.prototype={constructor:wv,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Sv():+n)+(t==null?0:+t),!this._next&&gv!==this&&(gv?gv._next=this:hv=this,gv=this),this._call=e,this._time=n,Av()},stop:function(){this._call&&(this._call=null,this._time=1/0,Av())}};function Tv(e,t,n){var r=new wv;return r.restart(e,t,n),r}function Ev(){Sv(),++dv;for(var e=hv,t;e;)(t=vv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--dv}function Dv(){vv=(_v=bv.now())+yv,dv=fv=0;try{Ev()}finally{dv=0,kv(),vv=0}}function Ov(){var e=bv.now(),t=e-_v;t>mv&&(yv-=t,_v=e)}function kv(){for(var e,t=hv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:hv=n);gv=e,Av(r)}function Av(e){dv||(fv&&=clearTimeout(fv),e-vv>24?(e<1/0&&(fv=setTimeout(Dv,e-bv.now()-yv)),pv&&=clearInterval(pv)):(pv||=(_v=bv.now(),setInterval(Ov,mv)),dv=1,xv(Dv)))}function jv(e,t,n){var r=new wv;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Mv=km(`start`,`end`,`cancel`,`interrupt`),Nv=[];function Pv(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Rv(e,n,{name:t,index:r,group:i,on:Mv,tween:Nv,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Fv(e,t){var n=Lv(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Iv(e,t){var n=Lv(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Lv(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Rv(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Tv(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return jv(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(jv(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function zv(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Bv(e){return this.each(function(){zv(this,e)})}function Vv(e,t){var n,r;return function(){var i=Iv(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Hv(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Iv(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Uv(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Lv(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Vv:Hv)(n,e,t))}function Wv(e,t,n){var r=e._id;return e.each(function(){var e=Iv(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Lv(e,r).value[t]}}function Gv(e,t){var n;return(typeof t==`number`?U_:t instanceof m_?R_:(n=m_(t))?(t=n,R_):Y_)(e,t)}function Kv(e){return function(){this.removeAttribute(e)}}function qv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jv(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Yv(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Xv(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Zv(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Qv(e,t){var n=Fm(e),r=n===`transform`?av:Gv;return this.attrTween(e,typeof t==`function`?(n.local?Zv:Xv)(n,r,Wv(this,`attr.`+e,t)):t==null?(n.local?qv:Kv)(n):(n.local?Yv:Jv)(n,r,t))}function $v(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ey(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ty(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ey(e,i)),n}return i._value=t,i}function ny(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$v(e,i)),n}return i._value=t,i}function ry(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Fm(e);return this.tween(n,(r.local?ty:ny)(r,t))}function iy(e,t){return function(){Fv(this,e).delay=+t.apply(this,arguments)}}function ay(e,t){return t=+t,function(){Fv(this,e).delay=t}}function oy(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?iy:ay)(t,e)):Lv(this.node(),t).delay}function sy(e,t){return function(){Iv(this,e).duration=+t.apply(this,arguments)}}function cy(e,t){return t=+t,function(){Iv(this,e).duration=t}}function ly(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?sy:cy)(t,e)):Lv(this.node(),t).duration}function uy(e,t){if(typeof t!=`function`)throw Error();return function(){Iv(this,e).ease=t}}function dy(e){var t=this._id;return arguments.length?this.each(uy(t,e)):Lv(this.node(),t).ease}function fy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Iv(this,e).ease=n}}function py(e){if(typeof e!=`function`)throw Error();return this.each(fy(this._id,e))}function my(e){typeof e!=`function`&&(e=qm(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Uy(r,this._parents,this._name,this._id)}function hy(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Uy(o,this._parents,this._name,this._id)}function gy(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function _y(e,t,n){var r,i,a=gy(t)?Fv:Iv;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function vy(e,t){var n=this._id;return arguments.length<2?Lv(this.node(),n).on.on(e):this.each(_y(n,e,t))}function yy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function by(){return this.on(`end.remove`,yy(this._id))}function xy(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Bm(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Pv(l[f],t,n,f,l,Lv(u,n)));return new Uy(a,this._parents,t,n)}function Sy(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Wm(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Lv(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Pv(p,t,n,h,f,m);a.push(f),o.push(u)}return new Uy(a,o,t,n)}var Cy=Ag.prototype.constructor;function wy(){return new Cy(this._groups,this._parents)}function Ty(e,t){var n,r,i;return function(){var a=Lh(this,e),o=(this.style.removeProperty(e),Lh(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ey(e){return function(){this.style.removeProperty(e)}}function Dy(e,t,n){var r,i=n+``,a;return function(){var o=Lh(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Oy(e,t,n){var r,i,a;return function(){var o=Lh(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Lh(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function ky(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Iv(this,e),l=c.on,u=c.value[a]==null?s||=Ey(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Ay(e,t,n){var r=(e+=``)==`transform`?iv:Gv;return t==null?this.styleTween(e,Ty(e,r)).on(`end.style.`+e,Ey(e)):typeof t==`function`?this.styleTween(e,Oy(e,r,Wv(this,`style.`+e,t))).each(ky(this._id,e)):this.styleTween(e,Dy(e,r,t),n).on(`end.style.`+e,null)}function jy(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function My(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&jy(e,a,n)),r}return a._value=t,a}function Ny(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,My(e,t,n??``))}function Py(e){return function(){this.textContent=e}}function Fy(e){return function(){var t=e(this);this.textContent=t??``}}function Iy(e){return this.tween(`text`,typeof e==`function`?Fy(Wv(this,`text`,e)):Py(e==null?``:e+``))}function Ly(e){return function(t){this.textContent=e.call(this,t)}}function Ry(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ly(r)),t}return r._value=e,r}function zy(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Ry(e))}function By(){for(var e=this._name,t=this._id,n=Gy(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Lv(c,t);Pv(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Uy(r,this._parents,e,n)}function Vy(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Iv(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Hy=0;function Uy(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Wy(e){return Ag().transition(e)}function Gy(){return++Hy}var Ky=Ag.prototype;Uy.prototype=Wy.prototype={constructor:Uy,select:xy,selectAll:Sy,selectChild:Ky.selectChild,selectChildren:Ky.selectChildren,filter:my,merge:hy,selection:wy,transition:By,call:Ky.call,nodes:Ky.nodes,node:Ky.node,size:Ky.size,empty:Ky.empty,each:Ky.each,on:vy,attr:Qv,attrTween:ry,style:Ay,styleTween:Ny,text:Iy,textTween:zy,remove:by,tween:Uv,delay:oy,duration:ly,ease:dy,easeVarying:py,end:Vy,[Symbol.iterator]:Ky[Symbol.iterator]};function qy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jy={time:null,delay:0,duration:250,ease:qy};function Yy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Xy(e){var t,n;e instanceof Uy?(t=e._id,e=e._name):(t=Gy(),(n=Jy).time=Sv(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Pv(c,e,t,l,o,n||Yy(c,t));return new Uy(r,this._parents,e,t)}Ag.prototype.interrupt=Bv,Ag.prototype.transition=Xy;var Zy=e=>()=>e;function Qy(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function $y(e,t,n){this.k=e,this.x=t,this.y=n}$y.prototype={constructor:$y,scale:function(e){return e===1?this:new $y(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $y(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var eb=new $y(1,0,0);tb.prototype=$y.prototype;function tb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return eb;return e.__zoom}function nb(e){e.stopImmediatePropagation()}function rb(e){e.preventDefault(),e.stopImmediatePropagation()}function ib(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function ab(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ob(){return this.__zoom||eb}function sb(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cb(){return navigator.maxTouchPoints||`ontouchstart`in this}function lb(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ub(){var e=ib,t=ab,n=lb,r=sb,i=cb,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=uv,l=km(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,ob).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,ob),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(eb.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new $y(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new $y(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new $y(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Mg(this.that).datum();l.call(e,this.that,new Qy(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Pg(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],zv(this),s.start();rb(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Mg(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Pg(t,i),l=t.clientX,u=t.clientY;zg(t.view),nb(t),a.mouse=[c,this.__zoom.invert(c)],zv(this),a.start();function d(e){if(rb(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Pg(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Bg(e.view,a.moved),rb(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Pg(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);rb(r),s>0?Mg(this).transition().duration(s).call(x,d,c,r):Mg(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(nb(t),s=0;s<i;++s)c=r[s],l=Pg(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),zv(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(rb(e),s=0;s<a;++s)c=i[s],l=Pg(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(nb(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Pg(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Mg(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Zy(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Zy(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Zy(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Zy([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var db={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},fb=[[-1/0,-1/0],[1/0,1/0]],pb=[`Enter`,` `,`Escape`],mb={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},hb;(function(e){e.Strict=`strict`,e.Loose=`loose`})(hb||={});var gb;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(gb||={});var _b;(function(e){e.Partial=`partial`,e.Full=`full`})(_b||={});var vb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},yb;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(yb||={});var bb;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(bb||={});var Q;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Q||={});var xb={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top},Sb=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Cb=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),wb=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Tb=(e,t=[0,0])=>{let{width:n,height:r}=ax(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Eb=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):wb(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,zb(e,Ub(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Vb(r):{x:0,y:0,width:0,height:0}},Db=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=zb(n,Ub(e)),r=!0)}),r?Vb(n):{x:0,y:0,width:0,height:0}},Ob=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Gb(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},kb=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Ab(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=ax(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function jb({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=nx(Db(Ab(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function Mb({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,db.error005());else{let{width:e,height:t}=ax(s);e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&ix(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=ix(d)?Fb(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,db.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Nb({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=kb(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Pb=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Fb=(e={x:0,y:0},t,n)=>({x:Pb(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Pb(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ib(e,t,n){let{width:r,height:i}=ax(n),{x:a,y:o}=n.internals.positionAbsolute;return Fb(e,[[a,o],[a+r,o+i]],t)}var Lb=(e,t,n)=>e<t?Pb(Math.abs(e-t),1,t)/t:e>n?-Pb(Math.abs(e-n),1,t)/t:0,Rb=(e,t,n=15,r=40)=>[Lb(e.x,r,t.width-r)*n,Lb(e.y,r,t.height-r)*n],zb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Bb=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Vb=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Hb=(e,t=[0,0])=>{let{x:n,y:r}=wb(e)?e.internals.positionAbsolute:Tb(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Ub=(e,t=[0,0])=>{let{x:n,y:r}=wb(e)?e.internals.positionAbsolute:Tb(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Wb=(e,t)=>Vb(zb(Bb(e),Bb(t))),Gb=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Kb=(e,t)=>Gb(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),qb=e=>Jb(e.width)&&Jb(e.height)&&Jb(e.x)&&Jb(e.y),Jb=e=>!isNaN(e)&&isFinite(e),Yb=(e,t)=>(e,t)=>{},Xb=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zb=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Xb(s,o):s},Qb=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function $b(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ex(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=$b(e,n),i=$b(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=$b(e.top??e.y??0,n),i=$b(e.bottom??e.y??0,n),a=$b(e.left??e.x??0,t),o=$b(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tx(e,t,n,r,i,a){let{x:o,y:s}=Qb(e,[t,n,r]),{x:c,y:l}=Qb({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var nx=(e,t,n,r,i,a)=>{let o=ex(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Pb(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=tx(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},rx=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function ix(e){return e!=null&&e!==`parent`}function ax(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ox(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function sx(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function cx(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function lx(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function ux(e){return{...mb,...e||{}}}function dx(e){return e===null?null:e?`valid`:`invalid`}function fx(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=vx(e),s=Zb({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Xb(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var px=e=>({width:e.offsetWidth,height:e.offsetHeight}),mx=e=>e?.getRootNode?.()||window?.document,hx=[`INPUT`,`SELECT`,`TEXTAREA`];function gx(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?hx.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var _x=e=>`clientX`in e,vx=(e,t)=>{let n=_x(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},yx=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...px(t)}})};function bx({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function xx(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Sx({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Q.Left:return[t-xx(t-r,a),n];case Q.Right:return[t+xx(r-t,a),n];case Q.Top:return[t,n-xx(n-i,a)];case Q.Bottom:return[t,n+xx(i-n,a)]}}function Cx({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){let[s,c]=Sx({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Sx({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=bx({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function wx({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Tx({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Ex({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=zb(Ub(e),Ub(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Kb({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Vb(a))>0}var Dx=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Ox=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),kx=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,db.error006()),t;let r=n.getEdgeId||Dx,i;return i=Sb(e)?{...e}:{...e,id:r(e)},Ox(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Ax({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=wx({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var jx={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Mx=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Nx=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Px({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:i,offset:a,stepPosition:o}){let s=jx[t],c=jx[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Mx({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=wx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Fx(e,t,n,r){let i=Math.min(Nx(e,t)/2,Nx(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Ix({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Px({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Fx(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function Lx(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Rx(e){let{sourceNode:t,targetNode:n}=e;if(!Lx(t)||!Lx(n))return null;let r=t.internals.handleBounds||zx(t.handles),i=n.internals.handleBounds||zx(n.handles),a=Vx(r?.source??[],e.sourceHandle),o=Vx(e.connectionMode===hb.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,db.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Q.Bottom,c=o?.position||Q.Top,l=Bx(t,a,s),u=Bx(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function zx(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function Bx(e,t,n=Q.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??ax(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function Vx(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Hx(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Ux(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Hx(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var Wx=1e3,Gx=10,Kx={nodeOrigin:[0,0],nodeExtent:fb,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},qx={...Kx,checkEquality:!0};function Jx(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Yx(e,t,n){let r=Jx(Kx,n);for(let n of e.values())if(n.parentId)eS(n,e,t,r);else{let e=Fb(Tb(n,r.nodeOrigin),ix(n.extent)?n.extent:r.nodeExtent,ax(n));n.internals.positionAbsolute=e}}function Xx(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Zx(e){return e===`manual`}function Qx(e,t,n,r={}){let i=Jx(qx,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Zx(i.zIndexMode)?Wx:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Fb(Tb(u,i.nodeOrigin),ix(u.extent)?u.extent:i.nodeExtent,ax(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Xx(u,e),z:tS(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&eS(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function $x(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function eS(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Jx(Kx,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}$x(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Gx),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=nS(e,u,o,s,a&&!Zx(c)?Wx:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function tS(e,t,n){let r=Jb(e.zIndex)?e.zIndex:0;return Zx(n)?r:r+(e.selected?t:0)}function nS(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=ax(e),l=Tb(e,n),u=ix(e.extent)?Fb(l,e.extent,c):l,d=Fb({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Ib(d,c,t));let f=tS(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function rS(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Wb(a.get(n.parentId)?.expandedRect??Hb(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=ax(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function iS(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=px(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=ix(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Ib(h,s,n))}else m&&(h=Fb(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:yx(`source`,r.nodeElement,p,d,e.id),target:yx(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&eS(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Hb(g,i)}))}}if(f.length>0){let e=rS(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function aS({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function oS(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function sS(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;oS(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),oS(`target`,s,c,e,i,o),t.set(r.id,r)}}function cS(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:cS(n,t):!1}function lS(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function uS(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!cS(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function dS({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function fS({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=Xb(a,t);return{x:o.x-a.x,y:o.y-a.y}}function pS({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=Mg(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Bb(Db(s)):null,x=v&&l?fS({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:Xb(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Mb({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=dS({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Rb(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=fx(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=uS(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=dS({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=qg().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=fx(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=vx(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=fx(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=vx(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=vx(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=dS({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!lS(t,`.${g}`,v))&&(!_||lS(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function mS(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Kb(i,Hb(e))>0&&r.push(e);return r}var hS=250;function gS(e,t,n,r){let i=[],a=1/0,o=mS(e,n,t+hS);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Bx(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function _S(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Bx(o,c,c.position,!0)}:c}function vS(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function yS(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var bS=()=>!0;function xS(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=bS,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=mx(e.target),E=0,D,{x:O,y:k}=vx(e),A=vS(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=_S(i,A,r,c,t);if(!N)return;let P=vx(e,j),F=!1,I=null,L=!1,ee=null;function te(){if(!u||!j)return;let[e,t]=Rb(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(te)}let R={...N,nodeId:i,type:A,position:N.position},z=c.get(i),B={inProgress:!0,isValid:null,from:Bx(z,R,Q.Left,!0),fromHandle:R,fromPosition:R.position,fromNode:z,to:P,toHandle:null,toPosition:xb[R.position],toNode:null,pointer:P};function ne(){M=!0,y(B),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ne();function V(e){if(!M){let{x:t,y:n}=vx(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ne()}if(!x()||!R){re(e);return}let a=b();P=vx(e,j),D=gS(Zb(P,a,!1,[1,1]),n,c,R),F||=(te(),!0);let s=SS(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});ee=s.handleDomNode,I=s.connection,L=yS(!!D,s.isValid);let u=c.get(i),f=u?Bx(u,R,Q.Left,!0):B.from,p={...B,from:f,isValid:L,to:s.toHandle&&L?Qb({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:xb[R.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),B=p}function re(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||ee)&&I&&L&&h?.(I);let{inProgress:t,...n}=B,r={...n,toPosition:B.toHandle?B.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,ee=null,T.removeEventListener(`mousemove`,V),T.removeEventListener(`mouseup`,re),T.removeEventListener(`touchmove`,V),T.removeEventListener(`touchend`,re)}}T.addEventListener(`mousemove`,V),T.addEventListener(`mouseup`,re),T.addEventListener(`touchmove`,V),T.addEventListener(`touchend`,re)}function SS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=bS,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=vx(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=vS(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===hb.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=_S(t,e,a,u,n,!0)}return _}var CS={onPointerDown:xS,isValid:SS};function wS({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Mg(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&rx()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=ub().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Pg}}var TS=e=>({x:e.x,y:e.y,zoom:e.k}),ES=({x:e,y:t,zoom:n})=>eb.translate(e,t).scale(n),DS=(e,t)=>e.target.closest(`.${t}`),OS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kS=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,AS=(e,t=0,n=kS,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},jS=e=>{let t=e.ctrlKey&&rx()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function MS({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(DS(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Pg(u),t=d*2**jS(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===gb.Vertical?0:u.deltaX*f,m=i===gb.Horizontal?0:u.deltaY*f;!rx()&&u.shiftKey&&i!==gb.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=TS(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function NS({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=DS(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function PS({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=TS(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function FS({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&OS(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,TS(a.transform))}}function IS({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&OS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=TS(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function LS({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(DS(f,`${u}-flow__node`)||DS(f,`${u}-flow__edge`)||DS(f,`${u}-flow__selection`)||DS(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||DS(f,c)&&h||DS(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function RS({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=ub().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=Mg(e).call(f);y({x:i.x,y:i.y,zoom:Pb(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(jS);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?X_:uv).transform(AS(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!Jb(D)||D<0?0:D);let A=k?MS({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):NS({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=PS({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=FS({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=IS({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let P=LS({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(P),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=ES(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=ES(e);return await g(n,t),n}function x(e){if(p){let t=ES(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?tb(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?X_:uv).scaleTo(AS(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?X_:uv).scaleBy(AS(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Jb(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var zS;(function(e){e.Line=`line`,e.Handle=`handle`})(zS||={});function BS({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function VS(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function HS(e,t){return Math.max(0,t-e)}function US(e,t){return Math.max(0,e-t)}function WS(e,t,n){return Math.max(0,t-e,e-n)}function GS(e,t){return e?!t:t}function KS(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=WS(E,h,g),j=WS(D,_,v);if(o){let e=0,t=0;c&&w<0?e=HS(y+w+O,o[0][0]):!c&&w>0&&(e=US(y+E+O,o[1][0])),l&&T<0?t=HS(b+T+k,o[0][1]):!l&&T>0&&(t=US(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=US(y+w,s[0][0]):!c&&w<0&&(e=HS(y+E,s[1][0])),l&&T>0?t=US(b+T,s[0][1]):!l&&T<0&&(t=HS(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=WS(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?US(b+k+E/C,o[1][1])*C:HS(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?HS(b+E/C,s[1][1])*C:US(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=WS(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?US(y+D*C+O,o[1][0])/C:HS(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?HS(y+D*C,s[1][0])/C:US(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(GS(c,l)?-w:w)/C:w=(GS(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var qS={width:0,height:0,x:0,y:0},JS={...qS,pointerX:0,pointerY:0,aspectRatio:1};function YS(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function XS({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=Mg(e),o={controlDirection:VS(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...qS},h={...JS};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:VS(e)};let g,_=null,v=[],y,b,x,S=!1,C=qg().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=fx(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=ix(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=YS(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=fx(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=KS(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=BS({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var ZS=o((e=>{var t=(h(),i(l)),n=Ta();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,u=t.useMemo,d=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=s(null);if(l.current===null){var f={hasValue:!1,value:null};l.current=f}else f=l.current;l=u(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,l[0],l[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}})),QS=n(o(((e,t)=>{t.exports=ZS()}))(),1),$S=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},eC=e=>e?$S(e):$S;h();var{useDebugValue:tC}=p,{useSyncExternalStoreWithSelector:nC}=QS.default,rC=e=>e;function iC(e,t=rC,n){let r=nC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tC(r),r}var aC=(e,t)=>{let n=eC(e),r=(e,r=t)=>iC(n,e,r);return Object.assign(r,n),r},oC=(e,t)=>e?aC(e,t):aC;function sC(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}N(),h();var cC=ue(null),lC=cC.Provider,uC=db.error001(`react`);function $(e,t){let n=s(cC);if(n===null)throw Error(uC);return iC(n,e,t)}function dC(){let e=s(cC);if(e===null)throw Error(uC);return L(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var fC={display:`none`},pC={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},mC=`react-flow__node-desc`,hC=`react-flow__edge-desc`,gC=`react-flow__aria-live`,_C=e=>e.ariaLiveMessage,vC=e=>e.ariaLabelConfig;function yC({rfId:e}){let t=$(_C);return U(`div`,{id:`${gC}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:pC,children:t})}function bC({rfId:e,disableKeyboardA11y:t}){let n=$(vC);return U(se,{children:[U(`div`,{id:`${mC}-${e}`,style:fC,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),U(`div`,{id:`${hC}-${e}`,style:fC,children:n[`edge.a11yDescription.default`]}),!t&&U(yC,{rfId:e})]})}var xC=S(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>U(`div`,{className:Dm([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));xC.displayName=`Panel`;var SC=`https://reactflow.dev?utm_source=attribution`;function CC({proOptions:e,position:t=`bottom-right`}){return k(()=>{},[]),e?.hideAttribution?null:U(xC,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${SC}`,children:U(`a`,{href:SC,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var wC=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},TC=e=>e.id;function EC(e,t){return sC(e.selectedNodes.map(TC),t.selectedNodes.map(TC))&&sC(e.selectedEdges.map(TC),t.selectedEdges.map(TC))}function DC({onSelectionChange:e}){let t=dC(),{selectedNodes:n,selectedEdges:r}=$(wC,EC);return k(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var OC=e=>!!e.onSelectionChangeHandlers;function kC({onSelectionChange:e}){let t=$(OC);return e||t?U(DC,{onSelectionChange:e}):null}var AC=[0,0],jC={x:0,y:0,zoom:1},MC=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],NC=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),PC={translateExtent:fb,nodeOrigin:AC,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function FC(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$(NC,sC),l=dC();k(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=PC,s()}),[]);let u=_(PC);return k(()=>{for(let s of MC){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:ux(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},MC.map(t=>e[t])),null}function IC(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function LC(e){let[t,n]=A(e===`system`?null:e);return k(()=>{if(e!==`system`){n(e);return}let t=IC(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?IC()?.matches?`dark`:`light`:t}var RC=typeof document<`u`?document:null;function zC(e=null,t={target:RC,actInsideInputWithModifier:!0}){let[n,r]=A(!1),i=_(!1),a=_(new Set([])),[o,s]=L(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
1164
|
+
`).replace(`
|
|
1165
|
+
|
|
1166
|
+
`,`
|
|
1167
|
+
+`).split(`
|
|
1168
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return k(()=>{let n=t?.target??RC,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&gx(e))return!1;let n=VC(e.code,s);if(a.current.add(e[n]),BC(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=VC(e.code,s);BC(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function BC(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function VC(e,t){return t.includes(e)?`code`:`key`}var HC=()=>{let e=dC();return L(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=nx(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Zb(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Qb(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function UC(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)WC(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function WC(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function GC(e,t){return UC(e,t)}function KC(e,t){return UC(e,t)}function qC(e,t){return{id:e,type:`select`,selected:t}}function JC(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(qC(a.id,e)))}return r}function YC({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function XC(e){return{id:e.id,type:`remove`}}var ZC=Yb(`React Flow`,`https://reactflow.dev/`);function QC(e,t,n={}){return kx(e,t,{...n,onError:n.onError??ZC})}var $C=e=>Cb(e),ew=e=>Sb(e);function tw(e){return S(e)}var nw=typeof window<`u`?m:k;function rw(e){let[t,n]=A(BigInt(0)),[r]=A(()=>iw(()=>n(e=>e+BigInt(1))));return nw(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function iw(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var aw=ue(null);function ow({children:e}){let t=dC(),n=rw(O(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=YC({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=rw(O(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(YC({items:s,lookup:o}))},[])),i=L(()=>({nodeQueue:n,edgeQueue:r}),[]);return U(aw.Provider,{value:i,children:e})}function sw(){let e=s(aw);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var cw=e=>!!e.panZoom;function lw(){let e=HC(),t=dC(),n=sw(),r=$(cw),i=L(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=$C(e)?e:n.get(e.id),a=i.parentId?sx(i.position,i.measured,i.parentId,n,r):i.position;return Hb({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&$C(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&ew(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Nb({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(XC);o?.(f),c(e)}if(m){let e=d.map(XC);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=qb(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=Hb(s?r:a),l=Kb(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=qb(e)?e:a(e);if(!r)return!1;let i=Kb(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Eb(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??lx();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return L(()=>({...i,...e,viewportInitialized:r}),[r])}var uw=e=>e.selected,dw=typeof window<`u`?window:void 0;function fw({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=dC(),{deleteElements:r}=lw(),i=zC(e,{actInsideInputWithModifier:!1}),a=zC(t,{target:dw});k(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(uw),edges:e.filter(uw)}),n.setState({nodesSelectionActive:!1})}},[i]),k(()=>{n.setState({multiSelectionActive:a})},[a])}function pw(e){let t=dC();k(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=px(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,db.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var mw={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},hw=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function gw({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=gb.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:v,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=dC(),w=_(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=$(hw,sC),A=zC(p),j=_();pw(w);let M=O(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[y,b]);return k(()=>{if(w.current){j.current=RS({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=j.current.getViewport();return C.setState({panZoom:j.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{j.current?.destroy()}}},[]),k(()=>{j.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:A,preventScrolling:m,noPanClassName:v,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:M,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,A,m,v,T,g,E,M,D,S,x]),U(`div`,{className:`react-flow__renderer`,ref:w,style:mw,children:h})}var _w=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vw(){let{userSelectionActive:e,userSelectionRect:t}=$(_w,sC);return e&&t?U(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var yw=(e,t)=>n=>{n.target===t.current&&e?.(n)},bw=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function xw({isSelecting:e,selectionKeyPressed:t,selectionMode:n=_b.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=_(0),v=dC(),{userSelectionActive:y,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=$(bw,sC),w=b&&(e||y),T=_(null),E=_(),D=_(new Set),O=_(new Set),A=_(!1),j=_(!1),M=_({x:0,y:0}),N=_(!1),P=e=>{if(j.current||A.current||v.getState().connection.inProgress){j.current=!1,A.current=!1;return}l?.(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},F=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},I=d?e=>d(e):void 0,L=e=>{j.current&&=(e.stopPropagation(),!1)},ee=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=v.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),j.current=!1;let{x:c,y:l}=vx(n.nativeEvent,E.current),u=Zb({x:c,y:l},a);v.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function te(e,t){let{userSelectionRect:r}=v.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=v.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Qb(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=O.current;D.current=new Set(Ob(a,m,i,n===_b.Partial,!0).map(e=>e.id)),O.current=new Set;let _=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&O.current.add(e)}}cx(h,D.current)||c(JC(a,D.current,!0)),cx(g,O.current)||l(JC(o,O.current)),v.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function R(){if(!i||!E.current)return;let[e,t]=Rb(M.current,E.current,C);S({x:e,y:t}).then(e=>{if(!j.current||!e){g.current=requestAnimationFrame(R);return}let{x:t,y:n}=M.current;te(t,n),g.current=requestAnimationFrame(R)})}let z=()=>{cancelAnimationFrame(g.current),g.current=0,N.current=!1};return k(()=>()=>z(),[]),U(`div`,{className:Dm([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:x,selection:e}]),onClick:w?void 0:yw(P,T),onContextMenu:yw(F,T),onWheel:yw(I,T),onPointerEnter:w?void 0:f,onPointerMove:w?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=v.getState();if(!E.current||!n)return;let{x:o,y:c}=vx(e.nativeEvent,E.current);M.current={x:o,y:c};let l=Qb({x:n.startX,y:n.startY},r);if(!j.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}j.current=!0,N.current||=(R(),!0),te(o,c)}:p,onPointerUp:e=>{if(!w){e.target===T.current&&v.getState().connection.inProgress&&(A.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!y&&e.target===T.current&&v.getState().userSelectionRect&&P?.(e),v.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c?.(e),v.setState({nodesSelectionActive:D.current.size>0})),z())},onPointerCancel:w?e=>{e.target?.releasePointerCapture?.(e.pointerId),z()}:void 0,onPointerDownCapture:w?ee:void 0,onClickCapture:w?L:void 0,onPointerLeave:m,ref:T,style:mw,children:[h,U(vw,{})]})}function Sw({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,db.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function Cw({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=dC(),[c,l]=A(!1),u=_();return k(()=>{if(!t)return u.current=pS({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Sw({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),k(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var ww=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Tw(){let e=dC();return O(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=ww(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=Xb(t,i));let{position:a,positionAbsolute:s}=Mb({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Ew=ue(null),Dw=Ew.Provider;Ew.Consumer;var Ow=()=>s(Ew),kw=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Aw=ue(null);function jw({children:e}){let t=$(kw,sC);return U(Aw.Provider,{value:t,children:e})}function Mw(){let e=s(Aw);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var Nw={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Pw=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return Nw;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===hb.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Fw({type:e=`source`,position:t=Q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=dC(),_=Ow(),{connectOnClick:v,noPanClassName:y,rfId:b}=Mw(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=$(Pw(_,m,e),sC);_||g.getState().onError?.(`010`,db.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(QC(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=_x(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();CS.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return U(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Dm([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=mx(t.target),h=n||c,{connection:v,isValid:y}=CS.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Iw=y(tw(Fw));function Lw({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return U(se,{children:[e?.label,U(Iw,{type:`source`,position:n,isConnectable:t})]})}function Rw({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return U(se,{children:[U(Iw,{type:`target`,position:n,isConnectable:t}),e?.label,U(Iw,{type:`source`,position:r,isConnectable:t})]})}function zw(){return null}function Bw({data:e,isConnectable:t,targetPosition:n=Q.Top}){return U(se,{children:[U(Iw,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Vw={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Hw={input:Lw,default:Rw,output:Bw,group:zw};function Uw(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Ww=e=>{let{width:t,height:n,x:r,y:i}=Db(e.nodeLookup,{filter:e=>!!e.selected});return{width:Jb(t)?t:null,height:Jb(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Gw({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=dC(),{width:i,height:a,transformString:o,userSelectionActive:s}=$(Ww,sC),c=Tw(),l=_(null);k(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Cw({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return U(`div`,{className:Dm([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:U(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Vw,e.key)&&(e.preventDefault(),c({direction:Vw[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var Kw=typeof window<`u`?window:void 0,qw=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Jw({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:ee}=$(qw,sC),te=zC(l,{target:Kw}),R=zC(h,{target:Kw}),z=R||w,B=R||b,ne=u&&z!==!0,V=te||ee||ne;return fw({deleteKeyCode:c,multiSelectionKeyCode:m}),U(gw,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:B,panActivationKeyPressed:R,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!te&&z,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:ne,children:U(xw,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:z,autoPanOnSelection:T,isSelecting:!!V,selectionMode:d,selectionKeyPressed:te,paneClickDistance:s,selectionOnDrag:ne,children:[e,L&&U(Gw,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}Jw.displayName=`FlowRenderer`;var Yw=y(Jw),Xw=e=>t=>e?Ob(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Zw(e){return $(O(Xw(e),[e]),sC)}var Qw=e=>e.updateNodeInternals;function $w(){let e=$(Qw),[t]=A(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return k(()=>()=>{t?.disconnect()},[t]),t}function eT({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=dC(),a=_(null),o=_(null),s=_(e.sourcePosition),c=_(e.targetPosition),l=_(t),u=n&&!!e.internals.handleBounds;return k(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),k(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),k(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function tT({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=$(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},sC),S=y.type||`default`,C=g?.[S]||Hw[S];C===void 0&&(v?.(`003`,db.error003(S)),S=`default`,C=g?.default||Hw.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=dC(),k=ox(y),A=eT({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Cw({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Tw();if(y.hidden)return null;let N=ax(y),P=Uw(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,ee=i?e=>i(e,{...b.userNode}):void 0,te=a?e=>a(e,{...b.userNode}):void 0,R=o?e=>o(e,{...b.userNode}):void 0,z=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Sw({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},B=t=>{if(!(gx(t.nativeEvent)||m)){if(pb.includes(t.key)&&T){let n=t.key===`Escape`;Sw({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(Vw,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:Vw[t.key],factor:t.shiftKey?4:1})}}},ne=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Ob(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return U(`div`,{className:Dm([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:ee,onContextMenu:te,onClick:z,onDoubleClick:R,onKeyDown:D?B:void 0,tabIndex:D?0:void 0,onFocus:D?ne:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${mC}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:U(Dw,{value:e,children:U(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var nT=y(tT),rT=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iT(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=$(rT,sC),a=Zw(e.onlyRenderVisibleElements),o=$w();return U(`div`,{className:`react-flow__nodes`,style:mw,children:a.map(a=>U(nT,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}iT.displayName=`NodeRenderer`;var aT=y(iT);function oT(e){return $(O(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Ex({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),sC)}var sT=({color:e=`none`,strokeWidth:t=1})=>U(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),cT=({color:e=`none`,strokeWidth:t=1})=>U(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),lT={[bb.Arrow]:sT,[bb.ArrowClosed]:cT};function uT(e){let t=dC();return L(()=>Object.prototype.hasOwnProperty.call(lT,e)?lT[e]:(t.getState().onError?.(`009`,db.error009(e)),null),[e])}var dT=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=uT(t);return c?U(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:U(c,{color:n,strokeWidth:o})}):null},fT=({defaultColor:e,rfId:t})=>{let n=$(e=>e.edges),r=$(e=>e.defaultEdgeOptions),i=L(()=>Ux(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?U(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:U(`defs`,{children:i.map(e=>U(dT,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};fT.displayName=`MarkerDefinitions`;var pT=y(fT);function mT({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=A({x:1,y:0,width:0,height:0}),p=Dm([`react-flow__edge-textwrapper`,l]),m=_(null);return k(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?U(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&U(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),U(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}mT.displayName=`EdgeText`;var hT=y(mT);function gT({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return U(se,{children:[U(`path`,{...u,d:e,fill:`none`,className:Dm([`react-flow__edge-path`,u.className])}),l?U(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Jb(t)&&Jb(n)?U(hT,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function _T({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function vT({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top}){let[o,s]=_T({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=_T({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=bx({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function yT(e){return y(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=vT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return U(gT,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var bT=yT({isInternal:!1}),xT=yT({isInternal:!0});bT.displayName=`SimpleBezierEdge`,xT.displayName=`SimpleBezierEdgeInternal`;function ST(e){return y(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Q.Bottom,targetPosition:m=Q.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Ix({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return U(gT,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var CT=ST({isInternal:!1}),wT=ST({isInternal:!0});CT.displayName=`SmoothStepEdge`,wT.displayName=`SmoothStepEdgeInternal`;function TT(e){return y(({id:t,...n})=>{let r=e.isInternal?void 0:t;return U(CT,{...n,id:r,pathOptions:L(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var ET=TT({isInternal:!1}),DT=TT({isInternal:!0});ET.displayName=`StepEdge`,DT.displayName=`StepEdgeInternal`;function OT(e){return y(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Ax({sourceX:n,sourceY:r,targetX:i,targetY:a});return U(gT,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var kT=OT({isInternal:!1}),AT=OT({isInternal:!0});kT.displayName=`StraightEdge`,AT.displayName=`StraightEdgeInternal`;function jT(e){return y(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Q.Bottom,targetPosition:s=Q.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Cx({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return U(gT,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var MT=jT({isInternal:!1}),NT=jT({isInternal:!0});MT.displayName=`BezierEdge`,NT.displayName=`BezierEdgeInternal`;var PT={default:NT,straight:AT,step:DT,smoothstep:wT,simplebezier:xT},FT={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},IT=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,LT=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,RT=`react-flow__edgeupdater`;function zT({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return U(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Dm([RT,`${RT}-${s}`]),cx:IT(t,r,e),cy:LT(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function BT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=dC(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;CS.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return U(se,{children:[(e===!0||e===`source`)&&U(zT,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&U(zT,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function VT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:v,disableKeyboardA11y:y}){let b=$(t=>t.edgeLookup.get(e)),x=$(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||PT[S];C===void 0&&(v?.(`011`,db.error011(S)),S=`default`,C=h?.default||PT.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=_(null),[k,j]=A(!1),[M,N]=A(!1),P=dC(),{zIndex:F=b.zIndex,sourceX:I,sourceY:ee,targetX:te,targetY:R,sourcePosition:z,targetPosition:B}=$(O(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return FT;let i=Rx({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),a=Tx({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||FT,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,v]),sC),ne=L(()=>b.markerStart?`url('#${Hx(b.markerStart,m)}')`:void 0,[b.markerStart,m]),V=L(()=>b.markerEnd?`url('#${Hx(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||I===null||ee===null||te===null||R===null)return null;let re=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=P.getState();E&&(P.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},ie=a?e=>{a(e,{...b})}:void 0,ae=o?e=>{o(e,{...b})}:void 0,oe=s?e=>{s(e,{...b})}:void 0,se=c?e=>{c(e,{...b})}:void 0,ce=l?e=>{l(e,{...b})}:void 0;return U(`svg`,{style:{zIndex:F},children:U(`g`,{className:Dm([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:k,selectable:E}]),onClick:re,onDoubleClick:ie,onContextMenu:ae,onMouseEnter:oe,onMouseMove:se,onMouseLeave:ce,onKeyDown:w?t=>{if(!y&&pb.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=P.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${hC}-${m}`:void 0,ref:D,...b.domAttributes,children:[!M&&U(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:I,sourceY:ee,targetX:te,targetY:R,sourcePosition:z,targetPosition:B,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:ne,markerEnd:V,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&U(BT,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:I,sourceY:ee,targetX:te,targetY:R,sourcePosition:z,targetPosition:B,setUpdateHover:j,setReconnecting:N})]})})}var HT=y(VT),UT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function WT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=$(UT,sC),b=oT(t);return U(`div`,{className:`react-flow__edges`,children:[U(pT,{defaultColor:e,rfId:n}),b.map(e=>U(HT,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}WT.displayName=`EdgeRenderer`;var GT=y(WT),KT=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function qT({children:e}){let t=dC(),n=_(null),[r]=A(()=>t.getState().transform);return nw(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=KT(r)))};return r(),t.subscribe(r)},[t]),U(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:KT(r)},children:e})}function JT(e){let t=lw(),n=_(!1);k(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var YT=e=>e.panZoom?.syncViewport;function XT(e){let t=$(YT),n=dC();return k(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ZT(e){return e.connection.inProgress?{...e.connection,to:Zb(e.connection.to,e.transform)}:{...e.connection}}function QT(e){return e?t=>e(ZT(t)):ZT}function $T(e){return $(QT(e),sC)}var eE=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tE({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=$(eE,sC);return a&&i&&c?U(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:U(`g`,{className:Dm([`react-flow__connection`,dx(s)]),children:U(nE,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var nE=({style:e,type:t=yb.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=$T();if(!i)return;if(n)return U(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:dx(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case yb.Bezier:[m]=Cx(h);break;case yb.SimpleBezier:[m]=vT(h);break;case yb.Step:[m]=Ix({...h,borderRadius:0});break;case yb.SmoothStep:[m]=Ix(h);break;default:[m]=Ax(h)}return U(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};nE.displayName=`ConnectionLine`;var rE={};function iE(e=rE){_(e),dC(),k(()=>{},[e])}function aE(){dC(),_(!1),k(()=>{},[])}function oE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:ee,panOnDrag:te,autoPanOnSelection:R,onPaneClick:z,onPaneMouseEnter:B,onPaneMouseMove:ne,onPaneMouseLeave:V,onPaneScroll:re,onPaneContextMenu:ie,paneClickDistance:ae,nodeClickDistance:oe,onEdgeContextMenu:se,onEdgeMouseEnter:ce,onEdgeMouseMove:le,onEdgeMouseLeave:ue,reconnectRadius:de,onReconnect:fe,onReconnectStart:pe,onReconnectEnd:H,noDragClassName:me,noWheelClassName:he,noPanClassName:ge,disableKeyboardA11y:_e,nodeExtent:ve,rfId:ye,viewport:be,onViewportChange:xe,nodesDraggable:Se}){return iE(e),iE(t),aE(),JT(n),XT(be),U(Yw,{onPaneClick:z,onPaneMouseEnter:B,onPaneMouseMove:ne,onPaneMouseLeave:V,onPaneContextMenu:ie,onPaneScroll:re,paneClickDistance:ae,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:ee,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:te,autoPanOnSelection:R,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:me,noWheelClassName:he,noPanClassName:ge,disableKeyboardA11y:_e,onViewportChange:xe,isControlledViewport:!!be,children:U(qT,{children:[U(GT,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:fe,onReconnectStart:pe,onReconnectEnd:H,onlyRenderVisibleElements:T,onEdgeContextMenu:se,onEdgeMouseEnter:ce,onEdgeMouseMove:le,onEdgeMouseLeave:ue,reconnectRadius:de,defaultMarkerColor:M,noPanClassName:ge,disableKeyboardA11y:_e,rfId:ye}),U(tE,{style:h,type:m,component:g,containerStyle:_}),U(`div`,{className:`react-flow__edgelabel-renderer`}),U(aT,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:oe,onlyRenderVisibleElements:T,noPanClassName:ge,noDragClassName:me,disableKeyboardA11y:_e,nodeExtent:ve,rfId:ye,nodesDraggable:Se}),U(`div`,{className:`react-flow__viewport-portal`})]})})}oE.displayName=`GraphView`;var sE=y(oE),cE=Yb(`React Flow`,`https://reactflow.dev/`),lE=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??fb;sS(h,g,_);let{nodesInitialized:x}=Qx(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=nx(Db(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:fb,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hb.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...vb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:cE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:mb,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},uE=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>oC((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await jb({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...lE({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Qx(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();sS(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=iS(e,n,r,i,a,o,l);d&&(Yx(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=Bx(e,o.fromHandle,Q.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=rS(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(GC(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(KC(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>qC(e,!0)));return}i(JC(r,new Set([...e]),!0)),a(JC(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>qC(e,!0)));return}a(JC(n,new Set([...e]))),i(JC(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(qC(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(qC(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,qC(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,qC(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(Qx(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return aS({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...vb}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...lE()})}},Object.is);function dE({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=A(()=>uE({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return U(lC,{value:m,children:U(ow,{children:U(jw,{children:p})})})}function fE({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:c,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m}){return s(cC)?U(se,{children:e}):U(dE,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:c,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:e})}var pE={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function mE({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onBeforeDelete:L,connectionMode:ee,connectionLineType:te=yb.Bezier,connectionLineStyle:R,connectionLineComponent:z,connectionLineContainerStyle:B,deleteKeyCode:ne=`Backspace`,selectionKeyCode:V=`Shift`,selectionOnDrag:re=!1,selectionMode:ie=_b.Full,panActivationKeyCode:ae=`Space`,multiSelectionKeyCode:oe=rx()?`Meta`:`Control`,zoomActivationKeyCode:se=rx()?`Meta`:`Control`,snapToGrid:ce,snapGrid:le,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:de,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:H,nodesFocusable:me,nodeOrigin:he=AC,edgesFocusable:ge,edgesReconnectable:_e,elementsSelectable:ve=!0,defaultViewport:ye=jC,minZoom:be=.5,maxZoom:xe=2,translateExtent:Se=fb,preventScrolling:Ce=!0,nodeExtent:we,defaultMarkerColor:Te=`#b1b1b7`,zoomOnScroll:Ee=!0,zoomOnPinch:De=!0,panOnScroll:Oe=!1,panOnScrollSpeed:ke=.5,panOnScrollMode:Ae=gb.Free,zoomOnDoubleClick:je=!0,panOnDrag:Me=!0,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le=1,nodeClickDistance:Re=0,children:ze,onReconnect:Be,onReconnectStart:K,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe=10,onNodesChange:Je,onEdgesChange:Ye,noDragClassName:Xe=`nodrag`,noWheelClassName:Ze=`nowheel`,noPanClassName:Qe=`nopan`,fitView:$e,fitViewOptions:et,connectOnClick:tt,attributionPosition:nt,proOptions:rt,defaultEdgeOptions:it,elevateNodesOnSelect:at=!0,elevateEdgesOnSelect:ot=!1,disableKeyboardA11y:st=!1,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanOnSelection:ut=!0,autoPanSpeed:dt,connectionRadius:ft,isValidConnection:pt,onError:mt,style:ht,id:gt,nodeDragThreshold:_t,connectionDragThreshold:vt,viewport:yt,onViewportChange:bt,width:xt,height:St,colorMode:Ct=`light`,debug:wt,onScroll:Tt,ariaLabelConfig:Et,zIndexMode:Dt=`basic`,...Ot},kt){let At=gt||`1`,jt=LC(Ct),Mt=O(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Tt?.(e)},[Tt]);return U(`div`,{"data-testid":`rf__wrapper`,...Ot,onScroll:Mt,style:{...ht,...pE},ref:kt,className:Dm([`react-flow`,i,jt]),id:gt,role:`application`,children:U(fE,{nodes:e,edges:t,width:xt,height:St,fitView:$e,fitViewOptions:et,minZoom:be,maxZoom:xe,nodeOrigin:he,nodeExtent:we,zIndexMode:Dt,children:[U(FC,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:fe,autoPanOnNodeFocus:pe,nodesConnectable:H,nodesFocusable:me,edgesFocusable:ge,edgesReconnectable:_e,elementsSelectable:ve,elevateNodesOnSelect:at,elevateEdgesOnSelect:ot,minZoom:be,maxZoom:xe,nodeExtent:we,onNodesChange:Je,onEdgesChange:Ye,snapToGrid:ce,snapGrid:le,connectionMode:ee,translateExtent:Se,connectOnClick:tt,defaultEdgeOptions:it,fitView:$e,fitViewOptions:et,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Qe,nodeOrigin:he,rfId:At,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanSpeed:dt,onError:mt,connectionRadius:ft,isValidConnection:pt,selectNodesOnDrag:de,nodeDragThreshold:_t,connectionDragThreshold:vt,onBeforeDelete:L,debug:wt,ariaLabelConfig:Et,zIndexMode:Dt}),U(sE,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:te,connectionLineStyle:R,connectionLineComponent:z,connectionLineContainerStyle:B,selectionKeyCode:V,selectionOnDrag:re,selectionMode:ie,deleteKeyCode:ne,multiSelectionKeyCode:oe,panActivationKeyCode:ae,zoomActivationKeyCode:se,onlyRenderVisibleElements:ue,defaultViewport:ye,translateExtent:Se,minZoom:be,maxZoom:xe,preventScrolling:Ce,zoomOnScroll:Ee,zoomOnPinch:De,zoomOnDoubleClick:je,panOnScroll:Oe,panOnScrollSpeed:ke,panOnScrollMode:Ae,panOnDrag:Me,autoPanOnSelection:ut,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le,nodeClickDistance:Re,onSelectionContextMenu:P,onSelectionStart:F,onSelectionEnd:I,onReconnect:Be,onReconnectStart:K,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe,defaultMarkerColor:Te,noDragClassName:Xe,noWheelClassName:Ze,noPanClassName:Qe,rfId:At,disableKeyboardA11y:st,nodeExtent:we,viewport:yt,onViewportChange:bt,nodesDraggable:fe}),U(kC,{onSelectionChange:A}),ze,U(CC,{proOptions:rt,position:nt}),U(bC,{rfId:At,disableKeyboardA11y:st})]})})}var hE=tw(mE);db.error014();function gE({dimensions:e,lineWidth:t,variant:n,className:r}){return U(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Dm([`react-flow__background-pattern`,n,r])})}function _E({radius:e,className:t}){return U(`circle`,{cx:e,cy:e,r:e,className:Dm([`react-flow__background-pattern`,`dots`,t])})}var vE;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(vE||={});var yE={[vE.Dots]:1,[vE.Lines]:1,[vE.Cross]:6},bE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function xE({id:e,variant:t=vE.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=_(null),{transform:f,patternId:p}=$(bE,sC),m=r||yE[t],h=t===vE.Dots,g=t===vE.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:y,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${p}${e||``}`;return U(`svg`,{className:Dm([`react-flow__background`,l]),style:{...c,...mw,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[U(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?U(_E,{radius:b/2,className:u}):U(gE,{dimensions:S,lineWidth:i,variant:t,className:u})}),U(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}xE.displayName=`Background`;var SE=y(xE);function CE(){return U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:U(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function wE(){return U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:U(`path`,{d:`M0 0h32v4.2H0z`})})}function TE(){return U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:U(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function EE(){return U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:U(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function DE(){return U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:U(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function OE({children:e,className:t,...n}){return U(`button`,{type:`button`,className:Dm([`react-flow__controls-button`,t]),...n,children:e})}var kE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function AE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=dC(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=$(kE,sC),{zoomIn:y,zoomOut:b,fitView:x}=lw();return U(xC,{className:Dm([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&U(se,{children:[U(OE,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:U(CE,{})}),U(OE,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:U(wE,{})})]}),n&&U(OE,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:U(TE,{})}),r&&U(OE,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:U(h?DE:EE,{})}),u]})}AE.displayName=`Controls`,y(AE);function jE({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return U(`rect`,{className:Dm([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var ME=y(jE),NE=e=>e.nodes.map(e=>e.id),PE=e=>e instanceof Function?e:()=>e;function FE({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=ME,onClick:o}){let s=$(NE,sC),c=PE(t),l=PE(e),u=PE(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return U(se,{children:s.map(e=>U(LE,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function IE({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=$(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=ax(r);return{node:r,x:i,y:a,width:o,height:s}},sC);return!l||l.hidden||!ox(l)?null:U(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var LE=y(IE),RE=y(FE),zE=200,BE=150,VE=e=>!e.hidden,HE=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Wb(Db(e.nodeLookup,{filter:VE}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},UE=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,WE=(e,t)=>UE(e.viewBB,t.viewBB)&&UE(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,GE=`react-flow__minimap-desc`;function KE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:x=5}){let S=dC(),C=_(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:A,flowWidth:j,flowHeight:M,ariaLabelConfig:N}=$(HE,WE),P=e?.width??zE,F=e?.height??BE,I=w.width/P,L=w.height/F,ee=Math.max(I,L),te=ee*P,R=ee*F,z=x*ee,B=w.x-(te-w.width)/2-z,ne=w.y-(R-w.height)/2-z,V=te+z*2,re=R+z*2,ie=`${GE}-${D}`,ae=_(0),oe=_();ae.current=ee,k(()=>{let e=S.getState().panZoom;if(C.current&&e)return oe.current=wS({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>ae.current}),()=>{oe.current?.destroy()}},[T]),k(()=>{oe.current?.update({translateExtent:A,width:j,height:M,inversePan:y,pannable:h,zoomStep:b,zoomable:g})},[h,g,y,b,A,j,M]);let se=p?e=>{let[t,n]=oe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ce=O((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),le=m?ce:void 0,ue=v??N[`minimap.ariaLabel`];return U(xC,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ee:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Dm([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:U(`svg`,{width:P,height:F,viewBox:`${B} ${ne} ${V} ${re}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ie,ref:C,onClick:se,children:[ue&&U(`title`,{id:ie,children:ue}),U(RE,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),U(`path`,{className:`react-flow__minimap-mask`,d:`M${B-z},${ne-z}h${V+z*2}v${re+z*2}h${-V-z*2}z
|
|
1169
|
+
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}KE.displayName=`MiniMap`,y(KE);var qE=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,JE={[zS.Line]:`right`,[zS.Handle]:`bottom-right`};function YE({nodeId:e,position:t,variant:n=zS.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:v}){let y=Ow(),b=typeof e==`string`?e:y,x=dC(),S=_(null),C=n===zS.Handle,w=$(O(qE(C&&p),[C,p]),sC),T=_(null),E=t??JE[n];return k(()=>{if(!(!S.current||!b))return T.current||=XS({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=rS([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...sx({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:v,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,v,m]),U(`div`,{className:Dm([`react-flow__resize-control`,`nodrag`,...E.split(`-`),n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}y(YE);var XE=40,ZE=280,QE=98,$E=24,eD=e=>{let t=e.split(/\s+/).filter(Boolean),n=[],r=``;for(let e of t){let t=r?`${r} ${e}`:e;if(t.length<=$E){r=t;continue}if(n.length===1)break;r&&n.push(r),r=e}r&&n.length<2&&n.push(r);let i=n.slice(0,2);return i.join(` `).length<e.length&&i.length&&(i[i.length-1]=`${i[i.length-1].slice(0,$E-1)}…`),i.length?i:[e.slice(0,$E)]},tD=(e,t)=>{let n=lm(t.hover,e.edges),r=new Set(e.nodes.map(e=>e.uri)),i=e.nodes.map(e=>{let r=um(e);return{id:e.uri,type:`work`,position:{x:XE+e.column*ZE,y:XE+e.row*QE},width:190,height:74,draggable:!1,selectable:!1,data:{uri:e.uri,title:r,lines:eD(r),meta:[ym(e.format),e.episodeCount?`${e.episodeCount} ep`:void 0].filter(Boolean).join(` · `),current:t.current.has(e.uri),lit:n.nodes.has(e.uri)}}}),a=e=>t.hover?.kind===`node`&&(e.from===t.hover.uri||e.to===t.hover.uri),o=e.chain.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>({id:`chain\u0000${e.from}\u0000${e.to}`,type:`chain`,source:e.from,target:e.to,data:{kind:`chain`,label:``,lit:a(e)}})),s=e.edges.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>{let t=cm(e);return{id:t,type:`relation`,source:e.from,target:e.to,data:{kind:`relation`,label:_m(e.relation).toUpperCase(),lit:n.edges.has(t)}}});return{nodes:i,edges:[...o,...s]}};x();var nD=B`
|
|
1170
|
+
display: inline-flex;
|
|
1171
|
+
align-items: center;
|
|
1172
|
+
gap: 0.6rem;
|
|
1173
|
+
padding: 0.5rem 1.1rem;
|
|
1174
|
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
1175
|
+
border-radius: 0.5rem;
|
|
1176
|
+
background: transparent;
|
|
1177
|
+
color: rgba(255, 255, 255, 0.75);
|
|
1178
|
+
font-family: inherit;
|
|
1179
|
+
font-size: 1.3rem;
|
|
1180
|
+
font-weight: 600;
|
|
1181
|
+
cursor: pointer;
|
|
1182
|
+
transition: all 0.15s ease;
|
|
1183
|
+
|
|
1184
|
+
&:hover {
|
|
1185
|
+
color: #fff;
|
|
1186
|
+
border-color: rgba(255, 255, 255, 0.4);
|
|
1187
|
+
background: rgba(255, 255, 255, 0.06);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
svg { width: 1.5rem; height: 1.5rem; }
|
|
1191
|
+
`,rD=B`
|
|
1192
|
+
display: flex;
|
|
1193
|
+
align-items: center;
|
|
1194
|
+
justify-content: center;
|
|
1195
|
+
padding: 4rem;
|
|
1196
|
+
background: rgba(0, 0, 0, 0.75);
|
|
1197
|
+
z-index: ${Md.franchiseDialog};
|
|
1198
|
+
|
|
1199
|
+
.sheet {
|
|
1200
|
+
position: relative;
|
|
1201
|
+
display: flex;
|
|
1202
|
+
flex-direction: column;
|
|
1203
|
+
width: 100%;
|
|
1204
|
+
height: 100%;
|
|
1205
|
+
max-width: 170rem;
|
|
1206
|
+
background: rgb(18, 18, 20);
|
|
1207
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
1208
|
+
border-radius: 0.8rem;
|
|
1209
|
+
overflow: hidden;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.bar {
|
|
1213
|
+
display: flex;
|
|
1214
|
+
align-items: center;
|
|
1215
|
+
gap: 2rem;
|
|
1216
|
+
/* right padding clears the close button, which is positioned rather than in the flow */
|
|
1217
|
+
padding: 1.5rem 7rem 1.5rem 2rem;
|
|
1218
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
1219
|
+
|
|
1220
|
+
& > .title {
|
|
1221
|
+
font-size: 1.8rem;
|
|
1222
|
+
font-weight: 700;
|
|
1223
|
+
color: #fff;
|
|
1224
|
+
flex-shrink: 0;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
.close {
|
|
1230
|
+
position: absolute;
|
|
1231
|
+
top: 1.4rem;
|
|
1232
|
+
right: 2rem;
|
|
1233
|
+
display: flex;
|
|
1234
|
+
align-items: center;
|
|
1235
|
+
justify-content: center;
|
|
1236
|
+
width: 3.4rem;
|
|
1237
|
+
height: 3.4rem;
|
|
1238
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
1239
|
+
border-radius: 50%;
|
|
1240
|
+
background: transparent;
|
|
1241
|
+
color: rgba(255, 255, 255, 0.7);
|
|
1242
|
+
cursor: pointer;
|
|
1243
|
+
|
|
1244
|
+
&:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
|
|
1245
|
+
svg { width: 1.7rem; height: 1.7rem; }
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/* Over the canvas rather than up in the bar, so the control sits with the thing it controls. It is
|
|
1249
|
+
the one part of the surface that is NOT draggable, hence the pointer handlers it stops. */
|
|
1250
|
+
.kinds {
|
|
1251
|
+
position: absolute;
|
|
1252
|
+
top: 1.2rem;
|
|
1253
|
+
left: 1.2rem;
|
|
1254
|
+
z-index: 1;
|
|
1255
|
+
display: flex;
|
|
1256
|
+
flex-direction: column;
|
|
1257
|
+
gap: 0.2rem;
|
|
1258
|
+
padding: 0.9rem 1.1rem;
|
|
1259
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
1260
|
+
border-radius: 0.6rem;
|
|
1261
|
+
background: rgba(18, 18, 20, 0.9);
|
|
1262
|
+
backdrop-filter: blur(6px);
|
|
1263
|
+
cursor: default;
|
|
1264
|
+
|
|
1265
|
+
& > .legend {
|
|
1266
|
+
font-size: 1.1rem;
|
|
1267
|
+
font-weight: 700;
|
|
1268
|
+
letter-spacing: 0.06em;
|
|
1269
|
+
text-transform: uppercase;
|
|
1270
|
+
color: rgba(255, 255, 255, 0.4);
|
|
1271
|
+
margin-bottom: 0.4rem;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
& > label {
|
|
1275
|
+
display: flex;
|
|
1276
|
+
align-items: center;
|
|
1277
|
+
gap: 0.7rem;
|
|
1278
|
+
font-size: 1.3rem;
|
|
1279
|
+
font-weight: 600;
|
|
1280
|
+
color: rgba(255, 255, 255, 0.55);
|
|
1281
|
+
cursor: pointer;
|
|
1282
|
+
white-space: nowrap;
|
|
1283
|
+
|
|
1284
|
+
&.on { color: #fff; }
|
|
1285
|
+
|
|
1286
|
+
input {
|
|
1287
|
+
width: 1.4rem;
|
|
1288
|
+
height: 1.4rem;
|
|
1289
|
+
margin: 0;
|
|
1290
|
+
accent-color: rgb(61, 180, 242);
|
|
1291
|
+
cursor: pointer;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
.canvas {
|
|
1297
|
+
flex: 1;
|
|
1298
|
+
/* HIDDEN, not auto. The drawing is moved by a transform rather than by a scroll offset, so there
|
|
1299
|
+
is nothing here to scroll and no content bounds to be stopped by: the surface is unbounded in
|
|
1300
|
+
every direction and at every zoom. */
|
|
1301
|
+
overflow: hidden;
|
|
1302
|
+
position: relative;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/* the library paints its own surface, so the app's dark ground is stated rather than inherited:
|
|
1306
|
+
its default is a light one and the modal around this box is not. The dot grid is the library's
|
|
1307
|
+
own Background component now, registered with the transform by it rather than by hand. */
|
|
1308
|
+
.react-flow { background-color: rgb(9, 9, 10); }
|
|
1309
|
+
.react-flow__pane { cursor: grab; }
|
|
1310
|
+
.react-flow__pane.dragging { cursor: grabbing; }
|
|
1311
|
+
.react-flow__attribution { background: rgba(0, 0, 0, 0.4); a { color: rgba(255, 255, 255, 0.4); } }
|
|
1312
|
+
/* the handles carry the geometry and nothing else: nobody connects this graph by hand */
|
|
1313
|
+
.react-flow__handle { opacity: 0; pointer-events: none; }
|
|
1314
|
+
|
|
1315
|
+
/* a relationship a source stated */
|
|
1316
|
+
.edge {
|
|
1317
|
+
fill: none;
|
|
1318
|
+
stroke: rgba(255, 255, 255, 0.22);
|
|
1319
|
+
stroke-width: 1.5;
|
|
1320
|
+
stroke-dasharray: 4 3;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/* the reading order, derived from the dates: solid, brighter, and never labelled */
|
|
1324
|
+
.chain {
|
|
1325
|
+
fill: none;
|
|
1326
|
+
stroke: rgba(61, 180, 242, 0.55);
|
|
1327
|
+
stroke-width: 2;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.edge-label {
|
|
1331
|
+
fill: rgba(255, 255, 255, 0.5);
|
|
1332
|
+
font-size: 10px;
|
|
1333
|
+
font-weight: 700;
|
|
1334
|
+
letter-spacing: 0.04em;
|
|
1335
|
+
text-anchor: middle;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/* An HTML box rather than an SVG one, which is what the move to xyflow bought here. The old
|
|
1339
|
+
version avoided foreignObject on purpose, since it is the one thing that renders differently
|
|
1340
|
+
across engines, and paid for it by breaking every title into lines by CHARACTER COUNT. The lines
|
|
1341
|
+
are still computed (see titleLines), because two of them is a deliberate cap rather than a
|
|
1342
|
+
limitation, but they are laid out by the browser now. */
|
|
1343
|
+
.work-node {
|
|
1344
|
+
display: flex;
|
|
1345
|
+
flex-direction: column;
|
|
1346
|
+
align-items: center;
|
|
1347
|
+
justify-content: center;
|
|
1348
|
+
gap: 0.2rem;
|
|
1349
|
+
box-sizing: border-box;
|
|
1350
|
+
width: ${190}px;
|
|
1351
|
+
height: ${74}px;
|
|
1352
|
+
padding: 0.4rem 0.6rem;
|
|
1353
|
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
|
1354
|
+
border-radius: 6px;
|
|
1355
|
+
background: rgb(28, 28, 30);
|
|
1356
|
+
text-align: center;
|
|
1357
|
+
text-decoration: none;
|
|
1358
|
+
overflow: hidden;
|
|
1359
|
+
|
|
1360
|
+
&:hover { background: rgb(42, 42, 46); border-color: rgba(255, 255, 255, 0.35); }
|
|
1361
|
+
&.current { border-color: rgb(61, 180, 242); border-width: 2px; }
|
|
1362
|
+
|
|
1363
|
+
.title { color: rgba(255, 255, 255, 0.95); font-size: 12px; font-weight: 700; line-height: 1.25; }
|
|
1364
|
+
.meta { color: rgba(255, 255, 255, 0.5); font-size: 10px; }
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/* One colour for "what the pointer is talking about", amber so it never reads as the blue that
|
|
1368
|
+
means "the work you came from". Both hovering a work and hovering an arrow use it, which is what
|
|
1369
|
+
makes the two gestures feel like the same question asked from either end. */
|
|
1370
|
+
.work-node.lit {
|
|
1371
|
+
border-color: rgb(255, 176, 62);
|
|
1372
|
+
border-width: 2px;
|
|
1373
|
+
background: rgb(52, 42, 26);
|
|
1374
|
+
|
|
1375
|
+
.title { color: #fff; }
|
|
1376
|
+
}
|
|
1377
|
+
.edge.lit { stroke: rgb(255, 176, 62); stroke-width: 2.5; stroke-dasharray: none; }
|
|
1378
|
+
.chain.lit { stroke: rgb(255, 176, 62); stroke-width: 3; }
|
|
1379
|
+
.edge-label.lit { fill: rgb(255, 176, 62); }
|
|
1380
|
+
|
|
1381
|
+
/* the text alone is a thin target, so each label carries an invisible pad it can be caught by */
|
|
1382
|
+
.label-hit { fill: transparent; cursor: pointer; }
|
|
1383
|
+
`,iD=ue(()=>{}),aD=({data:e})=>{let t=s(oD);return I(po,{className:`work-node${e.current?` current`:``}${e.lit?` lit`:``}`,to:`${Y(J.MEDIA,{uri:pe(e.uri)})}${t}`,title:e.title,children:[H(Iw,{type:`target`,position:Q.Left}),H(`div`,{className:`title`,children:e.lines.map(e=>H(`div`,{children:e},e))}),e.meta?H(`div`,{className:`meta`,children:e.meta}):void 0,H(Iw,{type:`source`,position:Q.Right})]})},oD=ue(``),sD=(e,t,n,r)=>{let i=n>=e,a=Math.max(20,Math.abs(n-e)/2)*(i?1:-1);return`M ${e} ${t} C ${e+a} ${t}, ${n-a} ${r}, ${n} ${r}`},cD=({data:e,sourceX:t,sourceY:n,targetX:r,targetY:i})=>H(`path`,{className:`chain${e?.lit?` lit`:``}`,d:sD(t,n,r,i)}),lD=({id:e,data:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=s(iD),c=t?.label??``,l=t?.lit?` lit`:``,u=(e,t)=>e+(t-e)*.34,d=u(n,i),f=u(r,a)-6,p=c.length*6.4+12;return I(V,{children:[H(`path`,{className:`edge${l}`,d:sD(n,r,i,a)}),I(`g`,{className:`label`,onPointerEnter:()=>o({kind:`edge`,key:e}),onPointerLeave:()=>o(void 0),children:[H(`rect`,{className:`label-hit`,x:d-p/2,y:f-11,width:p,height:15}),H(`text`,{className:`edge-label${l}`,x:d,y:f,children:c})]})]})},uD={work:aD},dD={chain:cD,relation:lD},fD=({franchise:e,currentUris:t})=>{let n=Yp(ao()),r=L(()=>om(e),[e]),[i,a]=A(()=>new Set(r.filter(am))),o=[...i].every(am)?`story`:`graph`,s=L(()=>pm(sm(e,e=>!e.format||i.has(e.format)),o),[e,i,o]),[c,l]=A(void 0),u=L(()=>new Set(t),[t]),{nodes:d,edges:f}=L(()=>tD(s,{current:u,hover:c}),[s,u,c]),p=O((e,t)=>l({kind:`node`,uri:t.id}),[]),m=O(()=>l(void 0),[]),h=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return I(V,{children:[H(`div`,{className:`bar`,children:H(`div`,{className:`title`,children:`Series`})}),I(`div`,{className:`canvas`,"data-canvas":!0,children:[r.length?I(`div`,{className:`kinds`,onPointerDown:e=>e.stopPropagation(),children:[H(`div`,{className:`legend`,children:`Show`}),r.map(e=>I(`label`,{className:i.has(e)?`on`:void 0,children:[H(`input`,{type:`checkbox`,checked:i.has(e),onChange:()=>h(e)}),H(`span`,{children:ym(e)})]},e))]}):void 0,H(oD.Provider,{value:n,children:H(iD.Provider,{value:l,children:H(hE,{nodes:d,edges:f,nodeTypes:uD,edgeTypes:dD,onNodeMouseEnter:p,onNodeMouseLeave:m,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every work in this series, in order`,children:H(SE,{variant:vE.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.14)`})})})})]})]})},pD=({franchise:e,currentUris:t})=>{let[n,r]=A(!1),{refs:i,context:a}=pd({open:n,onOpenChange:r}),{getReferenceProps:o,getFloatingProps:s}=hd([sd(a),dd(a,{outsidePress:!0}),_d(a,{role:`dialog`})]);return!e||(e.nodes?.length??0)<2?null:I(V,{children:[I(`button`,{type:`button`,css:nD,ref:i.setReference,...o(),"data-franchise-open":!0,children:[H(ic,{}),`See detailed relation graph`]}),n?H(Vu,{children:H(rd,{lockScroll:!0,css:rD,"data-franchise":!0,children:H(Qu,{context:a,children:I(`div`,{className:`sheet`,ref:i.setFloating,...s(),children:[H(fD,{franchise:e,currentUris:t}),H(`button`,{type:`button`,className:`close`,"aria-label":`Close`,onClick:()=>r(!1),children:H(vc,{})})]})})})}):void 0]})},mD=B`
|
|
1384
|
+
font-size: 1.2rem;
|
|
1385
|
+
padding: 0.15rem 0.6rem;
|
|
1386
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
1387
|
+
border-radius: 0.3rem;
|
|
1388
|
+
white-space: nowrap;
|
|
1389
|
+
|
|
1390
|
+
&:hover { border-color: rgba(255, 255, 255, 0.5); }
|
|
1391
|
+
`,hD=({uri:e})=>{let t=em(ao());return!e||!ve(`?${t}`,`http://d/`)?null:H(po,{css:mD,"data-trace-link":e,href:Jp({uri:e,search:t}),title:`what the graph holds for this uri`,children:`graph trace`})},gD=e=>e?M(e)?le(e)?.handleUris??[]:oe(e)?[e]:[]:[],_D=(e,t)=>{let n=gD(e);if(!n.length)return!1;let r=new Set(gD(t));return n.some(e=>r.has(e))},vD=(e,t)=>t?.find(t=>_D(t.uri,e)),yD=(e,t)=>e?.find(e=>!t.has(e.url))?.url,bD=/^\d{4}-\d{2}-\d{2}$/,xD=1900,SD=e=>{if(!e)return;let t=new Date(e);if(!Number.isNaN(t.getTime())&&!(t.getUTCFullYear()<xD))return t},CD=(e,{locale:t}={})=>{let n=SD(e);if(n)try{return new Intl.DateTimeFormat(t,{year:`numeric`,month:`short`,day:`numeric`,...bD.test(e)?{timeZone:`UTC`}:{}}).format(n)}catch{return}},wD=(e,t)=>t?Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()):Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),TD=864e5,ED=(e,{locale:t,now:n=new Date}={})=>{let r=SD(e);if(!r)return;let i=Math.round((wD(n,!1)-wD(r,bD.test(e)))/TD);return i===0?`today`:i===1?`yesterday`:i>1&&i<30?`${i} days ago`:CD(e,{locale:t})},DD=e=>{let t=SD(e);if(t)return bD.test(e)?e:t.toISOString()},OD=new Set([`cr`,`nf`]),kD=e=>OD.has(e);x();var AD=B`
|
|
1392
|
+
position: fixed;
|
|
1393
|
+
inset: 0;
|
|
1394
|
+
z-index: ${Md.sourcePopup};
|
|
1395
|
+
display: flex;
|
|
1396
|
+
align-items: center;
|
|
1397
|
+
justify-content: center;
|
|
1398
|
+
padding: 4vh 4vw;
|
|
1399
|
+
background: rgba(0, 0, 0, 0.65);
|
|
1400
|
+
backdrop-filter: blur(3px);
|
|
1401
|
+
|
|
1402
|
+
.wrap {
|
|
1403
|
+
display: flex;
|
|
1404
|
+
flex-direction: column;
|
|
1405
|
+
gap: 0.8rem;
|
|
1406
|
+
width: 100%;
|
|
1407
|
+
max-width: 120rem;
|
|
1408
|
+
height: 100%;
|
|
1409
|
+
max-height: 72rem;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
/* the package frame sits above every stub element (the fkn overlay pins itself to the top of the
|
|
1413
|
+
stacking order), so the close button lives OUTSIDE the slot rather than over it */
|
|
1414
|
+
.bar {
|
|
1415
|
+
display: flex;
|
|
1416
|
+
align-items: center;
|
|
1417
|
+
gap: 1rem;
|
|
1418
|
+
color: rgba(255, 255, 255, 0.75);
|
|
1419
|
+
font-size: 1.3rem;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.bar .spacer { margin-left: auto; }
|
|
1423
|
+
|
|
1424
|
+
.close {
|
|
1425
|
+
padding: 0.4rem 1.1rem;
|
|
1426
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
1427
|
+
border-radius: 0.4rem;
|
|
1428
|
+
background: rgba(0, 0, 0, 0.4);
|
|
1429
|
+
color: #fff;
|
|
1430
|
+
font: inherit;
|
|
1431
|
+
font-size: 1.3rem;
|
|
1432
|
+
cursor: pointer;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
.close:hover { background: rgba(255, 255, 255, 0.14); }
|
|
1436
|
+
|
|
1437
|
+
/* The slot IS the panel, not a child of one. fkn reads the placeholder's own computed
|
|
1438
|
+
border-radius and clips the package frame to it, so a radius on a wrapper would leave the frame
|
|
1439
|
+
painting square corners over a rounded box. */
|
|
1440
|
+
.slot,
|
|
1441
|
+
.fallback {
|
|
1442
|
+
flex: 1;
|
|
1443
|
+
min-height: 0;
|
|
1444
|
+
border-radius: 0.8rem;
|
|
1445
|
+
background: #101010;
|
|
1446
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
1447
|
+
overflow: hidden;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.fallback {
|
|
1451
|
+
display: flex;
|
|
1452
|
+
align-items: center;
|
|
1453
|
+
justify-content: center;
|
|
1454
|
+
padding: 2rem;
|
|
1455
|
+
text-align: center;
|
|
1456
|
+
color: rgba(255, 255, 255, 0.55);
|
|
1457
|
+
font-size: 1.4rem;
|
|
1458
|
+
}
|
|
1459
|
+
`,jD=({pluginUri:e,origin:n,name:r,uris:i,onPick:a,onClose:o})=>{let s=_(null),[c,l]=A(``);return k(()=>{let r=s.current;if(!r)return;let c=!1,u;return(async()=>{try{u=await t.show(e,{element:r})}catch(e){l(e instanceof Error?e.message:String(e));return}let s=await we(n,i);c||(s?a(s):o())})(),()=>{c=!0,u?.hide(),t.hide(e,{element:r}).catch(()=>{})}},[e,n,i.join(`,`)]),k(()=>{let e=e=>{e.key===`Escape`&&o()};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[o]),H(`div`,{css:AD,role:`dialog`,"aria-modal":`true`,"aria-label":`Choose a source from ${r}`,onClick:o,children:I(`div`,{className:`wrap`,onClick:e=>e.stopPropagation(),children:[I(`div`,{className:`bar`,children:[H(`span`,{children:r}),H(`span`,{className:`spacer`}),H(`button`,{type:`button`,className:`close`,onClick:o,children:`Close`})]}),c?I(`div`,{className:`fallback`,children:[`This source could not open its picker. `,c]}):H(`div`,{className:`slot`,ref:s})]})})};x();var MD={cr:`#f47521`,nf:`#e50914`,jw:`#fcd53f`,disney:`#0063e5`,amazon:`#00a8e1`,appletv:`#e8e8ed`,hulu:`#1ce783`,hbo:`#7b5cff`,peacock:`#069de0`,paramount:`#0064ff`,fubo:`#fa4616`},ND=`#9aa0a6`,PD=e=>e.color||MD[e.id]||ND,FD=B`
|
|
1460
|
+
display: flex;
|
|
1461
|
+
flex-direction: column;
|
|
1462
|
+
gap: 1.1rem;
|
|
1463
|
+
|
|
1464
|
+
.label {
|
|
1465
|
+
font-size: 1.2rem;
|
|
1466
|
+
font-weight: 600;
|
|
1467
|
+
letter-spacing: 0.08em;
|
|
1468
|
+
text-transform: uppercase;
|
|
1469
|
+
color: rgba(255, 255, 255, 0.4);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.list {
|
|
1473
|
+
display: flex;
|
|
1474
|
+
flex-wrap: wrap;
|
|
1475
|
+
gap: 1rem;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.source {
|
|
1479
|
+
--brand: ${ND};
|
|
1480
|
+
position: relative;
|
|
1481
|
+
display: flex;
|
|
1482
|
+
align-items: center;
|
|
1483
|
+
gap: 1.1rem;
|
|
1484
|
+
min-width: 17rem;
|
|
1485
|
+
padding: 0.9rem 1.4rem 0.9rem 1.1rem;
|
|
1486
|
+
background: rgb(28, 28, 30);
|
|
1487
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
1488
|
+
border-radius: 1rem;
|
|
1489
|
+
color: #fff;
|
|
1490
|
+
text-decoration: none;
|
|
1491
|
+
cursor: pointer;
|
|
1492
|
+
overflow: hidden;
|
|
1493
|
+
transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
1494
|
+
|
|
1495
|
+
&::before {
|
|
1496
|
+
content: '';
|
|
1497
|
+
position: absolute;
|
|
1498
|
+
left: 0;
|
|
1499
|
+
top: 0;
|
|
1500
|
+
bottom: 0;
|
|
1501
|
+
width: 3px;
|
|
1502
|
+
background: var(--brand);
|
|
1503
|
+
opacity: 0.45;
|
|
1504
|
+
transition: opacity 0.15s ease, width 0.15s ease;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
&:hover {
|
|
1508
|
+
transform: translateY(-2px);
|
|
1509
|
+
background: rgb(34, 34, 37);
|
|
1510
|
+
border-color: color-mix(in srgb, var(--brand) 55%, transparent);
|
|
1511
|
+
|
|
1512
|
+
&::before {
|
|
1513
|
+
opacity: 1;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
.play {
|
|
1517
|
+
opacity: 0.9;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
&.active {
|
|
1522
|
+
border-color: var(--brand);
|
|
1523
|
+
background:
|
|
1524
|
+
linear-gradient(
|
|
1525
|
+
90deg,
|
|
1526
|
+
color-mix(in srgb, var(--brand) 24%, transparent),
|
|
1527
|
+
color-mix(in srgb, var(--brand) 7%, transparent)
|
|
1528
|
+
);
|
|
1529
|
+
|
|
1530
|
+
&::before {
|
|
1531
|
+
width: 4px;
|
|
1532
|
+
opacity: 1;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
.icon {
|
|
1537
|
+
display: flex;
|
|
1538
|
+
align-items: center;
|
|
1539
|
+
justify-content: center;
|
|
1540
|
+
flex-shrink: 0;
|
|
1541
|
+
width: 3.2rem;
|
|
1542
|
+
height: 3.2rem;
|
|
1543
|
+
border-radius: 0.7rem;
|
|
1544
|
+
background: color-mix(in srgb, var(--brand) 16%, rgba(255, 255, 255, 0.04));
|
|
1545
|
+
color: var(--brand);
|
|
1546
|
+
font-size: 1.6rem;
|
|
1547
|
+
font-weight: 700;
|
|
1548
|
+
text-transform: uppercase;
|
|
1549
|
+
overflow: hidden;
|
|
1550
|
+
|
|
1551
|
+
img {
|
|
1552
|
+
width: 100%;
|
|
1553
|
+
height: 100%;
|
|
1554
|
+
object-fit: contain;
|
|
1555
|
+
padding: 0.45rem;
|
|
1556
|
+
box-sizing: border-box;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
.name {
|
|
1561
|
+
flex: 1;
|
|
1562
|
+
font-size: 1.45rem;
|
|
1563
|
+
font-weight: 600;
|
|
1564
|
+
white-space: nowrap;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
.play,
|
|
1568
|
+
.ext,
|
|
1569
|
+
.playing {
|
|
1570
|
+
flex-shrink: 0;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
.play {
|
|
1574
|
+
font-size: 1rem;
|
|
1575
|
+
color: var(--brand);
|
|
1576
|
+
opacity: 0;
|
|
1577
|
+
transition: opacity 0.15s ease;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
.ext {
|
|
1581
|
+
font-size: 1.4rem;
|
|
1582
|
+
color: rgba(255, 255, 255, 0.45);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
.playing {
|
|
1586
|
+
display: flex;
|
|
1587
|
+
align-items: flex-end;
|
|
1588
|
+
gap: 2px;
|
|
1589
|
+
height: 1.4rem;
|
|
1590
|
+
|
|
1591
|
+
i {
|
|
1592
|
+
width: 3px;
|
|
1593
|
+
background: var(--brand);
|
|
1594
|
+
border-radius: 1px;
|
|
1595
|
+
transform-origin: bottom;
|
|
1596
|
+
animation: source-eq 0.9s ease-in-out infinite;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
i:nth-of-type(1) {
|
|
1600
|
+
height: 45%;
|
|
1601
|
+
animation-delay: 0s;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
i:nth-of-type(2) {
|
|
1605
|
+
height: 100%;
|
|
1606
|
+
animation-delay: 0.2s;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
i:nth-of-type(3) {
|
|
1610
|
+
height: 70%;
|
|
1611
|
+
animation-delay: 0.4s;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
.source-group {
|
|
1617
|
+
display: flex;
|
|
1618
|
+
flex-direction: column;
|
|
1619
|
+
gap: 0.6rem;
|
|
1620
|
+
|
|
1621
|
+
.source {
|
|
1622
|
+
width: 100%;
|
|
1623
|
+
font: inherit;
|
|
1624
|
+
text-align: left;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
.count {
|
|
1628
|
+
flex-shrink: 0;
|
|
1629
|
+
padding: 0.1rem 0.6rem;
|
|
1630
|
+
border-radius: 1rem;
|
|
1631
|
+
background: color-mix(in srgb, var(--brand) 22%, rgba(255, 255, 255, 0.06));
|
|
1632
|
+
color: var(--brand);
|
|
1633
|
+
font-size: 1.1rem;
|
|
1634
|
+
font-weight: 700;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
.chevron {
|
|
1638
|
+
flex-shrink: 0;
|
|
1639
|
+
font-size: 1rem;
|
|
1640
|
+
color: rgba(255, 255, 255, 0.45);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.releases {
|
|
1645
|
+
display: flex;
|
|
1646
|
+
flex-direction: column;
|
|
1647
|
+
gap: 0.4rem;
|
|
1648
|
+
padding-left: 1.2rem;
|
|
1649
|
+
border-left: 1px solid rgba(255, 255, 255, 0.08);
|
|
1650
|
+
|
|
1651
|
+
.release {
|
|
1652
|
+
display: flex;
|
|
1653
|
+
align-items: center;
|
|
1654
|
+
gap: 0.8rem;
|
|
1655
|
+
padding: 0.6rem 1rem;
|
|
1656
|
+
border-radius: 0.7rem;
|
|
1657
|
+
background: rgba(255, 255, 255, 0.03);
|
|
1658
|
+
color: rgba(255, 255, 255, 0.75);
|
|
1659
|
+
font-size: 1.25rem;
|
|
1660
|
+
text-decoration: none;
|
|
1661
|
+
transition: background 0.12s ease, color 0.12s ease;
|
|
1662
|
+
|
|
1663
|
+
&:hover {
|
|
1664
|
+
background: rgba(255, 255, 255, 0.07);
|
|
1665
|
+
color: #fff;
|
|
1666
|
+
|
|
1667
|
+
.play {
|
|
1668
|
+
opacity: 0.9;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
&.active {
|
|
1673
|
+
background: color-mix(in srgb, var(--brand) 18%, transparent);
|
|
1674
|
+
color: #fff;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
.release-label {
|
|
1679
|
+
flex: 1;
|
|
1680
|
+
overflow: hidden;
|
|
1681
|
+
text-overflow: ellipsis;
|
|
1682
|
+
white-space: nowrap;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
@keyframes source-eq {
|
|
1687
|
+
0%, 100% { transform: scaleY(0.35); }
|
|
1688
|
+
50% { transform: scaleY(1); }
|
|
1689
|
+
}
|
|
1690
|
+
`,ID=B`
|
|
1691
|
+
display: flex;
|
|
1692
|
+
align-items: center;
|
|
1693
|
+
gap: 0.7rem;
|
|
1694
|
+
|
|
1695
|
+
.src {
|
|
1696
|
+
--brand: ${ND};
|
|
1697
|
+
display: flex;
|
|
1698
|
+
text-decoration: none;
|
|
1699
|
+
border-radius: 0.6rem;
|
|
1700
|
+
transition: transform 0.12s ease;
|
|
1701
|
+
|
|
1702
|
+
&:hover {
|
|
1703
|
+
transform: translateY(-2px);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
.icon {
|
|
1707
|
+
display: flex;
|
|
1708
|
+
align-items: center;
|
|
1709
|
+
justify-content: center;
|
|
1710
|
+
width: 2.8rem;
|
|
1711
|
+
height: 2.8rem;
|
|
1712
|
+
border-radius: 0.6rem;
|
|
1713
|
+
border: 1px solid transparent;
|
|
1714
|
+
background: color-mix(in srgb, var(--brand) 18%, rgba(255, 255, 255, 0.05));
|
|
1715
|
+
color: var(--brand);
|
|
1716
|
+
font-size: 1.3rem;
|
|
1717
|
+
font-weight: 700;
|
|
1718
|
+
text-transform: uppercase;
|
|
1719
|
+
overflow: hidden;
|
|
1720
|
+
transition: border-color 0.12s ease, background 0.12s ease;
|
|
1721
|
+
|
|
1722
|
+
img {
|
|
1723
|
+
width: 100%;
|
|
1724
|
+
height: 100%;
|
|
1725
|
+
object-fit: contain;
|
|
1726
|
+
padding: 0.4rem;
|
|
1727
|
+
box-sizing: border-box;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
&:hover .icon {
|
|
1732
|
+
border-color: var(--brand);
|
|
1733
|
+
background: color-mix(in srgb, var(--brand) 30%, rgba(255, 255, 255, 0.05));
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
`,LD=({source:e})=>{let[t,n]=A(!1);return H(`span`,{className:`icon`,children:e.icon&&!t?H(`img`,{src:e.icon,alt:``,onError:()=>n(!0)}):e.name.charAt(0)})},RD=({sources:e,compact:t=!1,onPickRelease:n})=>{let[r,i]=A(null);return e.length?t?H(`div`,{css:ID,children:e.map(e=>H(`a`,{className:`src`,style:{"--brand":PD(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:`Watch on ${e.name}`,children:H(LD,{source:e})},e.id))}):I(`div`,{css:FD,children:[H(`div`,{className:`label`,children:`Watch on`}),H(`div`,{className:`list`,children:e.map(e=>e.releases&&e.releases.length>1?H(zD,{source:e,onOpenPicker:()=>i(e)},e.id):I(`a`,{className:`source${e.active?` active`:``}`,style:{"--brand":PD(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.name,children:[H(LD,{source:e}),H(`span`,{className:`name`,children:e.name}),e.active?I(`span`,{className:`playing`,children:[H(`i`,{}),H(`i`,{}),H(`i`,{})]}):e.external?H(`span`,{className:`ext`,children:`↗`}):H(`span`,{className:`play`,children:`▶`})]},e.id))}),r?.picker?H(jD,{pluginUri:r.picker.pluginUri,origin:r.id,name:r.name,uris:(r.releases??[]).map(e=>e.uri),onPick:e=>{i(null),n?.(e)},onClose:()=>i(null)}):void 0]}):null},zD=({source:e,onOpenPicker:t})=>{let n=e.releases??[],[r,i]=A(n.some(e=>e.active)),a=!!e.picker;return I(`div`,{className:`source-group`,style:{"--brand":PD(e)},children:[I(`button`,{type:`button`,className:`source${e.active?` active`:``}`,style:{"--brand":PD(e)},onClick:()=>a?t():i(e=>!e),title:`${n.length} releases on ${e.name}`,"aria-expanded":a?void 0:r,"aria-haspopup":a?`dialog`:void 0,children:[H(LD,{source:e}),H(`span`,{className:`name`,children:e.name}),H(`span`,{className:`count`,children:n.length}),H(`span`,{className:`chevron`,children:a?`›`:r?`▾`:`▸`})]}),!a&&r?H(`div`,{className:`releases`,children:n.map(e=>I(`a`,{className:`release${e.active?` active`:``}`,href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.label,children:[H(`span`,{className:`release-label`,children:e.label}),e.active?I(`span`,{className:`playing`,children:[H(`i`,{}),H(`i`,{}),H(`i`,{})]}):e.external?H(`span`,{className:`ext`,children:`↗`}):H(`span`,{className:`play`,children:`▶`})]},e.uri))}):void 0]})},BD=e=>[...new Set((e?.handles??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node.origin))];x();var VD=B`
|
|
1737
|
+
z-index: ${Md.mediaModal};
|
|
1738
|
+
padding: 5rem 1rem;
|
|
1739
|
+
background-color: hsla(0, 0%, 0%, 0.439);
|
|
1740
|
+
animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1741
|
+
|
|
1742
|
+
@media (min-width: 1024px) {
|
|
1743
|
+
padding: 5rem 1rem;
|
|
1744
|
+
}
|
|
1745
|
+
@media (min-width: 1440px) {
|
|
1746
|
+
padding: 5rem 4rem;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
.modal {
|
|
1750
|
+
position: relative;
|
|
1751
|
+
display: flex;
|
|
1752
|
+
flex-direction: column;
|
|
1753
|
+
width: 100%;
|
|
1754
|
+
max-width: 80rem;
|
|
1755
|
+
background-color: rgb(35, 35, 35);
|
|
1756
|
+
border-radius: 1rem;
|
|
1757
|
+
box-shadow: hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
1758
|
+
overflow: hidden;
|
|
1759
|
+
margin: auto;
|
|
1760
|
+
|
|
1761
|
+
@media (min-width: 1024px) {
|
|
1762
|
+
max-width: 100rem;
|
|
1763
|
+
}
|
|
1764
|
+
@media (min-width: 1440px) {
|
|
1765
|
+
max-width: 130rem;
|
|
1766
|
+
}
|
|
1767
|
+
@media (min-width: 2560px) {
|
|
1768
|
+
max-width: 180rem;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
.trailer {
|
|
1773
|
+
--yt-top-margin: -24.5rem;
|
|
1774
|
+
--yt-height: 150.25rem;
|
|
1775
|
+
--trailer-height: 101rem;
|
|
1776
|
+
position: relative;
|
|
1777
|
+
overflow: hidden;
|
|
1778
|
+
height: var(--trailer-height);
|
|
1779
|
+
background-size: cover;
|
|
1780
|
+
background-position: center;
|
|
1781
|
+
.player {
|
|
1782
|
+
border-radius: 1rem 1rem 0 0;
|
|
1783
|
+
overflow: hidden;
|
|
1784
|
+
height: var(--trailer-height);
|
|
1785
|
+
user-select: none;
|
|
1786
|
+
|
|
1787
|
+
youtube-video {
|
|
1788
|
+
grid-area: container;
|
|
1789
|
+
pointer-events: none;
|
|
1790
|
+
margin-top: var(--yt-top-margin) !important;
|
|
1791
|
+
height: var(--yt-height) !important;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
.player-controls {
|
|
1795
|
+
position: absolute;
|
|
1796
|
+
bottom: 0rem;
|
|
1797
|
+
padding: 2.5rem;
|
|
1798
|
+
display: flex;
|
|
1799
|
+
align-items: center;
|
|
1800
|
+
gap: 1rem;
|
|
1801
|
+
|
|
1802
|
+
& > span {
|
|
1803
|
+
position: relative;
|
|
1804
|
+
width: 3rem;
|
|
1805
|
+
height: 3rem;
|
|
1806
|
+
cursor: pointer;
|
|
1807
|
+
|
|
1808
|
+
.icon-body {
|
|
1809
|
+
position: absolute;
|
|
1810
|
+
top: 50%;
|
|
1811
|
+
left: 50%;
|
|
1812
|
+
transform: translate(-50%, -50%);
|
|
1813
|
+
}
|
|
1814
|
+
.icon-outline {
|
|
1815
|
+
position: absolute;
|
|
1816
|
+
top: 50%;
|
|
1817
|
+
left: 50%;
|
|
1818
|
+
transform: translate(-50%, -50%);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
& > .content {
|
|
1825
|
+
padding: 2.5rem;
|
|
1826
|
+
& > .header {
|
|
1827
|
+
display: flex;
|
|
1828
|
+
gap: 1rem;
|
|
1829
|
+
|
|
1830
|
+
& > .title {
|
|
1831
|
+
font-size: 3rem;
|
|
1832
|
+
font-weight: 600;
|
|
1833
|
+
cursor: default;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
& > .origins {
|
|
1837
|
+
display: flex;
|
|
1838
|
+
gap: 1rem;
|
|
1839
|
+
align-items: center;
|
|
1840
|
+
|
|
1841
|
+
& > .origin {
|
|
1842
|
+
height: 4rem;
|
|
1843
|
+
& > img {
|
|
1844
|
+
height: 4rem;
|
|
1845
|
+
width: 4rem;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
& > .description {
|
|
1852
|
+
white-space: pre-wrap;
|
|
1853
|
+
margin-top: 2.5rem;
|
|
1854
|
+
cursor: default;
|
|
1855
|
+
|
|
1856
|
+
&.collapsed {
|
|
1857
|
+
max-height: 20rem;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.episodes {
|
|
1862
|
+
margin-top: 4rem;
|
|
1863
|
+
border-top: 0.1rem solid rgba(255, 255, 255, 0.1);
|
|
1864
|
+
.episode {
|
|
1865
|
+
position: relative;
|
|
1866
|
+
display: flex;
|
|
1867
|
+
border-bottom: 0.1rem solid rgba(255, 255, 255, 0.1);
|
|
1868
|
+
color: rgb(255, 255, 255);
|
|
1869
|
+
text-decoration: none;
|
|
1870
|
+
overflow: hidden;
|
|
1871
|
+
height: 10rem;
|
|
1872
|
+
|
|
1873
|
+
& > .episode-link {
|
|
1874
|
+
position: absolute;
|
|
1875
|
+
inset: 0;
|
|
1876
|
+
z-index: 0;
|
|
1877
|
+
color: inherit;
|
|
1878
|
+
text-decoration: none;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
&:hover {
|
|
1882
|
+
background-color: rgba(255, 255, 255, 0.05);
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
.number {
|
|
1886
|
+
display: flex;
|
|
1887
|
+
align-items: center;
|
|
1888
|
+
justify-content: center;
|
|
1889
|
+
font-size: 2rem;
|
|
1890
|
+
font-weight: bold;
|
|
1891
|
+
min-width: 7.5rem;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.thumbnail {
|
|
1895
|
+
flex-shrink: 0;
|
|
1896
|
+
margin: auto 0;
|
|
1897
|
+
height: 7.5rem;
|
|
1898
|
+
aspect-ratio: 16 / 9;
|
|
1899
|
+
object-fit: cover;
|
|
1900
|
+
background-color: rgb(35, 35, 35);
|
|
1901
|
+
border-radius: .5rem;
|
|
1902
|
+
margin-right: 2.5rem;
|
|
1903
|
+
/* decorative only, let the row link under it take hovers and clicks */
|
|
1904
|
+
pointer-events: none;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
.content {
|
|
1908
|
+
display: flex;
|
|
1909
|
+
flex-direction: column;
|
|
1910
|
+
/*align-items: center;*/
|
|
1911
|
+
justify-content: center;
|
|
1912
|
+
|
|
1913
|
+
& > .header {
|
|
1914
|
+
display: flex;
|
|
1915
|
+
|
|
1916
|
+
& > .title {
|
|
1917
|
+
font-size: 2rem;
|
|
1918
|
+
font-weight: bold;
|
|
1919
|
+
}
|
|
1920
|
+
& > .origins {
|
|
1921
|
+
position: relative;
|
|
1922
|
+
z-index: 1;
|
|
1923
|
+
display: flex;
|
|
1924
|
+
align-items: center;
|
|
1925
|
+
margin-left: 1rem;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
& > .description {
|
|
1930
|
+
margin-top: 0.5rem;
|
|
1931
|
+
max-height: 6rem;
|
|
1932
|
+
overflow: hidden;
|
|
1933
|
+
|
|
1934
|
+
* > .ellipsis {
|
|
1935
|
+
max-height: 6rem;
|
|
1936
|
+
white-space: pre-wrap;
|
|
1937
|
+
overflow: hidden;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
.side {
|
|
1943
|
+
/* auto rather than a grown .content: the row's other children keep the widths they had, and
|
|
1944
|
+
the date sits against the right edge however long the title and description turn out */
|
|
1945
|
+
margin-left: auto;
|
|
1946
|
+
display: flex;
|
|
1947
|
+
align-items: center;
|
|
1948
|
+
flex-shrink: 0;
|
|
1949
|
+
padding: 0 2.5rem 0 2rem;
|
|
1950
|
+
/* decorative, like the thumbnail above it: the whole row is one link */
|
|
1951
|
+
pointer-events: none;
|
|
1952
|
+
|
|
1953
|
+
& > .date {
|
|
1954
|
+
font-size: 1.5rem;
|
|
1955
|
+
font-weight: 600;
|
|
1956
|
+
color: rgba(255, 255, 255, 0.8);
|
|
1957
|
+
white-space: nowrap;
|
|
1958
|
+
text-align: right;
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
@media (max-width: 768px) {
|
|
1967
|
+
padding: 4rem 0.6rem;
|
|
1968
|
+
|
|
1969
|
+
.modal {
|
|
1970
|
+
.trailer {
|
|
1971
|
+
/* The desktop crop is fixed-rem, tuned for an 80rem modal; on a full-width
|
|
1972
|
+
mobile modal retune it in vw so the same crop ratio tracks the width. */
|
|
1973
|
+
--trailer-height: 64vw;
|
|
1974
|
+
--yt-height: 95vw;
|
|
1975
|
+
--yt-top-margin: -15.5vw;
|
|
1976
|
+
|
|
1977
|
+
.player-controls {
|
|
1978
|
+
padding: 1.5rem;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
& > .content {
|
|
1983
|
+
padding: 1.5rem;
|
|
1984
|
+
|
|
1985
|
+
& > .header > .title {
|
|
1986
|
+
font-size: 2.2rem;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
& > .header > .origins > .origin {
|
|
1990
|
+
height: 3rem;
|
|
1991
|
+
& > img {
|
|
1992
|
+
height: 3rem;
|
|
1993
|
+
width: 3rem;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
& > .description {
|
|
1998
|
+
margin-top: 1.5rem;
|
|
1999
|
+
font-size: 1.4rem;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
.episodes {
|
|
2003
|
+
margin-top: 2.5rem;
|
|
2004
|
+
|
|
2005
|
+
.episode {
|
|
2006
|
+
height: auto;
|
|
2007
|
+
min-height: 7rem;
|
|
2008
|
+
padding: 0.8rem 0;
|
|
2009
|
+
|
|
2010
|
+
.number {
|
|
2011
|
+
min-width: 3.5rem;
|
|
2012
|
+
font-size: 1.6rem;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
.thumbnail {
|
|
2016
|
+
height: 5rem;
|
|
2017
|
+
margin-right: 1rem;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
.content {
|
|
2021
|
+
& > .header > .title {
|
|
2022
|
+
font-size: 1.5rem;
|
|
2023
|
+
}
|
|
2024
|
+
& > .description {
|
|
2025
|
+
font-size: 1.3rem;
|
|
2026
|
+
max-height: 4.5rem;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
`,HD=Rf(`
|
|
2035
|
+
subscription GetMediaModal($input: MediaInput!, $descriptionInput: MediaDescriptionInput!) {
|
|
2036
|
+
media(input: $input) {
|
|
2037
|
+
...MediaFragment
|
|
2038
|
+
titles {
|
|
2039
|
+
language
|
|
2040
|
+
title
|
|
2041
|
+
score
|
|
2042
|
+
}
|
|
2043
|
+
descriptions(input: $descriptionInput) {
|
|
2044
|
+
language
|
|
2045
|
+
description
|
|
2046
|
+
}
|
|
2047
|
+
covers {
|
|
2048
|
+
language
|
|
2049
|
+
url
|
|
2050
|
+
}
|
|
2051
|
+
banners {
|
|
2052
|
+
language
|
|
2053
|
+
url
|
|
2054
|
+
}
|
|
2055
|
+
trailers {
|
|
2056
|
+
uri
|
|
2057
|
+
origin
|
|
2058
|
+
id
|
|
2059
|
+
url
|
|
2060
|
+
thumbnail
|
|
2061
|
+
}
|
|
2062
|
+
popularity
|
|
2063
|
+
categories
|
|
2064
|
+
franchise {
|
|
2065
|
+
nodes {
|
|
2066
|
+
uri
|
|
2067
|
+
format
|
|
2068
|
+
status
|
|
2069
|
+
episodeCount
|
|
2070
|
+
startDate
|
|
2071
|
+
titles {
|
|
2072
|
+
title
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
edges {
|
|
2076
|
+
from
|
|
2077
|
+
to
|
|
2078
|
+
relation
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
relations {
|
|
2082
|
+
relation
|
|
2083
|
+
format
|
|
2084
|
+
node {
|
|
2085
|
+
_id
|
|
2086
|
+
uri
|
|
2087
|
+
origin
|
|
2088
|
+
id
|
|
2089
|
+
url
|
|
2090
|
+
status
|
|
2091
|
+
episodeCount
|
|
2092
|
+
startDate
|
|
2093
|
+
titles {
|
|
2094
|
+
title
|
|
2095
|
+
}
|
|
2096
|
+
covers {
|
|
2097
|
+
url
|
|
2098
|
+
color
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
episodes {
|
|
2103
|
+
...EpisodeFragment
|
|
2104
|
+
episodeNumber
|
|
2105
|
+
releaseDate
|
|
2106
|
+
titles {
|
|
2107
|
+
title
|
|
2108
|
+
}
|
|
2109
|
+
shortDescriptions {
|
|
2110
|
+
language
|
|
2111
|
+
shortDescription
|
|
2112
|
+
}
|
|
2113
|
+
thumbnails {
|
|
2114
|
+
url
|
|
2115
|
+
}
|
|
2116
|
+
handles {
|
|
2117
|
+
relation
|
|
2118
|
+
node {
|
|
2119
|
+
...EpisodeFragment
|
|
2120
|
+
episodeNumber
|
|
2121
|
+
releaseDate
|
|
2122
|
+
titles {
|
|
2123
|
+
title
|
|
2124
|
+
}
|
|
2125
|
+
shortDescriptions {
|
|
2126
|
+
language
|
|
2127
|
+
shortDescription
|
|
2128
|
+
}
|
|
2129
|
+
thumbnails {
|
|
2130
|
+
url
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
handles {
|
|
2136
|
+
relation
|
|
2137
|
+
node {
|
|
2138
|
+
...MediaFragment
|
|
2139
|
+
handles {
|
|
2140
|
+
relation
|
|
2141
|
+
node {
|
|
2142
|
+
...MediaFragment
|
|
2143
|
+
episodes {
|
|
2144
|
+
...EpisodeFragment
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
episodes {
|
|
2149
|
+
...EpisodeFragment
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
episodeCount
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
`),UD=Rf(`
|
|
2157
|
+
subscription GetMediaModalOrigins($input: OriginPageInput!) {
|
|
2158
|
+
originPage(input: $input) {
|
|
2159
|
+
nodes {
|
|
2160
|
+
...OriginFragment
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
`),WD=({episode:e,index:t,mediaUri:n,isMovie:r})=>{let[i,a]=A(()=>new Set),o=yD(e.thumbnails,i),s=e.releaseDate??e.handles?.find(e=>e.node.releaseDate)?.node.releaseDate,c=ED(s),l=BD(e),[{data:u}]=Hn({query:UD,variables:{input:{ids:l,filters:[Eo.IsNotApiOnly]}},pause:!l}),d=(u?.originPage?.nodes??[]).map(t=>{let r=(e?.handles??[]).filter(e=>e.relation===`SAME_AS`&&e.node.origin===t.id).map(e=>e.node),i=r.at(0),a=i?.uri,o=!!(kD(t.id)&&i?.url),s=e.uri?r.length>1?Y(J.WATCH,{mediaUri:n,episodeUri:e.uri}):a?Y(J.WATCH,{mediaUri:n,episodeUri:e.uri,sourceUri:a}):void 0:void 0,c=r.length>1;return{id:t.id,name:t.name??t.id,icon:t.icon,color:t.color,href:c||o?s:i?.url??void 0,external:c?!1:!o,active:!1}}).filter(e=>e.href).sort((e,t)=>Number(e.external)-Number(t.external)).slice(0,5);return I(`div`,{className:`episode`,children:[e.uri?H(po,{className:`episode-link`,href:Y(J.WATCH,{mediaUri:n,episodeUri:e.uri})}):void 0,r?void 0:H(`div`,{className:`number`,children:e.episodeNumber}),o?H(`img`,{className:`thumbnail`,src:o,onError:()=>a(e=>new Set(e).add(o))}):H(`div`,{className:`thumbnail`}),r?H(`div`,{className:`content`,children:I(`div`,{className:`header`,children:[H(`div`,{className:`title`,children:`Play`}),H(`span`,{className:`origins`,children:H(RD,{compact:!0,sources:d})})]})}):e.titles?.length?I(`div`,{className:`content`,children:[I(`div`,{className:`header`,children:[H(`div`,{className:`title`,children:e.titles.at(0)?.title}),H(`span`,{className:`origins`,children:H(RD,{compact:!0,sources:d})})]}),e.shortDescriptions?.at(0)?H(`div`,{className:`description`,children:H($f,{className:`ellipsis`,children:e.shortDescriptions?.at(0)?.shortDescription})}):void 0]}):H(`div`,{className:`content`,children:H(`div`,{className:`header`,children:I(`div`,{className:`title`,children:[`Episode `,t+1]})})}),H(`div`,{className:`side`,children:c?H(`time`,{className:`date`,dateTime:DD(s),children:c}):void 0})]})},GD=({mediaNodes:e})=>{let t=no(),n={...t,uri:ie(t.uri)},[,r]=io(),i=vD(n.uri,e),[a,o]=A(n.uri);k(()=>{o(e=>e&&de(pe(e),pe(n.uri??``))?e:n.uri)},[n.uri]);let[{data:s}]=Hn({query:HD,variables:{input:{uri:a},descriptionInput:{type:xo.Html}},pause:!a}),c=s?.media??i,l=s?.media?.uri?le(s.media.uri)?.handleUrisValues:void 0,u=[...new Set([...l?.map(e=>e.origin)??[],...c?.handles?.map(e=>e.node.origin)??[]])],[{data:d}]=Hn({query:UD,variables:{input:{ids:u,filters:[Eo.IsNotApiOnly]}},pause:!u}),f=L(()=>c?.titles?.at(0)?.title,[c]),p=L(()=>c&&`descriptions`in c&&c.descriptions.sort((e,t)=>t.description.length-e.description.length)?.at(0)?.description,[c]),m=jp(c?.covers),[h,g]=A([]),[_,v]=A(),y=L(()=>{let e=(c?.trailers??[]).filter(e=>!h.includes(e.uri));return e.find(e=>e.uri===_)??e.at(0)},[c?.trailers,h,_]);k(()=>{y?.uri&&y.uri!==_&&v(y.uri)},[y?.uri,_]);let b=O(()=>{y&&g([...h,y.uri])},[y,h]),[x,S]=A(!0),{refs:C,context:w}=pd({open:x,onOpenChange:(e,t)=>{t?.target===C.reference.current&&S(!1)}}),{getReferenceProps:T,getFloatingProps:E}=hd([sd(w)]),[D,j]=A(!1),[M,N]=A(!0),[P,ee]=A(.25);return k(()=>{F(c?.uri,n.uri)&&r(`${Y(J.MEDIA,{uri:c.uri})}${location.search}`,{replace:!0})},[c?.uri,n.uri]),x?H(Vu,{children:H(rd,{lockScroll:!0,"data-party-scroll":!0,css:VD,ref:C.setReference,...T(),children:H(Qu,{context:w,children:I(`div`,{className:`modal`,ref:C.setFloating,...E(),children:[I(`div`,{className:`trailer`,style:!y?.url&&m?{backgroundImage:`url(${m})`}:{},children:[y?.url?H(Jf,{url:y.url,className:`player`,onError:b,paused:D,volume:M?0:P},y.url):void 0,I(`div`,{className:`player-controls ${y?.url?``:`hidden`}`,children:[I(`span`,{className:`playback`,children:[D?H(oc,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>j(!1)}):H(ac,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>j(!0)}),D?H(oc,{className:`icon-body`,size:30,onClick:()=>j(!1)}):H(ac,{className:`icon-body`,size:30,onClick:()=>j(!0)})]}),H(Zf,{defaultMuted:M,onMutedUpdate:N,defaultVolume:P,onVolumeUpdate:e=>ee(e)})]})]}),I(`div`,{className:`content`,children:[I(`div`,{className:`header`,children:[H(`span`,{className:`title`,children:f}),H(hD,{uri:c?.uri}),H(`span`,{className:`origins`,children:d?.originPage?.nodes?.map(e=>{let t=c?.handles.filter(t=>t.node.origin===e.id&&t.node.url)??[],n=(t.find(e=>e.relation===`SAME_AS`)??t.at(0))?.node.url;if(e.icon)return n?H(`a`,{className:`origin`,href:n,target:`_blank`,rel:`noreferrer`,title:e.name,children:H(`img`,{src:e.icon})}):H(`div`,{className:`origin`,children:H(`img`,{src:e.icon})})}).filter(Boolean)})]}),p?H(Hp,{collapsedHeight:200,className:`description`,children:H(`div`,{dangerouslySetInnerHTML:{__html:p}})}):void 0,H(Em,{relations:c&&`relations`in c?c.relations??[]:[],action:H(pD,{franchise:c&&`franchise`in c?c.franchise:void 0,currentUris:c?.handles?.map(e=>e.node.uri)??[]})}),H(`div`,{className:`episodes`,children:c&&`episodes`in c&&c.episodes?.map((e,t)=>H(WD,{episode:e,index:t,mediaUri:c.uri,isMovie:`categories`in c&&c.categories?.includes(bo.Movie)},e.episodeNumber??e.uri??t))})]})]})})})}):H(go,{to:`/`})},KD=[{label:`All`,value:null},{label:`Anime`,value:bo.Anime},{label:`Series`,value:bo.Series},{label:`Movies`,value:bo.Movie}],qD=B`
|
|
2165
|
+
display: flex;
|
|
2166
|
+
gap: 0.6rem;
|
|
2167
|
+
|
|
2168
|
+
.tab {
|
|
2169
|
+
padding: 0.5rem 1.3rem;
|
|
2170
|
+
border-radius: 2rem;
|
|
2171
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
2172
|
+
background: transparent;
|
|
2173
|
+
color: rgba(255, 255, 255, 0.6);
|
|
2174
|
+
font-size: 1.4rem;
|
|
2175
|
+
cursor: pointer;
|
|
2176
|
+
transition: all 0.15s;
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
.tab:hover { color: rgba(255, 255, 255, 0.9); }
|
|
2180
|
+
|
|
2181
|
+
.tab.active {
|
|
2182
|
+
background: #fff;
|
|
2183
|
+
color: #000;
|
|
2184
|
+
border-color: #fff;
|
|
2185
|
+
}
|
|
2186
|
+
`,JD=({value:e,onChange:t})=>H(`div`,{css:qD,children:KD.map(n=>H(`button`,{className:e===n.value?`tab active`:`tab`,onClick:()=>t(n.value),children:n.label},n.label))}),YD=e=>e._id??e.uri??``,XD=(e,t)=>{let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(YD(t))?r:i).push(t);return r.sort((e,t)=>n.get(YD(e))-n.get(YD(t))),[...r,...i]},ZD=e=>e.map(YD).filter(Boolean),QD=[`winter`,`spring`,`summer`,`fall`],$D=(e=new Date)=>({season:QD[Math.floor(e.getMonth()/3)],year:e.getFullYear()}),eO=e=>e.toUpperCase(),tO=(e=new Date)=>{let{season:t,year:n}=$D(e);return{season:eO(t),year:n}};x();var nO=Rf(`
|
|
2187
|
+
subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
|
|
2188
|
+
mediaPage(input: $input) {
|
|
2189
|
+
nodes {
|
|
2190
|
+
...MediaFragment
|
|
2191
|
+
score
|
|
2192
|
+
episodeCount
|
|
2193
|
+
titles {
|
|
2194
|
+
language
|
|
2195
|
+
title
|
|
2196
|
+
score
|
|
2197
|
+
}
|
|
2198
|
+
shortDescriptions(input: $shortDescriptionInput) {
|
|
2199
|
+
language
|
|
2200
|
+
shortDescription
|
|
2201
|
+
}
|
|
2202
|
+
covers {
|
|
2203
|
+
language
|
|
2204
|
+
url
|
|
2205
|
+
}
|
|
2206
|
+
banners {
|
|
2207
|
+
language
|
|
2208
|
+
url
|
|
2209
|
+
}
|
|
2210
|
+
trailers {
|
|
2211
|
+
uri
|
|
2212
|
+
origin
|
|
2213
|
+
id
|
|
2214
|
+
url
|
|
2215
|
+
thumbnail
|
|
2216
|
+
}
|
|
2217
|
+
popularity
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
`),rO=B`
|
|
2222
|
+
.category-bar {
|
|
2223
|
+
position: relative;
|
|
2224
|
+
z-index: ${Md.categoryBar};
|
|
2225
|
+
padding: 1.5rem 3rem 0.5rem;
|
|
2226
|
+
}
|
|
2227
|
+
`,iO=tO(),aO={season:qo(iO.season),year:iO.year},oO=as(aO),sO=()=>{let[e]=so(yo(J.MEDIA)),[t,n]=A(null),[{data:r}]=Hn({query:nO,variables:{input:{season:aO.season,seasonYear:aO.year,sorts:[Co.PopularityDesc],...t?{categories:[t]}:{}},shortDescriptionInput:{count:1}}}),i=r?.mediaPage?.nodes,a=_([]),o=L(()=>{if(!i?.length)return i||[];let e=XD(i,a.current);return a.current=ZD(e),e},[i]);return I(`div`,{css:rO,children:[H(ap,{mediaNodes:o}),H(`div`,{className:`category-bar`,children:H(JD,{value:t,onChange:n})}),H(Bp,{title:`Current season`,titleTo:oO,mediaNodes:o}),e&&H(GD,{mediaNodes:o})]})},cO=(e,t)=>{let n=e.nextAiringEpisode?.airingAt;if(!n)return;let r=new Date(n).getTime();return Number.isFinite(r)?r-t:void 0},lO=e=>e==null?void 0:`${e} episode${e===1?``:`s`}`,uO=(e,t)=>{if(!e)return;let n=e.trim().replace(/^#/,``),r=n.length===3?n.split(``).map(e=>e+e).join(``):n.length===6?n:void 0;if(!r||!/^[0-9a-f]{6}$/i.test(r))return;let i=parseInt(r,16);return`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, ${t})`},dO=e=>({"--accent":uO(e,1)??`rgba(255, 255, 255, 0.75)`,"--accent-soft":uO(e,.18)??`rgba(255, 255, 255, 0.08)`,"--accent-wash":uO(e,.07)??`rgba(255, 255, 255, 0.03)`}),fO=(e,t=2)=>{if(!Number.isFinite(e)||e<=0)return;let n=[],r=e;for(let e of pO){let i=Math.floor(r/e.ms);if(r-=i*e.ms,i&&(n.push(`${i} ${i===1?e.singular:e.plural}`),n.length>=t))break}return n.length?n.join(`, `):void 0},pO=[{ms:864e5,singular:`day`,plural:`days`},{ms:36e5,singular:`hour`,plural:`hours`},{ms:6e4,singular:`min`,plural:`mins`},{ms:1e3,singular:`sec`,plural:`secs`}];x();var mO=3e4,hO=new Set,gO,_O=()=>{let[e,t]=A(()=>Date.now());return k(()=>(hO.add(t),gO??=setInterval(()=>{let e=Date.now();for(let t of hO)t(e)},mO),()=>{hO.delete(t),!(hO.size||!gO)&&(clearInterval(gO),gO=void 0)}),[]),e},vO=e=>e>=75?`good`:e>=60?`mixed`:`poor`,yO={good:dc,mixed:nc,poor:Zs},bO={good:`#4ade80`,mixed:`#fb923c`,poor:`#f87171`},xO=B`
|
|
2228
|
+
display: inline-flex;
|
|
2229
|
+
align-items: center;
|
|
2230
|
+
gap: 0.6rem;
|
|
2231
|
+
white-space: nowrap;
|
|
2232
|
+
|
|
2233
|
+
.face {
|
|
2234
|
+
display: flex;
|
|
2235
|
+
}
|
|
2236
|
+
`,SO=({percent:e,size:t=18})=>{let n=yO[vO(e)];return I(`span`,{css:xO,"aria-label":`Rated ${e} percent`,children:[H(`span`,{className:`face`,style:{color:bO[vO(e)]},children:H(n,{size:t})}),I(`span`,{className:`value`,children:[e,`%`]})]})},CO=B`
|
|
2237
|
+
display: grid;
|
|
2238
|
+
grid-template-columns: 15rem minmax(0, 1fr);
|
|
2239
|
+
height: 23rem;
|
|
2240
|
+
border-radius: 0.8rem;
|
|
2241
|
+
overflow: hidden;
|
|
2242
|
+
background: rgba(255, 255, 255, 0.04);
|
|
2243
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2244
|
+
|
|
2245
|
+
&:hover { color: rgba(255, 255, 255, 0.85); }
|
|
2246
|
+
&:hover .title { color: #fff; }
|
|
2247
|
+
|
|
2248
|
+
.cover {
|
|
2249
|
+
position: relative;
|
|
2250
|
+
background-color: #191919;
|
|
2251
|
+
background-size: cover;
|
|
2252
|
+
background-position: center;
|
|
2253
|
+
display: flex;
|
|
2254
|
+
flex-direction: column;
|
|
2255
|
+
justify-content: flex-end;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
.cover-text {
|
|
2259
|
+
padding: 1rem;
|
|
2260
|
+
background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.75) 60%, rgba(0, 0, 0, 0) 100%);
|
|
2261
|
+
text-shadow: rgb(0 0 0 / 80%) 1px 1px 0;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
.title {
|
|
2265
|
+
font-size: 1.5rem;
|
|
2266
|
+
font-weight: 600;
|
|
2267
|
+
line-height: 1.3;
|
|
2268
|
+
color: #fff;
|
|
2269
|
+
display: -webkit-box;
|
|
2270
|
+
-webkit-line-clamp: 3;
|
|
2271
|
+
-webkit-box-orient: vertical;
|
|
2272
|
+
overflow: hidden;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
.season {
|
|
2276
|
+
margin-top: 0.4rem;
|
|
2277
|
+
font-size: 1.3rem;
|
|
2278
|
+
font-weight: 600;
|
|
2279
|
+
color: var(--accent);
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
.detail {
|
|
2283
|
+
display: flex;
|
|
2284
|
+
flex-direction: column;
|
|
2285
|
+
gap: 0.8rem;
|
|
2286
|
+
padding: 1.4rem 1.6rem;
|
|
2287
|
+
background: var(--accent-wash);
|
|
2288
|
+
min-width: 0;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
.detail-top {
|
|
2292
|
+
display: flex;
|
|
2293
|
+
align-items: flex-start;
|
|
2294
|
+
justify-content: space-between;
|
|
2295
|
+
gap: 1rem;
|
|
2296
|
+
font-size: 1.4rem;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.airing-label {
|
|
2300
|
+
color: rgba(255, 255, 255, 0.5);
|
|
2301
|
+
font-size: 1.3rem;
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
.airing-value {
|
|
2305
|
+
font-size: 1.8rem;
|
|
2306
|
+
font-weight: 500;
|
|
2307
|
+
color: #fff;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
.meta {
|
|
2311
|
+
font-size: 1.3rem;
|
|
2312
|
+
color: rgba(255, 255, 255, 0.5);
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
/* NOT flex: 1. A line clamp puts the ellipsis on the clamp line but leaves the lines after it in
|
|
2316
|
+
the box, and only a hidden overflow over a box the clamped text exactly fills keeps them out of
|
|
2317
|
+
sight. Stretched to fill the column, the card showed three clamped lines and then two more below
|
|
2318
|
+
the ellipsis. The chips carry the spare space instead. */
|
|
2319
|
+
.description {
|
|
2320
|
+
font-size: 1.3rem;
|
|
2321
|
+
line-height: 1.5;
|
|
2322
|
+
color: rgba(255, 255, 255, 0.6);
|
|
2323
|
+
display: -webkit-box;
|
|
2324
|
+
-webkit-line-clamp: 5;
|
|
2325
|
+
-webkit-box-orient: vertical;
|
|
2326
|
+
overflow: hidden;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
.chips {
|
|
2330
|
+
display: flex;
|
|
2331
|
+
flex-wrap: wrap;
|
|
2332
|
+
justify-content: flex-end;
|
|
2333
|
+
gap: 0.6rem;
|
|
2334
|
+
margin-top: auto;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
.chip {
|
|
2338
|
+
padding: 0.4rem 1rem;
|
|
2339
|
+
border-radius: 2rem;
|
|
2340
|
+
background: var(--accent-soft);
|
|
2341
|
+
color: var(--accent);
|
|
2342
|
+
font-size: 1.2rem;
|
|
2343
|
+
font-weight: 600;
|
|
2344
|
+
white-space: nowrap;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
@media (max-width: 768px) {
|
|
2348
|
+
grid-template-columns: 11rem minmax(0, 1fr);
|
|
2349
|
+
height: 17rem;
|
|
2350
|
+
|
|
2351
|
+
.detail { padding: 1rem; gap: 0.5rem; }
|
|
2352
|
+
.airing-value { font-size: 1.5rem; }
|
|
2353
|
+
.description { -webkit-line-clamp: 3; }
|
|
2354
|
+
.chips { display: none; }
|
|
2355
|
+
}
|
|
2356
|
+
`,wO=({media:e,to:t})=>{let n=_O(),r=jp(e.covers),i=e.covers?.find(e=>e.color)?.color,a=fO(cO(e,n)??0),o=e.nextAiringEpisode?.episodeNumber,s=ss(e.type),c=ls(e.season,e.seasonYear),l=[s,lO(e.episodeCount)].filter(Boolean).join(` • `);return I(po,{to:t,css:CO,style:dO(i),children:[H(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0,children:I(`div`,{className:`cover-text`,children:[H(`div`,{className:`title`,children:e.titles?.at(0)?.title}),c&&H(`div`,{className:`season`,children:c})]})}),I(`div`,{className:`detail`,children:[I(`div`,{className:`detail-top`,children:[H(`div`,{children:a&&o!=null?I(V,{children:[I(`div`,{className:`airing-label`,children:[`Ep `,o,` airing in`]}),H(`div`,{className:`airing-value airing`,children:a})]}):H(`div`,{className:`airing-value`,children:cs(e.status)??`Unknown status`})}),e.averageScore!=null&&H(SO,{percent:e.averageScore})]}),l&&H(`div`,{className:`meta`,children:l}),H(`div`,{className:`description`,children:e.shortDescriptions?.at(0)?.shortDescription}),H(`div`,{className:`chips`,children:e.genres?.slice(0,2).map(e=>H(`span`,{className:`chip`,children:e.toLowerCase()},e))})]})]})},TO=B`
|
|
2357
|
+
display: grid;
|
|
2358
|
+
grid-template-columns: 5rem minmax(0, 1fr) 11rem 11rem 17rem;
|
|
2359
|
+
align-items: center;
|
|
2360
|
+
gap: 1.6rem;
|
|
2361
|
+
padding: 1rem 1.6rem;
|
|
2362
|
+
border-radius: 0.6rem;
|
|
2363
|
+
background: rgba(255, 255, 255, 0.03);
|
|
2364
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2365
|
+
|
|
2366
|
+
&:hover {
|
|
2367
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2368
|
+
background: var(--accent-wash);
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
&:hover .title { color: #fff; }
|
|
2372
|
+
|
|
2373
|
+
.cover {
|
|
2374
|
+
height: 7rem;
|
|
2375
|
+
border-radius: 0.4rem;
|
|
2376
|
+
background-color: #191919;
|
|
2377
|
+
background-size: cover;
|
|
2378
|
+
background-position: center;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
.heading { min-width: 0; }
|
|
2382
|
+
|
|
2383
|
+
.title {
|
|
2384
|
+
font-size: 1.6rem;
|
|
2385
|
+
font-weight: 500;
|
|
2386
|
+
color: rgba(255, 255, 255, 0.9);
|
|
2387
|
+
overflow: hidden;
|
|
2388
|
+
text-overflow: ellipsis;
|
|
2389
|
+
white-space: nowrap;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
.chips {
|
|
2393
|
+
display: flex;
|
|
2394
|
+
flex-wrap: wrap;
|
|
2395
|
+
gap: 0.5rem;
|
|
2396
|
+
margin-top: 0.6rem;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
.chip {
|
|
2400
|
+
padding: 0.3rem 0.9rem;
|
|
2401
|
+
border-radius: 2rem;
|
|
2402
|
+
background: var(--accent-soft);
|
|
2403
|
+
color: var(--accent);
|
|
2404
|
+
font-size: 1.15rem;
|
|
2405
|
+
font-weight: 600;
|
|
2406
|
+
white-space: nowrap;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
.column {
|
|
2410
|
+
display: flex;
|
|
2411
|
+
flex-direction: column;
|
|
2412
|
+
gap: 0.4rem;
|
|
2413
|
+
font-size: 1.4rem;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
.secondary {
|
|
2417
|
+
font-size: 1.3rem;
|
|
2418
|
+
color: rgba(255, 255, 255, 0.45);
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
/* one place the numbers can differ in width without the column moving under them */
|
|
2422
|
+
.column .secondary { font-variant-numeric: tabular-nums; }
|
|
2423
|
+
|
|
2424
|
+
@media (max-width: 900px) {
|
|
2425
|
+
grid-template-columns: 5rem minmax(0, 1fr) 11rem;
|
|
2426
|
+
.format { display: none; }
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
@media (max-width: 640px) {
|
|
2430
|
+
grid-template-columns: 5rem minmax(0, 1fr);
|
|
2431
|
+
gap: 1.2rem;
|
|
2432
|
+
.score { display: none; }
|
|
2433
|
+
.chips { display: none; }
|
|
2434
|
+
}
|
|
2435
|
+
`,EO=({media:e,to:t})=>{let n=_O(),r=jp(e.covers),i=e.covers?.find(e=>e.color)?.color,a=fO(cO(e,n)??0,1),o=e.nextAiringEpisode?.episodeNumber;return I(po,{to:t,css:TO,style:dO(i),children:[H(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0}),I(`div`,{className:`heading`,children:[H(`div`,{className:`title`,children:e.titles?.at(0)?.title}),H(`div`,{className:`chips`,children:e.genres?.slice(0,5).map(e=>H(`span`,{className:`chip`,children:e.toLowerCase()},e))})]}),I(`div`,{className:`column score`,children:[e.averageScore!=null&&H(SO,{percent:e.averageScore,size:17}),e.popularity!=null&&I(`span`,{className:`secondary`,children:[e.popularity.toLocaleString(),` users`]})]}),I(`div`,{className:`column format`,children:[H(`span`,{children:ss(e.type)}),e.episodeCount!=null&&H(`span`,{className:`secondary`,children:lO(e.episodeCount)})]}),I(`div`,{className:`column`,children:[H(`span`,{children:cs(e.status)}),a&&o!=null&&I(`span`,{className:`secondary airing`,children:[`Ep `,o,` airing in `,a]})]})]})},DO=[{value:`grid`,label:`Covers`},{value:`card`,label:`Cards`},{value:`list`,label:`List`}],OO=`grid`,kO=`stub-search-display-mode`,AO=DO.map(e=>e.value),jO=e=>AO.includes(e)?e:OO,MO=()=>{try{return globalThis.localStorage}catch{return}},NO=(e=MO())=>{try{return jO(e?.getItem(kO))}catch{return OO}},PO=(e,t=MO())=>{try{t?.setItem(kO,e)}catch{}},FO={grid:$s,card:Qs,list:ec},IO=B`
|
|
2436
|
+
display: inline-flex;
|
|
2437
|
+
gap: 0.4rem;
|
|
2438
|
+
padding: 0.4rem;
|
|
2439
|
+
border-radius: 0.6rem;
|
|
2440
|
+
background: rgba(255, 255, 255, 0.05);
|
|
2441
|
+
|
|
2442
|
+
button {
|
|
2443
|
+
display: flex;
|
|
2444
|
+
align-items: center;
|
|
2445
|
+
justify-content: center;
|
|
2446
|
+
width: 3.4rem;
|
|
2447
|
+
height: 3.4rem;
|
|
2448
|
+
border: none;
|
|
2449
|
+
border-radius: 0.4rem;
|
|
2450
|
+
background: transparent;
|
|
2451
|
+
color: rgba(255, 255, 255, 0.45);
|
|
2452
|
+
cursor: pointer;
|
|
2453
|
+
transition: background 0.15s, color 0.15s;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
button:hover { color: #fff; }
|
|
2457
|
+
|
|
2458
|
+
button[aria-pressed="true"] {
|
|
2459
|
+
background: rgba(255, 255, 255, 0.12);
|
|
2460
|
+
color: #fff;
|
|
2461
|
+
}
|
|
2462
|
+
`,LO=({mode:e,onChange:t})=>H(`div`,{css:IO,role:`group`,"aria-label":`Result layout`,children:DO.map(n=>{let r=FO[n.value];return H(`button`,{type:`button`,title:n.label,"aria-label":n.label,"aria-pressed":e===n.value,onClick:()=>t(n.value),children:H(r,{size:18})},n.value)})});x();var RO=B`
|
|
2463
|
+
display: flex;
|
|
2464
|
+
flex-direction: column;
|
|
2465
|
+
gap: 0.7rem;
|
|
2466
|
+
min-width: 0;
|
|
2467
|
+
|
|
2468
|
+
.label {
|
|
2469
|
+
font-size: 1.3rem;
|
|
2470
|
+
color: rgba(255, 255, 255, 0.45);
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
.control {
|
|
2474
|
+
display: flex;
|
|
2475
|
+
align-items: center;
|
|
2476
|
+
gap: 0.8rem;
|
|
2477
|
+
width: 100%;
|
|
2478
|
+
height: 4.2rem;
|
|
2479
|
+
padding: 0 1.2rem;
|
|
2480
|
+
border-radius: 0.6rem;
|
|
2481
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
2482
|
+
background: rgba(255, 255, 255, 0.04);
|
|
2483
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2484
|
+
font-size: 1.5rem;
|
|
2485
|
+
font-family: inherit;
|
|
2486
|
+
cursor: pointer;
|
|
2487
|
+
text-align: left;
|
|
2488
|
+
transition: border-color 0.15s, background 0.15s;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
.control:hover { border-color: rgba(255, 255, 255, 0.3); }
|
|
2492
|
+
.control.open { border-color: rgba(255, 255, 255, 0.5); }
|
|
2493
|
+
|
|
2494
|
+
.control .value {
|
|
2495
|
+
flex: 1;
|
|
2496
|
+
min-width: 0;
|
|
2497
|
+
overflow: hidden;
|
|
2498
|
+
text-overflow: ellipsis;
|
|
2499
|
+
white-space: nowrap;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
.control .value.any { color: rgba(255, 255, 255, 0.4); }
|
|
2503
|
+
|
|
2504
|
+
.control .chevron {
|
|
2505
|
+
flex-shrink: 0;
|
|
2506
|
+
color: rgba(255, 255, 255, 0.4);
|
|
2507
|
+
transition: transform 0.15s;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
.control.open .chevron { transform: rotate(180deg); }
|
|
2511
|
+
`,zO=B`
|
|
2512
|
+
z-index: ${Md.filterMenu};
|
|
2513
|
+
width: max-content;
|
|
2514
|
+
min-width: 22rem;
|
|
2515
|
+
max-width: 34rem;
|
|
2516
|
+
padding: 0.6rem;
|
|
2517
|
+
border-radius: 0.8rem;
|
|
2518
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
2519
|
+
background: #17171a;
|
|
2520
|
+
box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.6);
|
|
2521
|
+
display: flex;
|
|
2522
|
+
flex-direction: column;
|
|
2523
|
+
gap: 0.4rem;
|
|
2524
|
+
|
|
2525
|
+
.filter {
|
|
2526
|
+
display: flex;
|
|
2527
|
+
align-items: center;
|
|
2528
|
+
gap: 0.7rem;
|
|
2529
|
+
padding: 0 0.9rem;
|
|
2530
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
2531
|
+
color: rgba(255, 255, 255, 0.4);
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
.filter input {
|
|
2535
|
+
flex: 1;
|
|
2536
|
+
min-width: 0;
|
|
2537
|
+
height: 3.4rem;
|
|
2538
|
+
border: none;
|
|
2539
|
+
outline: none;
|
|
2540
|
+
background: transparent;
|
|
2541
|
+
color: #fff;
|
|
2542
|
+
font-size: 1.5rem;
|
|
2543
|
+
font-family: inherit;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
.options {
|
|
2547
|
+
display: flex;
|
|
2548
|
+
flex-direction: column;
|
|
2549
|
+
max-height: 32rem;
|
|
2550
|
+
overflow-y: auto;
|
|
2551
|
+
overscroll-behavior: contain;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
.option {
|
|
2555
|
+
display: flex;
|
|
2556
|
+
align-items: center;
|
|
2557
|
+
gap: 0.8rem;
|
|
2558
|
+
padding: 0.8rem 0.9rem;
|
|
2559
|
+
border: none;
|
|
2560
|
+
border-radius: 0.5rem;
|
|
2561
|
+
background: transparent;
|
|
2562
|
+
color: rgba(255, 255, 255, 0.8);
|
|
2563
|
+
font-size: 1.5rem;
|
|
2564
|
+
font-family: inherit;
|
|
2565
|
+
text-align: left;
|
|
2566
|
+
cursor: pointer;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
.option:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
|
|
2570
|
+
.option.selected { color: #fff; }
|
|
2571
|
+
|
|
2572
|
+
.option .tick {
|
|
2573
|
+
flex-shrink: 0;
|
|
2574
|
+
width: 1.6rem;
|
|
2575
|
+
color: rgba(255, 255, 255, 0.9);
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
.option .tick.hidden { visibility: hidden; }
|
|
2579
|
+
|
|
2580
|
+
.empty {
|
|
2581
|
+
padding: 1.2rem 0.9rem;
|
|
2582
|
+
font-size: 1.4rem;
|
|
2583
|
+
color: rgba(255, 255, 255, 0.4);
|
|
2584
|
+
}
|
|
2585
|
+
`,BO=({label:e,placeholder:t=`Any`,options:n,selected:r,onChange:i,multiple:a=!1,searchable:o=!1,allowCustom:s=!1})=>{let[c,l]=A(!1),[u,d]=A(``),f=`filter-${e.toLowerCase().replace(/[^a-z]+/g,`-`)}`,{refs:p,floatingStyles:m,context:h}=pd({open:c,onOpenChange:e=>{l(e),e||d(``)},placement:`bottom-start`,whileElementsMounted:ce,middleware:[Gl(6),ql({padding:8}),Kl({padding:8}),Jl({padding:8,apply:({availableHeight:e,elements:t})=>{t.floating.style.maxHeight=`${Math.max(160,e)}px`}})]}),{getReferenceProps:g,getFloatingProps:_}=hd([sd(h),dd(h),_d(h,{role:`listbox`})]),v=r.map(e=>n.find(t=>t.value===e)?.label??e).join(`, `),y=L(()=>{let e=u.trim().toLowerCase(),t=e?n.filter(t=>t.label.toLowerCase().includes(e)):n;return!s||!e||t.some(t=>t.label.toLowerCase()===e)?t:[{value:u.trim(),label:u.trim()},...t]},[n,u,s]),b=e=>{if(!a){i(r.includes(e)?[]:[e]),l(!1),d(``);return}i(r.includes(e)?r.filter(t=>t!==e):[...r,e])};return I(`div`,{css:RO,children:[H(`span`,{className:`label`,id:f,children:e}),I(`button`,{ref:p.setReference,type:`button`,className:c?`control open`:`control`,"aria-labelledby":f,...g(),children:[H(`span`,{className:r.length?`value`:`value any`,children:r.length?v:t}),H(Ks,{size:16,className:`chevron`})]}),c&&H(Vu,{children:H(Qu,{context:h,modal:!1,initialFocus:o?0:-1,children:I(`div`,{ref:p.setFloating,css:zO,style:m,..._(),children:[o&&I(`div`,{className:`filter`,children:[H(cc,{size:15}),H(`input`,{type:`text`,value:u,placeholder:`Filter ${e.toLowerCase()}`,"aria-label":`Filter ${e.toLowerCase()}`,onInput:e=>d(e.currentTarget.value)})]}),H(`div`,{className:`options`,children:y.length?y.map(e=>I(`button`,{type:`button`,role:`option`,"aria-selected":r.includes(e.value),className:r.includes(e.value)?`option selected`:`option`,onClick:()=>b(e.value),children:[H(Gs,{size:16,className:r.includes(e.value)?`tick`:`tick hidden`}),H(`span`,{children:e.label})]},e.value)):I(`div`,{className:`empty`,children:[`Nothing matches “`,u,`”.`]})})]})})})]})},VO=({label:e,children:t})=>I(`div`,{css:RO,children:[H(`span`,{className:`label`,children:e}),t]});x();var HO=Rf(`
|
|
2586
|
+
subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
|
|
2587
|
+
mediaPage(input: $input) {
|
|
2588
|
+
nodes {
|
|
2589
|
+
...MediaFragment
|
|
2590
|
+
score
|
|
2591
|
+
episodeCount
|
|
2592
|
+
titles {
|
|
2593
|
+
language
|
|
2594
|
+
title
|
|
2595
|
+
score
|
|
2596
|
+
}
|
|
2597
|
+
shortDescriptions(input: $shortDescriptionInput) {
|
|
2598
|
+
language
|
|
2599
|
+
shortDescription
|
|
2600
|
+
}
|
|
2601
|
+
covers {
|
|
2602
|
+
language
|
|
2603
|
+
url
|
|
2604
|
+
color
|
|
2605
|
+
}
|
|
2606
|
+
banners {
|
|
2607
|
+
language
|
|
2608
|
+
url
|
|
2609
|
+
}
|
|
2610
|
+
trailers {
|
|
2611
|
+
uri
|
|
2612
|
+
origin
|
|
2613
|
+
id
|
|
2614
|
+
url
|
|
2615
|
+
thumbnail
|
|
2616
|
+
}
|
|
2617
|
+
popularity
|
|
2618
|
+
genres
|
|
2619
|
+
tags
|
|
2620
|
+
averageScore
|
|
2621
|
+
status
|
|
2622
|
+
type
|
|
2623
|
+
season
|
|
2624
|
+
seasonYear
|
|
2625
|
+
nextAiringEpisode {
|
|
2626
|
+
episodeNumber
|
|
2627
|
+
airingAt
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
`),UO=B`
|
|
2633
|
+
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
2634
|
+
min-height: 100vh;
|
|
2635
|
+
|
|
2636
|
+
.heading-row {
|
|
2637
|
+
display: flex;
|
|
2638
|
+
align-items: center;
|
|
2639
|
+
justify-content: space-between;
|
|
2640
|
+
gap: 1.6rem;
|
|
2641
|
+
margin-bottom: 2rem;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
.heading {
|
|
2645
|
+
font-size: 2.4rem;
|
|
2646
|
+
font-weight: 600;
|
|
2647
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
/* one track per control, wrapping to as many rows as the viewport needs */
|
|
2651
|
+
.filters {
|
|
2652
|
+
display: grid;
|
|
2653
|
+
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
|
|
2654
|
+
gap: 1.4rem 1.6rem;
|
|
2655
|
+
margin-bottom: 1.6rem;
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
.text-field {
|
|
2659
|
+
display: flex;
|
|
2660
|
+
align-items: center;
|
|
2661
|
+
gap: 0.8rem;
|
|
2662
|
+
height: 4.2rem;
|
|
2663
|
+
padding: 0 1.2rem;
|
|
2664
|
+
border-radius: 0.6rem;
|
|
2665
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
2666
|
+
background: rgba(255, 255, 255, 0.04);
|
|
2667
|
+
color: rgba(255, 255, 255, 0.4);
|
|
2668
|
+
transition: border-color 0.15s;
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
.text-field:focus-within { border-color: rgba(255, 255, 255, 0.5); }
|
|
2672
|
+
|
|
2673
|
+
.text-field input {
|
|
2674
|
+
flex: 1;
|
|
2675
|
+
min-width: 0;
|
|
2676
|
+
border: none;
|
|
2677
|
+
outline: none;
|
|
2678
|
+
background: transparent;
|
|
2679
|
+
color: #fff;
|
|
2680
|
+
font-size: 1.5rem;
|
|
2681
|
+
font-family: inherit;
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
.chips {
|
|
2685
|
+
display: flex;
|
|
2686
|
+
flex-wrap: wrap;
|
|
2687
|
+
align-items: center;
|
|
2688
|
+
gap: 0.6rem;
|
|
2689
|
+
margin-bottom: 2.5rem;
|
|
2690
|
+
min-height: 3rem;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
.chip {
|
|
2694
|
+
display: flex;
|
|
2695
|
+
align-items: center;
|
|
2696
|
+
gap: 0.5rem;
|
|
2697
|
+
padding: 0.4rem 0.6rem 0.4rem 1.1rem;
|
|
2698
|
+
border-radius: 2rem;
|
|
2699
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
2700
|
+
background: rgba(255, 255, 255, 0.06);
|
|
2701
|
+
color: rgba(255, 255, 255, 0.85);
|
|
2702
|
+
font-size: 1.4rem;
|
|
2703
|
+
font-family: inherit;
|
|
2704
|
+
cursor: pointer;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
.chip:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
|
|
2708
|
+
|
|
2709
|
+
.chip-clear {
|
|
2710
|
+
padding: 0.4rem 1.1rem;
|
|
2711
|
+
border-radius: 2rem;
|
|
2712
|
+
border: 1px solid transparent;
|
|
2713
|
+
background: transparent;
|
|
2714
|
+
color: rgba(255, 255, 255, 0.5);
|
|
2715
|
+
font-size: 1.4rem;
|
|
2716
|
+
font-family: inherit;
|
|
2717
|
+
cursor: pointer;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
.chip-clear:hover { color: #fff; }
|
|
2721
|
+
|
|
2722
|
+
.grid {
|
|
2723
|
+
display: grid;
|
|
2724
|
+
grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
|
|
2725
|
+
gap: 2rem;
|
|
2726
|
+
justify-items: center;
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
/* 42rem is the narrowest a card stays readable at: below it the description loses its last line
|
|
2730
|
+
before the cover gives up any width. */
|
|
2731
|
+
.cards {
|
|
2732
|
+
display: grid;
|
|
2733
|
+
grid-template-columns: repeat(auto-fill, minmax(42rem, 1fr));
|
|
2734
|
+
gap: 1.6rem;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
.rows {
|
|
2738
|
+
display: flex;
|
|
2739
|
+
flex-direction: column;
|
|
2740
|
+
gap: 0.8rem;
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2743
|
+
.status {
|
|
2744
|
+
font-size: 1.8rem;
|
|
2745
|
+
color: rgba(255, 255, 255, 0.5);
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
@media (max-width: 768px) {
|
|
2749
|
+
padding: calc(var(--stub-header-height) + 1rem) 1.5rem 3rem;
|
|
2750
|
+
|
|
2751
|
+
.heading {
|
|
2752
|
+
font-size: 2rem;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
.filters {
|
|
2756
|
+
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
|
|
2757
|
+
}
|
|
2758
|
+
|
|
2759
|
+
.grid {
|
|
2760
|
+
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
|
|
2761
|
+
gap: 1.2rem;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
.cards {
|
|
2765
|
+
grid-template-columns: 1fr;
|
|
2766
|
+
gap: 1.2rem;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
`,WO=(()=>{let e=[];for(let t=$o();t>=Qo;t--)e.push({value:String(t),label:String(t)});return e})(),GO=e=>({...e.query?{search:e.query}:{sorts:[Co.PopularityDesc]},...e.category?{categories:[e.category]}:{},...e.status?{status:e.status}:{},...e.season?{season:e.season}:{},...e.year?{seasonYear:e.year}:{},...e.formats.length?{formats:e.formats}:{},...e.genres.length?{genres:e.genres}:{},...e.tags.length?{tags:e.tags}:{}}),KO=()=>{let e=ao(),[,t]=io(),n=L(()=>ts(e),[e]),r=us(n),i=ds(n),a=e=>t(as({...n,...e}),{replace:!0}),[o,s]=A(n.query),c=_(null);k(()=>{document.activeElement!==c.current&&s(e=>e.trim()===n.query?e:n.query)},[n.query]),k(()=>{if(o.trim()===n.query)return;let e=setTimeout(()=>a({query:o}),350);return()=>clearTimeout(e)},[o,e]);let l=L(()=>GO(n),[n]),[{data:u}]=Hn({query:HO,variables:{input:l,shortDescriptionInput:{count:1}},pause:!i}),[d,f]=A(NO),p=e=>{f(e),PO(e)},[m,h]=A(!1);k(()=>{h(!1);let e=setTimeout(()=>h(!0),5e3);return()=>clearTimeout(e)},[e]);let g=_(u),v=_(l);u!==g.current&&(g.current=u,v.current=l);let y=i&&v.current===l?u?.mediaPage?.nodes??[]:[],{genreOptions:b,tagOptions:x,genreKeys:S}=L(()=>{let e=new Map(Ho.map(e=>[e.toLowerCase(),e])),t=new Map;for(let t of n.genres)e.set(t.toLowerCase(),t);for(let e of n.tags)t.set(e.toLowerCase(),e);for(let n of y){for(let t of n.genres??[])e.has(t.toLowerCase())||e.set(t.toLowerCase(),t);for(let r of n.tags??[])!e.has(r.toLowerCase())&&!t.has(r.toLowerCase())&&t.set(r.toLowerCase(),r)}let r=(e,t)=>e.localeCompare(t);return{genreKeys:new Set(e.keys()),genreOptions:[...e.values()].sort(r).map(e=>({value:e,label:e})),tagOptions:[...t.values()].sort(r).map(e=>({value:e,label:e}))}},[y,n.genres,n.tags]),C=[...n.genres,...n.tags],w=e=>S.has(e.toLowerCase())||Wo(e),T=e=>a({genres:e.filter(w),tags:e.filter(e=>!w(e))}),E={grid:{className:`grid`,item:e=>H(Np,{media:e,to:Y(J.MEDIA,{uri:e.uri}),ellipsis:!1},e._id)},card:{className:`cards`,item:e=>H(wO,{media:e,to:Y(J.MEDIA,{uri:e.uri})},e._id)},list:{className:`rows`,item:e=>H(EO,{media:e,to:Y(J.MEDIA,{uri:e.uri})},e._id)}}[d],D=[...n.year?[{key:`year`,label:String(n.year),clear:{year:null}}]:[],...n.season?[{key:`season`,label:Bo.find(e=>e.value===n.season).label,clear:{season:null}}]:[],...n.status?[{key:`status`,label:zo.find(e=>e.value===n.status).label,clear:{status:null}}]:[],...n.category?[{key:`category`,label:Vo.find(e=>e.value===n.category).label,clear:{category:null}}]:[],...n.formats.map(e=>({key:`format:${e}`,label:Ro.find(t=>t.value===e).label,clear:{formats:n.formats.filter(t=>t!==e)}})),...n.genres.map(e=>({key:`genre:${e}`,label:e,clear:{genres:n.genres.filter(t=>t!==e)}})),...n.tags.map(e=>({key:`tag:${e}`,label:e,clear:{tags:n.tags.filter(t=>t!==e)}}))];return I(`div`,{css:UO,children:[I(`div`,{className:`heading-row`,children:[H(`div`,{className:`heading`,children:os(n)}),H(LO,{mode:d,onChange:p})]}),I(`div`,{className:`filters`,children:[H(VO,{label:`Search`,children:I(`div`,{className:`text-field`,children:[H(cc,{size:17}),H(`input`,{ref:c,type:`text`,value:o,placeholder:`Any title`,"aria-label":`Search by title`,onInput:e=>s(e.currentTarget.value)})]})}),H(BO,{label:`Genres & Tags`,options:[...b,...x],selected:C,onChange:T,multiple:!0,searchable:!0,allowCustom:!0}),H(BO,{label:`Year`,options:WO,selected:n.year?[String(n.year)]:[],onChange:e=>a({year:e.length?Number(e[0]):null}),searchable:!0}),H(BO,{label:`Season`,options:Bo,selected:n.season?[n.season]:[],onChange:e=>a({season:e[0]??null})}),H(BO,{label:`Format`,options:Ro,selected:n.formats,onChange:e=>a({formats:e}),multiple:!0}),H(BO,{label:`Airing Status`,options:zo,selected:n.status?[n.status]:[],onChange:e=>a({status:e[0]??null})}),H(BO,{label:`Category`,options:Vo,selected:n.category?[n.category]:[],onChange:e=>a({category:e[0]??null})})]}),I(`div`,{className:`chips`,children:[D.map(e=>I(`button`,{type:`button`,className:`chip`,"aria-label":`Remove ${e.label}`,onClick:()=>a(e.clear),children:[e.label,H(vc,{size:14})]},e.key)),D.length>1&&H(`button`,{type:`button`,className:`chip-clear`,onClick:()=>a({category:null,status:null,season:null,year:null,formats:[],genres:[],tags:[]}),children:`Clear filters`})]}),y.length?H(`div`,{className:E.className,children:y.map(E.item)}):i?H(`div`,{className:`status`,children:m?`No results found.`:`Searching…`}):r?H(`div`,{className:`status`,children:`Add a title, a season, a year, a format or a genre to browse.`}):H(`div`,{className:`status`,children:`Search by title, or pick a filter to browse.`})]})},qO=B`
|
|
2770
|
+
max-width: 72rem;
|
|
2771
|
+
margin: 0 auto;
|
|
2772
|
+
padding: calc(var(--stub-header-height) + 3rem) 3rem 6rem;
|
|
2773
|
+
color: rgba(255, 255, 255, 0.8);
|
|
2774
|
+
|
|
2775
|
+
h1 {
|
|
2776
|
+
font-size: 3rem;
|
|
2777
|
+
font-weight: 700;
|
|
2778
|
+
color: #fff;
|
|
2779
|
+
margin-bottom: 0.6rem;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
.updated {
|
|
2783
|
+
font-size: 1.3rem;
|
|
2784
|
+
color: rgba(255, 255, 255, 0.4);
|
|
2785
|
+
margin-bottom: 3rem;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
h2 {
|
|
2789
|
+
font-size: 1.9rem;
|
|
2790
|
+
font-weight: 600;
|
|
2791
|
+
color: #fff;
|
|
2792
|
+
margin: 3rem 0 1rem;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
p {
|
|
2796
|
+
font-size: 1.5rem;
|
|
2797
|
+
line-height: 1.7;
|
|
2798
|
+
margin-bottom: 1rem;
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
a {
|
|
2802
|
+
color: #f47521;
|
|
2803
|
+
|
|
2804
|
+
&:hover {
|
|
2805
|
+
color: #ff8a3d;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
`,JO=({children:e})=>H(`div`,{css:qO,children:e}),YO=()=>I(JO,{children:[H(`h1`,{children:`Legal & Terms`}),H(`div`,{className:`updated`,children:`Last updated 1 June 2026`}),H(`p`,{children:`stub is an independent, non-commercial personal project, provided “as is” without warranties of any kind.`}),H(`h2`,{children:`No hosted content`}),H(`p`,{children:`stub hosts, stores, and distributes no media of its own. All titles, descriptions, artwork, ratings, and playback streams are retrieved on demand from third-party services (including AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix) and remain the property of their respective owners. You access those services with your own accounts and are responsible for complying with their terms.`}),H(`h2`,{children:`Personal use`}),H(`p`,{children:`stub is a technical showcase of in-browser media aggregation, intended for personal, non-commercial use. It is not a content provider.`}),H(`h2`,{children:`Privacy`}),I(`p`,{children:[`stub keeps no accounts and stores no personal data. See the`,` `,H(po,{href:Y(J.PRIVACY),children:`Privacy page`}),` for what is and isn’t handled when you use it.`]}),H(`h2`,{children:`Rights holders`}),I(`p`,{children:[`stub stores no content itself; anything you see lives on the third-party service it came from. If you are a rights holder with a concern, you can reach the maintainer through the project repository at`,` `,H(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]}),H(`h2`,{children:`Liability`}),H(`p`,{children:`stub is provided without warranty of any kind. The maintainer is not liable for any damages arising from its use, or for the availability, accuracy, or legality of any third-party service it connects to.`})]}),XO=()=>I(JO,{children:[H(`h1`,{children:`Privacy`}),H(`div`,{className:`updated`,children:`Last updated 1 June 2026`}),H(`p`,{children:`stub is an independent, non-commercial personal project. In short: it has no accounts, runs no analytics, and keeps nothing about you on a server.`}),H(`h2`,{children:`What stub stores`}),H(`p`,{children:`stub has no user accounts and no server-side database. Everything it shows is held in memory in your browser and is cleared when you refresh or close the tab. It sets no advertising or tracking cookies and runs no analytics or telemetry.`}),H(`h2`,{children:`Network requests & third parties`}),I(`p`,{children:[`To fetch titles, artwork, and streams, stub sends requests through the FKN platform proxy, which then reaches third-party services such as AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix. The proxy processes only the connection metadata needed to route and rate-limit a request (for example your IP address) and requires no account; how the FKN platform handles that data is described in the`,` `,H(`a`,{href:`https://fkn.app/privacy`,target:`_blank`,rel:`noreferrer noopener`,children:`FKN platform privacy policy`}),`. Each third-party service receives the requests made to it and applies its own privacy policy, especially when you sign in to one (for example Crunchyroll) to watch.`]}),H(`h2`,{children:`The optional browser extension`}),H(`p`,{children:`If you install the FKN browser extension, it works with your own already-logged-in sessions locally on your device so you can play content you have access to. Those credentials stay in your browser; stub never receives them.`}),H(`h2`,{children:`Your control`}),H(`p`,{children:`Because stub stores nothing persistently, closing or refreshing the tab clears all of its state. If you use the browser extension, you can review and revoke its access at any time from the extension itself.`}),H(`h2`,{children:`Contact`}),I(`p`,{children:[`Questions about privacy can be raised through the project repository at`,` `,H(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]})]}),ZO=[{origin:`omdb`,name:`OMDb`,label:`OMDb API key`,getUrl:`https://www.omdbapi.com/apikey.aspx`,help:`Free tier: 1,000 requests/day; choose the "FREE" account type on the form.`},{origin:`trakt`,name:`Trakt`,label:`Trakt Client ID`,getUrl:`https://trakt.tv/oauth/applications`,help:`Create an app at trakt.tv/oauth/applications, then copy its Client ID. Free; no OAuth needed for public metadata.`},{origin:`simkl`,name:`Simkl`,label:`Simkl Client ID`,getUrl:`https://simkl.com/settings/developer/new/`,help:`Create an app under Settings → Developer and paste its Client ID. Free for non-commercial use.`},{origin:`tvdb`,name:`TheTVDB`,label:`TheTVDB API key`,getUrl:`https://www.thetvdb.com/dashboard/account/apikey`,help:`Paid/subscriber v4 key. User-supported keys also need a PIN; enter it as apikey:pin (e.g. ab12cd34:5678).`},{origin:`watchmode`,name:`Watchmode`,label:`Watchmode API key`,getUrl:`https://api.watchmode.com/requestApiKey/`,help:`Free tier: ~1,000 requests/month. Request a key on the form and paste it here.`}],QO=`stub.apikeys`,$O=()=>{try{let e=localStorage.getItem(QO);return e?JSON.parse(e):{}}catch{return{}}},ek=(e=$O())=>Me(e),tk=e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e));return localStorage.setItem(QO,JSON.stringify(t)),ek(t)};x();var nk=B`
|
|
2809
|
+
max-width: 720px;
|
|
2810
|
+
margin: calc(var(--stub-header-height) + 3rem) auto 4rem;
|
|
2811
|
+
padding: 0 1.5rem;
|
|
2812
|
+
|
|
2813
|
+
h1 { font-size: 2rem; margin-bottom: .25rem; }
|
|
2814
|
+
h2 { font-size: 1.15rem; margin: 2rem 0 .25rem; }
|
|
2815
|
+
.intro { opacity: .75; line-height: 1.55; }
|
|
2816
|
+
|
|
2817
|
+
.keys { display: flex; flex-direction: column; gap: 1.5rem; margin: 1.5rem 0; }
|
|
2818
|
+
.key-field { display: flex; flex-direction: column; gap: .4rem; }
|
|
2819
|
+
.key-field label { font-weight: 600; }
|
|
2820
|
+
.key-field input {
|
|
2821
|
+
padding: .6rem .8rem;
|
|
2822
|
+
border-radius: .4rem;
|
|
2823
|
+
border: 1px solid rgba(255, 255, 255, .18);
|
|
2824
|
+
background: rgba(255, 255, 255, .05);
|
|
2825
|
+
color: inherit;
|
|
2826
|
+
font-family: monospace;
|
|
2827
|
+
}
|
|
2828
|
+
.key-field input:focus { outline: none; border-color: rgba(255, 255, 255, .45); }
|
|
2829
|
+
.help { font-size: .82rem; opacity: .65; }
|
|
2830
|
+
.help a { color: inherit; text-decoration: underline; }
|
|
2831
|
+
|
|
2832
|
+
.actions { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
|
|
2833
|
+
button {
|
|
2834
|
+
padding: .55rem 1.3rem;
|
|
2835
|
+
border-radius: .4rem;
|
|
2836
|
+
border: none;
|
|
2837
|
+
cursor: pointer;
|
|
2838
|
+
background: #fff;
|
|
2839
|
+
color: #000;
|
|
2840
|
+
font-weight: 600;
|
|
2841
|
+
}
|
|
2842
|
+
.saved { color: #4ade80; font-size: .9rem; }
|
|
2843
|
+
|
|
2844
|
+
.add-uri { display: flex; gap: .6rem; margin-top: 1rem; }
|
|
2845
|
+
.add-uri input {
|
|
2846
|
+
flex: 1;
|
|
2847
|
+
min-width: 0;
|
|
2848
|
+
padding: .55rem .8rem;
|
|
2849
|
+
border-radius: .4rem;
|
|
2850
|
+
border: 1px solid rgba(255, 255, 255, .18);
|
|
2851
|
+
background: rgba(255, 255, 255, .05);
|
|
2852
|
+
color: inherit;
|
|
2853
|
+
font-family: monospace;
|
|
2854
|
+
}
|
|
2855
|
+
.add-uri input:focus { outline: none; border-color: rgba(255, 255, 255, .45); }
|
|
2856
|
+
.add-error { color: #f87171; font-size: .85rem; margin: .5rem 0 0; overflow-wrap: anywhere; }
|
|
2857
|
+
|
|
2858
|
+
.plugins { display: flex; flex-direction: column; gap: .75rem; margin: 1.5rem 0; }
|
|
2859
|
+
.plugin {
|
|
2860
|
+
display: flex;
|
|
2861
|
+
align-items: center;
|
|
2862
|
+
gap: 1rem;
|
|
2863
|
+
padding: .75rem 1rem;
|
|
2864
|
+
border: 1px solid rgba(255, 255, 255, .12);
|
|
2865
|
+
border-radius: .5rem;
|
|
2866
|
+
}
|
|
2867
|
+
.plugin .info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
|
|
2868
|
+
.plugin .name { font-weight: 600; }
|
|
2869
|
+
.plugin .uri { font-size: .8rem; opacity: .6; font-family: monospace; overflow-wrap: anywhere; }
|
|
2870
|
+
.plugin .state { margin-left: auto; font-size: .82rem; opacity: .75; white-space: nowrap; }
|
|
2871
|
+
.plugin .state.error { color: #f87171; opacity: 1; }
|
|
2872
|
+
.plugin .remove {
|
|
2873
|
+
background: none;
|
|
2874
|
+
border: 1px solid rgba(255, 255, 255, .25);
|
|
2875
|
+
color: inherit;
|
|
2876
|
+
font-weight: 400;
|
|
2877
|
+
padding: .35rem .8rem;
|
|
2878
|
+
}
|
|
2879
|
+
`,rk=()=>{let[e,t]=A({}),[n,r]=A(!1),[i,a]=A(Xn),[o,s]=A(``),[c,l]=A(``);return k(()=>{t($O())},[]),k(()=>(a(Xn()),Yn(()=>a(Xn()))),[]),I(`div`,{css:nk,children:[H(`h1`,{children:`Settings`}),H(`h2`,{children:`Sources`}),H(`p`,{className:`intro`,children:`Add community-made sources published on npm. They are installed through FKN, run isolated from stub, and only talk to it through a brokered connection.`}),i.length>0&&H(`div`,{className:`plugins`,children:i.map(e=>I(`div`,{className:`plugin`,children:[I(`div`,{className:`info`,children:[H(`span`,{className:`name`,children:e.sources?.length?e.sources.map(e=>e.name).join(`, `):e.uri}),I(`span`,{className:`uri`,children:[e.uri,e.sources&&e.sources.length>1?` · ${e.sources.length} sources`:``,e.rejected?.length?` · ${e.rejected.length} unavailable`:``]})]}),H(`span`,{className:`state${e.state===`error`?` error`:``}`,children:e.state===`connected`?`connected`:e.state===`error`?e.error??`error`:`connecting…`}),H(`button`,{type:`button`,className:`remove`,onClick:()=>{ur(e.uri).then(()=>a(Xn()))},children:`Remove`})]},e.uri))}),H(`div`,{className:`actions`,children:H(`button`,{type:`button`,onClick:()=>{dr().finally(()=>a(Xn()))},children:`Add sources`})}),I(`form`,{className:`add-uri`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(l(``),lr(t).then(()=>s(``)).catch(e=>l(e instanceof Error?e.message:String(e))).finally(()=>a(Xn())))},children:[H(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`Or add one by address, e.g. npm:@banou/example or localhost:4599`,value:o,onInput:e=>s(e.target.value)}),H(`button`,{type:`submit`,children:`Add`})]}),c&&H(`p`,{className:`add-error`,children:c}),H(`h2`,{children:`API keys`}),H(`p`,{className:`intro`,children:`Some sources need your own API key. Keys are kept in this browser only and are used solely to authenticate your requests to that source. Leave a field blank to keep its source disabled.`}),I(`form`,{className:`keys`,onSubmit:t=>{t.preventDefault(),tk(e),r(!0),setTimeout(()=>r(!1),2e3)},children:[ZO.map(n=>I(`div`,{className:`key-field`,children:[H(`label`,{htmlFor:n.origin,children:n.label}),H(`input`,{id:n.origin,type:`password`,autoComplete:`off`,spellcheck:!1,placeholder:`Paste your ${n.name} key`,value:e[n.origin]??``,onInput:r=>t({...e,[n.origin]:r.target.value})}),I(`span`,{className:`help`,children:[n.help?`${n.help} `:``,H(`a`,{href:n.getUrl,target:`_blank`,rel:`noreferrer`,children:`Get a key →`})]})]},n.origin)),I(`div`,{className:`actions`,children:[H(`button`,{type:`submit`,children:`Save`}),n&&H(`span`,{className:`saved`,children:`Saved`})]})]})]})},ik=e=>{let{onPlayback:t,applyPlayback:n}=e;if(!t||!n)return;let r=new Set,i=!1,a=e=>{if(!i&&Yd(e))for(let t of r)t(e)},o=()=>{t(a).catch(()=>{})};return o(),{apply:e=>{n(e).catch(()=>{})},onReport:e=>(r.add(e),o(),()=>{r.delete(e)}),dispose:()=>{i=!0,r.clear()}}};x();var ak=B`
|
|
2880
|
+
position: relative;
|
|
2881
|
+
width: 100%;
|
|
2882
|
+
flex: 1;
|
|
2883
|
+
min-height: 0;
|
|
2884
|
+
background: #000;
|
|
2885
|
+
|
|
2886
|
+
iframe {
|
|
2887
|
+
display: block;
|
|
2888
|
+
width: 100%;
|
|
2889
|
+
height: 100%;
|
|
2890
|
+
border: none;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
.failed {
|
|
2894
|
+
position: absolute;
|
|
2895
|
+
inset: 0;
|
|
2896
|
+
display: flex;
|
|
2897
|
+
align-items: center;
|
|
2898
|
+
justify-content: center;
|
|
2899
|
+
padding: 2rem;
|
|
2900
|
+
text-align: center;
|
|
2901
|
+
background: #000;
|
|
2902
|
+
color: rgba(255, 255, 255, 0.55);
|
|
2903
|
+
font-size: 1.4rem;
|
|
2904
|
+
}
|
|
2905
|
+
`,ok=({pluginUri:e,release:n,onUnplayable:r,onPlayback:i})=>{let a=_(null),[o,s]=A(``),c=_({onUnplayable:r,onPlayback:i});return c.current={onUnplayable:r,onPlayback:i},k(()=>{let r=a.current;if(!r)return;let i=!1,o,l;return s(``),(async()=>{try{let a=await t.mount(e,{iframe:r,protocol:Un});if(i){a.unmount();return}o=a;let{origin:s}=R(n.uri),u=a.remote,d=u.sources?.find(e=>e.origin===s)??u,f=await d.play?.({uri:n.uri,url:n.url});if(i)return;if(!f){a.unmount(),o=void 0,c.current.onUnplayable();return}l=ik(d),l&&c.current.onPlayback?.(l)}catch(e){if(i)return;s(e instanceof Error?e.message:String(e))}})(),()=>{i=!0,l&&(l.dispose(),c.current.onPlayback?.(void 0)),o?.unmount()}},[e,n.uri,n.url]),I(`div`,{css:ak,children:[H(`iframe`,{ref:a,sandbox:`allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox`,allow:`fullscreen; autoplay; encrypted-media; cross-origin-isolated`}),o?I(`div`,{className:`failed`,children:[`This source could not start playback. `,o]}):null]})};x();var sk=({link:e})=>{let t=Cf(),n=t.status===`active`?t.role:void 0,r=_(void 0);return k(()=>{if(r.current=void 0,!e||!n)return;let t=e.onReport(t=>{n===`host`?(Z.setPlayback(t),Z.send({t:`playback`,s:t})):r.current&&e.apply(tf(r.current.state,r.current.receivedAt,Date.now()),r.current.measured)});return()=>{t(),n===`host`&&Z.setPlayback(void 0)}},[n,e]),wf(t=>{if(n!==`guest`)return;let i=t.t===`playback`||t.t===`state`?t.s:void 0;if(!i)return;let a=location.pathname+location.search;if(Z.hostPath()!==a)return;let o=Z.hostClock(),s=o?{...i,at:af(i.at,o.offset)}:i;r.current={state:s,receivedAt:Date.now(),measured:!!o},e?.apply(s,!!o)}),null},ck=[`play`,`pause`,`seeked`,`ratechange`],lk=e=>({paused:e.paused,time:e.currentTime,rate:e.playbackRate??1,at:Date.now()}),uk=(e,t=()=>{})=>{let n=new Set,r=()=>{let t=lk(e);for(let e of n)e(t)};for(let t of ck)e.addEventListener(t,r);let i=setInterval(()=>{e.paused||r()},Zd);return{apply:(t,n)=>{let r=ef(lk(e),t,Date.now(),n);r.seek!==void 0&&(e.currentTime=r.seek),r.rate!==void 0&&(e.playbackRate=r.rate),r.pause&&e.pause(),r.play&&(e.autoplay?e.autoplay():e.play()).catch(()=>{})},onReport:e=>(n.add(e),queueMicrotask(r),()=>{n.delete(e)}),dispose:()=>{for(let t of ck)e.removeEventListener(t,r);clearInterval(i),n.clear(),t()}}},dk=e=>{let t=Pe(e,{origin:location.origin});return uk(t,()=>t.destroy())};x();var fk=e=>(e??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node),pk=Rf(`
|
|
2906
|
+
subscription GetWatchMedia($input: MediaInput!) {
|
|
2907
|
+
media(input: $input) {
|
|
2908
|
+
_id
|
|
2909
|
+
uri
|
|
2910
|
+
origin
|
|
2911
|
+
id
|
|
2912
|
+
titles {
|
|
2913
|
+
title
|
|
2914
|
+
}
|
|
2915
|
+
episodes {
|
|
2916
|
+
...EpisodeFragment
|
|
2917
|
+
episodeNumber
|
|
2918
|
+
titles {
|
|
2919
|
+
title
|
|
2920
|
+
}
|
|
2921
|
+
thumbnails {
|
|
2922
|
+
url
|
|
2923
|
+
}
|
|
2924
|
+
handles {
|
|
2925
|
+
relation
|
|
2926
|
+
node {
|
|
2927
|
+
_id
|
|
2928
|
+
uri
|
|
2929
|
+
origin
|
|
2930
|
+
id
|
|
2931
|
+
url
|
|
2932
|
+
embedUrl
|
|
2933
|
+
mediaUri
|
|
2934
|
+
episodeNumber
|
|
2935
|
+
titles {
|
|
2936
|
+
title
|
|
2937
|
+
}
|
|
2938
|
+
shortDescriptions {
|
|
2939
|
+
language
|
|
2940
|
+
shortDescription
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
}
|
|
2945
|
+
handles {
|
|
2946
|
+
relation
|
|
2947
|
+
node {
|
|
2948
|
+
...MediaFragment
|
|
2949
|
+
handles {
|
|
2950
|
+
relation
|
|
2951
|
+
node {
|
|
2952
|
+
...MediaFragment
|
|
2953
|
+
episodes {
|
|
2954
|
+
...EpisodeFragment
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
episodes {
|
|
2959
|
+
...EpisodeFragment
|
|
2960
|
+
episodeNumber
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
`),mk=Rf(`
|
|
2967
|
+
subscription GetWatchOrigins($input: OriginPageInput!) {
|
|
2968
|
+
originPage(input: $input) {
|
|
2969
|
+
nodes {
|
|
2970
|
+
id
|
|
2971
|
+
url
|
|
2972
|
+
name
|
|
2973
|
+
icon
|
|
2974
|
+
color
|
|
2975
|
+
isApiOnly
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
`),hk=B`
|
|
2980
|
+
display: flex;
|
|
2981
|
+
flex-direction: column;
|
|
2982
|
+
height: 100vh;
|
|
2983
|
+
/* The bar is fixed, so it takes no room in the flow and every other route pads itself out from
|
|
2984
|
+
under it. This one has to as well: without the reservation the header floats over the top strip
|
|
2985
|
+
of the player, which is exactly where the source puts its own title and controls. The height is
|
|
2986
|
+
the whole viewport minus that strip, which border-box gives us for free. */
|
|
2987
|
+
padding-top: var(--stub-header-height);
|
|
2988
|
+
overflow: hidden;
|
|
2989
|
+
color: rgb(255, 255, 255);
|
|
2990
|
+
|
|
2991
|
+
.watch-container {
|
|
2992
|
+
display: flex;
|
|
2993
|
+
flex-direction: column;
|
|
2994
|
+
flex: 1;
|
|
2995
|
+
min-height: 0;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
.player-container {
|
|
2999
|
+
position: relative;
|
|
3000
|
+
flex: 1;
|
|
3001
|
+
min-height: 0;
|
|
3002
|
+
|
|
3003
|
+
.player-loading {
|
|
3004
|
+
position: absolute;
|
|
3005
|
+
inset: 0;
|
|
3006
|
+
display: flex;
|
|
3007
|
+
align-items: center;
|
|
3008
|
+
justify-content: center;
|
|
3009
|
+
background: #000;
|
|
3010
|
+
font-size: 1.4rem;
|
|
3011
|
+
opacity: 0.7;
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
.watch-info {
|
|
3016
|
+
display: flex;
|
|
3017
|
+
flex-direction: column;
|
|
3018
|
+
gap: 1.2rem;
|
|
3019
|
+
padding: 1.6rem 2.4rem;
|
|
3020
|
+
width: 100%;
|
|
3021
|
+
max-width: 2200px;
|
|
3022
|
+
margin: 0 auto;
|
|
3023
|
+
box-sizing: border-box;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
.episode-info {
|
|
3027
|
+
display: flex;
|
|
3028
|
+
flex-direction: column;
|
|
3029
|
+
gap: 0.4rem;
|
|
3030
|
+
|
|
3031
|
+
.episode-title {
|
|
3032
|
+
font-size: 1.8rem;
|
|
3033
|
+
font-weight: 600;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
.media-title {
|
|
3037
|
+
font-size: 1.2rem;
|
|
3038
|
+
opacity: 0.6;
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
`,gk=()=>{let e=no(),t={...e,mediaUri:ie(e.mediaUri),episodeUri:ie(e.episodeUri),sourceUri:ie(e.sourceUri)},[,n]=io(),r=_(null),[i,a]=A(void 0),[{data:o}]=Hn({query:pk,variables:{input:{uri:t.mediaUri}},pause:!t.mediaUri}),s=o?.media,c=L(()=>s?.episodes?.find(e=>e.uri&&t.episodeUri?de(pe(e.uri),pe(t.episodeUri)):!1),[s?.episodes,t.episodeUri]),l=L(()=>c?.uri?le(c.uri)?.handleUrisValues:void 0,[c?.uri]),u=L(()=>l&&[...new Set(l.map(e=>e.origin))],[l]),[{data:d}]=Hn({query:mk,variables:{input:{ids:u,filters:[Eo.IsNotApiOnly]}},pause:!u}),f=t.sourceUri,p=s?.titles?.at(0)?.title,m=c?.titles?.at(0)?.title,h=c?.episodeNumber,g=L(()=>{if(!f)return;let e=fk(c?.handles).find(e=>e.uri===f);if(!e)return;if(e.embedUrl)return e.embedUrl;let{origin:n}=R(f);if(!(!kD(n)||!e.url))return`/embed.html?${new URLSearchParams({mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:f,url:e.url})}`},[f,c?.handles,t.mediaUri,t.episodeUri]),v=(d?.originPage?.nodes??[]).map(e=>e.id).join(`,`),[y,b]=A({}),[x,S]=A({});k(()=>{let e=!1,t=v?v.split(`,`):[],n=async e=>Object.fromEntries((await Promise.all(t.map(async t=>[t,(await e(t))?.pluginUri]))).filter(e=>!!e[1]));return Promise.all([n(Ae),n(be)]).then(([t,n])=>{e||(b(t),S(n))}).catch(()=>{}),()=>{e=!0}},[v]);let C=L(()=>{if(!f)return;let{origin:e}=R(f),t=x[e];if(!t)return;let n=fk(c?.handles).find(e=>e.uri===f);return{pluginUri:t,release:{uri:f,url:n?.url??void 0}}},[f,x,c?.handles]),[w,T]=A();k(()=>{T(void 0)},[f]);let E=!!(C&&w!==f);k(()=>{let e=r.current;if(E||!g||!e)return;let t=dk(e);return a(t),()=>{t.dispose(),a(void 0)}},[E,g]);let D=L(()=>(d?.originPage?.nodes??[]).map(e=>{let n=fk(c?.handles).filter(t=>t.origin===e.id),r=!!x[e.id],i=t=>!!(t?.embedUrl||r||kD(e.id)&&t?.url),a=e=>Y(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}),o=n.map(e=>({uri:e.uri,label:e.shortDescriptions?.at(0)?.shortDescription??e.titles?.at(0)?.title??R(e.uri).id,href:i(e)?a(e.uri):e.url??void 0,external:!i(e),active:f===e.uri})),s=n.at(0);return{id:e.id,name:e.name??e.id,icon:e.icon,color:e.color,href:s?o.at(0)?.href:void 0,external:s?!i(s):!0,active:o.some(e=>e.active),releases:o.length>1?o:void 0,picker:y[e.id]?{pluginUri:y[e.id]}:void 0}}),[d,c?.handles,t.mediaUri,t.episodeUri,f,y,x]);return H(`div`,{css:hk,children:I(`div`,{className:`watch-container`,children:[E&&C?H(ok,{pluginUri:C.pluginUri,release:C.release,onUnplayable:()=>T(f),onPlayback:a}):g?H(`iframe`,{ref:r,src:g,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`,css:B`
|
|
3042
|
+
width: 100%;
|
|
3043
|
+
border: none;
|
|
3044
|
+
background: #000;
|
|
3045
|
+
flex: 1;
|
|
3046
|
+
min-height: 0;
|
|
3047
|
+
`}):void 0,H(sk,{link:i}),I(`div`,{className:`watch-info`,children:[I(`div`,{className:`episode-info`,children:[H(`div`,{className:`episode-title`,children:m?`${h==null?``:`E${h} - `}${m}`:h==null?t.episodeUri:`Episode ${h}`}),p?H(`div`,{className:`media-title`,children:p}):void 0]}),H(RD,{sources:D,onPickRelease:e=>n(Y(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}))})]})]})})};x();var _k=B`
|
|
3048
|
+
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
3049
|
+
min-height: 100vh;
|
|
3050
|
+
max-width: 72rem;
|
|
3051
|
+
|
|
3052
|
+
.heading {
|
|
3053
|
+
font-size: 2.4rem;
|
|
3054
|
+
font-weight: 600;
|
|
3055
|
+
margin-bottom: 1rem;
|
|
3056
|
+
color: rgba(255, 255, 255, 0.85);
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
.status {
|
|
3060
|
+
font-size: 1.6rem;
|
|
3061
|
+
color: rgba(255, 255, 255, 0.5);
|
|
3062
|
+
max-width: 60ch;
|
|
3063
|
+
line-height: 1.5;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
a { color: rgba(255, 255, 255, 0.85); text-decoration: underline; }
|
|
3067
|
+
|
|
3068
|
+
.section {
|
|
3069
|
+
margin-top: 2.4rem;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
.label {
|
|
3073
|
+
font-size: 1.1rem;
|
|
3074
|
+
font-weight: 700;
|
|
3075
|
+
letter-spacing: 0.06em;
|
|
3076
|
+
text-transform: uppercase;
|
|
3077
|
+
color: rgba(255, 255, 255, 0.45);
|
|
3078
|
+
margin-bottom: 0.8rem;
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
.row {
|
|
3082
|
+
display: flex;
|
|
3083
|
+
align-items: center;
|
|
3084
|
+
gap: 1rem;
|
|
3085
|
+
padding: 0.8rem 1rem;
|
|
3086
|
+
border-radius: 0.6rem;
|
|
3087
|
+
background: rgba(255, 255, 255, 0.04);
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
.row + .row { margin-top: 0.6rem; }
|
|
3091
|
+
|
|
3092
|
+
.row .id {
|
|
3093
|
+
flex: 1;
|
|
3094
|
+
min-width: 0;
|
|
3095
|
+
font-family: ui-monospace, monospace;
|
|
3096
|
+
font-size: 1.3rem;
|
|
3097
|
+
color: rgba(255, 255, 255, 0.75);
|
|
3098
|
+
overflow: hidden;
|
|
3099
|
+
text-overflow: ellipsis;
|
|
3100
|
+
white-space: nowrap;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
.row .name {
|
|
3104
|
+
font-size: 1.4rem;
|
|
3105
|
+
font-weight: 600;
|
|
3106
|
+
color: #fff;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
.badge {
|
|
3110
|
+
padding: 0.2rem 0.6rem;
|
|
3111
|
+
border-radius: 0.4rem;
|
|
3112
|
+
background: rgba(74, 222, 128, 0.18);
|
|
3113
|
+
color: #4ade80;
|
|
3114
|
+
font-size: 1.1rem;
|
|
3115
|
+
font-weight: 700;
|
|
3116
|
+
text-transform: uppercase;
|
|
3117
|
+
letter-spacing: 0.04em;
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
.badge.you { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }
|
|
3121
|
+
|
|
3122
|
+
button, input {
|
|
3123
|
+
font-family: inherit;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
.action {
|
|
3127
|
+
display: inline-flex;
|
|
3128
|
+
align-items: center;
|
|
3129
|
+
gap: 0.5rem;
|
|
3130
|
+
padding: 0.5rem 0.9rem;
|
|
3131
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
3132
|
+
border-radius: 0.5rem;
|
|
3133
|
+
background: transparent;
|
|
3134
|
+
color: rgba(255, 255, 255, 0.8);
|
|
3135
|
+
font-size: 1.2rem;
|
|
3136
|
+
cursor: pointer;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
.action:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
|
|
3140
|
+
.action.danger:hover { border-color: #f87171; color: #f87171; }
|
|
3141
|
+
|
|
3142
|
+
.field {
|
|
3143
|
+
display: flex;
|
|
3144
|
+
gap: 0.6rem;
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
.field input {
|
|
3148
|
+
flex: 1;
|
|
3149
|
+
min-width: 0;
|
|
3150
|
+
height: 3.6rem;
|
|
3151
|
+
padding: 0 1rem;
|
|
3152
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
3153
|
+
border-radius: 0.5rem;
|
|
3154
|
+
background: rgba(255, 255, 255, 0.04);
|
|
3155
|
+
color: #fff;
|
|
3156
|
+
font-size: 1.4rem;
|
|
3157
|
+
outline: none;
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
.field input:focus { border-color: rgba(255, 255, 255, 0.4); }
|
|
3161
|
+
`,vk={"not-found":`That party has ended.`,"bad-key":`The invite link is not valid.`,invalid:`The invite link is broken.`,full:`The party is full.`,blocked:`You cannot join this party.`,unavailable:`Parties are not available right now. Is FKN connected?`},yk=()=>{let e=Cf(),[t]=A(()=>_f(location.hash,location.origin)),[n]=A(()=>location.hash.length>1&&!_f(location.hash,location.origin)),[r,i]=A([]),[a,o]=A(()=>Z.name()??``),[s,c]=A(!1),l=e.status===`active`;k(()=>{if(!t)return;let e=Z.getState();(e.status===`joining`||e.status===`active`)&&e.invite===t||Z.join(t)},[t]),k(()=>{if(!l){i([]);return}let e=!1;return Z.roster().then(t=>{e||i(t)}),()=>{e=!0}},[l,l?e.members:0]),wf(e=>{e.t===`name`&&Z.roster().then(i)}),k(()=>{if(!s)return;let e=setTimeout(()=>c(!1),1500);return()=>clearTimeout(e)},[s]);let u=l?gf(location.origin,e.invite):void 0,d=async()=>{if(u)try{await navigator.clipboard.writeText(u),c(!0)}catch{}};return I(`div`,{css:_k,children:[H(`div`,{className:`heading`,children:`Watch together`}),I(`div`,{className:`status`,children:[n?H(V,{children:`This invite link is broken. Ask the host for a new one.`}):!t&&!l&&e.status!==`joining`?e.status===`failed`?I(V,{children:[`Could not join. `,vk[e.code]??`Something went wrong.`]}):e.status===`ended`?H(V,{children:`The party ended.`}):H(V,{children:`You are not in a party. Start one from the header, or open an invite link.`}):!t&&e.status===`joining`?H(V,{children:`Joining the party…`}):t&&!l?e.status===`joining`?H(V,{children:`Joining the party…`}):e.status===`failed`?I(V,{children:[`Could not join. `,vk[e.code]??`Something went wrong.`]}):e.status===`ended`?H(V,{children:`The party ended.`}):H(V,{children:`This invite link is broken. Ask the host for a new one.`}):l&&e.role===`guest`&&t?H(V,{children:`You are in. Waiting for the host…`}):l&&e.role===`guest`?I(V,{children:[`You are following the host. `,H(po,{to:Y(J.HOME),children:`Go home`}),` and Catch up from the header to rejoin them.`]}):H(V,{children:`You are hosting. Everyone here follows you, and you decide who stays.`}),!t&&!l&&e.status!==`joining`&&(e.status===`failed`||e.status===`ended`)?I(V,{children:[` `,H(`button`,{type:`button`,className:`action`,onClick:()=>Z.dismiss(),children:`OK`})]}):null]}),l&&I(V,{children:[I(`div`,{className:`section`,children:[H(`div`,{className:`label`,children:`Your name`}),I(`form`,{className:`field`,onSubmit:e=>{e.preventDefault(),Z.setName(Ud(a))},children:[H(`input`,{value:a,maxLength:32,placeholder:`What the party should call you`,"aria-label":`Your name`,onInput:e=>o(e.currentTarget.value)}),I(`button`,{type:`submit`,className:`action`,children:[H(Gs,{size:14}),` Save`]})]})]}),I(`div`,{className:`section`,children:[H(`div`,{className:`label`,children:`Invite link`}),I(`div`,{className:`field`,children:[H(`input`,{readOnly:!0,value:u,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),I(`button`,{type:`button`,className:`action`,onClick:()=>{d()},children:[H(s?Gs:Ys,{size:14}),` Copy`]})]})]}),I(`div`,{className:`section`,children:[I(`div`,{className:`label`,children:[`In the party (`,r.length,`)`]}),r.map(t=>I(`div`,{className:`row`,"data-member":t.id,children:[t.name?H(`span`,{className:`name`,children:t.name}):null,H(`span`,{className:`id`,title:t.id,children:t.id}),t.host&&H(`span`,{className:`badge`,children:`host`}),t.self&&H(`span`,{className:`badge you`,children:`you`}),e.role===`host`&&!t.self&&I(V,{children:[I(`button`,{type:`button`,className:`action danger`,onClick:()=>{Z.kick(t.id)},children:[H(fc,{size:14}),` Kick`]}),I(`button`,{type:`button`,className:`action danger`,onClick:()=>{Z.ban(t.id)},children:[H(Ws,{size:14}),` Ban`]})]})]},t.id))]}),H(`div`,{className:`section`,children:I(`button`,{type:`button`,className:`action`,onClick:()=>{Z.leave()},children:[H(tc,{size:14}),` `,e.role===`host`?`End party`:`Leave party`]})})]})]})},bk=e=>e.owned?`owned`:`placeholder`,xk=e=>{let t=[],n=new Set;for(let r of e.members??[])!r.uri||n.has(r.uri)||(n.add(r.uri),t.push({uri:r.uri,kind:bk(r),origin:r.origin,scope:r.scope,title:r.title,episodeCount:r.episodeCount,startDate:r.startDate,member:r}));let r=[...(e.links??[]).flatMap(e=>[e.fromUri,e.toUri]),...(e.claims??[]).flatMap(e=>[e.fromUri,e.toUri])];for(let e of r)!e||n.has(e)||(n.add(e),t.push({uri:e,kind:`named`,origin:null,scope:null,title:null,episodeCount:null,startDate:null,member:null}));return t},Sk=e=>{let t=xk(e),n=pm({nodes:t.map(e=>({uri:e.uri,titles:[{title:e.title??e.uri}],startDate:e.startDate})),edges:(e.links??[]).map(e=>({from:e.fromUri,to:e.toUri,relation:e.kind}))},`graph`),r=new Map(n.nodes.map(e=>[e.uri,e]));return{nodes:t.map(e=>({...e,column:r.get(e.uri)?.column??0,row:r.get(e.uri)?.row??0})),columns:n.columns,rows:n.rows}},Ck=(e,t)=>[e,t].sort().join(` `),wk=e=>{let t=new Map;for(let n of e){let e=Ck(n.fromUri,n.toUri),r=t.get(e)??[];r.push(n.key),t.set(e,r)}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,{lane:r,lanes:e.length}));return n},Tk=e=>{let t=new Map;for(let n of e.links??[])t.set(n.key,{kind:`link`,row:n});for(let n of e.claims??[])t.set(n.key,{kind:`claim`,row:n});for(let n of e.episodeLinks??[])t.set(n.key,{kind:`episode-link`,row:n});for(let n of e.episodeClaims??[])t.set(n.key,{kind:`episode-claim`,row:n});for(let n of e.episodeSources??[])t.set(n.key,{kind:`episode-source`,row:n});return t},Ek=/^[0-9a-f]{64}$/,Dk=(e,t)=>(t??[]).map(t=>{let n=e.get(t)??null;return{key:t,ref:n,gap:n?null:Ek.test(t)?`missing`:`not-an-edge-key`}}),Ok=(e,t)=>(e.answers??[]).find(e=>e.seq===t)??null,kk=e=>e===null?null:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),Ak=e=>{if(e==null||e===``)return{kind:`absent`};let t;try{t=JSON.parse(e)}catch{return{kind:`raw`,raw:e}}return t===null?{kind:`fields`,fields:[{field:`value`,value:null}]}:typeof t==`object`&&!Array.isArray(t)?{kind:`fields`,fields:Object.entries(t).map(([e,t])=>({field:e,value:kk(t)}))}:{kind:`fields`,fields:[{field:Array.isArray(t)?`values`:`value`,value:kk(t)}]}},jk=e=>e===`not-enabled`?`The graph engine is switched off for this page, so there is nothing to read. Reloading with ?graph=1 turns it on, and this page then asks the sources about the uri itself. The only way a page gets here now is ?store=legacy, which pins it to the old store; dropping that flag puts the whole app back on the graph, which is the default.`:e===`graph-empty`?`The engine is on and the graph is empty. A graph is built inside one tab and never outlives it, so a link opened cold always starts here: what fills it is a page asking the sources, which is what this page does with the uri it was given.`:e===`no-row`?`No media row exists for that uri, so there is nothing to cluster. Either no source has answered for it in this tab yet, or the uri is not one any source recognises.`:e===`no-cluster`?`A media row exists for that uri, but no cluster holds it yet: either a pass has not run since it arrived, or it is a placeholder no pass will ever cluster on its own.`:`That uri reached no cluster, and the bundle carries no reason for it.`,Mk=e=>e===`active`,Nk=async(e,t,n={},r={})=>{let i=r.settleMs??2e4,a=await e(`http://d/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json, text/event-stream`},body:JSON.stringify({query:t,variables:n})});if(!(a.headers.get(`content-type`)??``).includes(`event-stream`)){let e=await a.json();return r.onPayload?.(e,1),{payloads:1,last:e}}let o=a.body.getReader(),s=new TextDecoder,c=Date.now()+i,l=``,u=0,d,f=!1;for(;!f&&Date.now()<c;){let e=await Promise.race([o.read(),new Promise(e=>setTimeout(()=>e({done:!0,value:void 0}),Math.max(0,c-Date.now())))]);if(e.done)break;l+=s.decode(e.value,{stream:!0});let t=l.split(`
|
|
3162
|
+
|
|
3163
|
+
`);l=t.pop()??``;for(let e of t){let t=e.split(`
|
|
3164
|
+
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t){try{d=JSON.parse(t),u+=1}catch{continue}if(r.onPayload?.(d,u),r.done?.(d,u)){f=!0;break}}}}return o.cancel().catch(()=>{}),{payloads:u,last:d}},Pk=`
|
|
3165
|
+
subscription TraceWarm($input: MediaInput!) {
|
|
3166
|
+
media(input: $input) {
|
|
3167
|
+
_id
|
|
3168
|
+
uri
|
|
3169
|
+
origin
|
|
3170
|
+
id
|
|
3171
|
+
url
|
|
3172
|
+
episodeCount
|
|
3173
|
+
startDate
|
|
3174
|
+
status
|
|
3175
|
+
titles {
|
|
3176
|
+
language
|
|
3177
|
+
title
|
|
3178
|
+
score
|
|
3179
|
+
}
|
|
3180
|
+
handles {
|
|
3181
|
+
relation
|
|
3182
|
+
node {
|
|
3183
|
+
_id
|
|
3184
|
+
uri
|
|
3185
|
+
origin
|
|
3186
|
+
id
|
|
3187
|
+
url
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
episodes {
|
|
3191
|
+
uri
|
|
3192
|
+
origin
|
|
3193
|
+
episodeNumber
|
|
3194
|
+
releaseDate
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
`,Fk=(e,t)=>{let n=e?.data?.media;return{payloads:t,uri:typeof n?.uri==`string`?n.uri:null,handles:Array.isArray(n?.handles)?n.handles.length:0,episodes:Array.isArray(n?.episodes)?n.episodes.length:0}},Ik=async(t,{onProgress:n,settleMs:r=25e3}={})=>{let i={payloads:0,uri:null,handles:0,episodes:0};if(!t)return i;try{let a=await e(()=>import(`./worker-juGKbgx7.js`),__vite__mapDeps([0,1,2,3,4,5]));if(typeof a.handleRequest!=`function`)return i;await Nk(a.handleRequest,Pk,{input:{uri:t}},{settleMs:r,onPayload:(e,t)=>{i=Fk(e,t),n?.(i)}})}catch(e){console.error(Error(`graph trace: the warm could not ask the sources`,{cause:e}))}return i},Lk=B`
|
|
3199
|
+
&.nothing {
|
|
3200
|
+
color: rgb(250, 204, 21);
|
|
3201
|
+
font-style: italic;
|
|
3202
|
+
}
|
|
3203
|
+
`,Rk=({value:e})=>e===null?H(`span`,{css:Lk,className:`nothing`,children:`null`}):e===void 0?H(`span`,{css:Lk,className:`nothing`,children:`absent`}):e===``?H(`span`,{css:Lk,className:`nothing`,children:`empty`}):H(`span`,{css:Lk,children:String(e)}),zk=B`
|
|
3204
|
+
.fields {
|
|
3205
|
+
width: 100%;
|
|
3206
|
+
border-collapse: collapse;
|
|
3207
|
+
font-size: 1.2rem;
|
|
3208
|
+
|
|
3209
|
+
th, td {
|
|
3210
|
+
padding: 0.2rem 0.6rem 0.2rem 0;
|
|
3211
|
+
text-align: left;
|
|
3212
|
+
vertical-align: top;
|
|
3213
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
th {
|
|
3217
|
+
width: 14rem;
|
|
3218
|
+
font-weight: 600;
|
|
3219
|
+
color: rgba(255, 255, 255, 0.55);
|
|
3220
|
+
font-family: monospace;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
td { font-family: monospace; overflow-wrap: anywhere; }
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
.raw {
|
|
3227
|
+
margin: 0;
|
|
3228
|
+
padding: 0.5rem 0.6rem;
|
|
3229
|
+
background: rgba(255, 255, 255, 0.05);
|
|
3230
|
+
border-left: 2px solid rgb(250, 204, 21);
|
|
3231
|
+
font-family: monospace;
|
|
3232
|
+
font-size: 1.2rem;
|
|
3233
|
+
white-space: pre-wrap;
|
|
3234
|
+
overflow-wrap: anywhere;
|
|
3235
|
+
}
|
|
3236
|
+
`,Bk=({blob:e,label:t})=>I(`div`,{css:zk,className:`blob`,"data-blob":t,children:[e.kind===`absent`&&H(`div`,{className:`absent`,children:H(Rk,{value:null})}),e.kind===`raw`&&I(V,{children:[H(`div`,{className:`note`,children:`not JSON, shown as it is stored`}),H(`pre`,{className:`raw`,children:e.raw})]}),e.kind===`fields`&&H(`table`,{className:`fields`,children:H(`tbody`,{children:e.fields.map(e=>I(`tr`,{"data-field":e.field,children:[H(`th`,{scope:`row`,children:e.field}),H(`td`,{children:H(Rk,{value:e.value})})]},e.field))})})]}),Vk=88,Hk=20,Uk=36,Wk=266,Gk=76,Kk=e=>[e.member?`${e.kind} ${e.member.via===`member`?`member`:`claimed`}`:`named by an edge`,e.origin??`no origin`,e.scope??`no scope`].join(` · `),qk=(e,t)=>{let n=e.find(e=>e.key===t);return new Set(n?[n.fromUri,n.toUri]:[])},Jk=(e,t)=>{let n=Sk(e),r=e.links??[],i=wk(r),a=qk(r,t),o=new Set(n.nodes.map(e=>e.uri));return{nodes:n.nodes.map(e=>({id:e.uri,type:`trace`,position:{x:Uk+e.column*Wk,y:Uk+e.row*Gk},width:178,height:56,draggable:!1,selectable:!1,data:{uri:e.uri,kind:e.kind,title:e.title,meta:Kk(e),lit:a.has(e.uri)}})),edges:r.filter(e=>o.has(e.fromUri)&&o.has(e.toUri)).map(e=>{let n=i.get(e.key)??{lane:0,lanes:1};return{id:e.key,type:`trace`,source:e.fromUri,target:e.toUri,selected:e.key===t,data:{spread:(n.lane-(n.lanes-1)/2)*26,active:Mk(e.status),status:e.status,label:e.kind,tooltip:`${e.kind} ${e.status} by ${e.by}: ${e.reason}`}}}),width:Math.max(1,n.columns)*Wk-Vk+Uk*2,height:Math.max(1,n.rows)*Gk-Hk+Uk*2}};x();var Yk=B`
|
|
3237
|
+
position: relative;
|
|
3238
|
+
height: 46rem;
|
|
3239
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3240
|
+
border-radius: 0.5rem;
|
|
3241
|
+
overflow: hidden;
|
|
3242
|
+
|
|
3243
|
+
/* the library paints its own surface, so the app's dark ground has to be stated here rather than
|
|
3244
|
+
inherited: its default is a light one and the page around this box is not */
|
|
3245
|
+
.react-flow { background-color: rgb(9, 9, 10); }
|
|
3246
|
+
.react-flow__attribution { background: rgba(0, 0, 0, 0.4); a { color: rgba(255, 255, 255, 0.4); } }
|
|
3247
|
+
|
|
3248
|
+
/* No z-index, deliberately: it is positioned and the canvas below it is not, so it already paints
|
|
3249
|
+
on top, and a raw layer number in a component is what src/layers.ts exists to prevent.
|
|
3250
|
+
|
|
3251
|
+
BOTTOM left, not top. This box is taller than the viewport, so it is always scrolled, and the
|
|
3252
|
+
app's own fixed header (search field, account, the logo) paints over the top of it: at 1440x1000
|
|
3253
|
+
the logo covered the legend's first two lines, permanently, whatever the reader did. The bottom
|
|
3254
|
+
edge is the one strip of a scrolled tall box that no fixed chrome can reach. */
|
|
3255
|
+
.legend {
|
|
3256
|
+
position: absolute;
|
|
3257
|
+
bottom: 0.8rem;
|
|
3258
|
+
left: 0.8rem;
|
|
3259
|
+
display: flex;
|
|
3260
|
+
flex-direction: column;
|
|
3261
|
+
gap: 0.2rem;
|
|
3262
|
+
padding: 0.6rem 0.8rem;
|
|
3263
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
3264
|
+
border-radius: 0.4rem;
|
|
3265
|
+
background: rgba(18, 18, 20, 0.92);
|
|
3266
|
+
font-size: 1.1rem;
|
|
3267
|
+
color: rgba(255, 255, 255, 0.6);
|
|
3268
|
+
cursor: default;
|
|
3269
|
+
|
|
3270
|
+
b { color: #fff; font-weight: 600; }
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
.trace-node {
|
|
3274
|
+
box-sizing: border-box;
|
|
3275
|
+
width: ${178}px;
|
|
3276
|
+
height: ${56}px;
|
|
3277
|
+
padding: 0.5rem 0.7rem;
|
|
3278
|
+
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
3279
|
+
border-radius: 4px;
|
|
3280
|
+
background: rgba(255, 255, 255, 0.06);
|
|
3281
|
+
color: rgba(255, 255, 255, 0.8);
|
|
3282
|
+
font-size: 11px;
|
|
3283
|
+
line-height: 1.35;
|
|
3284
|
+
overflow: hidden;
|
|
3285
|
+
|
|
3286
|
+
&.placeholder { border-style: dashed; border-color: rgb(250, 204, 21); background: none; }
|
|
3287
|
+
&.named { border-style: dotted; border-color: rgba(255, 255, 255, 0.25); background: none; }
|
|
3288
|
+
&.lit { border-color: rgb(61, 180, 242); border-width: 2px; }
|
|
3289
|
+
|
|
3290
|
+
.uri { color: #fff; font-family: monospace; }
|
|
3291
|
+
.meta { color: rgba(255, 255, 255, 0.45); font-size: 10px; }
|
|
3292
|
+
div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
/* the handles carry the geometry and nothing else: an edge has to start somewhere, but this graph
|
|
3296
|
+
is not one anybody connects by hand, so they are never shown */
|
|
3297
|
+
.react-flow__handle { opacity: 0; pointer-events: none; }
|
|
3298
|
+
|
|
3299
|
+
.edge { fill: none; stroke-width: 1.5; }
|
|
3300
|
+
.edge.active { stroke: rgb(74, 222, 128); }
|
|
3301
|
+
.edge.refused { stroke: rgb(248, 113, 113); stroke-dasharray: 7 5; }
|
|
3302
|
+
.edge.selected { stroke-width: 3; }
|
|
3303
|
+
.edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
|
|
3304
|
+
.edge-label { font-size: 10px; }
|
|
3305
|
+
.edge-label.active { fill: rgb(134, 239, 172); }
|
|
3306
|
+
.edge-label.refused { fill: rgb(252, 165, 165); }
|
|
3307
|
+
.cross { stroke: rgb(248, 113, 113); stroke-width: 1.5; }
|
|
3308
|
+
`,Xk=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,Zk=({data:e})=>I(`div`,{className:`trace-node ${e.kind}${e.lit?` lit`:``}`,"data-node":e.uri,"data-kind":e.kind,title:`${e.uri} (${e.kind})`,children:[H(Iw,{type:`target`,position:Q.Left}),H(`div`,{className:`uri`,children:Xk(e.uri,26)}),H(`div`,{children:e.title===null?`no title`:Xk(e.title,28)}),H(`div`,{className:`meta`,children:Xk(e.meta,34)}),H(Iw,{type:`source`,position:Q.Right})]}),Qk=({data:e,selected:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=e?.spread??0,s=e?.active?`active`:`refused`,c=i>=n,l=Math.max(20,Math.abs(i-n)/2)*(c?1:-1),u=`M ${n} ${r} C ${n+l} ${r+o}, ${i-l} ${a+o}, ${i} ${a}`,d=(n+i)/2,f=(r+a)/2+o*.75;return I(V,{children:[H(`path`,{className:`edge ${s}${t?` selected`:``}`,d:u}),H(`path`,{className:`edge-hit`,d:u,children:H(`title`,{children:e?.tooltip})}),s===`refused`?I(`g`,{className:`cross-mark`,children:[H(`path`,{className:`cross`,d:`M ${d-5} ${f-5} L ${d+5} ${f+5}`}),H(`path`,{className:`cross`,d:`M ${d+5} ${f-5} L ${d-5} ${f+5}`})]}):null,H(`text`,{className:`edge-label ${s}`,x:d,y:f-9,textAnchor:`middle`,children:Xk(e?.label??``,22)})]})},$k={trace:Zk},eA={trace:Qk},tA=({bundle:e,selected:t,onSelect:n})=>{let{nodes:r,edges:i}=L(()=>Jk(e,t),[e,t]),a=O((e,t)=>n(t.id),[n]);return I(`div`,{css:Yk,"data-trace-graph":!0,children:[I(`div`,{className:`legend`,children:[I(`div`,{children:[H(`b`,{children:`solid`}),` owned: its origin described it`]}),I(`div`,{children:[H(`b`,{children:`dashed yellow`}),` placeholder: no origin has`]}),I(`div`,{children:[H(`b`,{children:`dotted`}),` named by an edge only`]}),I(`div`,{children:[H(`b`,{children:`green line`}),` active link`]}),I(`div`,{children:[H(`b`,{children:`red dashed, crossed`}),` refused link`]})]}),H(hE,{nodes:r,edges:i,nodeTypes:$k,edgeTypes:eA,onEdgeClick:a,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every uri this cluster names, and every link between them`,children:H(SE,{variant:vE.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.12)`})})]})};x();var nA=B`
|
|
3309
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3310
|
+
border-radius: 0.5rem;
|
|
3311
|
+
padding: 1rem 1.2rem;
|
|
3312
|
+
font-size: 1.3rem;
|
|
3313
|
+
|
|
3314
|
+
h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
|
|
3315
|
+
|
|
3316
|
+
.trail {
|
|
3317
|
+
display: flex;
|
|
3318
|
+
flex-wrap: wrap;
|
|
3319
|
+
align-items: center;
|
|
3320
|
+
gap: 0.4rem;
|
|
3321
|
+
margin-bottom: 0.8rem;
|
|
3322
|
+
font-size: 1.15rem;
|
|
3323
|
+
}
|
|
3324
|
+
.trail button {
|
|
3325
|
+
padding: 0.15rem 0.5rem;
|
|
3326
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
3327
|
+
border-radius: 0.3rem;
|
|
3328
|
+
background: transparent;
|
|
3329
|
+
color: rgba(255, 255, 255, 0.7);
|
|
3330
|
+
font-family: monospace;
|
|
3331
|
+
font-size: 1.1rem;
|
|
3332
|
+
cursor: pointer;
|
|
3333
|
+
}
|
|
3334
|
+
.trail button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
|
|
3335
|
+
.trail .here { font-family: monospace; color: #fff; overflow-wrap: anywhere; }
|
|
3336
|
+
|
|
3337
|
+
.facts {
|
|
3338
|
+
width: 100%;
|
|
3339
|
+
border-collapse: collapse;
|
|
3340
|
+
margin-bottom: 0.8rem;
|
|
3341
|
+
}
|
|
3342
|
+
.facts th, .facts td {
|
|
3343
|
+
padding: 0.25rem 0.6rem 0.25rem 0;
|
|
3344
|
+
text-align: left;
|
|
3345
|
+
vertical-align: top;
|
|
3346
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
|
|
3347
|
+
font-size: 1.2rem;
|
|
3348
|
+
}
|
|
3349
|
+
.facts th { width: 12rem; font-weight: 600; color: rgba(255, 255, 255, 0.55); }
|
|
3350
|
+
.facts td { font-family: monospace; overflow-wrap: anywhere; }
|
|
3351
|
+
|
|
3352
|
+
.status.active { color: rgb(74, 222, 128); font-weight: 700; }
|
|
3353
|
+
.status.refused { color: rgb(248, 113, 113); font-weight: 700; }
|
|
3354
|
+
|
|
3355
|
+
h4 {
|
|
3356
|
+
font-size: 1.2rem;
|
|
3357
|
+
text-transform: uppercase;
|
|
3358
|
+
letter-spacing: 0.05em;
|
|
3359
|
+
color: rgba(255, 255, 255, 0.45);
|
|
3360
|
+
margin: 0.9rem 0 0.3rem;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
.supports { display: flex; flex-direction: column; gap: 0.35rem; }
|
|
3364
|
+
.support {
|
|
3365
|
+
display: flex;
|
|
3366
|
+
align-items: baseline;
|
|
3367
|
+
gap: 0.6rem;
|
|
3368
|
+
font-size: 1.2rem;
|
|
3369
|
+
}
|
|
3370
|
+
.support .what { color: rgba(255, 255, 255, 0.8); }
|
|
3371
|
+
.support .key { font-family: monospace; color: rgba(255, 255, 255, 0.45); overflow-wrap: anywhere; }
|
|
3372
|
+
.support button {
|
|
3373
|
+
padding: 0.15rem 0.6rem;
|
|
3374
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
3375
|
+
border-radius: 0.3rem;
|
|
3376
|
+
background: transparent;
|
|
3377
|
+
color: inherit;
|
|
3378
|
+
cursor: pointer;
|
|
3379
|
+
font-size: 1.1rem;
|
|
3380
|
+
flex-shrink: 0;
|
|
3381
|
+
}
|
|
3382
|
+
.support .unresolved { color: rgb(250, 204, 21); flex-shrink: 0; }
|
|
3383
|
+
|
|
3384
|
+
.answer { margin-top: 0.4rem; }
|
|
3385
|
+
.answer pre {
|
|
3386
|
+
margin: 0.4rem 0 0;
|
|
3387
|
+
padding: 0.5rem 0.6rem;
|
|
3388
|
+
max-height: 24rem;
|
|
3389
|
+
overflow: auto;
|
|
3390
|
+
background: rgba(255, 255, 255, 0.05);
|
|
3391
|
+
font-family: monospace;
|
|
3392
|
+
font-size: 1.15rem;
|
|
3393
|
+
white-space: pre-wrap;
|
|
3394
|
+
overflow-wrap: anywhere;
|
|
3395
|
+
}
|
|
3396
|
+
.answer .failed { color: rgb(248, 113, 113); }
|
|
3397
|
+
button.load {
|
|
3398
|
+
padding: 0.25rem 0.8rem;
|
|
3399
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
3400
|
+
border-radius: 0.3rem;
|
|
3401
|
+
background: transparent;
|
|
3402
|
+
color: inherit;
|
|
3403
|
+
cursor: pointer;
|
|
3404
|
+
font-size: 1.15rem;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
.empty { color: rgba(255, 255, 255, 0.5); }
|
|
3408
|
+
`,rA=e=>e.kind===`link`?`link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`episode-link`?`episode link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`claim`?`claim ${e.row.kind} from ${e.row.claimer}`:e.kind===`episode-source`?`episode list from ${e.row.claimer}`:`episode claim ${e.row.kind} from ${e.row.claimer}`,iA=e=>e===`not-an-edge-key`?`not an edge key`:`not in this bundle`,aA=e=>{if(e==null)return``;if(typeof e==`string`)return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(typeof e==`object`&&typeof e.raw==`string`)return e.raw;try{return JSON.stringify(e,null,2)}catch{return String(e)}},oA=({rows:e})=>H(`table`,{className:`facts`,children:H(`tbody`,{children:e.map(([e,t])=>I(`tr`,{"data-fact":e,children:[H(`th`,{scope:`row`,children:e}),H(`td`,{children:H(Rk,{value:t})})]},e))})}),sA=({bundle:e,seq:t,answer:n,onLoad:r})=>{let i=Ok(e,t);return I(V,{children:[I(`h4`,{children:[`answer `,t]}),i?H(oA,{rows:[[`uri`,i.uri],[`origin`,i.origin],[`operation`,i.operation],[`bytes`,i.bytes]]}):H(`p`,{className:`empty`,"data-no-answer-row":!0,children:`The bundle lists no answer with that sequence.`}),H(`button`,{type:`button`,className:`load`,onClick:()=>r(t),children:`Load answer bytes`}),n?.seq===t&&I(`div`,{className:`answer`,"data-answer":!0,children:[n.state===`loading`&&H(`p`,{className:`empty`,children:`loading…`}),n.state===`failed`&&H(`p`,{className:`failed`,children:n.text}),n.state===`done`&&(n.text===``?H(`p`,{className:`empty`,children:`nothing came back for that sequence.`}):H(`pre`,{children:n.text}))]})]})},cA=({bundle:e,index:t,trail:n,onFollow:r,onTrailTo:i,loadAnswerBytes:a})=>{let[o,s]=A(void 0),c=n[n.length-1],l=c===void 0?void 0:t.get(c),u=Dk(t,l&&(l.kind===`link`||l.kind===`episode-link`)?l.row.supports:[]),d=e=>{s({seq:e,state:`loading`,text:``}),a(e).then(t=>s({seq:e,state:`done`,text:aA(t)})).catch(t=>s({seq:e,state:`failed`,text:t instanceof Error?t.message:String(t)}))};return I(`div`,{css:nA,"data-inspector":!0,children:[H(`h3`,{children:`Edge inspector`}),c===void 0?H(`p`,{className:`empty`,children:`Select a link in the graph, or any row in the tables below.`}):I(V,{children:[I(`div`,{className:`trail`,children:[n.slice(0,-1).map((e,n)=>H(`button`,{type:`button`,onClick:()=>i(n),children:t.get(e)?rA(t.get(e)):e},e)),H(`span`,{className:`here`,children:l?rA(l):c})]}),l===void 0?I(`p`,{className:`empty`,"data-unknown-row":!0,children:[`The bundle carries no row with the key `,H(`code`,{children:c}),`.`]}):I(V,{children:[(l.kind===`link`||l.kind===`episode-link`)&&I(V,{children:[H(oA,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`written by`,l.row.by],[`rule`,l.row.reason]]}),I(`p`,{children:[`status`,` `,H(`span`,{className:`status ${Mk(l.row.status)?`active`:`refused`}`,children:l.row.status})]}),H(oA,{rows:l.kind===`link`?[[`confidence`,l.row.confidence],[`version`,l.row.version]]:[[`from number`,l.row.fromNumber],[`to number`,l.row.toNumber]]}),H(`h4`,{children:`evidence`}),H(Bk,{blob:Ak(l.row.evidence),label:`evidence`}),l.kind===`link`&&I(V,{children:[H(`h4`,{children:`gates`}),H(Bk,{blob:Ak(l.row.gates),label:`gates`})]})]}),(l.kind===`claim`||l.kind===`episode-claim`)&&I(V,{children:[H(oA,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`claimed by`,l.row.claimer],[`provenance`,l.row.provenance],[`answer seq`,l.row.answerSeq],...l.kind===`claim`?[[`target scope`,l.row.targetScope]]:[]]}),H(sA,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),l.kind===`episode-source`&&I(V,{children:[H(oA,{rows:[[`media`,l.row.fromUri],[`episode`,l.row.toUri],[`listed by`,l.row.claimer],[`answer seq`,l.row.answerSeq]]}),H(sA,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),H(`h4`,{children:`supports`}),l.kind===`claim`||l.kind===`episode-claim`||l.kind===`episode-source`?H(`p`,{className:`empty`,children:`This row is source truth: it is derived from nothing.`}):u.length===0?H(`p`,{className:`empty`,children:`This row names no supports.`}):H(`div`,{className:`supports`,children:u.map(e=>I(`div`,{className:`support`,"data-gap":e.gap??void 0,children:[e.ref?H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Follow`}):H(`span`,{className:`unresolved`,children:iA(e.gap)}),H(`span`,{className:`what`,children:e.ref?rA(e.ref):`unresolved`}),H(`span`,{className:`key`,children:e.key})]},e.key))})]})]})]})},lA=B`
|
|
3409
|
+
table {
|
|
3410
|
+
width: 100%;
|
|
3411
|
+
border-collapse: collapse;
|
|
3412
|
+
font-size: 1.2rem;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
th, td {
|
|
3416
|
+
padding: 0.35rem 0.6rem 0.35rem 0;
|
|
3417
|
+
text-align: left;
|
|
3418
|
+
vertical-align: top;
|
|
3419
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
3420
|
+
}
|
|
3421
|
+
|
|
3422
|
+
thead th {
|
|
3423
|
+
font-size: 1.1rem;
|
|
3424
|
+
text-transform: uppercase;
|
|
3425
|
+
letter-spacing: 0.05em;
|
|
3426
|
+
color: rgba(255, 255, 255, 0.45);
|
|
3427
|
+
}
|
|
3428
|
+
|
|
3429
|
+
td.uri, td.slot { font-family: monospace; overflow-wrap: anywhere; }
|
|
3430
|
+
|
|
3431
|
+
.fill {
|
|
3432
|
+
display: flex;
|
|
3433
|
+
flex-wrap: wrap;
|
|
3434
|
+
align-items: baseline;
|
|
3435
|
+
gap: 0.5rem;
|
|
3436
|
+
padding: 0.15rem 0;
|
|
3437
|
+
}
|
|
3438
|
+
.fill .uri { font-family: monospace; color: #fff; }
|
|
3439
|
+
.fill .via { color: rgb(147, 197, 253); }
|
|
3440
|
+
.fill .by { color: rgba(255, 255, 255, 0.5); }
|
|
3441
|
+
|
|
3442
|
+
.proof { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; font-size: 1.15rem; }
|
|
3443
|
+
.proof .pair { font-family: monospace; color: rgba(255, 255, 255, 0.75); }
|
|
3444
|
+
.proof .missing { color: rgb(250, 204, 21); }
|
|
3445
|
+
|
|
3446
|
+
button {
|
|
3447
|
+
padding: 0.1rem 0.5rem;
|
|
3448
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
3449
|
+
border-radius: 0.3rem;
|
|
3450
|
+
background: transparent;
|
|
3451
|
+
color: inherit;
|
|
3452
|
+
font-size: 1.1rem;
|
|
3453
|
+
cursor: pointer;
|
|
3454
|
+
}
|
|
3455
|
+
button:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
|
|
3456
|
+
|
|
3457
|
+
tr.selected > td { background: rgba(61, 180, 242, 0.12); }
|
|
3458
|
+
.status.active { color: rgb(74, 222, 128); }
|
|
3459
|
+
.status.refused { color: rgb(248, 113, 113); }
|
|
3460
|
+
.empty { color: rgba(255, 255, 255, 0.5); font-size: 1.2rem; }
|
|
3461
|
+
`,uA=({fill:e,index:t,onSelect:n})=>{let r=Dk(t,e.supports);return r.length===0?H(`div`,{className:`proof`,children:H(`span`,{className:`missing`,"data-no-proof":!0,children:`${e.via} names no proving pair`})}):H(V,{children:r.map(e=>{let t=e.ref?.kind===`episode-link`?e.ref.row:void 0;return I(`div`,{className:`proof`,children:[H(`button`,{type:`button`,onClick:()=>n(e.key),children:`Inspect`}),t?H(`span`,{className:`pair`,children:`${t.fromUri} #${t.fromNumber??`null`} to ${t.toUri} #${t.toNumber??`null`}`}):H(`span`,{className:`pair`,children:e.ref?`${rA(e.ref)} ${e.key}`:H(`span`,{className:`missing`,children:`${e.key}: ${iA(e.gap)}`})}),t&&H(`span`,{className:`status ${Mk(t.status)?`active`:`refused`}`,children:t.status})]},e.key)})})},dA=({bundle:e,index:t,selected:n,onSelect:r})=>I(`div`,{css:lA,"data-episodes":!0,children:[(e.episodes??[]).length===0?H(`p`,{className:`empty`,children:`This cluster holds no slots.`}):I(`table`,{"data-slots":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`slot`}),H(`th`,{children:`number`}),H(`th`,{children:`title`}),H(`th`,{children:`fills`})]})}),H(`tbody`,{children:e.episodes.map(e=>I(`tr`,{"data-slot":e.slotId,children:[H(`td`,{className:`slot`,children:e.slotId}),H(`td`,{children:H(Rk,{value:e.number})}),H(`td`,{children:H(Rk,{value:e.title})}),H(`td`,{children:e.fills.length===0?H(`span`,{className:`empty`,children:`nothing fills this slot`}):e.fills.map(e=>I(`div`,{"data-fill":e.episodeUri,children:[I(`div`,{className:`fill`,children:[H(`span`,{className:`uri`,children:e.episodeUri}),I(`span`,{children:[`#`,H(Rk,{value:e.number})]}),H(`span`,{children:e.origin}),H(`span`,{className:`via`,children:e.via}),H(`span`,{className:`by`,children:e.by})]}),H(uA,{fill:e,index:t,onSelect:r})]},`${e.episodeUri}\u0000${e.via}`))})]},e.slotId))})]}),H(`h3`,{children:`Episode edges`}),(e.episodeLinks??[]).length===0?H(`p`,{className:`empty`,children:`No episode links, refused or otherwise.`}):I(`table`,{"data-episode-links":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`status`}),H(`th`,{children:`by`}),H(`th`,{children:`rule`}),H(`th`,{})]})}),H(`tbody`,{children:e.episodeLinks.map(e=>I(`tr`,{"data-episode-link":e.key,"data-status":e.status,className:n===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:`${e.fromUri} #${e.fromNumber??`null`}`}),H(`td`,{className:`uri`,children:`${e.toUri} #${e.toNumber??`null`}`}),H(`td`,{children:e.kind}),H(`td`,{children:H(`span`,{className:`status ${Mk(e.status)?`active`:`refused`}`,children:e.status})}),H(`td`,{children:e.by}),H(`td`,{children:e.reason}),H(`td`,{children:H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Episode claims`}),(e.episodeClaims??[]).length===0?H(`p`,{className:`empty`,children:`no episode level claims`}):I(`table`,{"data-episode-claims":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`claimer`}),H(`th`,{children:`provenance`}),H(`th`,{children:`answer`}),H(`th`,{})]})}),H(`tbody`,{children:e.episodeClaims.map(e=>I(`tr`,{"data-episode-claim":e.key,className:n===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:e.claimer}),H(`td`,{children:e.provenance}),H(`td`,{children:e.answerSeq}),H(`td`,{children:H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]})]});x();var fA=B`
|
|
3462
|
+
max-width: 150rem;
|
|
3463
|
+
margin: calc(var(--stub-header-height) + 2rem) auto 6rem;
|
|
3464
|
+
padding: 0 1.5rem;
|
|
3465
|
+
font-size: 1.3rem;
|
|
3466
|
+
|
|
3467
|
+
h1 { font-size: 2rem; margin-bottom: 0.25rem; }
|
|
3468
|
+
h2 { font-size: 1.5rem; margin: 2rem 0 0.5rem; }
|
|
3469
|
+
h3 { font-size: 1.3rem; margin: 1.2rem 0 0.4rem; }
|
|
3470
|
+
.intro { opacity: 0.7; line-height: 1.5; margin-bottom: 1rem; }
|
|
3471
|
+
|
|
3472
|
+
form.ask { display: flex; gap: 0.6rem; margin: 1rem 0; }
|
|
3473
|
+
form.ask input {
|
|
3474
|
+
flex: 1;
|
|
3475
|
+
min-width: 0;
|
|
3476
|
+
padding: 0.55rem 0.8rem;
|
|
3477
|
+
border-radius: 0.4rem;
|
|
3478
|
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
3479
|
+
background: rgba(255, 255, 255, 0.05);
|
|
3480
|
+
color: inherit;
|
|
3481
|
+
font-family: monospace;
|
|
3482
|
+
}
|
|
3483
|
+
form.ask input:focus { outline: none; border-color: rgba(255, 255, 255, 0.45); }
|
|
3484
|
+
form.ask button {
|
|
3485
|
+
padding: 0.55rem 1.3rem;
|
|
3486
|
+
border-radius: 0.4rem;
|
|
3487
|
+
border: none;
|
|
3488
|
+
background: #fff;
|
|
3489
|
+
color: #000;
|
|
3490
|
+
font-weight: 600;
|
|
3491
|
+
cursor: pointer;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
.resolved, .unresolved {
|
|
3495
|
+
padding: 0.8rem 1rem;
|
|
3496
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3497
|
+
border-radius: 0.5rem;
|
|
3498
|
+
margin-bottom: 1rem;
|
|
3499
|
+
}
|
|
3500
|
+
.unresolved { border-color: rgb(250, 204, 21); }
|
|
3501
|
+
.unresolved .why { color: rgb(250, 204, 21); }
|
|
3502
|
+
.failed {
|
|
3503
|
+
padding: 0.8rem 1rem;
|
|
3504
|
+
border: 1px solid rgb(248, 113, 113);
|
|
3505
|
+
border-radius: 0.5rem;
|
|
3506
|
+
color: rgb(248, 113, 113);
|
|
3507
|
+
overflow-wrap: anywhere;
|
|
3508
|
+
}
|
|
3509
|
+
.pairs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 1.2rem; }
|
|
3510
|
+
.pairs span.label { color: rgba(255, 255, 255, 0.5); margin-right: 0.3rem; }
|
|
3511
|
+
.pairs code { font-family: monospace; }
|
|
3512
|
+
|
|
3513
|
+
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; font-size: 1.15rem; }
|
|
3514
|
+
.chips .chip {
|
|
3515
|
+
padding: 0.1rem 0.5rem;
|
|
3516
|
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
|
3517
|
+
border-radius: 0.3rem;
|
|
3518
|
+
font-family: monospace;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
table {
|
|
3522
|
+
width: 100%;
|
|
3523
|
+
border-collapse: collapse;
|
|
3524
|
+
font-size: 1.2rem;
|
|
3525
|
+
}
|
|
3526
|
+
th, td {
|
|
3527
|
+
padding: 0.3rem 0.6rem 0.3rem 0;
|
|
3528
|
+
text-align: left;
|
|
3529
|
+
vertical-align: top;
|
|
3530
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
3531
|
+
}
|
|
3532
|
+
thead th {
|
|
3533
|
+
font-size: 1.1rem;
|
|
3534
|
+
text-transform: uppercase;
|
|
3535
|
+
letter-spacing: 0.05em;
|
|
3536
|
+
color: rgba(255, 255, 255, 0.45);
|
|
3537
|
+
}
|
|
3538
|
+
td.uri { font-family: monospace; overflow-wrap: anywhere; }
|
|
3539
|
+
tr.selected > td { background: rgba(61, 180, 242, 0.12); }
|
|
3540
|
+
.status.active { color: rgb(74, 222, 128); }
|
|
3541
|
+
.status.refused { color: rgb(248, 113, 113); }
|
|
3542
|
+
.empty { color: rgba(255, 255, 255, 0.5); font-size: 1.2rem; }
|
|
3543
|
+
|
|
3544
|
+
button.inspect {
|
|
3545
|
+
padding: 0.1rem 0.5rem;
|
|
3546
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
3547
|
+
border-radius: 0.3rem;
|
|
3548
|
+
background: transparent;
|
|
3549
|
+
color: inherit;
|
|
3550
|
+
font-size: 1.1rem;
|
|
3551
|
+
cursor: pointer;
|
|
3552
|
+
}
|
|
3553
|
+
button.inspect:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
|
|
3554
|
+
|
|
3555
|
+
.warming {
|
|
3556
|
+
padding: 0.6rem 1rem;
|
|
3557
|
+
border: 1px solid rgb(61, 180, 242);
|
|
3558
|
+
border-radius: 0.5rem;
|
|
3559
|
+
margin-bottom: 1rem;
|
|
3560
|
+
color: rgb(147, 214, 250);
|
|
3561
|
+
}
|
|
3562
|
+
.warming.done { border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.6); }
|
|
3563
|
+
.advice { margin-top: 0.4rem; }
|
|
3564
|
+
.advice a { color: rgb(147, 214, 250); text-decoration: underline; }
|
|
3565
|
+
.split { margin-top: 0.5rem; color: rgb(250, 204, 21); }
|
|
3566
|
+
.split a { color: rgb(250, 204, 21); text-decoration: underline; margin-left: 0.4rem; }
|
|
3567
|
+
code.token { font-family: monospace; }
|
|
3568
|
+
|
|
3569
|
+
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
|
3570
|
+
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }
|
|
3571
|
+
`,pA=1500,mA=({label:e,value:t})=>I(`div`,{children:[H(`span`,{className:`label`,children:e}),H(`code`,{children:H(Rk,{value:t})})]}),hA=({reason:e})=>e===`null`?H(`code`,{className:`token`,"data-token-reason":!0,children:`"null"`}):H(Rk,{value:e}),gA=({load:e=Gp,loadAnswerBytes:t=Kp,warm:n=Ik})=>{let r=ao(),[,i]=io(),a=tm(r),[o,s]=A(a),[c,l]=A({kind:`idle`}),[u,d]=A(0),[f,p]=A({kind:`off`}),[m,h]=A([]),g=_(``),v=_(void 0);k(()=>{s(a),h([]),p({kind:`off`}),g.current=``,v.current!==void 0&&clearTimeout(v.current),v.current=void 0},[a]),k(()=>{if(!a){l({kind:`idle`});return}let t=!0;return l(e=>e.kind===`done`?e:{kind:`loading`}),e(a).then(e=>{t&&l({kind:`done`,bundle:e})}).catch(e=>{t&&l({kind:`failed`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[a,u]);let y=c.kind===`done`?c.bundle:void 0,b=L(()=>y?Tk(y):new Map,[y]),x=m[m.length-1],S=!!(y&&!y.resolved&&y.reason!==`not-enabled`);return k(()=>{if(!a||!S||g.current===a)return;g.current=a;let e=a,t=()=>g.current===e,r=()=>{v.current===void 0&&(v.current=setTimeout(()=>{v.current=void 0,t()&&d(e=>e+1)},pA))};p({kind:`asking`,progress:{payloads:0,uri:null,handles:0,episodes:0}}),n(a,{onProgress:e=>{t()&&(p({kind:`asking`,progress:e}),r())}}).then(e=>{t()&&(p({kind:`done`,progress:e}),d(e=>e+1))}).catch(()=>{t()&&p({kind:`off`})})},[a,S]),k(()=>()=>{g.current=``,v.current!==void 0&&clearTimeout(v.current)},[]),I(`div`,{css:fA,"data-debug-trace":!0,children:[H(`h1`,{children:`Graph trace`}),H(`p`,{className:`intro`,children:`Everything the graph holds for one cluster: its members, every link between them including the refused ones, the episodes it resolved to, and the answer each edge came from. Nothing here is derived, and a value the graph does not carry shows as null. The graph is built inside this tab, so a uri nothing has asked about yet is asked about here first, which is what makes this url worth pasting into a bug report.`}),I(`form`,{className:`ask`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(d(e=>e+1),i(Jp({uri:t})))},children:[H(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`ag:(mal:39535,anilist:101280), or a member uri like mal:39535, or a cluster id like cl:...`,value:o,onInput:e=>s(e.target.value)}),H(`button`,{type:`submit`,children:`Trace`})]}),c.kind===`idle`&&H(`p`,{className:`empty`,children:`Give it a uri. It rides in the url, so this page can be linked into a bug report.`}),f.kind!==`off`&&H(`p`,{className:f.kind===`asking`?`warming`:`warming done`,"data-warming":f.kind,"data-answered":f.progress.payloads,children:f.kind===`asking`?`asking the sources about ${a}: ${f.progress.payloads} answer(s) so far, ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). All 24 sources are asked, so a cold graph takes tens of seconds. The panel fills as they answer and stops waiting on its own.`:f.progress.payloads===0?`nothing answered about ${a}. All 24 sources were asked and none returned a row, so the graph stayed empty: either no source recognises that uri, or every one of them refused it. Nothing is still loading.`:`the sources have stopped answering about ${a}: ${f.progress.payloads} answer(s), ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). What is below is what that produced.`}),c.kind===`loading`&&I(`p`,{className:`empty`,"data-loading":!0,children:[`tracing `,a,`…`]}),c.kind===`failed`&&H(`p`,{className:`failed`,"data-failed":!0,children:c.error}),y&&I(V,{children:[y.resolved?I(`div`,{className:`resolved`,"data-resolved":!0,children:[I(`div`,{className:`pairs`,children:[H(mA,{label:`asked`,value:y.asked}),H(mA,{label:`cluster`,value:y.resolved.clusterId}),H(mA,{label:`aggregate`,value:y.resolved.aggUri}),H(mA,{label:`scope`,value:y.resolved.scope}),H(mA,{label:`kind`,value:y.resolved.kind})]}),(y.resolved.otherClusters??[]).length>0&&I(`div`,{className:`split`,"data-other-clusters":!0,children:[`This address also reaches`,` `,y.resolved.otherClusters.length,` other cluster(s), whose members are not below:`,` `,y.resolved.otherClusters.map(e=>H(`a`,{href:Jp({uri:e,search:r}),children:H(`code`,{children:e})},e))]})]}):I(`div`,{className:`unresolved`,"data-unresolved":!0,"data-reason":y.reason??`none`,children:[H(`div`,{className:`why`,children:jk(y.reason)}),y.reason===`not-enabled`&&I(`div`,{className:`advice`,children:[H(`a`,{"data-reload-graph":!0,href:Xp(r),children:`Reload with ?graph=1`}),` or `,H(`a`,{"data-reload-store":!0,href:Zp(r),children:`drop ?store=legacy`}),`, keeping this uri.`]}),I(`div`,{className:`pairs`,children:[H(mA,{label:`asked`,value:y.asked}),H(mA,{label:`reason`,value:y.reason??null})]})]}),I(`div`,{className:`pairs`,"data-run-length":!0,children:[H(mA,{label:`run length`,value:y.runLength?.value??null}),H(mA,{label:`from`,value:y.runLength?.from??null}),H(mA,{label:`tier`,value:y.runLength?.tier??null}),H(mA,{label:`witnesses`,value:y.runLength?.witnesses??null})]}),I(`div`,{className:`pairs`,"data-cost":!0,children:[H(mA,{label:`statements`,value:y.cost?.statements??null}),H(mA,{label:`ms to build`,value:y.cost?.ms??null})]}),H(`h3`,{children:`Graph counts`}),H(`div`,{className:`chips`,"data-counts":!0,children:Object.entries(y.counts??{}).length===0?H(`span`,{className:`empty`,children:`the bundle carries no counts`}):Object.entries(y.counts).map(([e,t])=>H(`span`,{className:`chip`,children:`${e} ${t}`},e))}),I(`div`,{className:`columns`,children:[I(`div`,{children:[H(`h3`,{children:`Anomalies`}),(y.anomalies??[]).length===0?H(`p`,{className:`empty`,children:`no rule complained`}):H(`table`,{"data-anomalies":!0,children:H(`tbody`,{children:y.anomalies.map((e,t)=>I(`tr`,{children:[H(`td`,{children:e.rule}),H(`td`,{children:e.detail})]},`${e.rule} ${e.detail} ${t}`))})})]}),I(`div`,{children:[H(`h3`,{children:`Asks`}),(y.asks??[]).length===0?H(`p`,{className:`empty`,children:`nothing was asked of any origin`}):I(`table`,{"data-asks":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`seq`}),H(`th`,{children:`origin`}),H(`th`,{children:`outcome`}),H(`th`,{children:`reason`})]})}),H(`tbody`,{children:y.asks.map((e,t)=>I(`tr`,{"data-ask":e.origin,children:[H(`td`,{children:H(Rk,{value:e.seq??null})}),H(`td`,{children:e.origin}),H(`td`,{children:e.outcome}),H(`td`,{children:H(hA,{reason:e.reason})})]},`${e.origin} ${e.seq??t}`))})]})]})]}),H(`h2`,{children:`Media graph`}),H(tA,{bundle:y,selected:x,onSelect:e=>h([e])}),H(`h3`,{children:`Links`}),(y.links??[]).length===0?H(`p`,{className:`empty`,children:`no links, refused or otherwise`}):I(`table`,{"data-links":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`status`}),H(`th`,{children:`by`}),H(`th`,{children:`rule`}),H(`th`,{children:`confidence`}),H(`th`,{})]})}),H(`tbody`,{children:y.links.map(e=>I(`tr`,{"data-link":e.key,"data-status":e.status,className:x===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:H(`span`,{className:`status ${Mk(e.status)?`active`:`refused`}`,children:e.status})}),H(`td`,{children:e.by}),H(`td`,{children:e.reason}),H(`td`,{children:H(Rk,{value:e.confidence})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Claims`}),(y.claims??[]).length===0?H(`p`,{className:`empty`,children:`no claims between the uris this bundle names`}):I(`table`,{"data-claims":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`claimer`}),H(`th`,{children:`provenance`}),H(`th`,{children:`answer`}),H(`th`,{children:`target scope`}),H(`th`,{})]})}),H(`tbody`,{children:y.claims.map(e=>I(`tr`,{"data-claim":e.key,className:x===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:e.claimer}),H(`td`,{children:e.provenance}),H(`td`,{children:e.answerSeq}),H(`td`,{children:H(Rk,{value:e.targetScope})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Attachments`}),(y.attachments??[]).length===0?H(`p`,{className:`empty`,children:`no run is attached to a container here`}):I(`table`,{"data-attachments":!0,children:[H(`thead`,{children:I(`tr`,{children:[H(`th`,{children:`run`}),H(`th`,{children:`container`}),H(`th`,{children:`via`}),H(`th`,{children:`by`}),H(`th`,{children:`evidence`}),H(`th`,{children:`supports`})]})}),H(`tbody`,{children:y.attachments.map(e=>I(`tr`,{children:[H(`td`,{className:`uri`,children:e.runUri}),H(`td`,{className:`uri`,children:e.containerUri}),H(`td`,{children:e.via}),H(`td`,{children:e.by}),H(`td`,{className:`uri`,children:H(Rk,{value:e.evidence})}),H(`td`,{children:(e.supports??[]).length===0?H(Rk,{value:null}):e.supports.map(e=>H(`button`,{type:`button`,className:`inspect`,"data-attachment-support":e,onClick:()=>h([e]),children:e},e))})]},`${e.runUri} ${e.containerUri} ${e.via} ${e.by}`))})]}),H(`h2`,{children:`Episodes`}),H(dA,{bundle:y,index:b,selected:x,onSelect:e=>h([e])}),H(`h2`,{children:`Inspector`}),H(cA,{bundle:y,index:b,trail:m,onFollow:e=>h(t=>[...t,e]),onTrailTo:e=>h(t=>t.slice(0,e+1)),loadAnswerBytes:t})]})]})},_A=`[data-party-scroll]`,vA=()=>{let e=document.querySelectorAll(_A);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.scrollHeight-n.clientHeight>0)return n}},yA=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):0,bA=()=>{let e=vA();return e?Math.max(0,e.scrollHeight-e.clientHeight):Math.max(0,document.documentElement.scrollHeight-window.innerHeight)},xA=()=>{let e=vA();return e?yA(e.scrollTop,e.scrollHeight-e.clientHeight):yA(window.scrollY,document.documentElement.scrollHeight-window.innerHeight)},SA=()=>{try{return window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0}catch{return!1}},CA=(e,t,n)=>!e||SA()?`instant`:t<=n*2?`smooth`:`instant`,wA=(e,{smooth:t}={})=>{let n=vA();if(n){let r=n.scrollHeight-n.clientHeight,i=r>0?e*r:0;n.scrollTo({top:i,behavior:CA(t,Math.abs(i-n.scrollTop),n.clientHeight)});return}let r=document.documentElement.scrollHeight-window.innerHeight,i=r>0?e*r:0;window.scrollTo({top:i,behavior:CA(t,Math.abs(i-window.scrollY),window.innerHeight)})};x();var TA=2,EA=8e3,DA=[`wheel`,`touchstart`,`keydown`,`pointerdown`],OA=60,kA=()=>{let e=Cf(),[t,n]=io(),r=ao(),i=r?`${t}?${r}`:t,a=e.status===`active`?e.role:void 0,o=t===hf;k(()=>{a!==`host`||o||(Z.setLocation(i,xA()),Z.send({t:`nav`,path:i}))},[a,i,o]),k(()=>{if(a!==`host`||o)return;let e=0,t,n=()=>{t=void 0,e=Date.now();let n=xA();Z.setLocation(i,n),Z.send({t:`scroll`,y:n})},r=()=>{if(t)return;let r=Math.max(0,1e3/TA-(Date.now()-e));t=setTimeout(n,r)};return document.addEventListener(`scroll`,r,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,r,{capture:!0}),t&&clearTimeout(t)}},[a,i]);let s=_(void 0),c=_(0);k(()=>{if(s.current===void 0)return;let e=s.current;s.current=void 0;let t=0,n=-1,r=0,i=!1,a=c.current,o=Date.now()+EA,l=()=>{i=!0};for(let e of DA)document.addEventListener(e,l,{passive:!0});let u=()=>{cancelAnimationFrame(t);for(let e of DA)document.removeEventListener(e,l)};if(wc(),e===0)return wA(0),u;let d=()=>{let s=bA();s===n?r+=1:(r=0,n=s);let l=s>0&&r>=OA;if(i||c.current!==a||l||Date.now()>o)return u();wA(e),t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),u},[i]);let l=_(!1);k(()=>{l.current=!1},[e.status===`active`?e.invite:void 0]);let u=(e,t)=>{l.current=!0,e===i?(wc(),c.current+=1,wA(t,{smooth:!0})):(s.current=t,n(e))};return wf((e,{replayed:t})=>{if(a===`guest`)switch(e.t){case`nav`:l.current=!0,e.path!==i&&n(e.path);return;case`scroll`:Z.hostPath()===i&&(wc(),c.current+=1,wA(e.y,{smooth:!0}));return;case`state`:(!l.current||t)&&u(e.path,e.y);return}}),null};x();var AA=4,jA=2500,MA=B`
|
|
3572
|
+
position: fixed;
|
|
3573
|
+
left: 0;
|
|
3574
|
+
top: 0;
|
|
3575
|
+
z-index: ${Md.partyCursor};
|
|
3576
|
+
pointer-events: none;
|
|
3577
|
+
display: flex;
|
|
3578
|
+
align-items: flex-start;
|
|
3579
|
+
gap: 0.4rem;
|
|
3580
|
+
transform: translate(var(--x), var(--y));
|
|
3581
|
+
transition: transform 0.12s linear, opacity 0.3s;
|
|
3582
|
+
will-change: transform;
|
|
3583
|
+
|
|
3584
|
+
svg {
|
|
3585
|
+
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
.tag {
|
|
3589
|
+
margin-top: 1.4rem;
|
|
3590
|
+
padding: 0.2rem 0.6rem;
|
|
3591
|
+
border-radius: 0.4rem;
|
|
3592
|
+
background: #4ade80;
|
|
3593
|
+
color: #06120a;
|
|
3594
|
+
font-size: 1.1rem;
|
|
3595
|
+
font-weight: 600;
|
|
3596
|
+
white-space: nowrap;
|
|
3597
|
+
}
|
|
3598
|
+
`,NA=()=>{let e=Cf(),t=e.status===`active`?e.role:void 0,[n]=io(),r=ao(),i=r?`${n}?${r}`:n;k(()=>{if(t!==`host`)return;let e=0,n,r,i=()=>{n=void 0,!(!r||Z.playing())&&(e=Date.now(),Z.send({t:`cursor`,x:r.x,y:r.y}))},a=t=>{r={x:Math.min(1,Math.max(0,t.clientX/window.innerWidth)),y:Math.min(1,Math.max(0,t.clientY/window.innerHeight))},!n&&(n=setTimeout(i,Math.max(0,1e3/AA-(Date.now()-e))))};return window.addEventListener(`pointermove`,a,{passive:!0}),()=>{window.removeEventListener(`pointermove`,a),n&&clearTimeout(n)}},[t]);let[a,o]=A(void 0),[s,c]=A(()=>Date.now()),l=_(!1);if(wf(e=>{if(t===`guest`){if(e.t===`playback`||e.t===`state`&&e.s){let t=(e.t,e.s);l.current=!t.paused,l.current&&o(void 0);return}e.t!==`cursor`||l.current||Z.hostPath()===i&&o({x:e.x,y:e.y,at:Date.now()})}}),k(()=>{if(!a)return;let e=setInterval(()=>c(Date.now()),500);return()=>clearInterval(e)},[a]),t!==`guest`||!a||s-a.at>jA)return null;let u=e.status===`active`?Z.nameOf(e.owner):void 0;return I(`div`,{css:MA,style:{"--x":`${a.x*100}vw`,"--y":`${a.y*100}vh`},"aria-hidden":`true`,children:[H(`svg`,{width:`18`,height:`22`,viewBox:`0 0 18 22`,fill:`none`,children:H(`path`,{d:`M2 2 L2 17 L6.5 13 L9.5 20 L12 19 L9 12.5 L15 12 Z`,fill:`#4ade80`,stroke:`#06120a`,strokeWidth:`1.2`,strokeLinejoin:`round`})}),H(`span`,{className:`tag`,children:u??`host`})]})};x();var PA=B`
|
|
3599
|
+
position: fixed;
|
|
3600
|
+
right: 2rem;
|
|
3601
|
+
bottom: 2rem;
|
|
3602
|
+
z-index: ${Md.headerPopup};
|
|
3603
|
+
display: flex;
|
|
3604
|
+
flex-direction: column;
|
|
3605
|
+
align-items: flex-end;
|
|
3606
|
+
gap: 1rem;
|
|
3607
|
+
|
|
3608
|
+
.toggle {
|
|
3609
|
+
position: relative;
|
|
3610
|
+
display: flex;
|
|
3611
|
+
align-items: center;
|
|
3612
|
+
justify-content: center;
|
|
3613
|
+
width: 4.8rem;
|
|
3614
|
+
height: 4.8rem;
|
|
3615
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
3616
|
+
border-radius: 50%;
|
|
3617
|
+
background: #1a1a1a;
|
|
3618
|
+
color: rgba(255, 255, 255, 0.85);
|
|
3619
|
+
cursor: pointer;
|
|
3620
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.toggle:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
|
|
3624
|
+
|
|
3625
|
+
.unread {
|
|
3626
|
+
position: absolute;
|
|
3627
|
+
top: -0.3rem;
|
|
3628
|
+
right: -0.3rem;
|
|
3629
|
+
min-width: 1.8rem;
|
|
3630
|
+
height: 1.8rem;
|
|
3631
|
+
padding: 0 0.5rem;
|
|
3632
|
+
border-radius: 1rem;
|
|
3633
|
+
background: #4ade80;
|
|
3634
|
+
color: #06120a;
|
|
3635
|
+
font-size: 1.1rem;
|
|
3636
|
+
font-weight: 700;
|
|
3637
|
+
line-height: 1.8rem;
|
|
3638
|
+
text-align: center;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
.panel {
|
|
3642
|
+
display: flex;
|
|
3643
|
+
flex-direction: column;
|
|
3644
|
+
width: min(32rem, calc(100vw - 4rem));
|
|
3645
|
+
height: min(40rem, calc(100vh - 12rem));
|
|
3646
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3647
|
+
border-radius: 0.8rem;
|
|
3648
|
+
background: #1a1a1a;
|
|
3649
|
+
color: rgba(255, 255, 255, 0.85);
|
|
3650
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
|
|
3651
|
+
overflow: hidden;
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
.head {
|
|
3655
|
+
display: flex;
|
|
3656
|
+
align-items: center;
|
|
3657
|
+
justify-content: space-between;
|
|
3658
|
+
padding: 1rem 1.2rem;
|
|
3659
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
3660
|
+
font-size: 1.3rem;
|
|
3661
|
+
font-weight: 600;
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
.head button {
|
|
3665
|
+
display: flex;
|
|
3666
|
+
border: none;
|
|
3667
|
+
background: transparent;
|
|
3668
|
+
color: rgba(255, 255, 255, 0.5);
|
|
3669
|
+
cursor: pointer;
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
.lines {
|
|
3673
|
+
flex: 1;
|
|
3674
|
+
min-height: 0;
|
|
3675
|
+
overflow-y: auto;
|
|
3676
|
+
padding: 1rem 1.2rem;
|
|
3677
|
+
display: flex;
|
|
3678
|
+
flex-direction: column;
|
|
3679
|
+
gap: 0.6rem;
|
|
3680
|
+
font-size: 1.3rem;
|
|
3681
|
+
line-height: 1.4;
|
|
3682
|
+
}
|
|
3683
|
+
|
|
3684
|
+
.line { display: flex; flex-direction: column; gap: 0.1rem; }
|
|
3685
|
+
.line .who { font-size: 1.1rem; color: rgba(255, 255, 255, 0.45); }
|
|
3686
|
+
.line.self .who { color: #4ade80; }
|
|
3687
|
+
.line .text { overflow-wrap: anywhere; }
|
|
3688
|
+
.empty { color: rgba(255, 255, 255, 0.4); }
|
|
3689
|
+
|
|
3690
|
+
form {
|
|
3691
|
+
display: flex;
|
|
3692
|
+
gap: 0.6rem;
|
|
3693
|
+
padding: 0.8rem;
|
|
3694
|
+
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
3695
|
+
}
|
|
3696
|
+
|
|
3697
|
+
input {
|
|
3698
|
+
flex: 1;
|
|
3699
|
+
min-width: 0;
|
|
3700
|
+
height: 3.4rem;
|
|
3701
|
+
padding: 0 1rem;
|
|
3702
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3703
|
+
border-radius: 0.5rem;
|
|
3704
|
+
background: rgba(255, 255, 255, 0.05);
|
|
3705
|
+
color: #fff;
|
|
3706
|
+
font-family: inherit;
|
|
3707
|
+
font-size: 1.3rem;
|
|
3708
|
+
outline: none;
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3711
|
+
input:focus { border-color: rgba(255, 255, 255, 0.4); }
|
|
3712
|
+
|
|
3713
|
+
form button {
|
|
3714
|
+
display: flex;
|
|
3715
|
+
align-items: center;
|
|
3716
|
+
justify-content: center;
|
|
3717
|
+
width: 3.4rem;
|
|
3718
|
+
height: 3.4rem;
|
|
3719
|
+
border: none;
|
|
3720
|
+
border-radius: 0.5rem;
|
|
3721
|
+
background: rgba(255, 255, 255, 0.1);
|
|
3722
|
+
color: #fff;
|
|
3723
|
+
cursor: pointer;
|
|
3724
|
+
}
|
|
3725
|
+
`,FA=(e,t)=>e.self?`you`:e.name??(e.from===t?`host`:e.from.slice(0,6)),IA=()=>{let e=Cf(),t=e.status===`active`,[n,r]=A(!1),[i,a]=A(()=>Z.chat()),[o,s]=A(0),[c,l]=A(``),u=_(null);if(wf((e,t)=>{e.t!==`chat`&&e.t!==`name`||(a(Z.chat()),e.t===`chat`&&!n&&!t.self&&s(e=>e+1))}),k(()=>{n&&s(0)},[n]),k(()=>{t||(a([]),s(0),r(!1))},[t]),k(()=>{u.current?.scrollTo({top:u.current.scrollHeight})},[i,n]),!t)return null;let d=e.owner;return I(`div`,{css:PA,children:[n&&I(`div`,{className:`panel`,role:`dialog`,"aria-label":`Party chat`,children:[I(`div`,{className:`head`,children:[H(`span`,{children:`Party chat`}),H(`button`,{type:`button`,"aria-label":`Close chat`,onClick:()=>r(!1),children:H(vc,{size:16})})]}),I(`div`,{className:`lines`,ref:u,children:[i.length===0&&H(`div`,{className:`empty`,children:`Nothing said yet.`}),i.map(e=>I(`div`,{className:`line${e.self?` self`:``}`,children:[H(`span`,{className:`who`,children:FA(e,d)}),H(`span`,{className:`text`,children:e.text})]},e.seq))]}),I(`form`,{onSubmit:e=>{e.preventDefault();let t=Hd(c);t&&(Z.send({t:`chat`,text:t}),l(``))},children:[H(`input`,{value:c,placeholder:`Say something`,"aria-label":`Chat message`,maxLength:500,onInput:e=>l(e.currentTarget.value)}),H(`button`,{type:`submit`,"aria-label":`Send`,children:H(lc,{size:16})})]})]}),I(`button`,{type:`button`,className:`toggle`,"aria-label":n?`Hide chat`:`Show chat`,onClick:()=>r(e=>!e),children:[H(rc,{size:20}),o>0&&H(`span`,{className:`unread`,children:o})]})]})};x();var LA=()=>({pathname:location.pathname,search:location.search}),RA=[[`pushState`,`push`],[`replaceState`,`replace`],[`popstate`,`pop`]],zA=()=>{let e=_(LA());return k(()=>{let t=RA.map(([t,n])=>{let r=()=>{let t={from:e.current,to:LA(),kind:n,asked:Dc()};e.current=t.to,bc(t)&&Cc()};return addEventListener(t,r),()=>removeEventListener(t,r)});return()=>{wc();for(let e of t)e()}},[]),null};x();var BA=()=>{let{query:e}=no();return H(go,{to:as({query:is(e)}),replace:!0})},VA=()=>(k(()=>{globalThis.close()},[]),H(`div`,{children:`Logging in... this window will close automatically.`})),HA=B`
|
|
3726
|
+
display: flex;
|
|
3727
|
+
flex-direction: column;
|
|
3728
|
+
min-height: 100vh;
|
|
3729
|
+
|
|
3730
|
+
& > .content {
|
|
3731
|
+
flex: 1;
|
|
3732
|
+
}
|
|
3733
|
+
`,UA=B`
|
|
3734
|
+
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
3735
|
+
`,WA=()=>H(co,{hrefs:Ps,children:I(`div`,{css:HA,children:[H(jf,{}),H(`div`,{className:`content`,children:I(ho,{children:[H(fo,{path:yo(J.HOME),component:sO}),H(fo,{path:yo(J.MEDIA),component:sO}),H(fo,{path:yo(J.SEARCH),component:KO}),H(fo,{path:yo(J.SEARCH_LEGACY),component:BA}),H(fo,{path:yo(J.LEGAL),component:YO}),H(fo,{path:yo(J.PRIVACY),component:XO}),H(fo,{path:yo(J.SETTINGS),component:rk}),H(fo,{path:yo(J.WATCH),component:gk}),H(fo,{path:yo(J.PARTY),component:yk}),H(fo,{path:yo(J.DEBUG_TRACE),component:gA}),H(fo,{path:yo(J.LOGIN_CALLBACK),component:VA}),H(fo,{component:()=>H(`div`,{css:UA,children:`404 No page found`})})]})}),H(Nf,{}),H(If,{}),H(kA,{}),H(NA,{}),H(IA,{}),H(zA,{})]})});N(),x();var GA=B`
|
|
3736
|
+
display: flex;
|
|
3737
|
+
align-items: center;
|
|
3738
|
+
justify-content: center;
|
|
3739
|
+
min-height: 100vh;
|
|
3740
|
+
padding: 3rem;
|
|
3741
|
+
|
|
3742
|
+
.panel {
|
|
3743
|
+
width: 100%;
|
|
3744
|
+
max-width: 48rem;
|
|
3745
|
+
padding: 2.4rem;
|
|
3746
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
3747
|
+
border-radius: 0.8rem;
|
|
3748
|
+
background: #171717;
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
h2 {
|
|
3752
|
+
font-size: 1.9rem;
|
|
3753
|
+
margin-bottom: 0.8rem;
|
|
3754
|
+
}
|
|
3755
|
+
|
|
3756
|
+
.message {
|
|
3757
|
+
font-family: monospace;
|
|
3758
|
+
font-size: 1.3rem;
|
|
3759
|
+
line-height: 1.5;
|
|
3760
|
+
color: rgba(255, 255, 255, 0.7);
|
|
3761
|
+
overflow-wrap: anywhere;
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
.actions {
|
|
3765
|
+
display: flex;
|
|
3766
|
+
align-items: center;
|
|
3767
|
+
gap: 1rem;
|
|
3768
|
+
margin-top: 1.8rem;
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
button {
|
|
3772
|
+
padding: 0.6rem 1.2rem;
|
|
3773
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
3774
|
+
border-radius: 0.4rem;
|
|
3775
|
+
background: none;
|
|
3776
|
+
color: inherit;
|
|
3777
|
+
font-size: 1.4rem;
|
|
3778
|
+
cursor: pointer;
|
|
3779
|
+
|
|
3780
|
+
&:hover {
|
|
3781
|
+
background: rgba(255, 255, 255, 0.08);
|
|
3782
|
+
}
|
|
3783
|
+
}
|
|
3784
|
+
`,KA=(e,t)=>`route: ${t}\nmessage: ${e.message}\nstack: ${e.stack??`(no stack)`}`,qA=({error:e,route:t})=>{let[n,r]=A(!1);return H(`div`,{css:GA,children:I(`div`,{className:`panel`,children:[H(`h2`,{children:`This page failed to render`}),H(`p`,{className:`message`,children:e.message||`No message was given.`}),I(`div`,{className:`actions`,children:[H(`button`,{type:`button`,onClick:()=>globalThis.location?.reload(),children:`Reload`}),H(`button`,{type:`button`,onClick:()=>{let n=navigator.clipboard?.writeText(KA(e,t));n&&n.then(()=>r(!0)).catch(e=>console.error(Error(`the failure details could not be copied`,{cause:e})))},children:n?`Copied`:`Copy details`})]})]})})},JA=class extends fe{state={error:null,route:this.props.route};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}static getDerivedStateFromProps(e,t){return e.route===t.route?null:{error:null,route:e.route}}componentDidCatch(e){console.error(Error(`the ${this.props.route} route failed to render`,{cause:e}))}render(){return this.state.error?H(qA,{error:this.state.error,route:this.props.route}):this.props.children}},YA=({children:e})=>{let[t]=io();return H(JA,{route:t,children:e})};Se(location.href)&&(window.__stubExportStore=e=>ke(e??{excludeOrigins:[]}));var XA=async(e,t={},n={})=>Nk(ye,e,t,{settleMs:n.settleMs});Te(location.href)&&(window.__stubExportAnswers=()=>je(),window.__stubExportAsks=()=>Ee(),window.__stubGraphCounts=()=>Ce()),xe(location.href)&&(window.__stubGraphQL=(e,t,n)=>XA(e,t,n)),N(),ek();var ZA=B`
|
|
3785
|
+
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
|
|
3786
|
+
|
|
3787
|
+
:root {
|
|
3788
|
+
color-scheme: dark;
|
|
3789
|
+
/* the fixed header's own height. Every page that has to start below the bar reads this instead of
|
|
3790
|
+
guessing, which is how /settings ended up 8px short of a header it never measured */
|
|
3791
|
+
--stub-header-height: 7rem;
|
|
3792
|
+
}
|
|
3793
|
+
|
|
3794
|
+
@media (max-width: 768px) {
|
|
3795
|
+
:root {
|
|
3796
|
+
--stub-header-height: 6.4rem;
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
*, *::before, *::after {
|
|
3801
|
+
box-sizing: border-box;
|
|
3802
|
+
margin: 0;
|
|
3803
|
+
padding: 0;
|
|
3804
|
+
}
|
|
3805
|
+
|
|
3806
|
+
html {
|
|
3807
|
+
font-size: 62.5%;
|
|
3808
|
+
height: 100vh;
|
|
3809
|
+
width: 100%;
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
body {
|
|
3813
|
+
margin: 0;
|
|
3814
|
+
height: 100vh;
|
|
3815
|
+
width: 100%;
|
|
3816
|
+
font-size: 1.6rem;
|
|
3817
|
+
font-family: Fira Sans;
|
|
3818
|
+
background-color: #0f0f0f;
|
|
3819
|
+
color: #fff;
|
|
3820
|
+
font-family: Montserrat;
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3823
|
+
#stub-root {
|
|
3824
|
+
height: 100vh;
|
|
3825
|
+
width: 100%;
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3828
|
+
a {
|
|
3829
|
+
color: #777777;
|
|
3830
|
+
text-decoration: none;
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
a:hover {
|
|
3834
|
+
color: #fff;
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
ul {
|
|
3838
|
+
list-style: none;
|
|
3839
|
+
}
|
|
3840
|
+
|
|
3841
|
+
.hidden {
|
|
3842
|
+
display: none !important;
|
|
3843
|
+
}
|
|
3844
|
+
`;Z.resume();var QA=document.createElement(`div`);QA.id=`stub-root`,ae(I(Pn,{value:Sa,children:[H(c,{styles:ZA}),H(YA,{children:H(WA,{})})]}),document.body.appendChild(QA));
|