@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
|
@@ -1,1530 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-D5uFVynV.js","assets/api-DLvscoll-DBsLjsEb.js","assets/build-BuC_lDPE.js","assets/account-CTqTIqCB.js","assets/account-DQlY5DdH.js","assets/remote-DNcNpuT3.js","assets/remote-CW2xewp5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,i as t,t as n}from"./rolldown-runtime-CNC7AqOf.js";import{A as r,C as i,D as a,O as o,S as s,T as c,_ as l,a as u,b as d,d as f,f as p,g as m,h,i as g,j as _,k as v,m as y,p as b,r as x,s as S,v as C,w,x as T,y as E}from"./compat-CusyxzKh.js";import{a as D,i as O,n as k,r as A,t as j}from"./build-BuC_lDPE.js";import{o as M}from"./account-DQlY5DdH.js";import{c as N,o as P,r as F,s as ee,t as I}from"./api-DLvscoll-DBsLjsEb.js";import{a as L,i as R,n as z,o as te,t as ne}from"./dist-D-OKiX-f.js";import{n as re,t as B}from"./dist-BrpV89uJ.js";import{t as ie}from"./preload-helper-D2XUqLHy.js";import{n as ae}from"./remote-CW2xewp5.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),v(),s(),p();function oe(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function se(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var ce=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0?!0:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(se(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=oe(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),le=`-ms-`,ue=`-moz-`,V=`-webkit-`,de=`comm`,fe=`rule`,pe=`decl`,me=`@import`,he=`@keyframes`,ge=`@layer`,_e=Math.abs,ve=String.fromCharCode,ye=Object.assign;function be(e,t){return we(e,0)^45?(((t<<2^we(e,0))<<2^we(e,1))<<2^we(e,2))<<2^we(e,3):0}function xe(e){return e.trim()}function Se(e,t){return(e=t.exec(e))?e[0]:e}function H(e,t,n){return e.replace(t,n)}function Ce(e,t){return e.indexOf(t)}function we(e,t){return e.charCodeAt(t)|0}function Te(e,t,n){return e.slice(t,n)}function Ee(e){return e.length}function De(e){return e.length}function Oe(e,t){return t.push(e),e}function ke(e,t){return e.map(t).join(``)}var Ae=1,je=1,Me=0,Ne=0,U=0,Pe=``;function Fe(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Ae,column:je,length:o,return:``}}function Ie(e,t){return ye(Fe(``,null,null,``,null,null,0),e,{length:-e.length},t)}function Le(){return U}function Re(){return U=Ne>0?we(Pe,--Ne):0,je--,U===10&&(je=1,Ae--),U}function ze(){return U=Ne<Me?we(Pe,Ne++):0,je++,U===10&&(je=1,Ae++),U}function Be(){return we(Pe,Ne)}function Ve(){return Ne}function He(e,t){return Te(Pe,e,t)}function Ue(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function We(e){return Ae=je=1,Me=Ee(Pe=e),Ne=0,[]}function Ge(e){return Pe=``,e}function Ke(e){return xe(He(Ne-1,Ye(e===91?e+2:e===40?e+1:e)))}function qe(e){for(;(U=Be())&&U<33;)ze();return Ue(e)>2||Ue(U)>3?``:` `}function Je(e,t){for(;--t&&ze()&&!(U<48||U>102||U>57&&U<65||U>70&&U<97););return He(e,Ve()+(t<6&&Be()==32&&ze()==32))}function Ye(e){for(;ze();)switch(U){case e:return Ne;case 34:case 39:e!==34&&e!==39&&Ye(U);break;case 40:e===41&&Ye(e);break;case 92:ze();break}return Ne}function Xe(e,t){for(;ze()&&e+U!==57&&!(e+U===84&&Be()===47););return`/*`+He(t,Ne-1)+`*`+ve(e===47?e:ze())}function Ze(e){for(;!Ue(Be());)ze();return He(e,Ne)}function Qe(e){return Ge($e(``,null,null,null,[``],e=We(e),0,[0],e))}function $e(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=ze()){case 40:if(m!=108&&we(C,d-1)==58){Ce(C+=H(Ke(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=Ke(v);break;case 9:case 10:case 13:case 32:C+=qe(m);break;case 92:C+=Je(Ve()-1,7);continue;case 47:switch(Be()){case 42:case 47:Oe(tt(Xe(ze(),Ve()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=Ee(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=H(C,/\f/g,``)),p>0&&Ee(C)-d&&Oe(p>32?nt(C+`;`,r,n,d-1):nt(H(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(Oe(S=et(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123)if(u===0)$e(C,t,S,S,b,a,d,s,x);else switch(f===99&&we(C,3)===110?100:f){case 100:case 108:case 109:case 115:$e(e,S,S,r&&Oe(et(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:$e(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+Ee(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Re()==125)continue}switch(C+=ve(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(Ee(C)-1)*_,_=1;break;case 64:Be()===45&&(C+=Ke(ze())),f=Be(),u=d=Ee(y=C+=Ze(Ve())),v++;break;case 45:m===45&&Ee(C)==2&&(h=0)}}return a}function et(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=De(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=Te(e,d+1,d=_e(h=o[m])),y=e;_<p;++_)(y=xe(h>0?f[_]+` `+v:H(v,/&\f/g,f[_])))&&(c[g++]=y);return Fe(e,t,n,i===0?fe:s,c,l,u)}function tt(e,t,n){return Fe(e,t,n,de,ve(Le()),Te(e,2,-2),0)}function nt(e,t,n,r){return Fe(e,t,n,pe,Te(e,0,r),Te(e,r+1,-1),r)}function rt(e,t){for(var n=``,r=De(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function it(e,t,n,r){switch(e.type){case ge:if(e.children.length)break;case me:case pe:return e.return=e.return||e.value;case de:return``;case he:return e.return=e.value+`{`+rt(e.children,r)+`}`;case fe:e.value=e.props.join(`,`)}return Ee(n=rt(e.children,r))?e.return=e.value+`{`+n+`}`:``}function at(e){var t=De(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function ot(e){return function(t){t.root||(t=t.return)&&e(t)}}function st(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var ct=function(e,t,n){for(var r=0,i=0;r=i,i=Be(),r===38&&i===12&&(t[n]=1),!Ue(i);)ze();return He(e,Ne)},lt=function(e,t){var n=-1,r=44;do switch(Ue(r)){case 0:r===38&&Be()===12&&(t[n]=1),e[n]+=ct(Ne-1,t,n);break;case 2:e[n]+=Ke(r);break;case 4:if(r===44){e[++n]=Be()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=ve(r)}while(r=ze());return e},ut=function(e,t){return Ge(lt(We(e),t))},dt=new WeakMap,ft=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!dt.get(n))&&!r){dt.set(e,!0);for(var i=[],a=ut(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},pt=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function mt(e,t){switch(be(e,t)){case 5103:return V+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return V+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return V+e+ue+e+le+e+e;case 6828:case 4268:return V+e+le+e+e;case 6165:return V+e+le+`flex-`+e+e;case 5187:return V+e+H(e,/(\w+).+(:[^]+)/,V+`box-$1$2`+le+`flex-$1$2`)+e;case 5443:return V+e+le+`flex-item-`+H(e,/flex-|-self/,``)+e;case 4675:return V+e+le+`flex-line-pack`+H(e,/align-content|flex-|-self/,``)+e;case 5548:return V+e+le+H(e,`shrink`,`negative`)+e;case 5292:return V+e+le+H(e,`basis`,`preferred-size`)+e;case 6060:return V+`box-`+H(e,`-grow`,``)+V+e+le+H(e,`grow`,`positive`)+e;case 4554:return V+H(e,/([^-])(transform)/g,`$1`+V+`$2`)+e;case 6187:return H(H(H(e,/(zoom-|grab)/,V+`$1`),/(image-set)/,V+`$1`),e,``)+e;case 5495:case 3959:return H(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return H(H(e,/(.+:)(flex-)?(.*)/,V+`box-pack:$3`+le+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+V+e+e;case 4095:case 3583:case 4068:case 2532:return H(e,/(.+)-inline(.+)/,V+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ee(e)-1-t>6)switch(we(e,t+1)){case 109:if(we(e,t+4)!==45)break;case 102:return H(e,/(.+:)(.+)-([^]+)/,`$1`+V+`$2-$3$1`+ue+(we(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~Ce(e,`stretch`)?mt(H(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(we(e,t+1)!==115)break;case 6444:switch(we(e,Ee(e)-3-(~Ce(e,`!important`)&&10))){case 107:return H(e,`:`,`:`+V)+e;case 101:return H(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+V+(we(e,14)===45?`inline-`:``)+`box$3$1`+V+`$2$3$1`+le+`$2box$3`)+e}break;case 5936:switch(we(e,t+11)){case 114:return V+e+le+H(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return V+e+le+H(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return V+e+le+H(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return V+e+le+e+e}return e}var ht=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case pe:e.return=mt(e.value,e.length);break;case he:return rt([Ie(e,{value:H(e.value,`@`,`@`+V)})],r);case fe:if(e.length)return ke(e.props,function(t){switch(Se(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return rt([Ie(e,{props:[H(t,/:(read-\w+)/,`:`+ue+`$1`)]})],r);case`::placeholder`:return rt([Ie(e,{props:[H(t,/:(plac\w+)/,`:`+V+`input-$1`)]}),Ie(e,{props:[H(t,/:(plac\w+)/,`:`+ue+`$1`)]}),Ie(e,{props:[H(t,/:(plac\w+)/,le+`input-$1`)]})],r)}return``})}}],gt=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||ht,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[ft,pt],l,u=[it,ot(function(e){l.insert(e)})],d=at(c.concat(r,u)),f=function(e){return rt(Qe(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new ce({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p},_t=n((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),vt=n(((e,t)=>{t.exports=_t()})),yt=n(((e,t)=>{var n=vt(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h}));function bt(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var xt=function(e,t,n){var r=e.key+`-`+t.name;n===!1&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},St=function(e,t,n){xt(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function Ct(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var wt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Tt=/[A-Z]|^ms/g,Et=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dt=function(e){return e.charCodeAt(1)===45},Ot=function(e){return e!=null&&typeof e!=`boolean`},kt=st(function(e){return Dt(e)?e:e.replace(Tt,`-$&`).toLowerCase()}),At=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(Et,function(e,t,n){return Pt={name:t,styles:n,next:Pt},t})}return wt[e]!==1&&!Dt(e)&&typeof t==`number`&&t!==0?t+`px`:t};function jt(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return Pt={name:i.name,styles:i.styles,next:Pt},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Pt={name:o.name,styles:o.styles,next:Pt},o=o.next;return a.styles+`;`}return Mt(e,t,n);case`function`:if(e!==void 0){var s=Pt,c=n(e);return Pt=s,jt(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function Mt(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=jt(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:Ot(s)&&(r+=kt(a)+`:`+At(a,s)+`;`)}else if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)Ot(o[c])&&(r+=kt(a)+`:`+At(a,o[c])+`;`);else{var l=jt(e,t,o);switch(a){case`animation`:case`animationName`:r+=kt(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}return r}var Nt=/label:\s*([^\s;{]+)\s*(;|$)/g,Pt;function Ft(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;Pt=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=jt(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=jt(n,t,e[o]),r&&(i+=a[o]);Nt.lastIndex=0;for(var s=``,c;(c=Nt.exec(i))!==null;)s+=`-`+c[1];return{name:Ct(i)+s,styles:i,next:Pt}}var It=function(e){return e()},Lt=y||!1,Rt=Lt||It,zt=Lt||h;p();var Bt=a(typeof HTMLElement<`u`?gt({key:`css`}):null);Bt.Provider;var Vt=function(e){return S(function(t,n){return e(t,i(Bt),n)})},Ht=a({}),Ut={}.hasOwnProperty,Wt=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,Gt=function(e,t){var n={};for(var r in t)Ut.call(t,r)&&(n[r]=t[r]);return n[Wt]=e,n},Kt=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return xt(t,n,r),Rt(function(){return St(t,n,r)}),null},qt=Vt(function(e,t,n){var a=e.css;typeof a==`string`&&t.registered[a]!==void 0&&(a=t.registered[a]);var s=e[Wt],c=[a],l=``;typeof e.className==`string`?l=bt(t.registered,c,e.className):e.className!=null&&(l=e.className+` `);var u=Ft(c,void 0,i(Ht));l+=t.key+`-`+u.name;var d={};for(var f in e)Ut.call(e,f)&&f!==`css`&&f!==Wt&&(d[f]=e[f]);return d.className=l,n&&(d.ref=n),o(r,null,o(Kt,{cache:t,serialized:u,isStringTag:typeof s==`string`}),o(s,d))});p(),yt();var Jt=function(e,t){var n=arguments;if(t==null||!Ut.call(t,`css`))return o.apply(void 0,n);var r=n.length,i=Array(r);i[0]=qt,i[1]=Gt(e,t);for(var a=2;a<r;a++)i[a]=n[a];return o.apply(null,i)};(function(e){var t;t||=e.JSX||={}})(Jt||={});var Yt=Vt(function(e,t){var n=e.styles,r=Ft([n],void 0,i(Ht)),a=m();return zt(function(){var e=t.key+`-global`,n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),i=!1,o=document.querySelector(`style[data-emotion="`+e+` `+r.name+`"]`);return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),o!==null&&(i=!0,o.setAttribute(`data-emotion`,e),n.hydrate([o])),a.current=[n,i],function(){n.flush()}},[t]),zt(function(){var e=a.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&St(t,r.next,!0),n.tags.length&&(n.before=n.tags[n.tags.length-1].nextElementSibling,n.flush()),t.insert(``,r,n,!1)},[t,r.name]),null});function Xt(){return Ft([...arguments])}function Zt(){var e=Xt.apply(void 0,arguments),t=`animation-`+e.name;return{name:t,styles:`@keyframes `+t+`{`+e.styles+`}`,anim:1,toString:function(){return`_EMO_`+this.name+`_`+this.styles+`_EMO_`}}}var Qt=(e,t)=>{let n=new EventTarget,r=new Map,i=EventTarget.prototype.addEventListener.bind(n),a=EventTarget.prototype.removeEventListener.bind(n);return Object.defineProperty(n,"addEventListener",{configurable:!0,value:(a,o,s)=>{if(o!==null){if(!r.has(a)){let i=r=>{n.dispatchEvent(new CustomEvent(a,{detail:t(r,e),bubbles:r.bubbles,cancelable:r.cancelable,composed:r.composed}))};e.addEventListener(a,i),r.set(a,i)}i(a,o,s)}}}),Object.defineProperty(n,"removeEventListener",{configurable:!0,value:(t,n,i)=>{if(n===null)return;a(t,n,i);let o=r.get(t);o&&(e.removeEventListener(t,o),r.delete(t))}}),n},$t=e=>typeof e==`boolean`?+!!e:+!!e?.capture,en=e=>{let t=new WeakMap;return{addEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${$t(i)}`,o=t.get(r);if(o||(o=new Map,t.set(r,o)),o.has(a))return;let s=typeof i==`object`&&!!i&&!!i.once,c=t=>{s&&o.delete(a);let i=e.unenrich(t,n);typeof r==`function`?r.call(e.target,i):r.handleEvent(i)};o.set(a,c),e.remoteEvents.addEventListener(n,c,i)},removeEventListener:(n,r,i)=>{if(r===null)return;let a=`${n}|${$t(i)}`,o=t.get(r),s=o?.get(a);s&&(e.remoteEvents.removeEventListener(n,s,i),o.delete(a))},dispatchEvent:t=>e.remoteEvents.dispatchEvent(t)}},tn=M({box:()=>bn,createVideoElementHandle:()=>vn,isType:()=>yn,revive:()=>xn,type:()=>nn}),nn=`videoElement`,rn=[`currentTime`,`volume`,`muted`,`playbackRate`,`src`,`loop`,`autoplay`,`preload`,`poster`,`disableRemotePlayback`],an=[`duration`,`paused`,`ended`,`seeking`,`readyState`,`currentSrc`],on=[`buffered`,`seekable`],sn=Symbol.for(`fkn.remoteVideoElement`),cn=Symbol.for(`fkn.remoteVideoElement.state`),ln=Symbol.for(`fkn.remoteVideoElement.controller`),un=e=>e?Array.from({length:e.length},(t,n)=>[e.start(n),e.end(n)]):[],dn=e=>{let t={};for(let n of[...rn,...an])t[n]=e[n];for(let n of on)t[n]=un(e[n]);return t.error=e.error?{code:e.error.code,message:e.error.message}:null,t},fn=e=>{let t=t=>{if(!Number.isInteger(t)||t<0||t>=e.length)throw new DOMException(`Index or size is negative or greater than the allowed amount`,`IndexSizeError`)};return{get length(){return e.length},start(n){return t(n),e[n][0]},end(n){return t(n),e[n][1]}}},pn=e=>e?{code:e.code,message:e.message,MEDIA_ERR_ABORTED:1,MEDIA_ERR_NETWORK:2,MEDIA_ERR_DECODE:3,MEDIA_ERR_SRC_NOT_SUPPORTED:4}:null,mn=e=>Qt(e,(e,t)=>({originalDetail:e instanceof CustomEvent?e.detail:null,snapshot:dn(t)})),hn=async(e,t)=>{switch(t){case`play`:return await e.play(),null;case`pause`:return e.pause(),null;case`load`:return e.load(),null;case`requestPictureInPicture`:if(typeof e.requestPictureInPicture!=`function`)throw Error(`requestPictureInPicture is not supported in this environment`);return await e.requestPictureInPicture(),null;case`exitPictureInPicture`:{let t=e.ownerDocument;if(typeof t?.exitPictureInPicture!=`function`)throw Error(`exitPictureInPicture is not supported in this environment`);return await t.exitPictureInPicture(),null}default:throw Error(`videoElement: unknown method "${t}"`)}},gn=e=>({call:async t=>hn(e,t),set:async(t,n)=>{try{e[t]=n}catch{}return dn(e)},events:mn(e)}),_n=(e,t)=>{let n=new EventTarget;Object.defineProperty(n,sn,{value:!0}),Object.defineProperty(n,cn,{value:e}),Object.defineProperty(n,ln,{value:t});let r=en({target:n,remoteEvents:t.events,unenrich:(t,n)=>{if(!(t instanceof CustomEvent))return t;let r=t.detail;if(!r||!(`snapshot`in r))return t;Object.assign(e,r.snapshot);let i={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed};return r.originalDetail===null?new Event(n,i):new CustomEvent(n,{...i,detail:r.originalDetail})}}),i={addEventListener:{configurable:!0,value:r.addEventListener},removeEventListener:{configurable:!0,value:r.removeEventListener},dispatchEvent:{configurable:!0,value:r.dispatchEvent},error:{configurable:!0,enumerable:!0,get(){return pn(e.error)}},play:{configurable:!0,value:()=>t.call(`play`,[])},pause:{configurable:!0,value:()=>{t.call(`pause`,[]).catch(()=>{})}},load:{configurable:!0,value:()=>{t.call(`load`,[]).catch(()=>{})}},requestPictureInPicture:{configurable:!0,value:()=>t.call(`requestPictureInPicture`,[])},exitPictureInPicture:{configurable:!0,value:()=>t.call(`exitPictureInPicture`,[])},HAVE_FUTURE_DATA:{enumerable:!0,value:3},HAVE_ENOUGH_DATA:{enumerable:!0,value:4}};for(let n of rn)i[n]={configurable:!0,enumerable:!0,get(){return e[n]},set(r){e[n]=r,t.set(n,r).then(t=>{Object.assign(e,t)},()=>{})}};for(let t of an)i[t]={configurable:!0,enumerable:!0,get(){return e[t]}};for(let t of on)i[t]={configurable:!0,enumerable:!0,get(){return fn(e[t])}};return Object.defineProperties(n,i),n},vn=e=>_n(dn(e),gn(e)),yn=e=>typeof e==`object`&&!!e&&e[sn]===!0,bn=(e,t)=>{let n=e;return{...A,type:nn,initialState:n[cn],controller:O(n[ln],t)}},xn=(e,t)=>{let n=j(e.controller,t);return _n({...e.initialState},n)},Sn=e=>[tn,...e],Cn=`fknExtension`,wn=`fknExtensionAbi`,Tn=`fknExtensionOps`,En=[`data-fkn-extension`,`data-fkn-extension-abi`,`data-fkn-extension-ops`],Dn=e=>{if(e===void 0)return 0;let t=Number(e);return Number.isInteger(t)&&t>=0?t:0},On=e=>e===void 0?null:e.split(`,`).map(e=>e.trim()).filter(Boolean),kn=(e,t=0)=>{if(e.fknExtension!==`true`)return{status:`absent`};let n=Dn(e[wn]),r=On(e[Tn]);return n<t?{status:`outdated`,abi:n,required:t,operations:r}:{status:`ok`,abi:n,operations:r}},An=class extends Error{abi;required;name=`ExtensionOutdatedError`;constructor(e,t){super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`),this.abi=e,this.required=t}},jn=`FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY`,Mn=Cn,Nn=k();typeof document<`u`&&document.addEventListener(jn,()=>{Nn.dispatchEvent(new CustomEvent(`statuschange`,{detail:{enabled:Pn()}}))});var Pn=()=>typeof document>`u`?!1:document.documentElement.dataset[Mn]===`true`,Fn=()=>typeof document>`u`?{status:`absent`}:kn(document.documentElement.dataset),In=null,Ln=e=>{In=e},Rn=150,zn=(e=1e3)=>new Promise((t,n)=>{let r=()=>Fn().status===`ok`;if(r())return t();let i,a=e=>{clearTimeout(i),c.disconnect(),document.removeEventListener(`readystatechange`,l),e()},o=()=>a(async()=>{let e=Fn();if(e.status===`outdated`)return n(new An(e.abi,e.required));if(In){if(await In().catch(()=>{}),r())return t();let e=Fn();if(e.status===`outdated`)return n(new An(e.abi,e.required))}n(Error(`The FKN WebExtension is not installed, enabled or not exposed on this page.`))}),s=()=>{clearTimeout(i),i=setTimeout(()=>r()?a(t):o(),Rn)},c=new MutationObserver(()=>{r()&&a(t)}),l=()=>{document.readyState===`complete`&&!r()&&s()};if(i=setTimeout(o,e),c.observe(document.documentElement,{attributes:!0,attributeFilter:[...En]}),document.addEventListener(`readystatechange`,l),document.readyState===`complete`)return s();r()&&a(t)}),Bn,Vn=new Proxy({},{get:(e,t)=>async(...e)=>{await zn(),Bn??=D({},{transport:window,revivableModules:Sn});let n=(await Bn)[t];return n(...e)}}),Hn=[`fkn.app`,`fkn.dev`,`sdbx.app`],Un=e=>e.replace(/\.+$/,``),Wn=e=>{let t=Un(e);return Hn.some(e=>t===e||t.endsWith(`.${e}`))},Gn=class extends Error{reason;filename;line;column;source;constructor(e,t,n,r,i){super(`${e}:${n}:${r}: ${t}`),this.reason=t,this.filename=e,this.line=n,this.column=r,this.source=i}},Kn=class{start;end;source;constructor(e,t,n){this.start=e,this.end=t,this.source=n}},W;(function(e){e.stylesheet=`stylesheet`,e.rule=`rule`,e.declaration=`declaration`,e.comment=`comment`,e.atRule=`at-rule`,e.container=`container`,e.charset=`charset`,e.counterStyle=`counter-style`,e.document=`document`,e.customMedia=`custom-media`,e.fontFace=`font-face`,e.fontFeatureValues=`font-feature-values`,e.host=`host`,e.import=`import`,e.keyframes=`keyframes`,e.keyframe=`keyframe`,e.layer=`layer`,e.media=`media`,e.namespace=`namespace`,e.page=`page`,e.pageMarginBox=`page-margin-box`,e.positionTry=`position-try`,e.property=`property`,e.scope=`scope`,e.startingStyle=`starting-style`,e.supports=`supports`,e.viewTransition=`view-transition`})(W||={});var qn=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);if(e[o]!==`\\`)return o;r=o+2,i--}while(i>0);throw Error(`Too many escaping`)},Jn=(e,t,n)=>{let r=n,i=1e4;do{let n=t.map(t=>e.indexOf(t,r));n.push(e.indexOf(`(`,r)),n.push(e.indexOf(`"`,r)),n.push(e.indexOf(`'`,r)),n.push(e.indexOf(`\\`,r));let a=n.filter(e=>e!==-1);if(a.length===0)return-1;let o=Math.min(...a);switch(e[o]){case`\\`:r=o+2;break;case`(`:{let t=Jn(e,[`)`],o+1);if(t===-1)return-1;r=t+1}break;case`"`:{let t=qn(e,[`"`],o+1);if(t===-1)return-1;r=t+1}break;case`'`:{let t=qn(e,[`'`],o+1);if(t===-1)return-1;r=t+1}break;default:return o}i--}while(i>0);throw Error(`Too many escaping`)},Yn=/\/\*[^]*?(?:\*\/|$)/g;function Xn(e){return e?e.trim():``}function Zn(e,t){let n=e&&typeof e.type==`string`,r=n?e:t;for(let t in e){let n=e[t];Array.isArray(n)?n.forEach(e=>{Zn(e,r)}):n&&typeof n==`object`&&Zn(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Qn=class{level=0;indentation=` `;compress=!1;constructor(e){typeof e?.indent==`string`&&(this.indentation=e?.indent),e?.compress&&(this.compress=!0)}emit(e,t){return e}indent(e){return this.level=this.level||1,e?(this.level+=e,``):Array(this.level).join(this.indentation)}visit(e){switch(e.type){case W.stylesheet:return this.stylesheet(e);case W.rule:return this.rule(e);case W.declaration:return this.declaration(e);case W.comment:return this.comment(e);case W.container:return this.container(e);case W.charset:return this.charset(e);case W.counterStyle:return this.counterStyle(e);case W.document:return this.document(e);case W.customMedia:return this.customMedia(e);case W.fontFace:return this.fontFace(e);case W.fontFeatureValues:return this.fontFeatureValues(e);case W.host:return this.host(e);case W.import:return this.import(e);case W.keyframes:return this.keyframes(e);case W.keyframe:return this.keyframe(e);case W.layer:return this.layer(e);case W.media:return this.media(e);case W.namespace:return this.namespace(e);case W.page:return this.page(e);case W.pageMarginBox:return this.pageMarginBox(e);case W.positionTry:return this.positionTry(e);case W.property:return this.property(e);case W.scope:return this.scope(e);case W.startingStyle:return this.startingStyle(e);case W.supports:return this.supports(e);case W.viewTransition:return this.viewTransition(e);case W.atRule:return this.genericAtRule(e)}}mapVisit(e,t){let n=``;t||=``;for(let r=0,i=e.length;r<i;r++)n+=this.visit(e[r]),t&&r<i-1&&(n+=this.emit(t));return n}compile(e){return this.compress?e.stylesheet.rules.map(this.visit,this).join(``):this.stylesheet(e)}stylesheet(e){return this.mapVisit(e.stylesheet.rules,`
|
|
3
|
-
|
|
4
|
-
`)}comment(e){return this.compress?this.emit(``,e.position):this.emit(`${this.indent()}/*${e.comment}*/`,e.position)}container(e){return this.compress?this.emit(`@container ${e.container}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@container ${e.container}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
5
|
-
|
|
6
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}layer(e){return this.compress?this.emit(`@layer ${e.layer}`,e.position)+(e.rules?this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):`;`):this.emit(`${this.indent()}@layer ${e.layer}`,e.position)+(e.rules?this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
7
|
-
|
|
8
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`):`;`)}import(e){return this.emit(`@import ${e.import};`,e.position)}media(e){return this.compress?this.emit(`@media ${e.media}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@media ${e.media}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
9
|
-
|
|
10
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}document(e){let t=`@${e.vendor||``}document ${e.document}`;return this.compress?this.emit(t,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(t,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
11
|
-
|
|
12
|
-
`)+this.emit(`${this.indent(-1)}\n}`)}charset(e){return this.emit(`@charset ${e.charset};`,e.position)}namespace(e){return this.emit(`@namespace ${e.namespace};`,e.position)}startingStyle(e){return this.compress?this.emit(`@starting-style`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@starting-style`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
13
|
-
|
|
14
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}supports(e){return this.compress?this.emit(`@supports ${e.supports}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@supports ${e.supports}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
15
|
-
|
|
16
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}keyframes(e){return this.compress?this.emit(`@${e.vendor||``}keyframes ${e.name}`,e.position)+this.emit(`{`)+this.mapVisit(e.keyframes)+this.emit(`}`):this.emit(`@${e.vendor||``}keyframes ${e.name}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.keyframes,`
|
|
17
|
-
`)+this.emit(`${this.indent(-1)}}`)}keyframe(e){let t=e.declarations;return this.compress?this.emit(e.values.join(`,`),e.position)+this.emit(`{`)+this.mapVisit(t)+this.emit(`}`):this.emit(this.indent())+this.emit(e.values.join(`, `),e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(t,`
|
|
18
|
-
`)+this.emit(`${this.indent(-1)}\n${this.indent()}}\n`)}page(e){if(this.compress){let t=e.selectors.length?e.selectors.join(`, `):``;return this.emit(`@page ${t}`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`)}let t=e.selectors.length?`${e.selectors.join(`, `)} `:``;return this.emit(`@page ${t}`,e.position)+this.emit(`{
|
|
19
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
20
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
21
|
-
}`)}pageMarginBox(e){return this.compress?this.emit(`@${e.name}`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`${this.indent()}@${e.name} `,e.position)+this.emit(`{
|
|
22
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
23
|
-
`)+this.emit(this.indent(-1))+this.emit(`\n${this.indent()}}`)}fontFace(e){return this.compress?this.emit(`@font-face`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`@font-face `,e.position)+this.emit(`{
|
|
24
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
25
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
26
|
-
}`)}host(e){return this.compress?this.emit(`@host`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`@host`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
27
|
-
|
|
28
|
-
`)+this.emit(`${this.indent(-1)}\n}`)}customMedia(e){return this.emit(`@custom-media ${e.name} ${e.media};`,e.position)}property(e){return this.compress?this.emit(`@property ${e.name}`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`@property ${e.name} `,e.position)+this.emit(`{
|
|
29
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
30
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
31
|
-
}`)}counterStyle(e){return this.compress?this.emit(`@counter-style ${e.name}`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`@counter-style ${e.name} `,e.position)+this.emit(`{
|
|
32
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
33
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
34
|
-
}`)}fontFeatureValues(e){return this.compress?this.emit(`@font-feature-values ${e.fontFamily}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@font-feature-values ${e.fontFamily}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
35
|
-
|
|
36
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}scope(e){let t=e.scope?` ${e.scope}`:``;return this.compress?this.emit(`@scope${t}`,e.position)+this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):this.emit(`${this.indent()}@scope${t}`,e.position)+this.emit(` {\n${this.indent(1)}`)+this.mapVisit(e.rules,`
|
|
37
|
-
|
|
38
|
-
`)+this.emit(`\n${this.indent(-1)}${this.indent()}}`)}viewTransition(e){return this.compress?this.emit(`@view-transition`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`@view-transition `,e.position)+this.emit(`{
|
|
39
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
40
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
41
|
-
}`)}positionTry(e){return this.compress?this.emit(`@position-try ${e.name}`,e.position)+this.emit(`{`)+this.mapVisit(e.declarations)+this.emit(`}`):this.emit(`@position-try ${e.name} `,e.position)+this.emit(`{
|
|
42
|
-
`)+this.emit(this.indent(1))+this.mapVisit(e.declarations,`
|
|
43
|
-
`)+this.emit(this.indent(-1))+this.emit(`
|
|
44
|
-
}`)}genericAtRule(e){let t=e.prelude?` ${e.prelude}`:``;if(this.compress)return this.emit(`@${e.name}${t}`,e.position)+(e.rules?this.emit(`{`)+this.mapVisit(e.rules)+this.emit(`}`):`;`);if(!e.rules)return this.emit(`${this.indent()}@${e.name}${t};`,e.position);let n=e.rules.some(e=>e.type!==W.declaration&&e.type!==W.comment),r=n?`
|
|
45
|
-
|
|
46
|
-
`:`
|
|
47
|
-
`;return this.emit(`${this.indent()}@${e.name}${t}`,e.position)+this.emit(n?` {\n${this.indent(1)}`:` {
|
|
48
|
-
`)+this.emit(n?``:this.indent(1))+this.mapVisit(e.rules,r)+this.emit(n?`\n${this.indent(-1)}${this.indent()}}`:`${this.indent(-1)}\n${this.indent()}}`)}rule(e){let t=e.declarations;if(!t.length)return``;if(this.compress)return this.emit(e.selectors.join(`,`),e.position)+this.emit(`{`)+this.mapVisit(t)+this.emit(`}`);let n=this.indent();return this.emit(e.selectors.map(e=>n+e).join(`,
|
|
49
|
-
`),e.position)+this.emit(` {
|
|
50
|
-
`)+this.emit(this.indent(1))+this.mapVisit(t,`
|
|
51
|
-
`)+this.emit(this.indent(-1))+this.emit(`\n${this.indent()}}`)}declaration(e){return this.compress?this.emit(`${e.property}:${e.value}`,e.position)+this.emit(`;`):e.property===`grid-template-areas`?this.emit(this.indent())+this.emit(e.property+`: `+e.value.split(`
|
|
52
|
-
`).join(`
|
|
53
|
-
`.padEnd(22)+this.indent()),e.position)+this.emit(`;`):this.emit(this.indent())+this.emit(`${e.property}: ${e.value}`,e.position)+this.emit(`;`)}},$n=(e,t)=>{t||={};let n=1,r=1;function i(){let e={line:n,column:r};return i=>(i.position=new Kn(e,{line:n,column:r},t?.source||``),u(),i)}let a=[];function o(i){let o=new Gn(t?.source||``,i,n,r,e);if(!t?.silent)throw o;a.push(o)}function s(){let t=/^{\s*/.exec(e);return!!t&&(l(t),!0)}function c(){let t=/^}/.exec(e);return!!t&&(l(t),!0)}function l(t){let i=t[0];return function(e){let t=e.match(/\n/g);t&&(n+=t.length);let i=e.lastIndexOf(`
|
|
54
|
-
`);r=~i?e.length-i:r+e.length}(i),e=e.slice(i.length),t}function u(){let t=/^\s*/.exec(e);t&&l(t)}function d(e){e||=[];let t=f();for(;t;)e.push(t),t=f();return e}function f(){let t=i();if(e.charAt(0)!==`/`||e.charAt(1)!==`*`)return;let n=/^\/\*[^]*?\*\//.exec(e);return n?(l(n),t({type:W.comment,comment:n[0].slice(2,-2)})):o(`End of comment missing`)}function p(){let t=Jn(e,[`{`]);if(t===-1||t===0)return;let n=e.substring(0,t);return l([n]),((e,t)=>{let n=[],r=0;for(;r<e.length;){let i=Jn(e,t,r);if(i===-1)return n.push(e.substring(r)),n;n.push(e.substring(r,i)),r=i+1}return n})(Xn(n).replace(Yn,``),[`,`]).map(e=>Xn(e))}function m(){let t=i(),n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);if(!n)return;l(n);let r=Xn(n[0]),a=/^:\s*/.exec(e);if(!a)return o(`property missing ':'`);l(a);let s=``,c=Jn(e,[`;`,`}`]);c!==-1&&(s=e.substring(0,c),l([s]),s=Xn(s).replace(Yn,``));let u=t({type:W.declaration,property:r.replace(Yn,``),value:s}),d=/^[;\s]*/.exec(e);return d&&l(d),u}function h(){let n=[];if(!s())return o(`missing '{'`);d(n);let r=m();for(;r;)n.push(r),d(n),r=m();for(;t?.silent&&e.length&&e.charAt(0)!==`}`;){let t=e.indexOf(`;`),i=e.indexOf(`}`);if(t===-1||!(i===-1||t<i))break;for(l([e.substring(0,t+1)]),u(),d(n),r=m();r;)n.push(r),d(n),r=m()}return c()?n:o(`missing '}'`)}function g(){let t=Jn(e,[`{`]);if(t===-1)return!1;let n=Jn(e,[`;`]),r=Jn(e,[`}`]);return!(n!==-1&&n<t)&&!(r!==-1&&r<t)}function _(){let n=[];if(!s())return o(`missing '{'`);for(d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=T();if(e){n.push(e),d(n);continue}}if(g()){let e=E();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return c()?n:o(`missing '}'`)}function v(){let n=[];for(u(),d(n);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=T();if(e){n.push(e),d(n);continue}}if(g()){let e=E();if(e){n.push(e),d(n);continue}}let r=m();if(!r){if(t?.silent){let t=e.indexOf(`;`),r=e.indexOf(`}`);if(t!==-1&&(r===-1||t<r)){l([e.substring(0,t+1)]),u(),d(n);continue}}break}n.push(r),d(n)}return n}function y(){let t=[],n=i(),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);for(;r;){let n=l(r);t.push(n[1]);let i=/^,\s*/.exec(e);i&&l(i),r=/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e)}if(t.length)return n({type:W.keyframe,values:t,declarations:h()||[]})}let b=RegExp(`^@(${[`top-left-corner`,`top-left`,`top-center`,`top-right`,`top-right-corner`,`bottom-left-corner`,`bottom-left`,`bottom-center`,`bottom-right`,`bottom-right-corner`,`left-top`,`left-middle`,`left-bottom`,`right-top`,`right-middle`,`right-bottom`].join(`|`)})(?![\\w-])\\s*`),x=w(`import`),S=w(`charset`),C=w(`namespace`);function w(t){let n=RegExp(`^@`+t+`\\s*((?::?[^;'"]|"(?:\\\\"|[^"])*?"|'(?:\\\\'|[^'])*?')+)(?:;|$)`);return()=>{let r=i(),a=n.exec(e);if(!a)return;let o=l(a),s={type:t};return s[t]=o[1].trim(),r(s)}}function T(){if(e[0]===`@`)return function(){let t=i(),n=/^@([-\w]+)?keyframes\s*/.exec(e);if(!n)return;let r=l(n)[1],a=/^([-\w]+)\s*/.exec(e);if(!a)return o(`@keyframes missing name`);let u=l(a)[1];if(!s())return o(`@keyframes missing '{'`);let f=d(),p=y();for(;p;)f.push(p),f=f.concat(d()),p=y();return c()?t({type:W.keyframes,name:u,vendor:r,keyframes:f}):o(`@keyframes missing '}'`)}()||function(){let t=i(),n=/^@media *([^{]+)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s())return o(`@media missing '{'`);let a=v();return c()?t({type:W.media,media:r,rules:a}):o(`@media missing '}'`)}()||function(){let t=i(),n=/^@custom-media\s+(--\S+)\s+([^{;\s][^{;]*);/.exec(e);if(!n)return;let r=l(n);return t({type:W.customMedia,name:Xn(r[1]),media:Xn(r[2])})}()||function(){let t=i(),n=/^@supports *([^{]+)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s())return o(`@supports missing '{'`);let a=v();return c()?t({type:W.supports,supports:r,rules:a}):o(`@supports missing '}'`)}()||x()||S()||C()||function(){let t=i(),n=/^@([-\w]+)?document *([^{]+)/.exec(e);if(!n)return;let r=l(n),a=Xn(r[1]),u=Xn(r[2]);if(!s())return o(`@document missing '{'`);let d=v();return c()?t({type:W.document,document:u,vendor:a,rules:d}):o(`@document missing '}'`)}()||function(){let t=i(),n=/^@page */.exec(e);if(!n)return;l(n);let r=p()||[];if(!s())return o(`@page missing '{'`);let a=[];for(d(a);e.length&&e.charAt(0)!==`}`;){if(e.charAt(0)===`@`){let e=T();if(e){a.push(e),d(a);continue}}let t=m();if(!t)break;a.push(t),d(a)}return c()?t({type:W.page,selectors:r,declarations:a}):o(`@page missing '}'`)}()||function(){let t=i(),n=/^@host\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@host missing '{'`);let r=v();return c()?t({type:W.host,rules:r}):o(`@host missing '}'`)}()||function(){let t=i(),n=/^@font-face\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@font-face missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:W.fontFace,declarations:r}):o(`@font-face missing '}'`)}()||function(){let t=i(),n=/^@font-feature-values\s+([^{]+)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s())return o(`@font-feature-values missing '{'`);let a=v();return c()?t({type:W.fontFeatureValues,fontFamily:r,rules:a}):o(`@font-feature-values missing '}'`)}()||function(){let t=i(),n=/^@container *([^{]+)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s())return o(`@container missing '{'`);let a=v();return c()?t({type:W.container,container:r,rules:a}):o(`@container missing '}'`)}()||function(){let t=i(),n=/^@starting-style\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@starting-style missing '{'`);let r=v();return c()?t({type:W.startingStyle,rules:r}):o(`@starting-style missing '}'`)}()||function(){let t=i(),n=/^@layer *([^{;@]+)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s()){let n=/^[;\s]*/.exec(e);return n&&l(n),t({type:W.layer,layer:r})}let a=v();return c()?t({type:W.layer,layer:r,rules:a}):o(`@layer missing '}'`)}()||function(){let t=i(),n=/^@property\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@property missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:W.property,name:r,declarations:a}):o(`@property missing '}'`)}()||function(){let t=i(),n=/^@counter-style\s+([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@counter-style missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:W.counterStyle,name:r,declarations:a}):o(`@counter-style missing '}'`)}()||function(){let t=i(),n=/^@scope\s*([^{]*)/.exec(e);if(!n)return;let r=Xn(l(n)[1]);if(!s())return o(`@scope missing '{'`);let a=v();return c()?t({type:W.scope,scope:r,rules:a}):o(`@scope missing '}'`)}()||function(){let t=i(),n=/^@view-transition\s*/.exec(e);if(!n)return;if(l(n),!s())return o(`@view-transition missing '{'`);let r=d(),a=m();for(;a;)r.push(a),r=r.concat(d()),a=m();return c()?t({type:W.viewTransition,declarations:r}):o(`@view-transition missing '}'`)}()||function(){let t=i(),n=/^@position-try\s+(--[-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@position-try missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:W.positionTry,name:r,declarations:a}):o(`@position-try missing '}'`)}()||function(){let t=i(),n=b.exec(e);if(!n)return;let r=l(n)[1];if(!s())return o(`@${r} missing '{'`);let a=d(),u=m();for(;u;)a.push(u),a=a.concat(d()),u=m();return c()?t({type:W.pageMarginBox,name:r,declarations:a}):o(`@${r} missing '}'`)}()||function(){let t=i(),n=/^@([-\w]+)\s*/.exec(e);if(!n)return;let r=l(n)[1],a=``,u=Jn(e,[`{`,`;`]);if(u!==-1&&u>0&&(a=Xn(e.substring(0,u)),l([e.substring(0,u)])),s()){let e=v();return c()?t({type:W.atRule,name:r,prelude:a,rules:e}):o(`@${r} missing '}'`)}let d=/^[;\s]*/.exec(e);return d&&l(d),t({type:W.atRule,name:r,prelude:a})}()}function E(){let e=i(),t=p();return t?(d(),e({type:W.rule,selectors:t,declarations:_()||[]})):o(`selector missing`)}return Zn(function(){let n=function(){let n,r=[];for(u(),d(r);e.length;){if(e.charAt(0)===`}`){if(t?.silent){o(`extra '}'`),l([`}`]),u(),d(r);continue}break}if(n=T()||E(),!n){if(t?.silent){l([e.charAt(0)]),u(),d(r);continue}break}r.push(n),d(r)}return r}();return{type:W.stylesheet,stylesheet:{source:t?.source,rules:n,parsingErrors:a}}}())},er=(e,t)=>new Qn(t||{}).compile(e),tr=Object.defineProperty,nr=(e,t)=>{let n={};for(var r in e)tr(n,r,{get:e[r],enumerable:!0});return t||tr(n,Symbol.toStringTag,{value:`Module`}),n},rr=`LocatorError`,ir=`LocatorUnsupportedError`,ar=`LocatorDeniedError`,or=`LocatorInvalidError`,sr=e=>typeof e==`object`&&e?e.name:void 0,cr=e=>Object.assign(Error(e),{name:rr}),lr=(e,t=``,n)=>Object.assign(Error(e),{name:ir,operation:t,backend:n}),ur=(e,t)=>lr(`Locator operation not supported${t?` on the ${t} backend`:``}: ${e}`,e,t),dr=(e,t)=>Object.assign(Error(e),{name:ar,operation:t}),fr=(e,t)=>Object.assign(Error(e),{name:or,operation:t}),pr=e=>sr(e)===ir,mr=e=>sr(e)===ar,hr=e=>sr(e)===or,gr=e=>mr(e)||pr(e)||hr(e),_r=e=>{let t=(e.ownerDocument??e).defaultView;if(!t)throw cr(`the resolved element belongs to a document with no window`);return t},vr=(e,t)=>{let n=e?.[t];return typeof n==`function`?n:null},yr=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=(()=>{try{return vr(_r(e),t)}catch{return null}})();if(n&&e instanceof n)return n;let r=vr(globalThis,t);return r&&e instanceof r?r:null},br=(e,t)=>yr(e,t)!==null,xr=e=>{if(e.length===0)throw cr(`No elements found`);if(e.length>1)throw cr(`Strict mode violation: locator resolved to ${e.length} elements`);return e[0]},Sr=(e,t)=>{if(!br(e,t))throw cr(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);return e},Cr=e=>e.tagName.toLowerCase(),wr=new Set,Tr=e=>{wr.add(e)},Er=/(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i,Dr=e=>e.replace(/\\([0-9a-fA-F]{1,6})\s?/g,(e,t)=>String.fromCodePoint(Number.parseInt(t,16))).replace(/\\(.)/g,`$1`),Or=e=>!Er.test(Dr(e.value)),kr=new Set([W.import,W.fontFace,W.namespace,W.charset,W.document,W.comment]),Ar=e=>{if(kr.has(e.type))return null;if(e.type===W.declaration)return Or(e)?e:null;let t=e,n={...t};for(let e of[`declarations`,`rules`,`keyframes`]){let r=t[e];Array.isArray(r)&&(n[e]=jr(r))}return n},jr=e=>e.map(e=>Ar(e)).filter(e=>e!==null),Mr=e=>{let t;try{t=$n(e,{silent:!0})}catch{return``}return t.stylesheet.rules=jr(t.stylesheet.rules),er(t)},Nr=(e,t)=>{let n=()=>{t.parentNode||(e.head??e.documentElement).appendChild(t)};if(n(),e.readyState===`complete`)return;let r=new MutationObserver(e=>{for(let r of e)for(let e of r.removedNodes)if(e===t||e.contains?.(t)){n();return}});r.observe(e.documentElement,{childList:!0,subtree:!0});let i=()=>r.disconnect(),a=e.defaultView;a?a.addEventListener(`load`,i,{once:!0}):setTimeout(i,3e4)},Pr={resolve:(e,t)=>{let n=e.document.createElement(`style`);n.textContent=t.noSanitize?t.content:Mr(t.content);try{Nr(e.document,n)}catch(e){console.error(e)}Tr(n)}},Fr=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},Ir={kind:`frame`,resolve:async(e,t,n={})=>{if(typeof t!=`string`)throw fr(`fetch: url must be a string`,`fetch`);let r=_r(e.document),i;try{i=new r.URL(t,e.document.baseURI).href}catch{throw fr(`fetch: not a valid url: ${t}`,`fetch`)}let a=await r.fetch(i,{method:n.method??`GET`,headers:n.headers,body:n.body??null,redirect:n.redirect??`follow`,credentials:n.credentials??`include`});return{status:a.status,statusText:a.statusText,ok:a.ok,url:a.url,redirected:a.redirected,type:a.type,headers:Fr(a.headers),body:await a.arrayBuffer()}}},Lr=nr({click:()=>zr,count:()=>qr,exists:()=>Jr,fill:()=>Ur,getAttribute:()=>Gr,hover:()=>Br,isVisible:()=>Kr,textContent:()=>Wr}),Rr=(e,t)=>{let n=e.getBoundingClientRect();return{clientX:n.left+n.width*(t?.x??.5),clientY:n.top+n.height*(t?.y??.5)}},zr={resolve:(e,t={})=>{let n=xr(e.elements),r=_r(n),i={bubbles:!0,cancelable:!0,composed:!0,...Rr(n,t.position),button:0},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerdown`,{...a,buttons:1})),n.dispatchEvent(new r.MouseEvent(`mousedown`,{...i,buttons:1})),n.dispatchEvent(new r.PointerEvent(`pointerup`,{...a,buttons:0})),n.dispatchEvent(new r.MouseEvent(`mouseup`,{...i,buttons:0})),n.dispatchEvent(new r.MouseEvent(`click`,{...i,buttons:0}))}},Br={resolve:(e,t={})=>{let n=xr(e.elements),r=_r(n),i={bubbles:!0,cancelable:!0,composed:!0,...Rr(n,t.position)},a={...i,pointerType:`mouse`,pointerId:1,isPrimary:!0};n.dispatchEvent(new r.PointerEvent(`pointerover`,a)),n.dispatchEvent(new r.PointerEvent(`pointerenter`,{...a,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseenter`,{...i,bubbles:!1})),n.dispatchEvent(new r.MouseEvent(`mouseover`,i)),n.dispatchEvent(new r.PointerEvent(`pointermove`,a)),n.dispatchEvent(new r.MouseEvent(`mousemove`,i))}},Vr=(e,t)=>{e._valueTracker?.setValue(``);let n=(yr(e,`HTMLTextAreaElement`)??yr(e,`HTMLInputElement`))?.prototype,r=n&&Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t},Hr=(e,t)=>{if(e.type!==`range`)return null;let n=Number(e.min||0),r=Number(e.max||100);if(!Number.isFinite(n)||!Number.isFinite(r)||r<=n)return null;let i=Number(t);if(!Number.isFinite(i))return null;let a=Math.max(0,Math.min(1,(i-n)/(r-n))),o=e.getBoundingClientRect(),s={bubbles:!0,cancelable:!0,composed:!0,clientX:o.left+o.width*a,clientY:o.top+o.height/2,button:0},c={...s,pointerType:`mouse`,pointerId:1,isPrimary:!0};return{pointerDown:{...c,buttons:1},pointerUp:{...c,buttons:0},mouseDown:{...s,buttons:1},mouseUp:{...s,buttons:0}}},Ur={resolve:(e,t,n={})=>{let r=xr(e.elements),i=_r(r),a=br(r,`HTMLInputElement`);if(a||br(r,`HTMLTextAreaElement`)){let e=r,n=a?Hr(e,t):null;n&&(r.dispatchEvent(new i.PointerEvent(`pointerdown`,n.pointerDown)),r.dispatchEvent(new i.MouseEvent(`mousedown`,n.mouseDown))),Vr(e,t),r.dispatchEvent(new i.Event(`input`,{bubbles:!0})),n&&(r.dispatchEvent(new i.PointerEvent(`pointerup`,n.pointerUp)),r.dispatchEvent(new i.MouseEvent(`mouseup`,n.mouseUp))),r.dispatchEvent(new i.Event(`change`,{bubbles:!0}));return}if(br(r,`HTMLElement`)&&r.isContentEditable){r.textContent=t,r.dispatchEvent(new i.Event(`input`,{bubbles:!0}));return}throw Error(`fill: element <${Cr(r)}> is not fillable`)}},Wr={resolve:(e,t={})=>xr(e.elements).textContent},Gr={resolve:(e,t,n={})=>xr(e.elements).getAttribute(t)},Kr={resolve:(e,t={})=>{let n=xr(e.elements);if(!br(n,`HTMLElement`))return!0;let r=_r(n).getComputedStyle(n);if(r?.display===`none`||r?.visibility===`hidden`)return!1;let i=n.getBoundingClientRect();return i.width>0&&i.height>0}},qr={resolve:(e,t={})=>e.elements.length},Jr={resolve:(e,t={})=>e.elements.length>0},Yr=(e,t)=>e.elements.flatMap(e=>[...e.querySelectorAll(t)]),Xr=e=>e.replaceAll(`"`,`\\"`),Zr={to:`element`,css:!0,resolve:(e,t)=>Yr(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`descend`})},Qr={to:`frame`,css:!0,barrier:`down`,resolve:(e,t)=>Yr(e,t),render:e=>({fragment:typeof e==`string`?e:`?`,separator:`down`})},$r={element:{selectors:{locator:Zr,frameLocator:Qr,getByRole:{to:`element`,resolve:(e,t)=>Yr(e,`[role="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[role="${Xr(e)}"]`:`[role]`})},getByText:{to:`element`,resolve:(e,t)=>e.elements.flatMap(e=>[e,...e.querySelectorAll(`*`)]).filter(e=>e.textContent?.includes(t)),render:e=>({fragment:typeof e==`string`?`:has-text("${Xr(e)}")`:`:has-text(...)`})},getByTestId:{to:`element`,resolve:(e,t)=>Yr(e,`[data-testid="${CSS.escape(t)}"]`),render:e=>({fragment:typeof e==`string`?`[data-testid="${Xr(e)}"]`:`[data-testid]`})},first:{to:`element`,resolve:e=>e.elements.slice(0,1),render:()=>({fragment:`:first`})},nth:{to:`element`,resolve:(e,t)=>{let n=e.elements.at(t);return n?[n]:[]},render:e=>({fragment:typeof e==`number`?`:nth(${e})`:`:nth(?)`})}},operations:{click:zr,fill:Ur,hover:Br,textContent:Wr,getAttribute:Gr,isVisible:Kr,count:qr,exists:Jr}},frame:{selectors:{locator:Zr,frameLocator:Qr,owner:{to:`frame`,barrier:`up`,resolve:e=>{throw Error(`owner: must be processed by the executor as an upward pivot`)},render:()=>({fragment:``,separator:`up`})}},operations:{addStyleTag:Pr,fetch:Ir}}},ei=(e,t=$r)=>({element:{selectors:{...t.element.selectors,...e.element?.selectors},operations:{...t.element.operations,...e.element?.operations}},frame:{selectors:{...t.frame.selectors,...e.frame?.selectors},operations:{...t.frame.operations,...e.frame?.operations}}}),ti=3e4,ni=50,ri=e=>{let t=e[e.length-1];return typeof t==`object`&&t?t:void 0},ii=e=>{let t=ri(e)?.timeout;return typeof t==`number`?t:ti},ai=({executor:e,parts:t})=>({highlight:n=>e.highlight(t,n).then(()=>{},()=>{})}),oi=async e=>{let t={parts:e.parts,operation:e.operation,args:e.args,phase:`ensure`};await e.gate?.(t,ai(e))},si=async e=>{let{executor:t,gate:n,parts:r,operation:i,args:a}=e;n&&await n({parts:r,operation:i,args:a,phase:`execute`},ai(e));let o=ii(a),s=Date.now()+o,c=Error(`Locator timeout (${o}ms): ${i}`),{promise:l,reject:u}=Promise.withResolvers();l.catch(()=>{});let d=setTimeout(()=>u(c),o),f=c;try{for(;Date.now()<s;)try{return await Promise.race([t.execute(r,i,a),l])}catch(e){if(e===c)break;if(gr(e))throw e;f=e;let t=s-Date.now();if(t<=0)break;await new Promise(e=>setTimeout(e,Math.min(ni,t)))}}finally{clearTimeout(d)}throw f},ci=(e,t,n,r)=>{let i={};for(let[a,o]of Object.entries(t[n].selectors))i[a]=(...i)=>ci(e,t,o.to,[...r,{kind:n,name:a,args:i}]);for(let a of Object.keys(t[n].operations))i[a]=(...t)=>si({...e,parts:r,operation:a,args:t});return i.ensure=(t,n={})=>oi({...e,parts:r,operation:t,args:[n]}),i},li=e=>ci(e,e.modules??$r,`frame`,[]),ui=ei({element:{operations:{click:{resolve:(e,t={})=>Lr.click.resolve(e,t)},hover:{resolve:(e,t={})=>Lr.hover.resolve(e,t)},fill:{resolve:(e,t,n={})=>Lr.fill.resolve(e,t,n)},textContent:{resolve:(e,t={})=>Lr.textContent.resolve(e)},getAttribute:{resolve:(e,t,n={})=>Lr.getAttribute.resolve(e,t)},isVisible:{resolve:(e,t={})=>Lr.isVisible.resolve(e)},count:{resolve:(e,t={})=>Lr.count.resolve(e)},exists:{resolve:(e,t={})=>Lr.exists.resolve(e)},videoElement:{resolve:(e,t={})=>vn(Sr(xr(e.elements),`HTMLVideoElement`))}}},frame:{operations:{addStyleTag:{resolve:(e,t)=>Pr.resolve(e,t)},fetch:{resolve:(e,t,n={})=>Ir.resolve(e,t,n),kind:Ir.kind}}}}),di=e=>{if(!e||e===`about:blank`)return!1;let t;try{t=new URL(e,location.href)}catch{return!1}return t.protocol===`chrome-extension:`||t.protocol===`moz-extension:`||t.protocol!==`about:`&&Wn(t.hostname)},fi=e=>{if(di(e))throw Error(`attachFrame: refusing to target the extension's own pages or an FKN platform origin`)},pi=({src:e,domains:t,lockdown:n})=>{if(!(!n||t.length)&&e&&e!==`about:blank`)throw Error(`attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto`)},mi=e=>{let t=li({executor:e.executor,modules:ui,gate:e.gate}),n=(t,n={})=>(fi(t),e.goto(t,n)),r=()=>e.url();return{...t,goto:n,url:r}},hi=`FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY`,gi=async({iframe:e,domains:t=[],syncCookies:n=!0,lockdown:r=!1})=>{let i=crypto.randomUUID();if(fi(e.src),pi({src:e.src,domains:t,lockdown:r}),await zn(),!e.isConnected)throw Error(`attachFrame: the iframe must be connected to the document before attaching`);e.dispatchEvent(new CustomEvent(hi,{detail:i}));let{executeLocator:a,highlightLocator:o,ensureLocatorPermission:s,goto:c}=await Vn.attachFrame({marker:i,domains:t,syncCookies:n,lockdown:r});return mi({executor:{execute:a,highlight:o},gate:e=>s(e.parts,e.operation,e.args),goto:(e,t={})=>c({url:e,...t}),url:()=>e.src})},_i=new Map,vi=new Set,yi=e=>{_i.set(e,(_i.get(e)??0)+1);let t=!1;return()=>{t||(t=!0,_i.set(e,Math.max(0,(_i.get(e)??1)-1)))}},bi=(e,t)=>{vi.add({kind:e,probe:t})},xi=[`fkn.app`,`fkn.dev`,`sdbx.app`],Si=e=>e.replace(/\.+$/,``),Ci=e=>{let t=Si(e);return xi.some(e=>t===e||t.endsWith(`.${e}`))},wi=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(Ci(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},Ti=typeof FinalizationRegistry>`u`?void 0:new FinalizationRegistry(e=>e()),Ei=e=>{let t=e.body;if(!t)return e;let n=yi(`streamed response`),r=t.getReader(),i=new ReadableStream({pull:async e=>{try{let{done:t,value:i}=await r.read();if(t){n(),e.close();return}e.enqueue(i)}catch(t){n(),e.error(t)}},cancel:async e=>{n(),await r.cancel(e).catch(()=>{})}}),a=new Response(i,{status:e.status,statusText:e.statusText,headers:e.headers});return Ti?.register(a,n),a},Di=async e=>{if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e:new Request(`https://body.invalid/`,{method:`POST`,body:e,duplex:`half`}).arrayBuffer()},Oi=async e=>{if(e.method===`GET`||e.method===`HEAD`)return;let t=await e.clone().arrayBuffer();return t.byteLength?t:void 0},ki=async(e,t)=>{if(wi(e),typeof e==`object`&&e&&!(e instanceof URL)&&typeof e.url==`string`){let n=e,r={};n.headers.forEach((e,t)=>{r[t]=e});let i=await Di(t?.body===void 0?await Oi(n):t.body);return I.then(e=>e.cloud.fetch(n.url,{...t,method:t?.method??n.method,headers:t?.headers??r,body:i})).then(Ei)}let n=e instanceof URL?e.href:e,r=await Di(t?.body);return I.then(e=>e.cloud.fetch(n,t?.body===void 0?t:{...t,body:r})).then(Ei)},Ai=e=>{let t=[];for(let n of e){let e=n.trim().toLowerCase();!e||e.length>253||/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/.test(e)&&(t.includes(e)||t.push(e))}return t},ji=(e,t)=>{if(!e.session)return{kind:`refuse`,reason:`frame.fetch on the cloud backend needs its own session: attach with syncCookies: false`};if(typeof t!=`string`)return{kind:`refuse`,reason:`frame.fetch: url must be a string`};let n;try{n=new URL(t)}catch{return{kind:`refuse`,reason:`frame.fetch on the cloud backend needs an absolute url`}}if(n.protocol!==`https:`&&n.protocol!==`http:`)return{kind:`refuse`,reason:`frame.fetch: only http(s) urls are supported`};if(!(e.declaredHosts.includes(n.hostname)||e.approvedOrigins.has(n.origin)))return{kind:`refuse`,reason:`frame.fetch: the target is outside the origins this attachment declared`};let r=e.declaredHosts.length?e.declaredHosts:[n.hostname];return{kind:`consent`,targetHost:n.hostname,promptHosts:r}},Mi=M({lookup:()=>Ni}),Ni=(e,t)=>I.then(n=>n.cloud.dns.lookup(e,t));te();var Pi={json:`application/json`,txt:`text/plain`,html:`text/html`,htm:`text/html`,css:`text/css`,js:`text/javascript`,mjs:`text/javascript`,xml:`application/xml`,csv:`text/csv`,md:`text/markdown`,svg:`image/svg+xml`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`,wasm:`application/wasm`},Fi=(e,t)=>{if(t)return t;let n=e.split(`/`).pop()??``,r=n.lastIndexOf(`.`);if(!(r<=0))return Pi[n.slice(r+1).toLowerCase()]},Ii=(e,t)=>({size:e,mtimeMs:t,mtime:new Date(t),atimeMs:t,ctimeMs:t,mode:420,isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}),Li=(e=0)=>({size:0,mtimeMs:e,mtime:new Date(e),atimeMs:e,ctimeMs:e,mode:493,isFile:()=>!1,isDirectory:()=>!0,isSymbolicLink:()=>!1}),Ri=(e,t,n)=>{let r=Error(`${e}: ${{ENOENT:`no such file or directory`,EEXIST:`file already exists`,ENOTDIR:`not a directory`,EISDIR:`illegal operation on a directory`,ENOTEMPTY:`directory not empty`,ERR_FS_EISDIR:`is a directory`}[e]??e}, ${n} '${t}'`);return r.code=e,r.path=t,r.syscall=n,r},zi=e=>{let t=[];for(let n of e.split(`/`))if(!(!n||n===`.`)){if(n===`..`){t.pop();continue}t.push(n)}return t.join(`/`)},Bi=e=>e.split(`/`).slice(0,-1).join(`/`),G=e=>typeof e==`string`?e:e instanceof URL?decodeURIComponent(e.pathname):e.toString(),Vi=e=>typeof e==`string`?e:e?.encoding??void 0,Hi=e=>typeof e==`object`?e?.contentType:void 0,Ui=e=>typeof e==`object`&&!!e?.recursive,Wi=(e,t)=>{let n=Vi(t);return n?R.from(e).toString(n):R.from(e)},Gi=(e,t)=>{if(typeof e==`string`)return new Uint8Array(R.from(e,Vi(t)??`utf8`));if(e instanceof Uint8Array)return e.slice();if(e instanceof ArrayBuffer)return new Uint8Array(e).slice();if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice();throw TypeError(`The "data" argument must be of type string, Buffer, TypedArray, or DataView`)},Ki=e=>{let t=new Map([[``,{kind:`dir`,mtimeMs:0}]]),n=new Set,r=new Set;bi(`unsaved files`,()=>n.size>0||r.size>0);let i=new Set,a=()=>Date.now(),o=e=>{if(!e)return;let n=e.split(`/`),r=``;for(let e of n){r=r?`${r}/${e}`:e;let n=t.get(r);if(!n)t.set(r,{kind:`dir`,mtimeMs:a()});else if(n.kind===`file`)throw Ri(`ENOTDIR`,r,`mkdir`)}},s,c=0,l=async()=>{let s=await e.list().catch(()=>[]),l=new Set,u=!1;for(let c of s){let s=zi(c.path);if(l.add(s),!r.has(s)&&!(n.has(s)&&!i.has(s)))try{let l=await(await e.readFile(c.path)).arrayBuffer();if(r.has(s)||n.has(s)&&!i.has(s))continue;o(Bi(s));let u=Date.parse(c.updatedAt??``);t.set(s,{kind:`file`,data:new Uint8Array(l),mtimeMs:Number.isFinite(u)?u:a(),contentType:c.contentType??void 0}),i.delete(s),n.delete(s)}catch{u=!0,i.add(s)}}for(let e of i)l.has(e)||i.delete(e);c=u?Date.now():0},u=()=>(s&&(c===0||Date.now()-c<5e3)||(s=l()),s),d=async()=>{s=void 0,c=0,await u()},f=async()=>{let a=[...n].map(async r=>{if(i.has(r))return;let a=t.get(r);if(a?.kind!==`file`){n.delete(r);return}let o=a.data,s=Fi(r,a.contentType);try{await e.writeFile(r,o,s?{contentType:s}:void 0);let i=t.get(r);i?.kind===`file`&&i.data===o&&n.delete(r)}catch{}}),o=[...r].map(async t=>{try{await e.remove(t),r.delete(t)}catch{}});await Promise.all([...a,...o])},p,m=()=>{p||=setTimeout(()=>{p=void 0,f().catch(()=>{})},250)};typeof addEventListener<`u`&&(addEventListener(`pagehide`,()=>{f().catch(()=>{})}),addEventListener(`visibilitychange`,()=>{typeof document<`u`&&document.visibilityState===`hidden`&&f().catch(()=>{})}));let h=e=>e.kind===`file`?Ii(e.data.byteLength,e.mtimeMs):Li(e.mtimeMs),g=e=>Object.assign(Error(`storage: ${e} exists but could not be read, retry once its scope is available`),{code:`FKN_E2E_LOCKED`}),_=e=>{let n=zi(e);return t.has(n)||i.has(n)},v=e=>{let n=zi(e),r=t.get(n);if(!r)throw i.has(n)?g(e):Ri(`ENOENT`,e,`stat`);return h(r)},y=e=>{let n=zi(e),r=t.get(n);if(!r)throw i.has(n)?g(e):Ri(`ENOENT`,e,`open`);if(r.kind===`dir`)throw Ri(`EISDIR`,e,`read`);return r.data},b=(e,t)=>{let n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n},x=(e,s,c,l)=>{let u=zi(e);if(!u)throw Ri(`EISDIR`,e,`open`);if(i.has(u))throw g(e);let d=t.get(u);if(d?.kind===`dir`)throw Ri(`EISDIR`,e,`open`);o(Bi(u));let f=c&&d?.kind===`file`?b(d.data,s):s;t.set(u,{kind:`file`,data:f,mtimeMs:a(),contentType:l??(d?.kind===`file`?d.contentType:void 0)}),n.add(u),r.delete(u),m()},S=(e,n)=>{let r=zi(e);if(r){if(t.has(r)){if(n)return;throw Ri(`EEXIST`,e,`mkdir`)}if(!n&&!t.has(Bi(r)))throw Ri(`ENOENT`,e,`mkdir`);o(r)}},C=e=>{let n=zi(e),r=t.get(n);if(!r)throw Ri(`ENOENT`,e,`scandir`);if(r.kind===`file`)throw Ri(`ENOTDIR`,e,`scandir`);let a=n?`${n}/`:``,o=new Set;for(let e of[...t.keys(),...i]){if(!e||!e.startsWith(a))continue;let t=e.slice(a.length);t&&o.add(t.split(`/`)[0])}return[...o]},w=(e,{op:a,recursive:o,force:s})=>{let c=zi(e),l=t.get(c);if(!l&&i.has(c)){if(a===`rmdir`)throw Ri(`ENOTDIR`,e,`rmdir`);i.delete(c),n.delete(c),r.add(c),m();return}if(!l){if(s||a===`rmdir`&&o)return;throw Ri(`ENOENT`,e,a===`rmdir`?`rmdir`:`unlink`)}if(a===`unlink`&&l.kind===`dir`)throw Ri(`EISDIR`,e,`unlink`);if(a===`rmdir`&&l.kind===`file`)throw Ri(`ENOTDIR`,e,`rmdir`);if(a===`rm`&&l.kind===`dir`&&!o)throw Ri(`ERR_FS_EISDIR`,e,`rm`);let u=`${c}/`,d=[...t.keys()].filter(e=>e.startsWith(u));if(d.length&&!o)throw Ri(`ENOTEMPTY`,e,`rmdir`);for(let e of[c,...d]){let i=t.get(e);t.delete(e),i?.kind===`file`&&(n.delete(e),r.add(e))}m()};return{mount:u,remount:d,flush:f,exists:_,stat:v,readFile:y,writeFile:x,mkdir:S,readdir:C,remove:w,rename:(e,a)=>{let s=zi(e),c=zi(a);if(!s)throw Ri(`EBUSY`,e,`rename`);if(c===s||c.startsWith(`${s}/`))throw Ri(`EINVAL`,e,`rename`);if(i.has(s))throw g(e);if(i.has(c))throw g(a);let l=t.get(s);if(!l)throw Ri(`ENOENT`,e,`rename`);let u=t.get(c);if(u){if(u.kind!==l.kind)throw Ri(l.kind===`dir`?`ENOTDIR`:`EISDIR`,a,`rename`);w(c,{op:`rm`,recursive:!0,force:!0})}o(Bi(c));let d=`${s}/`,f=[s,...[...t.keys()].filter(e=>e.startsWith(d))];for(let e of f){let i=c+e.slice(s.length),a=t.get(e);t.set(i,a),t.delete(e),a.kind===`file`&&(n.add(i),r.delete(i),n.delete(e),r.add(e))}m()}}},qi=(e,t)=>typeof e==`function`?e:t,Ji=e=>typeof e==`function`?void 0:e,Yi=(e,t)=>{e.then(e=>t(null,e),e=>t(e))},Xi=e=>{let t=Ki(e),n=(e,n)=>Wi(t.readFile(G(e)),n),r=(e,n,r)=>t.writeFile(G(e),Gi(n,r),!1,Hi(r)),i=(e,n,r)=>t.writeFile(G(e),Gi(n,r),!0,Hi(r)),a=e=>t.exists(G(e)),o=e=>t.stat(G(e)),s=e=>t.readdir(G(e)),c=(e,n)=>t.mkdir(G(e),Ui(n)),l=(e,n)=>t.remove(G(e),{op:`rm`,...n}),u=(e,n)=>t.remove(G(e),{op:`rmdir`,...n}),d=e=>t.remove(G(e),{op:`unlink`}),f=(e,n)=>t.rename(G(e),G(n)),p=(e,n)=>{t.mount().finally(()=>{let t;try{t=e()}catch(e){n(e);return}n(null,t)})},m=e=>t.mount().then(()=>e());return{available:e.available,readFileSync:n,writeFileSync:r,appendFileSync:i,existsSync:a,statSync:o,lstatSync:o,readdirSync:s,mkdirSync:c,rmSync:l,rmdirSync:u,unlinkSync:d,renameSync:f,readFile:(e,n,r)=>p(()=>Wi(t.readFile(G(e)),Ji(n)),qi(n,r)),writeFile:(e,n,r,i)=>p(()=>t.writeFile(G(e),Gi(n,Ji(r)),!1,Hi(Ji(r))),qi(r,i)),appendFile:(e,n,r,i)=>p(()=>t.writeFile(G(e),Gi(n,Ji(r)),!0,Hi(Ji(r))),qi(r,i)),stat:(e,n)=>p(()=>t.stat(G(e)),n),readdir:(e,n,r)=>p(()=>t.readdir(G(e)),qi(n,r)),mkdir:(e,n,r)=>p(()=>t.mkdir(G(e),Ui(Ji(n))),qi(n,r)),rm:(e,n,r)=>p(()=>t.remove(G(e),{op:`rm`,...Ji(n)}),qi(n,r)),unlink:(e,n)=>p(()=>t.remove(G(e),{op:`unlink`}),n),rename:(e,n,r)=>p(()=>t.rename(G(e),G(n)),r),exists:(e,n)=>{t.mount().finally(()=>n(t.exists(G(e))))},promises:{readFile:(e,n)=>m(()=>Wi(t.readFile(G(e)),n)),writeFile:(e,n,r)=>m(()=>t.writeFile(G(e),Gi(n,r),!1,Hi(r))),appendFile:(e,n,r)=>m(()=>t.writeFile(G(e),Gi(n,r),!0,Hi(r))),stat:e=>m(()=>t.stat(G(e))),lstat:e=>m(()=>t.stat(G(e))),readdir:e=>m(()=>t.readdir(G(e))),mkdir:(e,n)=>m(()=>t.mkdir(G(e),Ui(n))),rm:(e,n)=>m(()=>t.remove(G(e),{op:`rm`,...n})),rmdir:(e,n)=>m(()=>t.remove(G(e),{op:`rmdir`,...n})),unlink:e=>m(()=>t.remove(G(e),{op:`unlink`})),rename:(e,n)=>m(()=>t.rename(G(e),G(n))),access:e=>m(()=>{if(!t.exists(G(e)))throw Ri(`ENOENT`,G(e),`access`)})},mount:t.mount,flush:t.flush,remount:t.remount}},Zi=e=>{let t=async(t,n)=>{let r=await e.readFile(G(t));return Wi(new Uint8Array(await r.arrayBuffer()),n)},n=async(t,n,r)=>{let i=G(t),a=Fi(i,Hi(r));await e.writeFile(i,Gi(n,r),a?{contentType:a}:void 0)},r=t=>e.remove(G(t)),i=async(t,n)=>{let r=zi(G(t)),i=zi(G(n));if(r===i)return;let a=await e.readFile(r);await e.writeFile(i,a),await e.remove(r)},a=async t=>{let n=zi(G(t)),r=n?`${n}/`:``,i=new Set;for(let t of await e.list()){let e=zi(t.path);if(r&&!e.startsWith(r))continue;let n=e.slice(r.length);n&&i.add(n.split(`/`)[0])}return[...i]},o=async(e,t)=>{},s=async(t,n)=>{let r=zi(G(t));if(!n?.recursive){await e.remove(G(t));return}let i=`${r}/`,a=await e.list();await Promise.all(a.filter(e=>{let t=zi(e.path);return t===r||t.startsWith(i)}).map(t=>e.remove(t.path).catch(()=>{})))},c=async t=>{let n=zi(G(t)),r=await e.list(),i=r.find(e=>zi(e.path)===n);if(i){let e=Date.parse(i.updatedAt??``);return Ii(i.size,Number.isFinite(e)?e:0)}if(r.some(e=>zi(e.path).startsWith(`${n}/`)))return Li();throw Ri(`ENOENT`,G(t),`stat`)},l={readFile:t,writeFile:n,unlink:r,rename:i,readdir:a,mkdir:o,rm:s,rmdir:s,stat:c,lstat:c,access:async e=>{await c(e)}};return{available:e.available,promises:l,readFile:(e,n,r)=>Yi(t(e,Ji(n)),qi(n,r)),writeFile:(e,t,r,i)=>Yi(n(e,t,Ji(r)),qi(r,i)),unlink:(e,t)=>Yi(r(e),t),rename:(e,t,n)=>Yi(i(e,t),n),readdir:(e,t,n)=>Yi(a(e),qi(t,n)),mkdir:(e,t,n)=>Yi(o(),qi(t,n)),rm:(e,t,n)=>Yi(s(e,Ji(t)),qi(t,n)),stat:(e,t)=>Yi(c(e),t)}};function Qi(e,t){return t.memfs?Xi(e):Zi(e)}var $i=`FKN_STORAGE_NOT_FOUND`,ea=M({StorageLockedError:()=>ta,StorageNotFoundError:()=>na,availability:()=>ua,available:()=>aa,encryption:()=>va,isNotFound:()=>ra,list:()=>da,quota:()=>fa,readFile:()=>pa,readFileSealed:()=>ha,remove:()=>_a,unlock:()=>ya,writeFile:()=>ga}),ta=class extends Error{code=`FKN_E2E_LOCKED`;constructor(){super(`storage locked: this account stores encrypted data, unlock it from the FKN card or unlock()`)}},na=class extends Error{code=$i;constructor(e=`storage: no object at that path`){super(e)}},ra=e=>e?.code===$i,ia=e=>{throw e instanceof Error&&e.message.startsWith(`fkn:e2e-locked`)?new ta:ra(e)||e instanceof Error&&(/^not found$/i.test(e.message)||/\(404\)$/.test(e.message))?new na(e.message):e},aa=()=>I.then(e=>e.cloud.fs.available()).catch(()=>!1),oa=8e3,sa=1e3,ca=!1,la=async()=>{let e=(await I).cloud.fs;return typeof e.availability==`function`?e.availability():await e.available()?`connected`:`disconnected`},ua=async()=>{let e=ca?sa:oa,t=await new Promise(t=>{let n=setTimeout(()=>t(`timeout`),e);la().then(e=>{clearTimeout(n),t(e)},()=>{clearTimeout(n),t(`unknown`)})});return t===`timeout`?(ca=!0,`unknown`):(ca=!1,t)},da=()=>I.then(e=>e.cloud.fs.list()),fa=()=>I.then(e=>e.cloud.fs.quota()),pa=async e=>{let t=await(await I).cloud.fs.readFile(e).catch(ia);return new Blob([t])},ma=e=>{if(e===null||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()},ha=async e=>{let t=(await I).cloud.fs;if(typeof t.readFileSealed!=`function`)return{data:await t.readFile(e).catch(ia),sealedAt:null};let n=await t.readFileSealed(e).catch(ia);return{data:n.bytes,sealedAt:ma(n.sealedAt)}},ga=async(e,t,n)=>{let r=await I,i=t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t;await r.cloud.fs.writeFile(e,i,n?.contentType??null).catch(ia)},_a=e=>I.then(t=>t.cloud.fs.remove(e)).then(()=>void 0),va=()=>I.then(e=>e.cloud.fs.encryption()),ya=()=>I.then(e=>e.cloud.fs.unlock()),ba=M({STORAGE_NOT_FOUND:()=>$i,StorageLockedError:()=>ta,StorageNotFoundError:()=>na,available:()=>xa,encryption:()=>va,isNotFound:()=>ra,mkdir:()=>Da,promises:()=>Aa,quota:()=>fa,readFile:()=>Sa,readFileSealed:()=>ha,readdir:()=>Ea,rename:()=>Ta,rm:()=>Oa,stat:()=>ka,unlink:()=>wa,unlock:()=>ya,writeFile:()=>Ca}),{available:xa,readFile:Sa,writeFile:Ca,unlink:wa,rename:Ta,readdir:Ea,mkdir:Da,rm:Oa,stat:ka,promises:Aa}=Qi(ea,{memfs:!1}),ja=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AddressError=void 0,e.AddressError=class extends Error{constructor(e,t){super(e),this.name=`AddressError`,this.parseMessage=t}}})),Ma=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isInSubnet=n,e.isHostInSubnet=r,e.isCorrect=i,e.prefixLengthFromMask=a,e.assertByteArray=o,e.numberToPaddedHex=s,e.stringToPaddedHex=c,e.testBit=l;var t=ja();function n(e){return this.subnetMask<e.subnetMask?!1:r.call(this,e)}function r(e){return this.mask(e.subnetMask)===e.mask()}function i(e){return function(){return this.addressMinusSuffix===this.correctForm()?this.subnetMask===e&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask):!1}}function a(e,n){let r=e.toString(2).padStart(n,`0`);if(r.length>n)throw new t.AddressError(`Invalid subnet mask.`);let i=r.indexOf(`0`);if(i===-1)return n;if(r.slice(i).includes(`1`))throw new t.AddressError(`Invalid subnet mask.`);return i}function o(e,n,r,i){if(e.length!==n)throw new t.AddressError(`${r} addresses require exactly ${n} bytes`);for(let n=0;n<e.length;n++)if(!Number.isInteger(e[n])||e[n]<i||e[n]>255)throw new t.AddressError(`All bytes must be integers between ${i} and 255`)}function s(e){return e.toString(16).padStart(2,`0`)}function c(e){return s(parseInt(e,10))}function l(e,t){let{length:n}=e;if(t>n)return!1;let r=n-t;return e.substring(r,r+1)===`1`}})),Na=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_SUBNET_STRING=e.RE_ADDRESS=e.GROUPS=e.BITS=void 0,e.BITS=32,e.GROUPS=4,e.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/g,e.RE_SUBNET_STRING=/\/\d{1,2}$/})),Pa=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address4=void 0;var i=r(Ma()),a=r(Na()),o=ja(),s=i.isCorrect(a.BITS),c=class e{constructor(e){this.addressMinusSuffix=``,this.groups=a.GROUPS,this.parsedAddress=[],this.parsedSubnet=``,this.subnet=`/32`,this.subnetMask=32,this.v4=!0,this.isCorrect=s,this.isInSubnet=i.isInSubnet,this.isHostInSubnet=i.isHostInSubnet,this.address=e;let t=a.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>a.BITS)throw new o.AddressError(`Invalid subnet mask.`);e=e.replace(a.RE_SUBNET_STRING,``)}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(t){try{return new e(t),!0}catch{return!1}}parse(e){let t=e.split(`.`);if(t.some(e=>/^0\d/.test(e)))throw new o.AddressError(`IPv4 addresses can't have leading zeroes.`);if(!e.match(a.RE_ADDRESS))throw new o.AddressError(`Invalid IPv4 address.`);return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(`.`)}static fromAddressAndMask(t,n){let r=i.prefixLengthFromMask(new e(n).bigInt(),a.BITS);return new e(`${t}/${r}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(a.BITS))-BigInt(1),o=i.prefixLengthFromMask(r,a.BITS);return new e(`${t}/${o}`)}static fromWildcard(t){let n=t.split(`.`);if(n.length!==a.GROUPS)throw new o.AddressError(`Wildcard pattern must have 4 octets`);let r=-1;for(let e=0;e<n.length;e++)if(n[e]===`*`)r===-1&&(r=e);else if(r!==-1)throw new o.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)");let i=r===-1?0:n.length-r,s=n.map(e=>e===`*`?`0`:e),c=a.BITS-i*8;return new e(`${s.join(`.`)}/${c}`)}static fromHex(t){let n=t.replace(/:/g,``);if(!/^[0-9a-fA-F]{8}$/.test(n))throw new o.AddressError(`IPv4 hex must be exactly 8 hex digits`);let r=[];for(let e=0;e<8;e+=2)r.push(parseInt(n.slice(e,e+2),16));return new e(r.join(`.`))}static fromInteger(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new o.AddressError(`IPv4 integer must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,``).split(`.`).reverse().join(`.`);return new e(n)}toHex(){return this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(`:`)}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<a.GROUPS;t+=2)e.push(`${i.stringToPaddedHex(this.parsedAddress[t])}${i.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>i.stringToPaddedHex(e)).join(``)}`)}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(a.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(a.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(a.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(a.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}static fromBigInt(t){if(t<BigInt(0)||t>BigInt(4294967295))throw new o.AddressError(`IPv4 BigInt must be in the range 0 to 2**32 - 1`);return e.fromHex(t.toString(16).padStart(8,`0`))}static fromByteArray(e){return i.assertByteArray(e,4,`IPv4`,0),this.fromUnsignedByteArray(e)}static fromUnsignedByteArray(t){if(t.length!==4)throw new o.AddressError(`IPv4 addresses require exactly 4 bytes`);let n=t.join(`.`);return new e(n)}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||={};let t=this.correctForm().split(`.`).reverse().join(`.`);return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isHostInSubnet(l)}isPrivate(){return u.some(e=>this.isHostInSubnet(e))}isLoopback(){return this.isHostInSubnet(d)}isLinkLocal(){return this.isHostInSubnet(f)}isUnspecified(){return this.isHostInSubnet(p)}isBroadcast(){return this.isHostInSubnet(m)}isCGNAT(){return this.isHostInSubnet(h)}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(a.BITS,`0`)),this._binaryZeroPad}groupForV6(){let e=this.parsedAddress;return this.correctForm().replace(a.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(`.`)}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(`.`)}</span>`)}};e.Address4=c;var l=new c(`224.0.0.0/4`),u=[new c(`10.0.0.0/8`),new c(`172.16.0.0/12`),new c(`192.168.0.0/16`)],d=new c(`127.0.0.0/8`),f=new c(`169.254.0.0/16`),p=new c(`0.0.0.0/32`),m=new c(`255.255.255.255/32`),h=new c(`100.64.0.0/10`)})),Fa=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RE_URL_WITH_PORT=e.RE_URL=e.RE_ZONE_STRING=e.RE_SUBNET_STRING=e.RE_BAD_ADDRESS=e.RE_BAD_CHARACTERS=e.TYPES=e.SCOPES=e.GROUPS=e.BITS=void 0,e.BITS=128,e.GROUPS=8,e.SCOPES={0:`Reserved`,1:`Interface local`,2:`Link local`,4:`Admin local`,5:`Site local`,8:`Organization local`,14:`Global`,15:`Reserved`},e.TYPES={"ff01::1/128":`Multicast (All nodes on this interface)`,"ff01::2/128":`Multicast (All routers on this interface)`,"ff02::1/128":`Multicast (All nodes on this link)`,"ff02::2/128":`Multicast (All routers on this link)`,"ff05::2/128":`Multicast (All routers in this site)`,"ff02::5/128":`Multicast (OSPFv3 AllSPF routers)`,"ff02::6/128":`Multicast (OSPFv3 AllDR routers)`,"ff02::9/128":`Multicast (RIP routers)`,"ff02::a/128":`Multicast (EIGRP routers)`,"ff02::d/128":`Multicast (PIM routers)`,"ff02::16/128":`Multicast (MLDv2 reports)`,"ff01::fb/128":`Multicast (mDNSv6)`,"ff02::fb/128":`Multicast (mDNSv6)`,"ff05::fb/128":`Multicast (mDNSv6)`,"ff02::1:2/128":`Multicast (All DHCP servers and relay agents on this link)`,"ff05::1:2/128":`Multicast (All DHCP servers and relay agents in this site)`,"ff02::1:3/128":`Multicast (All DHCP servers on this link)`,"ff05::1:3/128":`Multicast (All DHCP servers in this site)`,"::/128":`Unspecified`,"::1/128":`Loopback`,"::ffff:0:0/96":`IPv4-mapped`,"ff00::/8":`Multicast`,"fe80::/10":`Link-local unicast`,"fc00::/7":`Unique local`,"2002::/16":`6to4`,"2001:db8::/32":`Documentation`,"64:ff9b::/96":`NAT64 (well-known)`,"64:ff9b:1::/48":`NAT64 (local-use)`},e.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,e.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,e.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,e.RE_ZONE_STRING=/%.*$/,e.RE_URL=/^(?:\[([0-9a-f:.]+)\]|([0-9a-f:.]+))(?:[/?#].*)?$/i,e.RE_URL_WITH_PORT=/^\[([0-9a-f:.]+)\]:([0-9]{1,5})(?:[/?#].*)?$/i})),Ia=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeHtml=t,e.spanAllZeroes=n,e.spanAll=r,e.spanLeadingZeroes=a,e.simpleGroup=o;function t(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function n(e){return t(e).replace(/(0+)/g,`<span class="zero">$1</span>`)}function r(e,r=0){return e.split(``).map((e,i)=>`<span class="digit value-${t(e)} position-${i+r}">${n(e)}</span>`).join(``)}function i(e){return t(e).replace(/^(0+)/,`<span class="zero">$1</span>`)}function a(e){return e.split(`:`).map(e=>i(e)).join(`:`)}function o(e,t=0){return e.split(`:`).map((e,n)=>/group-v4/.test(e)?e:`<span class="hover-group group-${n+t}">${i(e)}</span>`)}})),La=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.ADDRESS_BOUNDARY=void 0,e.groupPossibilities=a,e.padGroup=o,e.simpleRegularExpression=s,e.possibleElisions=c;var i=r(Fa());function a(e){return`(${e.join(`|`)})`}function o(e){return e.length<4?`0{0,${4-e.length}}${e}`:e}e.ADDRESS_BOUNDARY=`[^A-Fa-f0-9:]`;function s(e){let t=[];e.forEach((e,n)=>{parseInt(e,16)===0&&t.push(n)});let n=t.map(t=>e.map((e,n)=>{if(n===t){let t=n===0||n===i.GROUPS-1?`:`:``;return a([o(e),t])}return o(e)}).join(`:`));return n.push(e.map(o).join(`:`)),a(n)}function c(e,t,n){let r=t?``:`:`,i=n?``:`:`,o=[];!t&&!n&&o.push(`::`),t&&n&&o.push(``),(n&&!t||!n&&t)&&o.push(`:`),o.push(`${r}(:0{1,4}){1,${e-1}}`),o.push(`(0{1,4}:){1,${e-1}}${i}`),o.push(`(0{1,4}:){${e-1}}0{1,4}`);for(let t=1;t<e-1;t++)for(let n=1;n<e-t;n++)o.push(`(0{1,4}:){${n}}:(0{1,4}:){${e-n-t-1}}0{1,4}`);return a(o)}})),Ra=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.Address6=void 0;var i=r(Ma()),a=r(Na()),o=r(Fa()),s=r(Ia()),c=Pa(),l=La(),u=ja(),d=Ma(),f=i.isCorrect(o.BITS);function p(e){if(!e)throw Error(`Assertion failed.`)}function m(e){let t=/(\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,`$1,$2`);return e}function h(e){return e=e.replace(/^(0{1,})([1-9]+)$/,`<span class="parse-error">$1</span>$2`),e=e.replace(/^(0{1,})(0)$/,`<span class="parse-error">$1</span>$2`),e}function g(e,t){let n=[],r=[],i;for(i=0;i<e.length;i++)i<t[0]?n.push(e[i]):i>t[1]&&r.push(e[i]);return n.concat([`compact`]).concat(r)}function _(e){return parseInt(e,16).toString(16).padStart(4,`0`)}function v(e){return e&255}var y=class e{constructor(e,t){this.addressMinusSuffix=``,this.parsedSubnet=``,this.subnet=`/128`,this.subnetMask=128,this.v4=!1,this.zone=``,this.isInSubnet=i.isInSubnet,this.isHostInSubnet=i.isHostInSubnet,this.isCorrect=f,t===void 0?this.groups=o.GROUPS:this.groups=t,this.address=e;let n=o.RE_SUBNET_STRING.exec(e);if(n){if(this.parsedSubnet=n[0].replace(`/`,``),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>o.BITS)throw new u.AddressError(`Invalid subnet mask.`);e=e.replace(o.RE_SUBNET_STRING,``)}if(/\//.test(e))throw new u.AddressError(`Invalid subnet mask.`);let r=o.RE_ZONE_STRING.exec(e);r&&(this.zone=r[0],e=e.replace(o.RE_ZONE_STRING,``)),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new e(t),!0}catch{return!1}}static fromBigInt(t){if(t<BigInt(0)||t>(BigInt(1)<<BigInt(o.BITS))-BigInt(1))throw new u.AddressError(`IPv6 BigInt must be in the range 0 to 2**128 - 1`);let n=t.toString(16).padStart(32,`0`),r=[];for(let e=0;e<o.GROUPS;e++)r.push(n.slice(e*4,(e+1)*4));return new e(r.join(`:`))}static fromURL(t){let n,r=null,i,a,s=t.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``);if(s.indexOf(`[`)!==-1&&s.indexOf(`]:`)!==-1){if(a=`failed to parse address with port`,i=o.RE_URL_WITH_PORT.exec(s),i===null)return{error:a,address:null,port:null};n=i[1],r=i[2]}else{if(a=`failed to parse address from URL`,i=o.RE_URL.exec(s),i===null)return{error:a,address:null,port:null};n=i[1]??i[2]}r?(r=parseInt(r,10),(r<0||r>65535)&&(r=null)):r=null;let c;try{c=new e(n)}catch{return{error:a,address:null,port:null}}return{address:c,port:r}}static fromAddressAndMask(t,n){let r=i.prefixLengthFromMask(new e(n).bigInt(),o.BITS);return new e(`${t}/${r}`)}static fromAddressAndWildcardMask(t,n){let r=new e(n).bigInt()^(BigInt(1)<<BigInt(o.BITS))-BigInt(1),a=i.prefixLengthFromMask(r,o.BITS);return new e(`${t}/${a}`)}static fromWildcard(t){if(t.includes(`%`)||t.includes(`/`))throw new u.AddressError(`Wildcard pattern must not include a zone or CIDR suffix`);let n=t.split(`::`);if(n.length>2)throw new u.AddressError(`Wildcard pattern cannot contain more than one '::'`);let r;if(n.length===2){let e=n[0]===``?[]:n[0].split(`:`),t=n[1]===``?[]:n[1].split(`:`),i=o.GROUPS-e.length-t.length;if(i<1)throw new u.AddressError(`Wildcard pattern with '::' has too many groups`);r=[...e,...Array(i).fill(`0`),...t]}else r=t.split(`:`);if(r.length!==o.GROUPS)throw new u.AddressError(`Wildcard pattern must have 8 groups`);let i=-1;for(let e=0;e<r.length;e++)if(r[e]===`*`)i===-1&&(i=e);else if(i!==-1)throw new u.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)");let a=i===-1?0:r.length-i,s=r.map(e=>e===`*`?`0`:e),c=o.BITS-a*16;return new e(`${s.join(`:`)}/${c}`)}static fromAddress4(t){let n=new c.Address4(t),r=o.BITS-(a.BITS-n.subnetMask);return new e(`::ffff:${n.correctForm()}/${r}`)}static fromArpa(t){let n=t.replace(/(\.ip6\.arpa)?\.$/,``);if(n.length!==63)throw new u.AddressError(`Invalid 'ip6.arpa' form.`);let r=n.split(`.`).reverse();for(let e=7;e>0;e--){let t=e*4;r.splice(t,0,`:`)}return n=r.join(``),new e(n)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,`-`)}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=o.BITS-this.subnetMask-Math.abs(e-o.BITS);return t<0?`0`:m((BigInt(`2`)**BigInt(t)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+`0`.repeat(o.BITS-this.subnetMask)}`)}startAddress(){return e.fromBigInt(this._startAddress())}startAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._startAddress()+t)}_endAddress(){return BigInt(`0b${this.mask()+`1`.repeat(o.BITS-this.subnetMask)}`)}endAddress(){return e.fromBigInt(this._endAddress())}endAddressExclusive(){let t=BigInt(`1`);return e.fromBigInt(this._endAddress()-t)}subnetMaskAddress(){return e.fromBigInt(BigInt(`0b${`1`.repeat(this.subnetMask)}${`0`.repeat(o.BITS-this.subnetMask)}`))}wildcardMask(){return e.fromBigInt(BigInt(`0b${`0`.repeat(this.subnetMask)}${`1`.repeat(o.BITS-this.subnetMask)}`))}networkForm(){return`${this.startAddress().correctForm()}/${this.subnetMask}`}getScope(){let e=this.getType();return e===`Multicast`||e.startsWith(`Multicast `)?o.SCOPES[parseInt(this.getBits(12,16).toString(10),10)]||`Unknown`:e===`Link-local unicast`||e===`Loopback`?`Link local`:e===`Unspecified`?`Unknown`:`Global`}getType(){for(let e=0;e<b.length;e++){let t=b[e];if(this.isHostInSubnet(t[0]))return t[1]}return`Global unicast`}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let n=t-e;if(n%4!=0)throw Error(`Length of bits to retrieve must be divisible by four`);return this.getBits(e,t).toString(16).padStart(n/4,`0`)}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,o.BITS)}reverseForm(e){e||={};let t=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,``).split(``).slice(0,t).reverse().join(`.`);return t>0?e.omitSuffix?n:`${n}.ip6.arpa.`:e.omitSuffix?``:`ip6.arpa.`}correctForm(){let e,t=[],n=0,r=[];for(e=0;e<this.parsedAddress.length;e++){let t=parseInt(this.parsedAddress[e],16);t===0&&n++,t!==0&&n>0&&(n>1&&r.push([e-n,e-1]),n=0)}n>1&&r.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let i=r.map(e=>e[1]-e[0]+1);if(r.length>0){let e=i.indexOf(Math.max(...i));t=g(this.parsedAddress,r[e])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!==`compact`&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(`:`);return a=a.replace(/^compact$/,`::`),a=a.replace(/(^compact)|(compact$)/,`:`),a=a.replace(/compact/,``),a}binaryZeroPad(){return this._binaryZeroPad===void 0&&(this._binaryZeroPad=this.bigInt().toString(2).padStart(o.BITS,`0`)),this._binaryZeroPad}parse4in6(e){if(e.indexOf(`.`)===-1)return e;let t=e.split(`:`),n=t.slice(-1)[0],r=n.split(`.`);if(r.length===a.GROUPS&&r.every(e=>/^\d{1,3}$/.test(e))&&r.some(e=>/^0\d/.test(e))){let e=r.map(h).join(`.`),n=t.slice(0,-1).map(s.escapeHtml).join(`:`),i=t.length>1?`:`:``;throw new u.AddressError(`IPv4 addresses can't have leading zeroes.`,`${n}${i}${e}`)}let i=n.match(a.RE_ADDRESS);if(i){this.parsedAddress4=i[0];let n=this.subnetMask>=96?`/${this.subnetMask-96}`:``;this.address4=new c.Address4(`${this.parsedAddress4}${n}`),this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(`:`)}return e}parse(e){e=this.parse4in6(e);let t=e.match(o.RE_BAD_CHARACTERS);if(t)throw new u.AddressError(`Bad character${t.length>1?`s`:``} detected in address: ${t.join(``)}`,e.replace(o.RE_BAD_CHARACTERS,`<span class="parse-error">$1</span>`));let n=e.match(o.RE_BAD_ADDRESS);if(n)throw new u.AddressError(`Address failed regex: ${n.join(``)}`,e.replace(o.RE_BAD_ADDRESS,`<span class="parse-error">$1</span>`));let r=[],i=e.split(`::`);if(i.length===2){let e=i[0].split(`:`),t=i[1].split(`:`);e.length===1&&e[0]===``&&(e=[]),t.length===1&&t[0]===``&&(t=[]);let n=this.groups-(e.length+t.length);if(!n)throw new u.AddressError(`Error parsing groups`);this.elidedGroups=n,this.elisionBegin=e.length,this.elisionEnd=e.length+this.elidedGroups,r=r.concat(e);for(let e=0;e<n;e++)r.push(`0`);r=r.concat(t)}else if(i.length===1)r=e.split(`:`),this.elidedGroups=0;else throw new u.AddressError(`Too many :: groups found`);if(r=r.map(e=>parseInt(e,16).toString(16)),r.length!==this.groups)throw new u.AddressError(`Incorrect number of groups found`);return r}canonicalForm(){return this.parsedAddress.map(_).join(`:`)}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,`0`)).join(`:`)}bigInt(){return BigInt(`0x${this.parsedAddress.map(_).join(``)}`)}to4(){let e=this.binaryZeroPad().split(``),t=BigInt(`0b${e.slice(96,128).join(``)}`).toString(16).padStart(8,`0`);if(this.subnetMask>=96){let e=this.subnetMask-96,n=[];for(let e=0;e<8;e+=2)n.push(parseInt(t.slice(e,e+2),16));return new c.Address4(`${n.join(`.`)}/${e}`)}return c.Address4.fromHex(t)}to4in6(){let t=this.to4(),n=new e(this.parsedAddress.slice(0,6).join(`:`),6).correctForm(),r=``;return/:$/.test(n)||(r=`:`),n+r+t.correctForm()}inspectTeredo(){let e=this.getBitsBase16(0,32),t=(this.getBits(80,96)^BigInt(`0xffff`)).toString(),n=c.Address4.fromHex(this.getBitsBase16(32,64)),r=this.getBits(96,128),i=c.Address4.fromHex((r^BigInt(`0xffffffff`)).toString(16).padStart(8,`0`)),a=this.getBitsBase2(64,80),o=(0,d.testBit)(a,15),s=(0,d.testBit)(a,14),l=(0,d.testBit)(a,8),u=(0,d.testBit)(a,9),f=BigInt(`0b${a.slice(2,6)+a.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:n.address,client4:i.address,flags:a,coneNat:o,microsoft:{reserved:s,universalLocal:u,groupIndividual:l,nonce:f},udpPort:t}}inspect6to4(){let e=this.getBitsBase16(0,16),t=c.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let t=[`2002`,this.getBitsBase16(96,112),this.getBitsBase16(112,128),``,`/16`].join(`:`);return new e(t)}static fromAddress4Nat64(t,n=`64:ff9b::/96`){let r=new c.Address4(t),i=new e(n),a=i.subnetMask;if(a!==32&&a!==40&&a!==48&&a!==56&&a!==64&&a!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);let o=i.binaryZeroPad(),s=r.binaryZeroPad(),l;if(a===96)l=o.slice(0,96)+s;else{let e=64-a;l=[o.slice(0,a),s.slice(0,e),`00000000`,s.slice(e),`0`.repeat(56-(32-e))].join(``)}let d=BigInt(`0b${l}`).toString(16).padStart(32,`0`),f=[];for(let e=0;e<8;e++)f.push(d.slice(e*4,(e+1)*4));return new e(f.join(`:`))}toAddress4Nat64(t=`64:ff9b::/96`){let n=new e(t),r=n.subnetMask;if(r!==32&&r!==40&&r!==48&&r!==56&&r!==64&&r!==96)throw new u.AddressError(`NAT64 prefix length must be 32, 40, 48, 56, 64, or 96`);if(!this.isHostInSubnet(n))return null;let i=this.binaryZeroPad(),a;if(r===96)a=i.slice(96,128);else{let e=64-r;a=i.slice(r,r+e)+i.slice(72,72+(32-e))}let o=[];for(let e=0;e<4;e++)o.push(parseInt(a.slice(e*8,(e+1)*8),2).toString());return new c.Address4(o.join(`.`))}toByteArray(){let e=this.bigInt().toString(16).padStart(o.BITS/4,`0`),t=[];for(let n=0,r=e.length;n<r;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t}toUnsignedByteArray(){return this.toByteArray().map(v)}static fromByteArray(e){return i.assertByteArray(e,16,`IPv6`,-128),this.fromUnsignedByteArray(e.map(v))}static fromUnsignedByteArray(t){i.assertByteArray(t,16,`IPv6`,0);let n=BigInt(`256`),r=BigInt(`0`),a=BigInt(`1`);for(let e=t.length-1;e>=0;e--)r+=a*BigInt(t[e].toString(10)),a*=n;return e.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){let e=this.embeddedIPv4();return e?e.isLinkLocal():this.getBitsBase2(0,64)===`1111111010000000000000000000000000000000000000000000000000000000`}isMulticast(){let e=this.embeddedIPv4();if(e)return e.isMulticast();let t=this.getType();return t===`Multicast`||t.startsWith(`Multicast `)}is4(){return this.v4}isMapped4(){return this.isHostInSubnet(T)}embeddedIPv4(){return this.isMapped4()||this.isHostInSubnet(E)?this.to4():null}isTeredo(){return this.isHostInSubnet(x)}is6to4(){return this.isHostInSubnet(S)}isLoopback(){let e=this.embeddedIPv4();return e?e.isLoopback():this.getType()===`Loopback`}isULA(){return this.isHostInSubnet(C)}isPrivate(){let e=this.embeddedIPv4();return e?e.isPrivate():this.isULA()}isCGNAT(){let e=this.embeddedIPv4();return e?e.isCGNAT():!1}isBroadcast(){let e=this.embeddedIPv4();return e?e.isBroadcast():!1}isUnspecified(){let e=this.embeddedIPv4();return e?e.isUnspecified():this.getType()===`Unspecified`}isDocumentation(){return this.isHostInSubnet(w)}href(e){return e=e===void 0?``:`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||={},e.className===void 0&&(e.className=``),e.prefix===void 0&&(e.prefix=`/#address=`),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let n=t.call(this),r=s.escapeHtml(`${e.prefix}${n}`),i=s.escapeHtml(n);return e.className?`<a href="${r}" class="${s.escapeHtml(e.className)}">${i}</a>`:`<a href="${r}">${i}</a>`}group(){if(this.elidedGroups===0)return s.simpleGroup(this.addressMinusSuffix).join(`:`);p(typeof this.elidedGroups==`number`),p(typeof this.elisionBegin==`number`);let e=[],[t,n]=this.addressMinusSuffix.split(`::`);t.length?e.push(...s.simpleGroup(t)):e.push(``);let r=[`hover-group`];for(let e=this.elisionBegin;e<this.elisionBegin+this.elidedGroups;e++)r.push(`group-${e}`);return e.push(`<span class="${r.join(` `)}"></span>`),n.length?e.push(...s.simpleGroup(n,this.elisionEnd)):e.push(``),this.is4()&&(p(this.address4 instanceof c.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(`:`)}regularExpressionString(t=!1){let n=[],r=new e(this.correctForm());if(r.elidedGroups===0)n.push((0,l.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===o.GROUPS)n.push((0,l.possibleElisions)(o.GROUPS));else{let e=r.address.split(`::`);e[0].length&&n.push((0,l.simpleRegularExpression)(e[0].split(`:`))),p(typeof r.elidedGroups==`number`),n.push((0,l.possibleElisions)(r.elidedGroups,e[0].length!==0,e[1].length!==0)),e[1].length&&n.push((0,l.simpleRegularExpression)(e[1].split(`:`))),n=[n.join(`:`)]}return t||(n=[`(?=^|`,l.ADDRESS_BOUNDARY,`|[^\\w\\:])(`,...n,`)(?=[^\\w\\:]|`,l.ADDRESS_BOUNDARY,`|$)`]),n.join(``)}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),`i`)}};e.Address6=y;var b=Object.keys(o.TYPES).map(e=>[new y(e),o.TYPES[e]]),x=new y(`2001::/32`),S=new y(`2002::/16`),C=new y(`fc00::/7`),w=new y(`2001:db8::/32`),T=new y(`::ffff:0:0/96`),E=new y(`64:ff9b::/96`)})),za=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.v6=e.AddressError=e.Address6=e.Address4=void 0;var i=Pa();Object.defineProperty(e,"Address4",{enumerable:!0,get:function(){return i.Address4}});var a=Ra();Object.defineProperty(e,"Address6",{enumerable:!0,get:function(){return a.Address6}});var o=ja();Object.defineProperty(e,"AddressError",{enumerable:!0,get:function(){return o.AddressError}}),e.v6={helpers:r(Ia())}}))(),Ba=new TextEncoder;new TextDecoder;var Va=`webvpn-udp-port-ack`,Ha=e=>za.Address4.isValid(e),Ua=e=>za.Address6.isValid(e),Wa=e=>Ha(e)?4:Ua(e)?6:0,Ga=(...e)=>{if(typeof e[0]==`string`)throw Error(`FKN WebVPN does not support IPC connections`);let t=typeof e.at(-1)==`function`?e.at(-1):void 0;return e[0]&&typeof e[0]==`object`?{...e[0],callback:t}:{port:e[0]??0,host:typeof e[1]==`string`?e[1]:void 0,callback:t}},Ka=(...e)=>{let t=typeof e.at(-1)==`function`?e.at(-1):void 0,n=e[0]??0,r=typeof e[1]==`string`?e[1]:void 0;return typeof e[0]==`object`?{...e[0],address:e[0].address??r,port:e[0].port??n,callback:t}:{address:r,port:n,callback:t}},qa=(...e)=>{let t=typeof e.at(-1)==`function`?e.at(-1):void 0,n=e[0];if(typeof e[2]==`number`)return{message:n,hasRange:!0,offset:e[1],length:e[2],port:typeof e[3]==`number`?e[3]:0,address:typeof e[4]==`string`?e[4]:void 0,callback:t};{let r=typeof e[1]==`number`?e[1]:0,i=typeof e[2]==`string`?e[2]:void 0;return{message:n,hasRange:!1,offset:0,length:n.length,port:r,address:i,callback:t}}},Ja=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),Ya=n(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Xa=n(((e,t)=>{t.exports=Ja().EventEmitter})),Za=n(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),Qa=n(((e,t)=>{var n=Za();t.exports=function(){return n()&&!!Symbol.toStringTag}})),$a=n(((e,t)=>{t.exports=Object})),eo=n(((e,t)=>{t.exports=Error})),to=n(((e,t)=>{t.exports=EvalError})),no=n(((e,t)=>{t.exports=RangeError})),ro=n(((e,t)=>{t.exports=ReferenceError})),io=n(((e,t)=>{t.exports=SyntaxError})),ao=n(((e,t)=>{t.exports=TypeError})),oo=n(((e,t)=>{t.exports=URIError})),so=n(((e,t)=>{t.exports=Math.abs})),co=n(((e,t)=>{t.exports=Math.floor})),lo=n(((e,t)=>{t.exports=Math.max})),uo=n(((e,t)=>{t.exports=Math.min})),fo=n(((e,t)=>{t.exports=Math.pow})),po=n(((e,t)=>{t.exports=Math.round})),mo=n(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),ho=n(((e,t)=>{var n=mo();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),go=n(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),_o=n(((e,t)=>{var n=go();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),vo=n(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),yo=n(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=Za();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),bo=n(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),xo=n(((e,t)=>{t.exports=$a().getPrototypeOf||null})),So=n(((e,t)=>{var n=Object.prototype.toString,r=Math.max,i=`[object Function]`,a=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},s=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||n.apply(t)!==i)throw TypeError(`Function.prototype.bind called on incompatible `+t);for(var c=o(arguments,1),l,u=function(){if(this instanceof l){var n=t.apply(this,a(c,arguments));return Object(n)===n?n:this}return t.apply(e,a(c,arguments))},d=r(0,t.length-c.length),f=[],p=0;p<d;p++)f[p]=`$`+p;if(l=Function(`binder`,`return function (`+s(f,`,`)+`){ return binder.apply(this,arguments); }`)(u),t.prototype){var m=function(){};m.prototype=t.prototype,l.prototype=new m,m.prototype=null}return l}})),Co=n(((e,t)=>{var n=So();t.exports=Function.prototype.bind||n})),wo=n(((e,t)=>{t.exports=Function.prototype.call})),To=n(((e,t)=>{t.exports=Function.prototype.apply})),Eo=n(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),Do=n(((e,t)=>{var n=Co(),r=To(),i=wo();t.exports=Eo()||n.call(i,r)})),Oo=n(((e,t)=>{var n=Co(),r=ao(),i=wo(),a=Do();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),ko=n(((e,t)=>{var n=Oo(),r=_o(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),Ao=n(((e,t)=>{var n=bo(),r=xo(),i=ko();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),jo=n(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=Co().call(n,r)})),Mo=n(((e,t)=>{var n,r=$a(),i=eo(),a=to(),o=no(),s=ro(),c=io(),l=ao(),u=oo(),d=so(),f=co(),p=lo(),m=uo(),h=fo(),g=po(),_=ho(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=_o(),x=vo(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=yo()(),T=Ao(),E=xo(),D=bo(),O=To(),k=wo(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var N=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},P={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},F=Co(),ee=jo(),I=F.call(k,Array.prototype.concat),L=F.call(O,Array.prototype.splice),R=F.call(k,String.prototype.replace),z=F.call(k,String.prototype.slice),te=F.call(k,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,B=function(e){var t=z(e,0,1),n=z(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return R(e,ne,function(e,t,n,i){r[r.length]=n?R(i,re,`$1`):t||e}),r},ie=function(e,t){var n=e,r;if(ee(P,n)&&(r=P[n],n=`%`+r[0]+`%`),ee(M,n)){var i=M[n];if(i===A&&(i=N(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(te(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=B(e),r=n.length>0?n[0]:``,i=ie(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],L(n,I([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=z(p,0,1),h=z(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,ee(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=ee(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),No=n(((e,t)=>{var n=Mo(),r=Oo(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),Po=n(((e,t)=>{var n=Qa()(),r=No()(`Object.prototype.toString`),i=function(e){return n&&e&&typeof e==`object`&&Symbol.toStringTag in e?!1:r(e)===`[object Arguments]`},a=function(e){return i(e)?!0:typeof e==`object`&&!!e&&`length`in e&&typeof e.length==`number`&&e.length>=0&&r(e)!==`[object Array]`&&`callee`in e&&r(e.callee)===`[object Function]`},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a})),Fo=n(((e,t)=>{var n=No(),r=Qa()(),i=jo(),a=_o(),o;if(r){var s=n(`RegExp.prototype.exec`),c={},l=function(){throw c},u={toString:l,valueOf:l};typeof Symbol.toPrimitive==`symbol`&&(u[Symbol.toPrimitive]=l),o=function(e){if(!e||typeof e!=`object`)return!1;var t=a(e,`lastIndex`);if(!(t&&i(t,`value`)))return!1;try{s(e,u)}catch(e){return e===c}}}else{var d=n(`Object.prototype.toString`),f=`[object RegExp]`;o=function(e){return!e||typeof e!=`object`&&typeof e!=`function`?!1:d(e)===f}}t.exports=o})),Io=n(((e,t)=>{var n=No(),r=Fo(),i=n(`RegExp.prototype.exec`),a=ao();t.exports=function(e){if(!r(e))throw new a("`regex` must be a RegExp");return function(t){return i(e,t)!==null}}})),Lo=n(((e,t)=>{var n=No(),r=Io()(/^\s*(?:function)?\*/),i=Qa()(),a=Ao(),o=n(`Object.prototype.toString`),s=n(`Function.prototype.toString`),c=function(){if(!i)return!1;try{return Function(`return function*() {}`)()}catch{}},l;t.exports=function(e){if(typeof e!=`function`)return!1;if(r(s(e)))return!0;if(!i)return o(e)===`[object GeneratorFunction]`;if(!a)return!1;if(l===void 0){var t=c();l=t?a(t):!1}return a(e)===l}})),Ro=n(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},"length",{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),zo=n(((e,t)=>{var n=Ro(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;r<a;r++)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))},o=function(e,t,n){for(var r=0,i=e.length;r<i;r++)n==null?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))};function c(e){return r.call(e)===`[object Array]`}t.exports=function(e,t,r){if(!n(t))throw TypeError(`iterator must be a function`);var i;arguments.length>=3&&(i=r),c(e)?a(e,t,i):typeof e==`string`?o(e,t,i):s(e,t,i)}})),Bo=n(((e,t)=>{t.exports=[`Float16Array`,`Float32Array`,`Float64Array`,`Int8Array`,`Int16Array`,`Int32Array`,`Uint8Array`,`Uint8ClampedArray`,`Uint16Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`]})),Vo=n(((e,t)=>{re();var n=Bo(),r=typeof globalThis>`u`?B:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)typeof r[n[t]]==`function`&&(e[e.length]=n[t]);return e}})),Ho=n(((e,t)=>{var n=vo(),r=io(),i=ao(),a=_o();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),Uo=n(((e,t)=>{var n=vo(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),Wo=n(((e,t)=>{var n=Mo(),r=Ho(),i=Uo()(),a=_o(),o=ao(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),Go=n(((e,t)=>{var n=Co(),r=To(),i=Do();t.exports=function(){return i(n,r,arguments)}})),Ko=n(((e,t)=>{var n=Wo(),r=vo(),i=Oo(),a=Go();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),qo=n(((e,t)=>{re();var n=zo(),r=Vo(),i=Ko(),a=No(),o=_o(),s=Ao(),c=a(`Object.prototype.toString`),l=Qa()(),u=typeof globalThis>`u`?B:globalThis,d=r(),f=a(`String.prototype.slice`),p=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};l&&o&&s?n(d,function(e){var t=new u[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=o(n,Symbol.toStringTag);!r&&n&&(r=o(s(n),Symbol.toStringTag)),m[`$`+e]=i(r.get)}}):n(d,function(e){var t=new u[e],n=t.slice||t.set;n&&(m[`$`+e]=i(n))});var h=function(e){var t=!1;return n(m,function(n,r){if(!t)try{`$`+n(e)===r&&(t=f(r,1))}catch{}}),t},g=function(e){var t=!1;return n(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch{}}),t};t.exports=function(e){if(!e||typeof e!=`object`)return!1;if(!l){var t=f(c(e),8,-1);return p(d,t)>-1?t:t===`Object`?g(e):!1}return o?h(e):null}})),Jo=n(((e,t)=>{var n=qo();t.exports=function(e){return!!n(e)}})),Yo=n((e=>{var t=Po(),n=Lo(),r=qo(),i=Jo();function a(e){return e.call.bind(e)}var o=typeof BigInt<`u`,s=typeof Symbol<`u`,c=a(Object.prototype.toString),l=a(Number.prototype.valueOf),u=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(o)var f=a(BigInt.prototype.valueOf);if(s)var p=a(Symbol.prototype.valueOf);function m(e,t){if(typeof e!=`object`)return!1;try{return t(e),!0}catch{return!1}}e.isArgumentsObject=t,e.isGeneratorFunction=n,e.isTypedArray=i;function h(e){return typeof Promise<`u`&&e instanceof Promise||typeof e==`object`&&!!e&&typeof e.then==`function`&&typeof e.catch==`function`}e.isPromise=h;function g(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||R(e)}e.isArrayBufferView=g;function _(e){return r(e)===`Uint8Array`}e.isUint8Array=_;function v(e){return r(e)===`Uint8ClampedArray`}e.isUint8ClampedArray=v;function y(e){return r(e)===`Uint16Array`}e.isUint16Array=y;function b(e){return r(e)===`Uint32Array`}e.isUint32Array=b;function x(e){return r(e)===`Int8Array`}e.isInt8Array=x;function S(e){return r(e)===`Int16Array`}e.isInt16Array=S;function C(e){return r(e)===`Int32Array`}e.isInt32Array=C;function w(e){return r(e)===`Float32Array`}e.isFloat32Array=w;function T(e){return r(e)===`Float64Array`}e.isFloat64Array=T;function E(e){return r(e)===`BigInt64Array`}e.isBigInt64Array=E;function D(e){return r(e)===`BigUint64Array`}e.isBigUint64Array=D;function O(e){return c(e)===`[object Map]`}O.working=typeof Map<`u`&&O(new Map);function k(e){return typeof Map>`u`?!1:O.working?O(e):e instanceof Map}e.isMap=k;function A(e){return c(e)===`[object Set]`}A.working=typeof Set<`u`&&A(new Set);function j(e){return typeof Set>`u`?!1:A.working?A(e):e instanceof Set}e.isSet=j;function M(e){return c(e)===`[object WeakMap]`}M.working=typeof WeakMap<`u`&&M(new WeakMap);function N(e){return typeof WeakMap>`u`?!1:M.working?M(e):e instanceof WeakMap}e.isWeakMap=N;function P(e){return c(e)===`[object WeakSet]`}P.working=typeof WeakSet<`u`&&P(new WeakSet);function F(e){return P(e)}e.isWeakSet=F;function ee(e){return c(e)===`[object ArrayBuffer]`}ee.working=typeof ArrayBuffer<`u`&&ee(new ArrayBuffer);function I(e){return typeof ArrayBuffer>`u`?!1:ee.working?ee(e):e instanceof ArrayBuffer}e.isArrayBuffer=I;function L(e){return c(e)===`[object DataView]`}L.working=typeof ArrayBuffer<`u`&&typeof DataView<`u`&&L(new DataView(new ArrayBuffer(1),0,1));function R(e){return typeof DataView>`u`?!1:L.working?L(e):e instanceof DataView}e.isDataView=R;var z=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:void 0;function te(e){return c(e)===`[object SharedArrayBuffer]`}function ne(e){return z===void 0?!1:(te.working===void 0&&(te.working=te(new z)),te.working?te(e):e instanceof z)}e.isSharedArrayBuffer=ne;function re(e){return c(e)===`[object AsyncFunction]`}e.isAsyncFunction=re;function B(e){return c(e)===`[object Map Iterator]`}e.isMapIterator=B;function ie(e){return c(e)===`[object Set Iterator]`}e.isSetIterator=ie;function ae(e){return c(e)===`[object Generator]`}e.isGeneratorObject=ae;function oe(e){return c(e)===`[object WebAssembly.Module]`}e.isWebAssemblyCompiledModule=oe;function se(e){return m(e,l)}e.isNumberObject=se;function ce(e){return m(e,u)}e.isStringObject=ce;function le(e){return m(e,d)}e.isBooleanObject=le;function ue(e){return o&&m(e,f)}e.isBigIntObject=ue;function V(e){return s&&m(e,p)}e.isSymbolObject=V;function de(e){return se(e)||ce(e)||le(e)||ue(e)||V(e)}e.isBoxedPrimitive=de;function fe(e){return typeof Uint8Array<`u`&&(I(e)||ne(e))}e.isAnyArrayBuffer=fe,[`isProxy`,`isExternal`,`isModuleNamespaceObject`].forEach(function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw Error(t+` is not supported in userland`)}})})})),Xo=n(((e,t)=>{t.exports=function(e){return e&&typeof e==`object`&&typeof e.copy==`function`&&typeof e.fill==`function`&&typeof e.readUInt8==`function`}})),Zo=n((e=>{ne();var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},n=/%[sdj%]/g;e.format=function(e){if(!x(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(` `)}for(var r=1,i=arguments,a=i.length,s=String(e).replace(n,function(e){if(e===`%%`)return`%`;if(r>=a)return e;switch(e){case`%s`:return String(i[r++]);case`%d`:return Number(i[r++]);case`%j`:try{return JSON.stringify(i[r++])}catch{return`[Circular]`}default:return e}}),c=i[r];r<a;c=i[++r])v(c)||!T(c)?s+=` `+c:s+=` `+o(c);return s},e.deprecate=function(t,n){if(z!==void 0&&z.noDeprecation===!0)return t;if(z===void 0)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;function i(){if(!r){if(z.throwDeprecation)throw Error(n);z.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}return i};var r={},i=/^$/;if({}.NODE_DEBUG){var a={}.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`.*`).replace(/,/g,`$|^`).toUpperCase(),i=RegExp(`^`+a+`$`,`i`)}e.debuglog=function(t){if(t=t.toUpperCase(),!r[t])if(i.test(t)){var n=z.pid;r[t]=function(){var r=e.format.apply(e,arguments);console.error(`%s %d: %s`,t,n,r)}}else r[t]=function(){};return r[t]};function o(t,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_(n)?r.showHidden=n:n&&e._extend(r,n),C(r.showHidden)&&(r.showHidden=!1),C(r.depth)&&(r.depth=2),C(r.colors)&&(r.colors=!1),C(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),u(r,t,r.depth)}e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:`cyan`,number:`yellow`,boolean:`yellow`,undefined:`grey`,null:`bold`,string:`green`,date:`magenta`,regexp:`red`};function s(e,t){var n=o.styles[t];return n?`\x1B[`+o.colors[n][0]+`m`+e+`\x1B[`+o.colors[n][1]+`m`:e}function c(e,t){return e}function l(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&!(n.constructor&&n.constructor.prototype===n)){var i=n.inspect(r,t);return x(i)||(i=u(t,i,r)),i}var a=d(t,n);if(a)return a;var o=Object.keys(n),s=l(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),D(n)&&(o.indexOf(`message`)>=0||o.indexOf(`description`)>=0))return f(n);if(o.length===0){if(O(n)){var c=n.name?`: `+n.name:``;return t.stylize(`[Function`+c+`]`,`special`)}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),`regexp`);if(E(n))return t.stylize(Date.prototype.toString.call(n),`date`);if(D(n))return f(n)}var _=``,v=!1,y=[`{`,`}`];if(g(n)&&(v=!0,y=[`[`,`]`]),O(n)&&(_=` [Function`+(n.name?`: `+n.name:``)+`]`),w(n)&&(_=` `+RegExp.prototype.toString.call(n)),E(n)&&(_=` `+Date.prototype.toUTCString.call(n)),D(n)&&(_=` `+f(n)),o.length===0&&(!v||n.length==0))return y[0]+_+y[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),`regexp`):t.stylize(`[Object]`,`special`);t.seen.push(n);var b=v?p(t,n,r,s,o):o.map(function(e){return m(t,n,r,s,e,v)});return t.seen.pop(),h(b,_,y)}function d(e,t){if(C(t))return e.stylize(`undefined`,`undefined`);if(x(t)){var n=`'`+JSON.stringify(t).replace(/^"|"$/g,``).replace(/'/g,`\\'`).replace(/\\"/g,`"`)+`'`;return e.stylize(n,`string`)}if(b(t))return e.stylize(``+t,`number`);if(_(t))return e.stylize(``+t,`boolean`);if(v(t))return e.stylize(`null`,`null`)}function f(e){return`[`+Error.prototype.toString.call(e)+`]`}function p(e,t,n,r,i){for(var a=[],o=0,s=t.length;o<s;++o)P(t,String(o))?a.push(m(e,t,n,r,String(o),!0)):a.push(``);return i.forEach(function(i){i.match(/^\d+$/)||a.push(m(e,t,n,r,i,!0))}),a}function m(e,t,n,r,i,a){var o,s,c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]};if(c.get?s=c.set?e.stylize(`[Getter/Setter]`,`special`):e.stylize(`[Getter]`,`special`):c.set&&(s=e.stylize(`[Setter]`,`special`)),P(r,i)||(o=`[`+i+`]`),s||(e.seen.indexOf(c.value)<0?(s=v(n)?u(e,c.value,null):u(e,c.value,n-1),s.indexOf(`
|
|
55
|
-
`)>-1&&(s=a?s.split(`
|
|
56
|
-
`).map(function(e){return` `+e}).join(`
|
|
57
|
-
`).slice(2):`
|
|
58
|
-
`+s.split(`
|
|
59
|
-
`).map(function(e){return` `+e}).join(`
|
|
60
|
-
`))):s=e.stylize(`[Circular]`,`special`)),C(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(``+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,`name`)):(o=o.replace(/'/g,`\\'`).replace(/\\"/g,`"`).replace(/(^"|"$)/g,`'`),o=e.stylize(o,`string`))}return o+`: `+s}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf(`
|
|
61
|
-
`)>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,``).length+1},0)>60?n[0]+(t===``?``:t+`
|
|
62
|
-
`)+` `+e.join(`,
|
|
63
|
-
`)+` `+n[1]:n[0]+t+` `+e.join(`, `)+` `+n[1]}e.types=Yo();function g(e){return Array.isArray(e)}e.isArray=g;function _(e){return typeof e==`boolean`}e.isBoolean=_;function v(e){return e===null}e.isNull=v;function y(e){return e==null}e.isNullOrUndefined=y;function b(e){return typeof e==`number`}e.isNumber=b;function x(e){return typeof e==`string`}e.isString=x;function S(e){return typeof e==`symbol`}e.isSymbol=S;function C(e){return e===void 0}e.isUndefined=C;function w(e){return T(e)&&A(e)===`[object RegExp]`}e.isRegExp=w,e.types.isRegExp=w;function T(e){return typeof e==`object`&&!!e}e.isObject=T;function E(e){return T(e)&&A(e)===`[object Date]`}e.isDate=E,e.types.isDate=E;function D(e){return T(e)&&(A(e)===`[object Error]`||e instanceof Error)}e.isError=D,e.types.isNativeError=D;function O(e){return typeof e==`function`}e.isFunction=O;function k(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||typeof e==`symbol`||e===void 0}e.isPrimitive=k,e.isBuffer=Xo();function A(e){return Object.prototype.toString.call(e)}function j(e){return e<10?`0`+e.toString(10):e.toString(10)}var M=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function N(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(`:`);return[e.getDate(),M[e.getMonth()],t].join(` `)}e.log=function(){console.log(`%s - %s`,N(),e.format.apply(e,arguments))},e.inherits=Ya(),e._extend=function(e,t){if(!t||!T(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var F=typeof Symbol<`u`?Symbol(`util.promisify.custom`):void 0;e.promisify=function(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);if(F&&e[F]){var n=e[F];if(typeof n!=`function`)throw TypeError(`The "util.promisify.custom" argument must be of type Function`);return Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),n}function n(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(e,r){e?n(e):t(r)});try{e.apply(this,i)}catch(e){n(e)}return r}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),F&&Object.defineProperty(n,F,{value:n,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(n,t(e))},e.promisify.custom=F;function ee(e,t){if(!e){var n=Error(`Promise was rejected with a falsy value`);n.reason=e,e=n}return t(e)}function I(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type Function`);function n(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var r=t.pop();if(typeof r!=`function`)throw TypeError(`The last argument must be of type Function`);var i=this,a=function(){return r.apply(i,arguments)};e.apply(this,t).then(function(e){z.nextTick(a.bind(null,null,e))},function(e){z.nextTick(ee.bind(null,e,a))})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,t(e)),n}e.callbackify=I})),Qo=n(((e,n)=>{function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?r(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e,t,n){return t=l(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=u(e,`string`);return typeof t==`symbol`?t:String(t)}function u(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d=(te(),t(L)).Buffer,f=Zo().inspect,p=f&&f.custom||`inspect`;function m(e,t,n){d.prototype.copy.call(e,t,n)}n.exports=function(){function e(){o(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:`push`,value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:`unshift`,value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:`shift`,value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:`clear`,value:function(){this.head=this.tail=null,this.length=0}},{key:`join`,value:function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n}},{key:`concat`,value:function(e){if(this.length===0)return d.alloc(0);for(var t=d.allocUnsafe(e>>>0),n=this.head,r=0;n;)m(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:`consume`,value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:`first`,value:function(){return this.head.data}},{key:`_getString`,value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),e-=a,e===0){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:`_getBuffer`,value:function(e){var t=d.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),e-=a,e===0){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:p,value:function(e,t){return f(this,i(i({},t),{},{depth:0,customInspect:!1}))}}]),e}()})),$o=n(((e,t)=>{ne();function n(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,z.nextTick(o,this,e)):z.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?n._writableState?n._writableState.errorEmitted?z.nextTick(i,n):(n._writableState.errorEmitted=!0,z.nextTick(r,n,e)):z.nextTick(r,n,e):t?(z.nextTick(i,n),t(e)):z.nextTick(i,n)}),this)}function r(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(`close`)}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit(`error`,t)}function s(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(`error`,t)}t.exports={destroy:n,undestroy:a,errorOrDestroy:s}})),es=n(((e,t)=>{function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var r={};function i(e,t,i){i||=Error;function a(e,n,r){return typeof t==`string`?t:t(e,n,r)}var o=function(e){n(t,e);function t(t,n,r){return e.call(this,a(t,n,r))||this}return t}(i);o.prototype.name=i.name,o.prototype.code=e,r[e]=o}function a(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function o(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function s(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function c(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}i(`ERR_INVALID_OPT_VALUE`,function(e,t){return`The value "`+t+`" is invalid for option "`+e+`"`},TypeError),i(`ERR_INVALID_ARG_TYPE`,function(e,t,n){var r;typeof t==`string`&&o(t,`not `)?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;var i=s(e,` argument`)?`The ${e} ${r} ${a(t,`type`)}`:`The "${e}" ${c(e,`.`)?`property`:`argument`} ${r} ${a(t,`type`)}`;return i+=`. Received type ${typeof n}`,i},TypeError),i(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`),i(`ERR_METHOD_NOT_IMPLEMENTED`,function(e){return`The `+e+` method is not implemented`}),i(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`),i(`ERR_STREAM_DESTROYED`,function(e){return`Cannot call `+e+` after a stream was destroyed`}),i(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`),i(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`),i(`ERR_STREAM_WRITE_AFTER_END`,`write after end`),i(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),i(`ERR_UNKNOWN_ENCODING`,function(e){return`Unknown encoding: `+e},TypeError),i(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`),t.exports.codes=r})),ts=n(((e,t)=>{var n=es().codes.ERR_INVALID_OPT_VALUE;function r(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function i(e,t,i,a){var o=r(t,a,i);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(a?i:`highWaterMark`,o);return Math.floor(o)}return e.objectMode?16:16*1024}t.exports={getHighWaterMark:i}})),ns=n(((e,t)=>{re(),t.exports=n;function n(e,t){if(r(`noDeprecation`))return e;var n=!1;function i(){if(!n){if(r(`throwDeprecation`))throw Error(t);r(`traceDeprecation`)?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}return i}function r(e){try{if(!B.localStorage)return!1}catch{return!1}var t=B.localStorage[e];return t==null?!1:String(t).toLowerCase()===`true`}})),rs=n(((e,n)=>{re(),ne(),n.exports=E;function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){ce(t,e)}}var i;E.WritableState=w;var a={deprecate:ns()},o=Xa(),s=(te(),t(L)).Buffer,c=(B===void 0?typeof window<`u`?window:typeof self<`u`?self:{}:B).Uint8Array||function(){};function l(e){return s.from(e)}function u(e){return s.isBuffer(e)||e instanceof c}var d=$o(),f=ts().getHighWaterMark,p=es().codes,m=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,_=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,y=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,x=p.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;Ya()(E,o);function C(){}function w(e,t,n){i||=is(),e||={},typeof n!=`boolean`&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,`writableHighWaterMark`,n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){P(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var T;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return T.call(this,e)?!0:this===E?e&&e._writableState instanceof w:!1}})):T=function(e){return e instanceof this};function E(e){i||=is();var t=this instanceof i;if(!t&&!T.call(E,this))return new E(e);this._writableState=new w(e,this,t),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),o.call(this)}E.prototype.pipe=function(){S(this,new _)};function D(e,t){var n=new b;S(e,n),z.nextTick(t,n)}function O(e,t,n,r){var i;return n===null?i=new y:typeof n!=`string`&&!t.objectMode&&(i=new m(`chunk`,[`string`,`Buffer`],n)),i?(S(e,i),z.nextTick(r,i),!1):!0}E.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&u(e);return a&&!s.isBuffer(e)&&(e=l(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=C),r.ending?D(this,n):(a||O(this,r,e,n))&&(r.pendingcb++,i=A(this,r,a,e,t,n)),i},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&I(this,e))},E.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function k(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=s.from(t,n)),t}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function A(e,t,n,r,i,a){if(!n){var o=k(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,r,i,a);return c}function j(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function M(e,t,n,r,i){--t.pendingcb,n?(z.nextTick(i,r),z.nextTick(oe,e,t),e._writableState.errorEmitted=!0,S(e,r)):(i(r),e._writableState.errorEmitted=!0,S(e,r),oe(e,t))}function N(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function P(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(typeof i!=`function`)throw new g;if(N(n),t)M(e,n,r,t,i);else{var a=R(n)||e.destroyed;!a&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&I(e,n),r?z.nextTick(F,e,n,a,i):F(e,n,a,i)}}function F(e,t,n,r){n||ee(e,t),t.pendingcb--,r(),oe(e,t)}function ee(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`))}function I(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,c=!0;n;)a[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;a.allBuffers=c,j(e,t,!0,t.length,a,``,o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,d=n.callback;if(j(e,t,!1,t.objectMode?1:l.length,l,u,d),n=n.next,t.bufferedRequestCount--,t.writing)break}n===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}E.prototype._write=function(e,t,n){n(new h(`_write()`))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;return typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||se(this,r,n),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function R(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ie(e,t){e._final(function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit(`prefinish`),oe(e,t)})}function ae(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,z.nextTick(ie,e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function oe(e,t){var n=R(t);if(n&&(ae(e,t),t.pendingcb===0&&(t.finished=!0,e.emit(`finish`),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function se(e,t,n){t.ending=!0,oe(e,t),n&&(t.finished?z.nextTick(n):e.once(`finish`,n)),t.ended=!0,e.writable=!1}function ce(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)}})),is=n(((e,t)=>{ne();var n=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=us(),i=rs();Ya()(c,r);for(var a=n(i.prototype),o=0;o<a.length;o++){var s=a[o];c.prototype[s]||(c.prototype[s]=i.prototype[s])}function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(`end`,l)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||z.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})})),as=n(((e,n)=>{var r=(te(),t(L)),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?n.exports=r:(a(r,e),e.Buffer=o);function o(e,t,n){return i(e,t,n)}o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return i(e,t,n)},o.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var r=i(e);return t===void 0?r.fill(0):typeof n==`string`?r.fill(t,n):r.fill(t),r},o.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return i(e)},o.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r.SlowBuffer(e)}})),os=n((e=>{var t=as().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}})),ss=n(((e,t)=>{var n=es().codes.ERR_STREAM_PREMATURE_CLOSE;function r(e){var t=!1;return function(){if(!t){t=!0;var n=[...arguments];e.apply(this,n)}}}function i(){}function a(e){return e.setHeader&&typeof e.abort==`function`}function o(e,t,s){if(typeof t==`function`)return o(e,null,t);t||={},s=r(s||i);var c=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){l=!1,d=!0,c||s.call(e)},p=e._readableState&&e._readableState.endEmitted,m=function(){c=!1,p=!0,l||s.call(e)},h=function(t){s.call(e,t)},g=function(){var t;if(c&&!p)return(!e._readableState||!e._readableState.ended)&&(t=new n),s.call(e,t);if(l&&!d)return(!e._writableState||!e._writableState.ended)&&(t=new n),s.call(e,t)},_=function(){e.req.on(`finish`,f)};return a(e)?(e.on(`complete`,f),e.on(`abort`,g),e.req?_():e.on(`request`,_)):l&&!e._writableState&&(e.on(`end`,u),e.on(`close`,u)),e.on(`end`,m),e.on(`finish`,f),t.error!==!1&&e.on(`error`,h),e.on(`close`,g),function(){e.removeListener(`complete`,f),e.removeListener(`abort`,g),e.removeListener(`request`,_),e.req&&e.req.removeListener(`finish`,f),e.removeListener(`end`,u),e.removeListener(`close`,u),e.removeListener(`finish`,f),e.removeListener(`end`,m),e.removeListener(`error`,h),e.removeListener(`close`,g)}}t.exports=o})),cs=n(((e,t)=>{ne();var n;function r(e,t,n){return t=i(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=a(e,`string`);return typeof t==`symbol`?t:String(t)}function a(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var o=ss(),s=Symbol(`lastResolve`),c=Symbol(`lastReject`),l=Symbol(`error`),u=Symbol(`ended`),d=Symbol(`lastPromise`),f=Symbol(`handlePromise`),p=Symbol(`stream`);function m(e,t){return{value:e,done:t}}function h(e){var t=e[s];if(t!==null){var n=e[p].read();n!==null&&(e[d]=null,e[s]=null,e[c]=null,t(m(n,!1)))}}function g(e){z.nextTick(h,e)}function _(e,t){return function(n,r){e.then(function(){if(t[u]){n(m(void 0,!0));return}t[f](n,r)},r)}}var v=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(t!==null)return Promise.reject(t);if(this[u])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise(function(t,n){z.nextTick(function(){e[l]?n(e[l]):t(m(void 0,!0))})});var n=this[d],r;if(n)r=new Promise(_(n,this));else{var i=this[p].read();if(i!==null)return Promise.resolve(m(i,!1));r=new Promise(this[f])}return this[d]=r,r}},r(n,Symbol.asyncIterator,function(){return this}),r(n,`return`,function(){var e=this;return new Promise(function(t,n){e[p].destroy(null,function(e){if(e){n(e);return}t(m(void 0,!0))})})}),n),v);t.exports=function(e){var t,n=Object.create(y,(t={},r(t,p,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:null,writable:!0}),r(t,u,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[p].read();r?(n[d]=null,n[s]=null,n[c]=null,e(m(r,!1))):(n[s]=e,n[c]=t)},writable:!0}),t));return n[d]=null,o(e,function(e){if(e&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`){var t=n[c];t!==null&&(n[d]=null,n[s]=null,n[c]=null,t(e)),n[l]=e;return}var r=n[s];r!==null&&(n[d]=null,n[s]=null,n[c]=null,r(m(void 0,!0))),n[u]=!0}),e.on(`readable`,g.bind(null,n)),n}})),ls=n(((e,t)=>{t.exports=function(){throw Error(`Readable.from is not available in the browser`)}})),us=n(((e,n)=>{re(),ne(),n.exports=D;var r;D.ReadableState=E,Ja().EventEmitter;var i=function(e,t){return e.listeners(t).length},a=Xa(),o=(te(),t(L)).Buffer,s=(B===void 0?typeof window<`u`?window:typeof self<`u`?self:{}:B).Uint8Array||function(){};function c(e){return o.from(e)}function l(e){return o.isBuffer(e)||e instanceof s}var u=Zo(),d=u&&u.debuglog?u.debuglog(`stream`):function(){},f=Qo(),p=$o(),m=ts().getHighWaterMark,h=es().codes,g=h.ERR_INVALID_ARG_TYPE,_=h.ERR_STREAM_PUSH_AFTER_EOF,v=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,b,x,S;Ya()(D,a);var C=p.errorOrDestroy,w=[`error`,`close`,`destroy`,`pause`,`resume`];function T(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function E(e,t,n){r||=is(),e||={},typeof n!=`boolean`&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,`readableHighWaterMark`,n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(b||=os().StringDecoder,this.decoder=new b(e.encoding),this.encoding=e.encoding)}function D(e){if(r||=is(),!(this instanceof D))return new D(e);var t=this instanceof r;this._readableState=new E(e,this,t),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),a.call(this)}Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),D.prototype.destroy=p.destroy,D.prototype._undestroy=p.undestroy,D.prototype._destroy=function(e,t){t(e)},D.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=o.from(e,t),t=``),r=!0),O(this,e,t,!1,r)},D.prototype.unshift=function(e){return O(this,e,null,!0,!1)};function O(e,t,n,r,i){d(`readableAddChunk`,t);var a=e._readableState;if(t===null)a.reading=!1,P(e,a);else{var s;if(i||(s=A(a,t)),s)C(e,s);else if(a.objectMode||t&&t.length>0)if(typeof t!=`string`&&!a.objectMode&&Object.getPrototypeOf(t)!==o.prototype&&(t=c(t)),r)a.endEmitted?C(e,new y):k(e,a,t,!0);else if(a.ended)C(e,new _);else if(a.destroyed)return!1;else a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||t.length!==0?k(e,a,t,!1):I(e,a)):k(e,a,t,!1);else r||(a.reading=!1,I(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function k(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&F(e)),I(e,t)}function A(e,t){var n;return!l(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=new g(`chunk`,[`string`,`Buffer`,`Uint8Array`],t)),n}D.prototype.isPaused=function(){return this._readableState.flowing===!1},D.prototype.setEncoding=function(e){b||=os().StringDecoder;var t=new b(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r=``;n!==null;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),r!==``&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var j=1073741824;function M(e){return e>=j?e=j:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=M(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}D.prototype.read=function(e){d(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return d(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?V(this):F(this),null;if(e=N(e,t),e===0&&t.ended)return t.length===0&&V(this),null;var r=t.needReadable;d(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,d(`length less than watermark`,r)),t.ended||t.reading?(r=!1,d(`reading or ended`,r)):r&&(d(`do read`),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=N(n,t)));var i=e>0?ue(e,t):null;return i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&V(this)),i!==null&&this.emit(`data`,i),i};function P(e,t){if(d(`onEofChunk`),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ee(e)))}}function F(e){var t=e._readableState;d(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d(`emitReadable`,t.flowing),t.emittedReadable=!0,z.nextTick(ee,e))}function ee(e){var t=e._readableState;d(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,le(e)}function I(e,t){t.readingMore||(t.readingMore=!0,z.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var n=t.length;if(d(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}D.prototype._read=function(e){C(this,new v(`_read()`))},D.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e);break}r.pipesCount+=1,d(`pipe count=%d opts=%j`,r.pipesCount,t);var a=(!t||t.end!==!1)&&e!==z.stdout&&e!==z.stderr?s:g;r.endEmitted?z.nextTick(a):n.once(`end`,a),e.on(`unpipe`,o);function o(e,t){d(`onunpipe`),e===n&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,u())}function s(){d(`onend`),e.end()}var c=ie(n);e.on(`drain`,c);var l=!1;function u(){d(`cleanup`),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`drain`,c),e.removeListener(`error`,p),e.removeListener(`unpipe`,o),n.removeListener(`end`,s),n.removeListener(`end`,g),n.removeListener(`data`,f),l=!0,r.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}n.on(`data`,f);function f(t){d(`ondata`);var i=e.write(t);d(`dest.write`,i),i===!1&&((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&fe(r.pipes,e)!==-1)&&!l&&(d(`false write response, pause`,r.awaitDrain),r.awaitDrain++),n.pause())}function p(t){d(`onerror`,t),g(),e.removeListener(`error`,p),i(e,`error`)===0&&C(e,t)}T(e,`error`,p);function m(){e.removeListener(`finish`,h),g()}e.once(`close`,m);function h(){d(`onfinish`),e.removeListener(`close`,m),g()}e.once(`finish`,h);function g(){d(`unpipe`),n.unpipe(e)}return e.emit(`pipe`,n),r.flowing||(d(`pipe resume`),n.resume()),e};function ie(e){return function(){var t=e._readableState;d(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&i(e,`data`)&&(t.flowing=!0,le(e))}}D.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit(`unpipe`,this,{hasUnpiped:!1});return this}var o=fe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),--t.pipesCount,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit(`unpipe`,this,n),this)},D.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t),r=this._readableState;return e===`data`?(r.readableListening=this.listenerCount(`readable`)>0,r.flowing!==!1&&this.resume()):e===`readable`&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d(`on readable`,r.length,r.reading),r.length?F(this):r.reading||z.nextTick(oe,this)),n},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return e===`readable`&&z.nextTick(ae,this),n},D.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&z.nextTick(ae,this),t};function ae(e){var t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(`data`)>0&&e.resume()}function oe(e){d(`readable nexttick read 0`),e.read(0)}D.prototype.resume=function(){var e=this._readableState;return e.flowing||(d(`resume`),e.flowing=!e.readableListening,se(this,e)),e.paused=!1,this};function se(e,t){t.resumeScheduled||(t.resumeScheduled=!0,z.nextTick(ce,e,t))}function ce(e,t){d(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),le(e),t.flowing&&!t.reading&&e.read(0)}D.prototype.pause=function(){return d(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(d(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState.paused=!0,this};function le(e){var t=e._readableState;for(d(`flow`,t.flowing);t.flowing&&e.read()!==null;);}D.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on(`end`,function(){if(d(`wrapped end`),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on(`data`,function(i){d(`wrapped data`),n.decoder&&(i=n.decoder.write(i)),!(n.objectMode&&i==null)&&(!n.objectMode&&(!i||!i.length)||t.push(i)||(r=!0,e.pause()))}),e)this[i]===void 0&&typeof e[i]==`function`&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<w.length;a++)e.on(w[a],this.emit.bind(this,w[a]));return this._read=function(t){d(`wrapped _read`,t),r&&(r=!1,e.resume())},this},typeof Symbol==`function`&&(D.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=cs()),x(this)}),Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(D.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(D.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),D._fromList=ue,Object.defineProperty(D.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ue(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function V(e){var t=e._readableState;d(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,z.nextTick(de,t,e))}function de(e,t){if(d(`endReadableNT`,e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}typeof Symbol==`function`&&(D.from=function(e,t){return S===void 0&&(S=ls()),S(D,e,t)});function fe(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}})),ds=n(((e,t)=>{t.exports=l;var n=es().codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,s=is();Ya()(l,s);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit(`error`,new i);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function u(){var e=this;typeof this._flush==`function`&&!this._readableState.destroyed?this._flush(function(t,n){d(e,t,n)}):d(this,null,null)}l.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new r(`_transform()`))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},l.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,function(e){t(e)})};function d(e,t,n){if(t)return e.emit(`error`,t);if(n!=null&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}})),fs=n(((e,t)=>{t.exports=r;var n=ds();Ya()(r,n);function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}r.prototype._transform=function(e,t,n){n(null,e)}})),ps=n(((e,t)=>{var n;function r(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i=es().codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){return e.setHeader&&typeof e.abort==`function`}function l(e,t,i,a){a=r(a);var s=!1;e.on(`close`,function(){s=!0}),n===void 0&&(n=ss()),n(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var l=!1;return function(t){if(!s&&!l){if(l=!0,c(e))return e.abort();if(typeof e.destroy==`function`)return e.destroy();a(t||new o(`pipe`))}}}function u(e){e()}function d(e,t){return e.pipe(t)}function f(e){return!e.length||typeof e[e.length-1]!=`function`?s:e.pop()}function p(){var e=[...arguments],t=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new a(`streams`);var n,r=e.map(function(i,a){var o=a<e.length-1;return l(i,o,a>0,function(e){n||=e,e&&r.forEach(u),!o&&(r.forEach(u),t(n))})});return e.reduce(d)}t.exports=p})),ms=n(((e,t)=>{t.exports=r;var n=Ja().EventEmitter;Ya()(r,n),r.Readable=us(),r.Writable=rs(),r.Duplex=is(),r.Transform=ds(),r.PassThrough=fs(),r.finished=ss(),r.pipeline=ps(),r.Stream=r;function r(){n.call(this)}r.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}r.on(`data`,i);function a(){r.readable&&r.resume&&r.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(r.on(`end`,s),r.on(`close`,c));var o=!1;function s(){o||(o=!0,e.end())}function c(){o||(o=!0,typeof e.destroy==`function`&&e.destroy())}function l(e){if(u(),n.listenerCount(this,`error`)===0)throw e}r.on(`error`,l),e.on(`error`,l);function u(){r.removeListener(`data`,i),e.removeListener(`drain`,a),r.removeListener(`end`,s),r.removeListener(`close`,c),r.removeListener(`error`,l),e.removeListener(`error`,l),r.removeListener(`end`,u),r.removeListener(`close`,u),e.removeListener(`close`,u)}return r.on(`end`,u),r.on(`close`,u),e.on(`close`,u),e.emit(`pipe`,r),e}}))(),hs=Ja(),gs=M({Server:()=>vs,Socket:()=>_s,_default:()=>Ss,connect:()=>ys,createConnection:()=>bs,createServer:()=>xs,default:()=>Ss,isIP:()=>Wa,isIPv4:()=>Ha,isIPv6:()=>Ua}),_s=class extends ms.Stream.Duplex{_localAddress;_remoteAddress;_webVPNTcpSocketPromise;constructor(e){if(e?.fd!==void 0)throw Error(`FKN WebVPN does not support file descriptors`);super(e),e?.connection&&this.__webvpn_tcp_socket_init__(e.connection)}_busyRelease;__webvpn_tcp_socket_init__(e,t){if(this._busyRelease??=yi(`tcp socket`),t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort},this._remoteAddress={address:t.remoteAddress,family:t.remoteFamily,port:t.remotePort}),this._webVPNTcpSocketPromise=e.then(e=>{let t=e.dataReadableStream.getReader(),n=e.dataWritableStream.getWriter();return this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},this._remoteAddress={address:e.remoteAddress,family:e.remoteFamily,port:e.remotePort},{...e,reader:t,writer:n}}).catch(e=>{this.emit(`error`,e)}),!this._webVPNTcpSocketPromise)throw Error(`Socket not connected`);return this._webVPNTcpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`connect`)}),this._webVPNTcpSocketPromise}_read(e){if(!this._webVPNTcpSocketPromise)throw Error(`Socket not connected`);this._webVPNTcpSocketPromise.then(e=>{if(!e){this.push(null);return}e.reader.read().then(({value:e,done:t})=>{if(t){this.push(null);return}this._restartTimeoutTimer(),this.push(e)}).catch(e=>{this.destroy(e)})})}_write(e,t,n){if(!this._webVPNTcpSocketPromise){n(Error(`Socket not connected`));return}this._webVPNTcpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not connected`);await t.writer.ready,await t.writer.write(e),this._restartTimeoutTimer(),n()}).catch(n)}connect(...e){let t=Ga(...e),n=this.__webvpn_tcp_socket_init__(N(`an outbound tcp socket`).then(e=>e.cloud.webvpn.tcpSocket({remoteAddress:t.host??`localhost`,remotePort:t.port})));return t.callback&&n.then(e=>{e&&t.callback.call(this)}),this}_final(e){if(!this._webVPNTcpSocketPromise){e();return}this._webVPNTcpSocketPromise.then(async e=>{e&&await e.writer.close()}).then(()=>e(),t=>e(t))}_destroy(e,t){if(this._timeoutTimer&&clearTimeout(this._timeoutTimer),this._busyRelease?.(),!this._webVPNTcpSocketPromise){t(e);return}this._webVPNTcpSocketPromise.then(async e=>{e&&await(this._resetRequested?e.resetAndDestroy():e.destroy())}).then(()=>t(e),()=>t(e))}destroySoon(){if(this.writableFinished){this.destroy();return}this.once(`finish`,()=>this.destroy()),this.end()}_resetRequested=!1;resetAndDestroy(){return this._resetRequested=!0,this.destroy(),this}_timeoutMs;_timeoutTimer;_restartTimeoutTimer(){this._timeoutTimer&&clearTimeout(this._timeoutTimer),this._timeoutMs&&(this._timeoutTimer=setTimeout(()=>this.emit(`timeout`),this._timeoutMs))}setTimeout(e,t){return t&&this.on(`timeout`,t),this._timeoutMs=e,this._restartTimeoutTimer(),this}setNoDelay(e){let t=e??!0;return this._setTcpOption({type:0,value:t}),this}setKeepAlive(e,t){let n=e??!1,r=t!==void 0&&t>0?Math.max(1,Math.round(t/1e3)):0;return this._setTcpOption({type:2,enabled:n,initialDelaySeconds:r}),this}setSendBufferSize(e){return this._setTcpOption({type:3,value:e}),this}setRecvBufferSize(e){return this._setTcpOption({type:4,value:e}),this}_typeOfService;getTypeOfService(){return this._typeOfService??0}setTypeOfService(e){return this._typeOfService=e,this}_setTcpOption(e){if(!this._webVPNTcpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before connect`));return}this._webVPNTcpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}write(e,t,...n){return super.write(e,t,...n)}address(){return this._localAddress??{}}unref(){return this}ref(){return this}autoSelectFamilyAttemptedAddresses;bufferSize;bytesRead;bytesWritten;connecting;pending;get localAddress(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.address}get localPort(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.port}get localFamily(){if(!this._localAddress)throw Error(`Socket is not connected`);return this._localAddress.family}readyState;get remoteAddress(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.address}get remotePort(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.port}get remoteFamily(){if(!this._remoteAddress)throw Error(`Socket is not connected`);return this._remoteAddress.family}timeout},vs=class extends hs.EventEmitter{_localAddress;_webVPNTcpSocketListenerPromise;constructor(e,t){super(e),t&&this.on(`connection`,t),e?.connection&&this.__webvpn_tcp_socket_listener_init__(e.connection)}_busyRelease;__webvpn_tcp_socket_listener_init__(e){return this._busyRelease??=yi(`tcp server`),this._webVPNTcpSocketListenerPromise=e.then(e=>(this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e)).catch(e=>{this.emit(`error`,e)}),this._webVPNTcpSocketListenerPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNTcpSocketListenerPromise}listen(...e){let t=Ga(...e);this._closeEmitted=!1;let n=e=>{let t=new _s;t.__webvpn_tcp_socket_init__(Promise.resolve(e),e),this.emit(`connection`,t)},r=e=>{this._localAddress=void 0;try{e&&this.listenerCount(`error`)>0&&this.emit(`error`,e)}finally{this._emitClose()}},i=e=>N(`a tcp listener`).then(i=>i.cloud.webvpn.tcpSocketListener({localAddress:e,localPort:t.port,onConnection:n,onClose:r})),a=t.host?i(t.host):i(`::`).catch(()=>i(`0.0.0.0`)),o=this.__webvpn_tcp_socket_listener_init__(a);return t.callback&&o.then(e=>{e&&t.callback.call(this)}),this}_closeEmitted=!1;_emitClose(){this._closeEmitted||(this._closeEmitted=!0,this._busyRelease?.(),this.emit(`close`))}close(e){return this._webVPNTcpSocketListenerPromise&&this._webVPNTcpSocketListenerPromise.then(async t=>{if(t)try{await t.close(),this._localAddress=void 0,this._emitClose(),e&&e()}catch(t){this._localAddress=void 0,this._emitClose(),e&&e(t)}}),this}address(){return this._localAddress??null}getConnections(e){throw Error(`Method not implemented.`)}ref(){return this}unref(){return this}maxConnections;connections;listening;async[Symbol.asyncDispose](){}},ys=(e,t)=>new _s().connect(e,t),bs=(e,t)=>new _s().connect(e,t),xs=(e,t)=>{typeof e==`function`&&(t=e,e=void 0);let n=new vs(e);return t&&n.on(`connection`,t),n},Ss={Socket:_s,Server:vs,connect:ys,createConnection:bs,createServer:xs,isIP:Wa,isIPv4:Ha,isIPv6:Ua};te();var Cs=M({Socket:()=>ws,createSocket:()=>As,default:()=>js}),ws=class extends hs.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:Va,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let a=t.getUint32(i);i+=4;let o=i+a;if(o>e.byteLength)break;let s=i+4,c=t.getUint8(s);s+=1;let l,u,d;if(c===2){if(!this._remoteAddress){i=o;continue}l=this._remoteAddress.address,u=this._remoteAddress.family,d=this._remoteAddress.port}else{let n=new Uint8Array(e,s,c===0?4:16);c===0?(u=`IPv4`,l=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(u=`IPv6`,l=Os(n)),s+=n.byteLength,d=t.getUint16(s),s+=2}let f=t.getUint32(s);s+=4;try{this.emit(`message`,R.from(e.slice(s,s+f)),{address:l,family:u,port:d,size:f})}catch(e){n||(n=!0,r=e)}i=o}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return Ts;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=za.Address4.isValid(e)?Ds(e):ks(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(za.Address4.isValid(e)){let n=Ds(e),r=t&&za.Address4.isValid(t)?Ds(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(za.Address6.isValid(e)){let t=ks(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let t=Ka(...e),n=this._type===`udp6`?`::`:`0.0.0.0`,r=this.__webvpn_udp_socket_init__(N(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:t.address??n,port:t.port,dataPort:!0})));return t.callback&&r.then(e=>{e&&t.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=yi(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,R.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(za.Address4.isValid(e)){let n=Ds(e),r=t&&za.Address4.isValid(t)?Ds(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(za.Address6.isValid(e)){let t=ks(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=qa(...e),n=Es(t.message),r=n;if(t.hasRange){let{offset:e,length:i}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(i)||i<0||i>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});r=n.subarray(e,e+i)}let i=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,a=t.address??i,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||za.Address4.isValid(a)||za.Address6.isValid(a))){this._portSend(r,o?void 0:a,o?void 0:t.port),n?.call(this,null,r.byteLength);return}e.send({port:t.port,address:a,message:r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}).then(()=>n?.call(this,null,r.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},Ts=new Uint8Array([2]),Es=e=>{if(typeof e==`string`)return Ba.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(Es),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},Ds=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},Os=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},ks=e=>{let t=new za.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},As=(e,t)=>{let n=new ws(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},js={Socket:ws,createSocket:As};te();var Ms=M({Agent:()=>Qs,ClientRequest:()=>Xs,HTTPParser:()=>Ws,IncomingMessage:()=>Ks,METHODS:()=>Ps,STATUS_CODES:()=>Fs,Server:()=>Zs,ServerResponse:()=>Js,_default:()=>rc,createServer:()=>nc,default:()=>rc,get:()=>tc,globalAgent:()=>$s,request:()=>ec}),Ns=new TextDecoder(`latin1`),Ps=`ACL.BIND.CHECKOUT.CONNECT.COPY.DELETE.GET.HEAD.LINK.LOCK.M-SEARCH.MERGE.MKACTIVITY.MKCALENDAR.MKCOL.MOVE.NOTIFY.OPTIONS.PATCH.POST.PROPFIND.PROPPATCH.PURGE.PUT.REBIND.REPORT.SEARCH.SOURCE.SUBSCRIBE.TRACE.UNBIND.UNLINK.UNLOCK.UNSUBSCRIBE`.split(`.`),Fs={100:`Continue`,101:`Switching Protocols`,102:`Processing`,103:`Early Hints`,200:`OK`,201:`Created`,202:`Accepted`,203:`Non-Authoritative Information`,204:`No Content`,205:`Reset Content`,206:`Partial Content`,207:`Multi-Status`,208:`Already Reported`,226:`IM Used`,300:`Multiple Choices`,301:`Moved Permanently`,302:`Found`,303:`See Other`,304:`Not Modified`,305:`Use Proxy`,307:`Temporary Redirect`,308:`Permanent Redirect`,400:`Bad Request`,401:`Unauthorized`,402:`Payment Required`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,406:`Not Acceptable`,407:`Proxy Authentication Required`,408:`Request Timeout`,409:`Conflict`,410:`Gone`,411:`Length Required`,412:`Precondition Failed`,413:`Payload Too Large`,414:`URI Too Long`,415:`Unsupported Media Type`,416:`Range Not Satisfiable`,417:`Expectation Failed`,418:`I'm a Teapot`,421:`Misdirected Request`,422:`Unprocessable Entity`,423:`Locked`,424:`Failed Dependency`,425:`Too Early`,426:`Upgrade Required`,428:`Precondition Required`,429:`Too Many Requests`,431:`Request Header Fields Too Large`,451:`Unavailable For Legal Reasons`,500:`Internal Server Error`,501:`Not Implemented`,502:`Bad Gateway`,503:`Service Unavailable`,504:`Gateway Timeout`,505:`HTTP Version Not Supported`,506:`Variant Also Negotiates`,507:`Insufficient Storage`,508:`Loop Detected`,509:`Bandwidth Limit Exceeded`,510:`Not Extended`,511:`Network Authentication Required`},Is=new Set([`content-type`,`content-length`,`user-agent`,`referer`,`host`,`authorization`,`proxy-authorization`,`if-modified-since`,`if-unmodified-since`,`from`,`location`,`max-forwards`,`retry-after`,`etag`,`last-modified`,`server`,`age`,`expires`]),Ls=13,Rs=10,zs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/,Bs=(e,t)=>(e.code=t,e),Vs=(e,t)=>{if(e.length===0)return t;if(t.length===0)return e;let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},Hs=(e,t)=>{for(let n=t;n+1<e.length;n++)if(e[n]===Ls&&e[n+1]===Rs)return n;return-1},Us=e=>{for(let t=0;t+3<e.length;t++)if(e[t]===Ls&&e[t+1]===Rs&&e[t+2]===Ls&&e[t+3]===Rs)return t;return-1},Ws=class{mode;handlers;buf=new Uint8Array;state=`HEAD`;framing=`none`;bodyRemaining=0;chunkState=`size`;skipBody=!1;constructor(e,t){this.mode=e,this.handlers=t}execute(e){this.buf=Vs(this.buf,e);let t=!0;for(;t;)if(t=!1,this.state===`HEAD`){let e=Us(this.buf);if(e===-1)return;let n=this.buf.subarray(0,e);this.buf=this.buf.subarray(e+4);let r=this.parseHead(n);this.handlers.onHeaders(r),this.setupBody(r),this.framing===`none`?(this.handlers.onComplete(),this.reset(),t=this.buf.length>0):(this.state=`BODY`,t=!0)}else this.consumeBody()&&(this.handlers.onComplete(),this.reset(),t=this.buf.length>0)}finish(){this.state===`BODY`&&this.framing===`eof`&&(this.handlers.onComplete(),this.reset())}reset(){this.state=`HEAD`,this.framing=`none`,this.bodyRemaining=0,this.chunkState=`size`,this.skipBody=!1}parseHead(e){let t=Ns.decode(e).split(`\r
|
|
64
|
-
`),n=t.shift()??``,r=[];for(let e of t)(e.startsWith(` `)||e.startsWith(` `))&&r.length>0?r[r.length-1]+=` `+e.trim():r.push(e);let i=[],a={};for(let e of r){if(!e)continue;let t=e.indexOf(`:`);if(t===-1)continue;let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();i.push(n,r),this.addHeader(a,n,r)}let o={httpVersionMajor:1,httpVersionMinor:1,httpVersion:`1.1`,headers:a,rawHeaders:i};if(this.mode===`request`){let[e,t,r]=n.split(` `);o.method=(e??`GET`).toUpperCase(),o.url=t??`/`,this.applyVersion(o,r)}else{let e=n.indexOf(` `),t=n.slice(0,e),r=n.slice(e+1),i=r.indexOf(` `),a=i===-1?r:r.slice(0,i);o.statusCode=parseInt(a,10)||0,o.statusMessage=i===-1?``:r.slice(i+1),this.applyVersion(o,t)}return o}applyVersion(e,t){let n=/HTTP\/(\d)\.(\d)/i.exec(t??``);n&&(e.httpVersionMajor=parseInt(n[1],10),e.httpVersionMinor=parseInt(n[2],10),e.httpVersion=`${e.httpVersionMajor}.${e.httpVersionMinor}`)}addHeader(e,t,n){let r=t.toLowerCase();if(r===`set-cookie`){let t=e[`set-cookie`];Array.isArray(t)?t.push(n):e[`set-cookie`]=[n];return}let i=e[r];i===void 0?e[r]=n:Is.has(r)||(e[r]=`${i}, ${n}`)}setupBody(e){if(this.skipBody){this.framing=`none`;return}let t=e.headers[`transfer-encoding`];if(typeof t==`string`&&t.toLowerCase().includes(`chunked`)){this.framing=`chunked`,this.chunkState=`size`;return}let n=e.headers[`content-length`];if(typeof n==`string`&&n!==``){let e=parseInt(n,10);e>0?(this.framing=`length`,this.bodyRemaining=e):this.framing=`none`;return}if(this.mode===`response`){let t=e.statusCode??0;this.framing=t>=100&&t<200||t===204||t===304?`none`:`eof`}else this.framing=`none`}consumeBody(){if(this.framing===`length`){if(this.buf.length===0)return!1;let e=Math.min(this.bodyRemaining,this.buf.length);return this.handlers.onBody(this.buf.subarray(0,e)),this.buf=this.buf.subarray(e),this.bodyRemaining-=e,this.bodyRemaining===0}return this.framing===`eof`?(this.buf.length>0&&(this.handlers.onBody(this.buf),this.buf=new Uint8Array),!1):this.framing!==`chunked`||this.consumeChunked()}consumeChunked(){for(;;)if(this.chunkState===`size`){let e=Hs(this.buf,0);if(e===-1)return!1;let t=Ns.decode(this.buf.subarray(0,e)),n=parseInt(t.split(`;`)[0].trim(),16);if(this.buf=this.buf.subarray(e+2),Number.isNaN(n))return!0;n===0?this.chunkState=`trailer`:(this.bodyRemaining=n,this.chunkState=`data`)}else if(this.chunkState===`data`){if(this.buf.length===0)return!1;let e=Math.min(this.bodyRemaining,this.buf.length);this.handlers.onBody(this.buf.subarray(0,e)),this.buf=this.buf.subarray(e),this.bodyRemaining-=e,this.bodyRemaining===0&&(this.chunkState=`dataCRLF`)}else if(this.chunkState===`dataCRLF`){if(this.buf.length<2)return!1;this.buf=this.buf.subarray(2),this.chunkState=`size`}else{let e=Hs(this.buf,0);if(e===-1)return!1;let t=e===0;if(this.buf=this.buf.subarray(e+2),t)return!0}}},Gs=(e,t)=>R.isBuffer(e)?e:typeof e==`string`?R.from(e,t??`utf8`):e instanceof Uint8Array?R.from(e):e instanceof ArrayBuffer?R.from(new Uint8Array(e)):R.from(String(e)),Ks=class extends ms.Stream.Readable{httpVersion=`1.1`;httpVersionMajor=1;httpVersionMinor=1;headers={};rawHeaders=[];trailers={};rawTrailers=[];method;url;statusCode;statusMessage;complete=!1;socket;constructor(e){super(),this.socket=e}get connection(){return this.socket}_applyHead(e){this.httpVersion=e.httpVersion,this.httpVersionMajor=e.httpVersionMajor,this.httpVersionMinor=e.httpVersionMinor,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.method=e.method,this.url=e.url,this.statusCode=e.statusCode,this.statusMessage=e.statusMessage}_read(){}setTimeout(e,t){return this.socket.setTimeout(e,t),this}},qs=class extends ms.Stream.Writable{_headerStore=new Map;headersSent=!1;chunkedEncoding=!1;finished=!1;_bodyWritten=!1;setHeader(e,t){if(this.headersSent)throw Bs(Error(`Cannot set headers after they are sent to the client`),`ERR_HTTP_HEADERS_SENT`);if(typeof e!=`string`||!zs.test(e))throw Bs(TypeError(`Header name must be a valid HTTP token [${JSON.stringify(String(e))}]`),`ERR_INVALID_HTTP_TOKEN`);if(t===void 0)throw Bs(TypeError(`Invalid value "undefined" for header "${e}"`),`ERR_HTTP_INVALID_HEADER_VALUE`);return this._headerStore.set(e.toLowerCase(),[e,Array.isArray(t)?[...t]:t]),this}getHeader(e){return this._headerStore.get(e.toLowerCase())?.[1]}getHeaderNames(){return[...this._headerStore.values()].map(([e])=>e)}getHeaders(){let e={};for(let[t,n]of this._headerStore.values())e[t]=n;return e}hasHeader(e){return this._headerStore.has(e.toLowerCase())}removeHeader(e){if(this.headersSent)throw Error(`Cannot remove headers after they are sent to the client`);this._headerStore.delete(e.toLowerCase())}_storeHeader(e){let t=this.hasHeader(`content-length`),n=this.getHeader(`transfer-encoding`);typeof n==`string`&&n.toLowerCase().includes(`chunked`)?this.chunkedEncoding=!0:!t&&this._shouldSendBody()&&(this.chunkedEncoding=!0,this.setHeader(`Transfer-Encoding`,`chunked`));let r=e+`\r
|
|
65
|
-
`;for(let[e,t]of this._headerStore.values())if(Array.isArray(t))for(let n of t)r+=`${e}: ${n}\r\n`;else r+=`${e}: ${t}\r\n`;return r+=`\r
|
|
66
|
-
`,r}_writeToSocket(e,t){if(!this.socket){t(Error(`Socket is not available`));return}this.socket.write(e,t)}write(e,t,n){return this._bodyWritten=!0,super.write(e,t,n)}_write(e,t,n){let r=Gs(e),i=[];if(this.headersSent||=(this._implicitHeader(),i.push(R.from(this._headBlock,`latin1`)),!0),this.chunkedEncoding?r.length>0&&(i.push(R.from(`${r.length.toString(16)}\r\n`,`latin1`)),i.push(r),i.push(R.from(`\r
|
|
67
|
-
`,`latin1`))):i.push(r),i.length===0){n();return}this._writeToSocket(R.concat(i),n)}_final(e){let t=[];if(this.headersSent||=(!this.chunkedEncoding&&!this.hasHeader(`content-length`)&&this.setHeader(`Content-Length`,0),this._implicitHeader(),t.push(R.from(this._headBlock,`latin1`)),!0),this.chunkedEncoding&&t.push(R.from(`0\r
|
|
68
|
-
\r
|
|
69
|
-
`,`latin1`)),this.finished=!0,t.length===0){e();return}this._writeToSocket(R.concat(t),e)}end(e,t,n){if(e!=null&&typeof e!=`function`&&!this._bodyWritten&&!this.headersSent&&!this.chunkedEncoding&&!this.hasHeader(`content-length`)){let n=typeof t==`string`?t:void 0;this.setHeader(`Content-Length`,Gs(e,n).length)}return super.end(e,t,n)}_headBlock},Js=class extends qs{statusCode=200;statusMessage;_writeHeadCalled=!1;sendDate=!0;req;socket;_keepAlive=!0;constructor(e){super(),this.req=e,this.socket=e.socket}_shouldSendBody(){if(this.req.method===`HEAD`)return!1;let e=this.statusCode;return!(e>=100&&e<200||e===204||e===304)}writeHead(e,t,n){if(this._writeHeadCalled||this.headersSent)throw Bs(Error(`Cannot render headers after they are sent to the client`),`ERR_HTTP_HEADERS_SENT`);this._writeHeadCalled=!0,this.statusCode=e;let r=n;if(typeof t==`string`?this.statusMessage=t:t!=null&&(r=t),Array.isArray(r)){let e=Array.isArray(r[0])?r:Array.from({length:Math.floor(r.length/2)},(e,t)=>[r[t*2],r[t*2+1]]);for(let[t,n]of e)n!==void 0&&this._appendHeader(t,n)}else if(r)for(let[e,t]of Object.entries(r))t!==void 0&&this.setHeader(e,t);return this}_appendHeader(e,t){let n=this.getHeader(e);if(n===void 0)this.setHeader(e,t);else{let r=[...Array.isArray(n)?n:[n],...Array.isArray(t)?t:[t]].map(String);this.setHeader(e,r)}}_implicitHeader(){let e=this.statusMessage??Fs[this.statusCode]??`unknown`;this.sendDate&&!this.hasHeader(`date`)&&this.setHeader(`Date`,new Date().toUTCString()),this.hasHeader(`connection`)||this.setHeader(`Connection`,this._keepAlive?`keep-alive`:`close`),this._headBlock=this._storeHeader(`HTTP/1.1 ${this.statusCode} ${e}`)}writeContinue(){this._writeToSocket(R.from(`HTTP/1.1 100 Continue\r
|
|
70
|
-
\r
|
|
71
|
-
`,`latin1`),()=>{})}setTimeout(e,t){return this.socket?.setTimeout(e,t),this}},Ys=(...e)=>{let t={},n={},r,i=[...e],a=i.shift();if(typeof a==`string`||a instanceof URL){let e=typeof a==`string`?new URL(a):a;t={protocol:e.protocol,hostname:e.hostname,host:e.hostname,port:e.port,path:`${e.pathname}${e.search}`,auth:e.username?`${e.username}:${e.password}`:void 0};let o=i.shift();typeof o==`function`?r=o:o&&typeof o==`object`&&(n=o,r=i.shift())}else a&&typeof a==`object`&&(n=a,r=i.shift());return{options:{...t,...n},callback:r}},Xs=class extends qs{method;path;host;protocol;socket;get connection(){return this.socket}res=null;aborted=!1;_aborted=!1;constructor(e,t){super(),this.method=(e.method??`GET`).toUpperCase(),this.path=e.path??`/`,this.protocol=e.protocol??`http:`;let n=e.hostname??e.host??`localhost`;this.host=n;let r=Number(e.port??(this.protocol===`https:`?443:80));if(t&&this.once(`response`,t),e.headers)for(let[t,n]of Object.entries(e.headers))n!==void 0&&this.setHeader(t,n);if(!this.hasHeader(`host`)){let e=this.protocol===`https:`&&r===443||this.protocol!==`https:`&&r===80;this.setHeader(`Host`,e?n:`${n}:${r}`)}e.auth&&!this.hasHeader(`authorization`)&&this.setHeader(`Authorization`,`Basic ${R.from(e.auth).toString(`base64`)}`),this.socket=new _s,this.emit(`socket`,this.socket),this.socket.on(`error`,e=>{this._aborted||this.emit(`error`,e)}),this._attachResponseParser(),this.socket.connect({host:n,port:r},()=>{this.emit(`connect`)})}_shouldSendBody(){return this.method!==`GET`&&this.method!==`HEAD`&&this.method!==`DELETE`}_implicitHeader(){this._headBlock=this._storeHeader(`${this.method} ${this.path} HTTP/1.1`)}_attachResponseParser(){let e=new Ks(this.socket),t=new Ws(`response`,{onHeaders:n=>{e._applyHead(n),this.method===`HEAD`&&(t.skipBody=!0),this.res=e,this.emit(`response`,e)},onBody:t=>{e.push(R.from(t))},onComplete:()=>{e.complete=!0,e.push(null)}});this.socket.on(`data`,e=>{this._aborted||t.execute(e)}),this.socket.on(`end`,()=>{t.finish()}),this.socket.on(`close`,()=>{this.emit(`close`)})}abort(){this._aborted||(this._aborted=!0,this.aborted=!0,this.emit(`abort`),this.socket.destroy())}destroy(e){return this._aborted?this:(this._aborted=!0,this.socket.destroy(e),super.destroy(e),this)}end(e,t,n){return this._aborted?this:super.end(e,t,n)}_writeToSocket(e,t){if(this._aborted){t();return}super._writeToSocket(e,t)}setTimeout(e,t){return this.socket.setTimeout(e,t),this}setNoDelay(e){this.socket.setNoDelay(e)}setSocketKeepAlive(e,t){this.socket.setKeepAlive(e,t)}},Zs=new Proxy(class extends vs{constructor(e,t){let n={},r=t;typeof e==`function`?r=e:e&&(n=e),super(n),r&&this.on(`request`,r),this.on(`connection`,e=>this._handleConnection(e))}_handleConnection(e){let t=null,n=new Ws(`request`,{onHeaders:r=>{t=new Ks(e),t._applyHead(r),r.method===`HEAD`&&(n.skipBody=!0);let i=new Js(t),a=String(r.headers.connection??``).toLowerCase();i._keepAlive=r.httpVersionMinor>=1?a!==`close`:a===`keep-alive`,i.on(`finish`,()=>{i._keepAlive||e.end()}),this.emit(`request`,t,i)},onBody:e=>{t?.push(R.from(e))},onComplete:()=>{t&&(t.complete=!0,t.push(null)),t=null}});e.on(`data`,e=>n.execute(e)),e.on(`end`,()=>{n.finish(),t&&t.push(null)}),e.on(`error`,t=>this.emit(`clientError`,t,e))}},{apply:(e,t,n)=>new e(...n)}),Qs=class{maxSockets;maxFreeSockets;keepAlive;options;constructor(e={}){this.options=e,this.keepAlive=!!e.keepAlive,this.maxSockets=e.maxSockets??1/0,this.maxFreeSockets=e.maxFreeSockets??256}getName(e={}){return`${e.host??`localhost`}:${e.port??``}:${e.localAddress??``}`}destroy(){}},$s=new Qs,ec=(...e)=>{let{options:t,callback:n}=Ys(...e);return new Xs(t,n)},tc=(...e)=>{let t=ec(...e);return t.end(),t},nc=(e,t)=>new Zs(e,t),rc={METHODS:Ps,STATUS_CODES:Fs,Agent:Qs,globalAgent:$s,Server:Zs,ServerResponse:Js,IncomingMessage:Ks,ClientRequest:Xs,OutgoingMessage:qs,createServer:nc,request:ec,get:tc},ic={scope:`frame.fetchRead`,category:`network`,severity:3,unsafe:!0,title:`Read your account data on this site`,description:`Lets the app read pages and data from this site as you, using the session in the frame.`},ac={scope:`frame.fetchWrite`,category:`network`,severity:3,unsafe:!0,title:`Change your account data on this site`,description:`Lets the app send changes to this site as you, using the session in the frame.`},oc=new Set([`GET`,`HEAD`,`OPTIONS`]),sc=(e,t)=>oc.has((t?.method??`GET`).toUpperCase())?ic:ac,cc=e=>e,lc=`autoplay; fullscreen; encrypted-media; picture-in-picture; clipboard-read; clipboard-write`,uc=2e4,dc=65e3,fc=3e4,pc=5e3,mc=new Set([]),hc=()=>`https://fkn.app`,gc=e=>!e||e===`about:blank`,_c=e=>e?``:`incognito-${crypto.randomUUID()}`,vc=({target:e,session:t,domains:n})=>{let r=new URL(`/attach-frame`,hc());return e&&r.searchParams.set(`url`,e),t&&r.searchParams.set(`session`,t),n.length&&r.searchParams.set(`domains`,n.join(`,`)),r.href},yc=(e,t,n)=>{let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(Error(n)),t)});return Promise.race([e,i]).finally(()=>clearTimeout(r))},bc=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},xc=()=>Object.assign(Error(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),{name:ir}),Sc=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Cc=[300,1200,4e3],wc=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Cc)setTimeout(t,e)},Tc=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},Ec=async({iframe:e,domains:t=[],syncCookies:n=!0,lockdown:r=!1})=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(r)throw Error(`cloud.attachFrame does not support lockdown; use the extension backend for a sealed frame`);if(!e.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Tc(e);let i=e.getAttribute(`src`)??``,a=(()=>{if(gc(i))return null;try{return new URL(e.src||i,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${i}`)}})();if(a){let e=new URL(`/attach-frame`,hc());if(a.origin===e.origin&&a.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let o=a?.href??``;o&&fi(o);let s=o,c=_c(n),l=Ai(t),u=new Set;try{u.add(new URL(o).origin)}catch{}let d=new AbortController,f=e.referrerPolicy,p=e.allow;if(e.referrerPolicy=`origin`,e.allow=Sc(lc,e.allow),e.src=vc({target:o,session:c,domains:l}),!e.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let t=await yc(D({},{key:`fkn-attach-frame`,origin:hc(),transport:{receive:window,emit:e.contentWindow},unregisterSignal:d.signal,revivableModules:cc(Sn)}),uc,`cloud.attachFrame: timed out connecting to the render proxy page`);await yc(t.ready(),dc,`cloud.attachFrame: the render proxy never became ready`),o&&wc(e),bc(e,()=>d.abort());let n=yi(`attached frame`);d.signal.aborted?n():d.signal.addEventListener(`abort`,n,{once:!0});let r=e.contentWindow,i=()=>{if(!(!d.signal.aborted&&e.isConnected&&e.contentWindow===r))throw d.abort(),xc()};return mi({executor:{execute:(e,n,r)=>mc.has(n)?Promise.reject(ur(n,`cloud`)):(i(),t.executeLocator(e,n,r)),highlight:async()=>{}},gate:async e=>{if(e.operation!==`fetch`)return;let t=ji({session:c,declaredHosts:l,approvedOrigins:u},e.args[0]);if(t.kind===`refuse`)throw dr(t.reason,`fetch`);if(!await(await I).frameConsent.ensure({scope:sc(e.args[0],e.args[1]).scope,hosts:t.promptHosts}))throw dr(`frame.fetch: the user did not grant this`,`fetch`)},goto:async(n,r={})=>{let a=new URL(n,location.href).href;i();let{timeoutMs:o}=r;await yc(t.goto(a,r),(o??fc)+pc,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`),s=a;try{u.add(new URL(a).origin)}catch{}wc(e)},url:()=>s})}catch(t){throw d.abort(),e.referrerPolicy=f,e.allow=p,e.src=o||`about:blank`,t}},Dc=()=>typeof window<`u`&&!0,Oc=async()=>{let e=await I.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},kc=M({attachFrame:()=>Ec,available:()=>Ac,dgram:()=>Cs,dns:()=>Mi,fetch:()=>ki,fs:()=>ba,http:()=>Ms,net:()=>gs,quota:()=>Oc}),Ac=()=>P,jc=async e=>{if(typeof window>`u`)return!1;if(Pn())return!0;let t=await I,n=null,r=new Promise(e=>{n=()=>{Pn()&&e(!0)},Nn.addEventListener(`statuschange`,n)}),i=t.installPrompt.show(e).then(()=>!1),a=await Promise.race([r,i]);return n&&Nn.removeEventListener(`statuschange`,n),await t.installPrompt.hide().catch(()=>{}),a},Mc=null;Ln(()=>(Mc||=jc().then(()=>void 0).finally(()=>{Mc=null}),Mc));var Nc=()=>typeof document<`u`&&Pn(),Pc=M({available:()=>Rc,list:()=>Hc,readFile:()=>Bc,remove:()=>Vc,writeFile:()=>zc}),Fc=()=>navigator.storage.getDirectory(),Ic=e=>{let t=e.split(`/`).filter(e=>e&&e!==`.`);if(t.some(e=>e===`..`)||!t.length)throw Error(`opfs: invalid path`);return t},Lc=async(e,t)=>{let n=await Fc();for(let r of e)n=await n.getDirectoryHandle(r,{create:t});return n},Rc=async()=>{try{return typeof navigator<`u`&&!!navigator.storage?.getDirectory&&!!await Fc()}catch{return!1}},zc=async(e,t,n)=>{let r=Ic(e),i=r.pop(),a=await(await(await Lc(r,!0)).getFileHandle(i,{create:!0})).createWritable({keepExistingData:!1});try{let e=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);await a.write(e)}finally{await a.close()}},Bc=async e=>{let t=Ic(e),n=t.pop();return(await(await Lc(t,!1)).getFileHandle(n)).getFile()},Vc=async e=>{let t=Ic(e),n=t.pop();await(await Lc(t,!1)).removeEntry(n,{recursive:!0})},Hc=async()=>{let e=[],t=async(n,r)=>{for await(let[i,a]of n.entries()){let n=r?`${r}/${i}`:i;if(a.kind===`file`){let t=await a.getFile();e.push({path:n,size:t.size,contentType:t.type||null,updatedAt:new Date(t.lastModified).toISOString()})}else await t(a,n)}};return await t(await Fc(),``),e},Uc=M({adopt:()=>Ml,adoptable:()=>Nl,available:()=>Jc,list:()=>xl,onConflict:()=>Ol,pending:()=>cl,pendingDeletes:()=>ll,pull:()=>El,readFile:()=>Sl,readFileSealed:()=>Cl,remove:()=>Tl,replicating:()=>ul,writeFile:()=>wl}),Wc,Gc=async()=>await(Wc??=Rc().catch(()=>!1))?!0:(Wc=void 0,!1),Kc=()=>ua().catch(()=>`unknown`),qc=async()=>await Kc()===`connected`,Jc=async()=>await Gc()||await qc(),Yc=`fkn:fs:pending`,Xc=`fkn:fs:pending-delete`,Zc=`fkn:fs:adopt-declined`,Qc=!0,$c=new Map,el=e=>{try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return Array.isArray(n)?Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,null])):n&&typeof n==`object`?n:{}}catch{return{}}},tl=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}catch{}},nl=()=>el(Yc),rl=(e,t)=>{let n=nl();e in n||(n[e]=t===void 0?$c.get(e)??null:t,tl(Yc,n))},il=e=>{let t=nl();e in t&&(delete t[e],tl(Yc,t),fl()||(hl=pl))},al=()=>el(Xc),ol=e=>{let t=al();e in t||(t[e]=$c.get(e)??null,tl(Xc,t))},sl=e=>{let t=al();e in t&&(delete t[e],tl(Xc,t),fl()||(hl=pl))},cl=()=>Object.keys(nl()),ll=()=>Object.keys(al()),ul=()=>Qc,dl=null;bi(`storage replication`,()=>dl!==null||Il!==null);var fl=()=>Object.keys(nl()).length>0||Object.keys(al()).length>0,pl=6e4,ml=6e5,hl=pl,gl=null,_l=()=>{gl||typeof window>`u`||!fl()||(gl=setTimeout(()=>{gl=null,vl()},hl),hl=Math.min(hl*2,ml))},vl=()=>{dl||!fl()||(dl=jl(!1).then(e=>{if(!fl()){hl=pl;return}e.failed.length&&_l()}).catch(()=>{_l()}).finally(()=>{dl=null}))},yl=null,bl=()=>yl??=ie(()=>import(`./api-D5uFVynV.js`).then(e=>e.apiPromise),__vite__mapDeps([0,1,2])),xl=async()=>{Hl();let e=await Kc(),t=e===`connected`,[n,r]=await Promise.all([Gc().then(e=>e?Hc():[]).catch(()=>[]),t?da().then(e=>({ok:!0,entries:e})).catch(()=>({ok:!1,entries:[]})):Promise.resolve({ok:e===`disconnected`,entries:[]})]);e!==`unknown`&&(Qc=r.ok),r.ok&&e!==`unknown`&&($c=new Map(r.entries.map(e=>[e.path,e.updatedAt])));let i=new Map,a=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},o=e=>{let t=i.get(e.path);(!t||a(e)>=a(t))&&i.set(e.path,e)};for(let e of n)o(e);for(let e of r.entries)o(e);return r.ok&&t&&(Bl(n,r.entries).catch(()=>{}),fl()?vl():Ll({local:n,remote:r.entries}).catch(()=>{})),[...i.values()]},Sl=async e=>{if(await Gc())try{return await Bc(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let t=await pa(e);return await Gc()&&zc(e,t).catch(()=>{}),t},Cl=async e=>{if(await Gc())try{let t=await Bc(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return ha(e)},wl=async(e,t,n)=>{let r=t instanceof Blob?t:new Blob([t],n?.contentType?{type:n.contentType}:void 0);if(await Gc()){await zc(e,r,n),Hl();let t=$c.get(e)??null,i=await Kc();if(i===`disconnected`)return;if(i===`unknown`||!Qc){rl(e,t),_l();return}ga(e,r,n).then(()=>il(e)).catch(n=>{rl(e,t),_l(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let i=await Kc();if(i===`connected`)return ga(e,r,n);throw Error(i===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},Tl=async e=>{Hl();let t=[];await Gc()&&t.push(Vc(e).catch(()=>{}));let n=await Kc();if(n===`connected`?t.push(_a(e).then(()=>sl(e)).catch(t=>{ol(e),_l(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):n===`unknown`&&t.length&&$c.has(e)&&(ol(e),_l()),!t.length)throw Error(n===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);il(e),await Promise.all(t)},El=async e=>{let t=await pa(e);return await Gc()&&await zc(e,t),t},Dl=null,Ol=e=>(Dl=e,()=>{Dl===e&&(Dl=null)}),kl=async e=>{let t=await(await bl()).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return t===`local`?e.readLocal():t===`cloud`?e.readCloud():null},Al=async e=>{if(Dl)try{return await Dl(e)}catch{return null}return kl(e)},jl=async e=>{let t={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},n=await Kc();if(n===`unknown`)throw Error(`fs: cloud unreachable`);if(n!==`connected`)throw Error(`fs: this needs a signed-in account`);let r=await Gc(),[i,a]=await Promise.all([r?Hc():Promise.resolve([]),da()]),o=new Map(a.map(e=>[e.path,e])),s=nl();if(r)for(let e of Object.keys(s))i.some(t=>t.path===e)||il(e);for(let[e,n]of Object.entries(al())){let r=o.get(e);if(!r){sl(e);continue}if(i.some(t=>t.path===e)){sl(e);continue}if(r.updatedAt!==n){sl(e);continue}try{await _a(e),sl(e),t.deleted.push(e)}catch(n){t.failed.push({path:e,error:n instanceof Error?n.message:String(n)})}}for(let n of i){let r=o.get(n.path),i=n.path in s;if(!i&&(r||!e)){r&&t.kept.push(n.path);continue}if(i&&r&&r.updatedAt!==s[n.path]){let e=null,i=null,a=await Al({path:n.path,local:{size:n.size,updatedAt:n.updatedAt},cloud:{size:r.size,updatedAt:r.updatedAt},readLocal:()=>e??=Bc(n.path),readCloud:()=>i??=pa(n.path)});if(a==null){t.unresolved.push(n.path);continue}try{let r=e!==null&&a===await e,o=i!==null&&a===await i;o||await ga(n.path,a,n.contentType?{contentType:n.contentType}:void 0),r||await zc(n.path,a),il(n.path),t.resolved.push({path:n.path,choice:r?`local`:o?`cloud`:`merged`})}catch(e){if(e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}continue}try{let e=await Bc(n.path);await ga(n.path,e,n.contentType?{contentType:n.contentType}:void 0),il(n.path),t.uploaded.push(n.path)}catch(e){if(rl(n.path),e?.code===`FKN_E2E_LOCKED`)throw e;t.failed.push({path:n.path,error:e instanceof Error?e.message:String(e)})}}return t},Ml=async()=>{for(;dl;)await dl;let e=jl(!0);dl=e.then(()=>{},()=>{});try{return await e}finally{dl=null}},Nl=async()=>{if(!await qc()||!await Gc())return{paths:[],bytes:0};let[e,t]=await Promise.all([Hc(),da()]),n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path));return{paths:r.map(e=>e.path),bytes:r.reduce((e,t)=>e+t.size,0)}},Pl=()=>new Set(Object.keys(el(Zc))),Fl=e=>{let t=el(Zc);for(let n of e)t[n]=null;tl(Zc,t)},Il=null,Ll=e=>Il||(Il=(async()=>{if(!await qc())return;let t=e??(await Gc()?{local:await Hc(),remote:await da()}:null);if(!t)return;let n=new Set(t.remote.map(e=>e.path)),r=Pl(),i=t.local.filter(e=>!n.has(e.path)&&!r.has(e.path));if(!i.length)return;let a=await bl(),o=i.reduce((e,t)=>e+t.size,0);if(!await a.cloud.fs.promptAdopt({files:i.length,bytes:o}).catch(()=>!1)){Fl(i.map(e=>e.path));return}await Ml()})().catch(()=>{}).finally(()=>{Il=null}),Il),Rl=null,zl=!1,Bl=async(e,t)=>{let n=new Set(t.map(e=>e.path)),r=e.filter(e=>!n.has(e.path)),i=await bl(),a=async()=>{await Ml().catch(()=>{});let e=await Nl().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};Rl=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},zl||(zl=!0,ie(()=>import(`./api-D5uFVynV.js`).then(e=>e.onApiEpoch((e,t)=>{t>1&&Rl?.()})),__vite__mapDeps([0,1,2])).catch(()=>{})),await i.cloud.fs.setAdoptSource(o,a)},Vl=!1,Hl=()=>{Vl||typeof window>`u`||(Vl=!0,window.addEventListener(`online`,()=>{vl()}),ie(()=>import(`./account-CTqTIqCB.js`).then(e=>e.onChange(()=>{Ll().catch(()=>{}),vl()})),__vite__mapDeps([3,4,1,2])).catch(()=>{}))},Ul=Qi(Uc,{memfs:!0}),{available:Wl,readFileSync:Gl,writeFileSync:Kl,appendFileSync:ql,existsSync:Jl,statSync:Yl,lstatSync:Xl,readdirSync:Zl,mkdirSync:Ql,rmSync:$l,rmdirSync:eu,unlinkSync:tu,renameSync:nu,readFile:ru,writeFile:iu,appendFile:au,stat:ou,readdir:su,mkdir:cu,rm:lu,unlink:uu,rename:du,exists:fu,promises:pu,mount:mu,flush:hu,remount:gu}=Ul;({...Ul});var{available:_u,readFileSync:vu,writeFileSync:yu,appendFileSync:bu,existsSync:xu,statSync:Su,lstatSync:Cu,readdirSync:wu,mkdirSync:Tu,rmSync:Eu,rmdirSync:Du,unlinkSync:Ou,renameSync:ku,readFile:Au,writeFile:ju,appendFile:Mu,stat:Nu,readdir:Pu,mkdir:Fu,rm:Iu,unlink:Lu,rename:Ru,exists:zu,promises:Bu,mount:Vu,flush:Hu,remount:Uu}=Qi(Pc,{memfs:!0}),Wu=M({attach:()=>_d,connect:()=>dd,hide:()=>ud,install:()=>$u,isVisible:()=>jd,list:()=>ed,mount:()=>gd,onConnect:()=>Ad,onVisibilityChange:()=>Md,pick:()=>Qu,search:()=>Zu,show:()=>ld,uninstall:()=>td}),Gu=`fkn-packages-connection`,Ku=3e4,qu=(e,t)=>Object.assign(Error(t),{code:e}),Ju=async()=>{if(!P)throw qu(`unavailable`,`packages: no FKN transport in this realm - use relayWorker to bridge workers`);return I},Yu=(e,t,n)=>D(e??{},{transport:t,key:Gu,unregisterSignal:n}),Xu=async(e,t,n={})=>{let{signal:r,closed:i}=n;if(r?.aborted)throw qu(`unavailable`,`packages.connect: aborted before connecting`);let a=new AbortController;r&&r.addEventListener(`abort`,()=>a.abort(r.reason),{once:!0});let o=new AbortController,s=new Promise((e,n)=>{let a=setTimeout(()=>n(qu(`timeout`,`packages.connect: the package did not complete the connection`)),Ku);o.signal.addEventListener(`abort`,()=>clearTimeout(a),{once:!0}),t.addEventListener(`message`,e=>{if(e.data?.type===`fkn-packages-nack`){let t=e.data.message;n(qu(`unavailable`,typeof t==`string`&&t?t:`packages.connect: the package refused the connection`))}},{signal:o.signal}),t.start(),r&&r.addEventListener(`abort`,()=>n(qu(`unavailable`,`packages.connect: aborted before connecting`)),{once:!0,signal:o.signal}),i?.then(()=>n(qu(`unavailable`,`packages.connect: the package closed before connecting`)))});try{return await Promise.race([Yu(e,t,a.signal),s])}catch(e){a.abort(e);try{t.close()}catch{}throw e}finally{o.abort()}},Zu=async e=>{let t=await(await Ju()).packages.search(e);if(`error`in t)throw qu(t.error,t.message);return t.results},Qu=async(e,t)=>{let n=await(await Ju()).packages.pick(e,t);if(`error`in n)throw qu(n.error,n.message);return`declined`in n?[]:n.results},$u=async(e,t)=>{let n=await(await Ju()).packages.install(e,t);if(`error`in n)throw qu(n.error,n.message);return`declined`in n?null:n.installed},ed=async()=>(await(await Ju()).packages.list()).results,td=async e=>{let t=await(await Ju()).packages.uninstall(e);if(`error`in t)throw qu(t.error,t.message)},nd=({x:e,y:t,width:n,height:r})=>({x:Math.round(e),y:Math.round(t),width:Math.round(n),height:Math.round(r)}),rd=(e,t)=>{let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y);return{x:n,y:r,width:Math.max(0,Math.min(e.x+e.width,t.x+t.width)-n),height:Math.max(0,Math.min(e.y+e.height,t.y+t.height)-r)}},id=(e,t)=>{let n=t;for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t);if((e.overflowX!==`visible`||e.overflowY!==`visible`)&&(n=rd(n,nd(t.getBoundingClientRect())),n.width===0||n.height===0))break}return n},ad=e=>{let t=getComputedStyle(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius];if(n.some(e=>e.includes(`%`)||e.includes(` `)))return;let r=n.map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:0});return r.some(e=>e>0)?r:void 0},od=(e,t)=>{if(!e)return!1;let n=(e,t)=>e===t||!!e&&!!t&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height;return n(e.rect,t.rect)&&n(e.clip,t.clip)&&((e,t)=>e===t||!!e&&!!t&&e.every((e,n)=>e===t[n]))(e.radius,t.radius)},sd=new Map;bi(`package view`,()=>sd.size>0);var cd=async(e,t)=>{let n=sd.get(e);if(n){for(let e of n)t&&e.element!==t||(e.stop(),n.delete(e));if(n.size>0)return;sd.delete(e)}let r=await(await Ju()).packages.hide(e);if(`error`in r)throw qu(r.error,r.message)},ld=async(e,t)=>{let{element:n,rect:r}=t;if(!n&&!r)throw qu(`invalid`,`packages.show: pass an element or a rect`);let i=(await Ju()).packages,a=()=>{if(!n)return{rect:nd(r)};let e=nd(n.getBoundingClientRect());return{rect:e,clip:id(n,e),radius:ad(n)}},o=!0,s,c=0,l=async t=>{s=t;let n=await i.show(e,t);if(`error`in n)throw o=!1,qu(n.error,n.message)};await l(a());let u=()=>{if(!o)return;let e=a();od(s,e)||l(e).catch(()=>{}),c=requestAnimationFrame(u)};n&&(c=requestAnimationFrame(u));let d={element:n,stop:()=>{o=!1,cancelAnimationFrame(c)}},f=sd.get(e)??new Set;return f.add(d),sd.set(e,f),{hide:()=>{cd(e,n).catch(()=>{})},refresh:()=>{if(!o)return;let e=a();od(s,e)||l(e).catch(()=>{})}}},ud=async(e,t={})=>cd(e,t.element),dd=(async(e,t={})=>{let n=await(await Ju()).packages.connect(e,{protocol:t.protocol});if(`error`in n)throw qu(n.error,n.message);let r=yi(`package connection`),i=ee()?.epoch??0,a=F((e,t)=>{t!==i&&(r(),a())});Promise.resolve(n.closed).then(()=>{r(),a()},()=>{r(),a()});let{port:o,closed:s}=n;if(t.raw)return{closed:s,port:o};let c=await Xu(t.payload,o,{signal:t.signal,closed:s});return t.signal&&t.signal.addEventListener(`abort`,()=>{try{o.postMessage({type:`fkn-packages-disconnect`})}catch{}},{once:!0}),{remote:c,closed:s,port:o}}),fd=[`allow-scripts`,`allow-same-origin`],pd=e=>{let t=e.getAttribute(`sandbox`);if(t!==null){let e=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),n=fd.filter(t=>!e.has(t));if(n.length)throw qu(`invalid`,`packages.mount: the iframe's sandbox attribute must include ${n.join(` and `)}, or the package cannot start`)}if(globalThis.crossOriginIsolated&&!new Set((e.getAttribute(`allow`)??``).toLowerCase().split(`;`).map(e=>e.trim().split(/\s+/)[0]).filter(Boolean)).has(`cross-origin-isolated`))throw qu(`invalid`,`packages.mount: this page is cross-origin isolated, so the iframe's allow attribute must include 'cross-origin-isolated' to hand that down to the package`)},md=3e4,hd=(e,t)=>new Promise((n,r)=>{let i=e=>{clearTimeout(o),window.removeEventListener(`message`,a),e?r(e):n()},a=n=>{if(n.source!==e.contentWindow||n.origin!==t)return;let r=n.data;if(r?.type===`fkn-packages-ready`)return i();r?.type===`fkn-packages-failed`&&i(qu(`unavailable`,typeof r.message==`string`&&r.message?r.message:`packages.mount: the package failed to boot`))},o=setTimeout(()=>i(qu(`timeout`,`packages.mount: the package did not register a connection handler`)),md);window.addEventListener(`message`,a)}),gd=async(e,t)=>{let{iframe:n}=t;if(!(n instanceof HTMLIFrameElement))throw qu(`invalid`,`packages.mount: pass the iframe to load the package into`);if(!n.isConnected)throw qu(`invalid`,`packages.mount: the iframe must be in the document before mounting into it`);pd(n);let r=await(await Ju()).packages.frame(e);if(`error`in r)throw qu(r.error,r.message);n.src=r.url;let i={done:!1},a=()=>{},o=new Promise(e=>{a=e}),s=yi(`mounted package`),c=()=>{if(!i.done){i.done=!0,s();try{n.contentWindow?.postMessage({type:`fkn-packages-close`},r.origin)}catch{}n.src=`about:blank`,a()}};try{await hd(n,r.origin)}catch(e){throw c(),e}let l=new MessageChannel,u=n.contentWindow;if(!u)throw c(),qu(`unavailable`,`packages.mount: the frame was detached before it could connect`);u.postMessage({type:`fkn-packages-port`,from:r.from,protocol:t.protocol,uri:r.uri,name:r.name,version:r.version},r.origin,[l.port2]);try{u.postMessage({type:`fkn-packages-visibility`,visible:!0},r.origin)}catch{}if(t.raw)return{closed:o,port:l.port1,frame:n,unmount:c};try{return{remote:await Xu(t.payload,l.port1,{signal:t.signal,closed:o}),closed:o,port:l.port1,frame:n,unmount:c}}catch(e){throw c(),e}},_d=(e,t,n)=>Xu(t,e,{signal:n?.signal}),vd=null,yd=!1,bd=new Set,xd=[],Sd=new Map,Cd=!1,wd=!1,Td=e=>{let t=Sd.get(e);t&&(Sd.delete(e),t())},Ed=(e,t)=>{try{e.postMessage({type:`fkn-packages-nack`,message:t})}catch{}try{e.close()}catch{}},Dd=async(e,t)=>{let{port:n,...r}=e;e.port.addEventListener(`message`,t=>{t.data?.type===`fkn-packages-disconnect`&&Td(e.port)});let i;try{i=await t.createPayload(r)}catch(t){throw Ed(e.port,t instanceof Error?t.message:`the package failed to produce a connection`),t}let a=new Promise(t=>Sd.set(e.port,t)),o=await Yu(i,e.port);t.handler?.({...r,remote:o,closed:a,port:e.port})},Od=()=>{Cd||typeof window>`u`||window.parent===window||(Cd=!0,window.addEventListener(`message`,e=>{if(e.source!==window.parent)return;let t=e.data;if(t?.type===`fkn-packages-port`){let n=e.ports[0];if(!n)return;let r={port:n,from:typeof t.from==`string`?t.from:``,protocol:typeof t.protocol==`string`?t.protocol:null,uri:typeof t.uri==`string`?t.uri:``,name:typeof t.name==`string`?t.name:``,version:typeof t.version==`string`?t.version:``};vd?Dd(r,vd).catch(e=>console.warn(`packages.onConnect:`,e)):xd.push(r)}if(t?.type===`fkn-packages-close`)for(let e of[...Sd.keys()])Td(e);if(t?.type===`fkn-packages-visibility`){yd=t.visible===!0;for(let e of bd)try{e(yd)}catch{}}}))},kd=()=>{wd||typeof window>`u`||window.parent===window||(wd=!0,window.parent.postMessage({type:`fkn-packages-ready`},`*`))},Ad=(e,t)=>{if(typeof window>`u`)return{unsubscribe:()=>{}};Od();let n={createPayload:e,handler:t};for(vd=n,kd();xd.length&&vd===n;)Dd(xd.shift(),n).catch(e=>console.warn(`packages.onConnect:`,e));return{unsubscribe:()=>{vd===n&&(vd=null)}}},jd=()=>yd,Md=e=>{if(typeof window>`u`)return{unsubscribe:()=>{}};Od(),bd.add(e);try{e(yd)}catch{}return{unsubscribe:()=>{bd.delete(e)}}},Nd=M({available:()=>Hd,create:()=>Wd,join:()=>Gd,open:()=>Ud}),Pd={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,needsPremium:`rooms: claiming needs premium`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},Fd=(e,t)=>Object.assign(Error(t),{code:e}),Id=e=>e instanceof Error&&typeof e.code==`string`,Ld={send:!0,receive:!0,maxMessageBytes:262144},Rd=async()=>{if(!P)return;let e=(await N(`a room`).catch(()=>void 0))?.rooms;return typeof e?.open==`function`?e:void 0},zd=()=>{throw Fd(`unavailable`,Pd.unavailable)},Bd=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,Vd=async e=>{let t=e.invite,n=e,r=0,i=e.self,a=e.owner,o=e.claimed,s=e.mailbox,c=await e.defaults().catch(()=>Ld),l=!1,u=new Set,d=new Set,f=yi(`room`),p=()=>{},m=()=>{},h=new Promise(e=>{m=e}),g=e=>{let t=[...d];d.clear();for(let n of t)try{n(e)}catch{}},_=e=>{l||(l=!0,p(),u.clear(),f(),g(Fd(`closed`,Pd.ended)),m({reason:e}))},v=e=>{if(!l){e.type===`defaults`&&(c=e.defaults),e.type===`permissions`&&e.id===i.id&&(i={id:i.id,permissions:e.permissions,maxMessageBytes:e.maxMessageBytes}),e.type===`claim`&&(o=e.claimed,a=e.owner,o||(s=null));for(let t of[...u])try{t(e)}catch{}}},y=(e,t)=>{Promise.resolve(e.on(v)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===r&&_(e.reason)},()=>{})},b=async(e,u)=>{if(typeof e?.join!=`function`)return _(`unavailable`);let d=await e.join(t).catch(()=>void 0);if(l||u!==r)return;if(!d)return _(`unavailable`);if(`error`in d)return _(Bd(d.error));if(d.self.id!==i.id)return Promise.resolve(d.leave()).catch(()=>{}),_(`unavailable`);n=d,i=d.self,a=d.owner,o=d.claimed,s=d.mailbox,y(d,u);let f=await d.defaults().catch(()=>void 0);f&&!l&&u===r&&(c=f)};p=F((e,t)=>{let n=r;r=t,!(l||n===0||n===t)&&(g(Fd(`unavailable`,Pd.unavailable)),b(e.rooms,t))}),y(e,r);let x=async e=>{if(l)throw Fd(`closed`,Pd.ended);let t=()=>{},r=new Promise((e,n)=>{t=n});d.add(t);try{return await Promise.race([Promise.resolve(e(n)),r])}catch(e){throw Id(e)?e:Fd(`unavailable`,Pd.unavailable)}finally{d.delete(t)}},S=async e=>{let t=await x(e);if(`error`in t)throw Fd(t.error,t.message)},C=async e=>{let t=await x(e);if(typeof t==`object`&&t&&`error`in t)throw Fd(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:t,get self(){return i},get owner(){return a},get claimed(){return o},get mailbox(){return s},defaults:()=>c,members:()=>x(e=>e.members()),send:e=>S(t=>t.send(e)),edit:(e,t)=>S(n=>n.edit(e,t)),delete:(e,t)=>S(n=>n.delete(e,t)),backlog:(e,t)=>C(n=>n.backlog(e,t)),setDefault:(e,t)=>S(n=>n.setDefault(e,t)),limit:(e,t)=>S(n=>n.limit(e,t)),grant:(e,t)=>S(n=>n.grant(e,t)),revoke:(e,t)=>S(n=>n.revoke(e,t)),remove:e=>S(t=>t.remove(e)),block:e=>S(t=>t.block(e)),unblock:e=>S(t=>t.unblock(e)),claim:()=>S(e=>e.claim()),release:()=>S(e=>e.release()),usage:async()=>{let e=await C(e=>e.usage());return s=e,e},on:async e=>l?()=>{}:(u.add(e),()=>{u.delete(e)}),leave:async()=>{await Promise.resolve(n.leave()).catch(()=>{}),_(`left`)},closed:h}},Hd=async()=>{let e=await Rd();return e?e.available().catch(()=>!1):!1},Ud=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw Fd(`invalid`,Pd.badName);let n=await Rd();if(!n)throw Fd(`unavailable`,Pd.unavailable);let r=await n.open(e,t).catch(zd);if(`error`in r)throw Fd(r.error,r.message);return Vd(r)},Wd=async e=>{let t=await Rd();if(!t)throw Fd(`unavailable`,Pd.unavailable);let n=await t.create(e).catch(zd);if(`error`in n)throw Fd(n.error,n.message);return Vd(n)},Gd=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw Fd(`invalid`,Pd.inviteNoKey);let r=await Rd();if(!r)throw Fd(`unavailable`,Pd.unavailable);let i=await r.join(e,t).catch(zd);if(`error`in i)throw Fd(i.error,i.message);return Vd(i)},Kd=()=>`https://fkn.app/connect-button`,qd=1e4,Jd=150,Yd=()=>new Promise(e=>{if(Pn())return e(!0);let t,n=setTimeout(()=>r(Pn()),qd),r=r=>{clearTimeout(t),clearTimeout(n),a.disconnect(),document.removeEventListener(`readystatechange`,o),e(r)},i=()=>{clearTimeout(t),t=setTimeout(()=>r(Pn()),Jd)},a=new MutationObserver(()=>{Pn()&&r(!0)}),o=()=>{document.readyState===`complete`&&!Pn()&&i()};a.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,o),document.readyState===`complete`&&i()}),Xd=async e=>Nc()||e.lockdown||!Dc()||await Yd()?gi(e):Ec(e),Zd=new Set,Qd=()=>{if(Zd.size===0)return!1;for(let e of[...Zd])try{e()}catch{}return!0},$d=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},ef=new Set,tf=()=>{for(let e of[...ef])try{e()}catch{}},nf=0;typeof window<`u`&&F(()=>{let e=ee();!e||ef.size===0||nf===e.epoch||(nf=e.epoch,Promise.resolve(e.remote.shell?.onUpdate(tf)).catch(()=>{nf===e.epoch&&(nf=0)}))});var rf=0,af=!1,of=()=>{if(!Qd()&&!af){af=!0;try{location.reload()}catch{}}};typeof window<`u`&&F(()=>{let e=ee();if(!e||rf===e.epoch)return;rf=e.epoch;let t=$d(e.remote.shell,of);if(!t){rf=0;return}t.catch(()=>{rf===e.epoch&&(rf=0)})});function sf(){return typeof window<`u`}function cf(e){return df(e)?(e.nodeName||``).toLowerCase():`#document`}function lf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function uf(e){return((df(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function df(e){return sf()?e instanceof Node||e instanceof lf(e).Node:!1}function ff(e){return sf()?e instanceof Element||e instanceof lf(e).Element:!1}function pf(e){return sf()?e instanceof HTMLElement||e instanceof lf(e).HTMLElement:!1}function mf(e){return!sf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof lf(e).ShadowRoot}var hf=new Set([`inline`,`contents`]);function gf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hf.has(i)}var _f=new Set([`table`,`td`,`th`]);function vf(e){return _f.has(cf(e))}var yf=[`:popover-open`,`:modal`];function bf(e){return yf.some(t=>{try{return e.matches(t)}catch{return!1}})}var xf=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Sf=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Cf=[`paint`,`layout`,`strict`,`content`];function wf(e){let t=Ef(),n=ff(e)?kf(e):e;return xf.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Sf.some(e=>(n.willChange||``).includes(e))||Cf.some(e=>(n.contain||``).includes(e))}function Tf(e){let t=jf(e);for(;pf(t)&&!Of(t);){if(wf(t))return t;if(bf(t))return null;t=jf(t)}return null}function Ef(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Df=new Set([`html`,`body`,`#document`]);function Of(e){return Df.has(cf(e))}function kf(e){return lf(e).getComputedStyle(e)}function Af(e){return ff(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jf(e){if(cf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||mf(e)&&e.host||uf(e);return mf(t)?t.host:t}function Mf(e){let t=jf(e);return Of(t)?e.ownerDocument?e.ownerDocument.body:e.body:pf(t)&&gf(t)?t:Mf(t)}function Nf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Mf(e),i=r===e.ownerDocument?.body,a=lf(r);if(i){let e=Pf(a);return t.concat(a,a.visualViewport||[],gf(r)?r:[],e&&n?Nf(e):[])}return t.concat(r,Nf(r,[],n))}function Pf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ff=Math.min,If=Math.max,Lf=Math.round,Rf=Math.floor,zf=e=>({x:e,y:e}),Bf={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Vf={start:`end`,end:`start`};function Hf(e,t,n){return If(e,Ff(t,n))}function Uf(e,t){return typeof e==`function`?e(t):e}function Wf(e){return e.split(`-`)[0]}function Gf(e){return e.split(`-`)[1]}function Kf(e){return e===`x`?`y`:`x`}function qf(e){return e===`y`?`height`:`width`}var Jf=new Set([`top`,`bottom`]);function Yf(e){return Jf.has(Wf(e))?`y`:`x`}function Xf(e){return Kf(Yf(e))}function Zf(e,t,n){n===void 0&&(n=!1);let r=Gf(e),i=Xf(e),a=qf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=op(o)),[o,op(o)]}function Qf(e){let t=op(e);return[$f(e),t,$f(t)]}function $f(e){return e.replace(/start|end/g,e=>Vf[e])}var ep=[`left`,`right`],tp=[`right`,`left`],np=[`top`,`bottom`],rp=[`bottom`,`top`];function ip(e,t,n){switch(e){case`top`:case`bottom`:return n?t?tp:ep:t?ep:tp;case`left`:case`right`:return t?np:rp;default:return[]}}function ap(e,t,n,r){let i=Gf(e),a=ip(Wf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map($f)))),a}function op(e){return e.replace(/left|right|bottom|top/g,e=>Bf[e])}function sp(e){return{top:0,right:0,bottom:0,left:0,...e}}function cp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:sp(e)}function lp(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var up=0;Array.isArray;function dp(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--up,__i:-1,__u:0,__source:i,__self:a};return _.vnode&&_.vnode(l),l}p();function fp(e,t,n){let{reference:r,floating:i}=e,a=Yf(t),o=Xf(t),s=qf(o),c=Wf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Gf(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var pp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fp(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=fp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function mp(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Uf(t,e),p=cp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=lp(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=lp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Uf(e,t)||{};if(l==null)return{};let d=cp(u),f={x:n,y:r},p=Xf(i),m=qf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ff(d[_],T),D=Ff(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Hf(O,A,k),M=!c.arrow&&Gf(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),gp=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Uf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Wf(r),_=Yf(o),v=Wf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[op(o)]:Qf(o)),x=p!==`none`;!d&&x&&b.push(...ap(o,m,p,y));let S=[o,...b],C=await mp(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Zf(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Yf(t))||T.every(e=>Yf(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Yf(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},_p=new Set([`left`,`top`]);async function vp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Wf(n),s=Gf(n),c=Yf(n)===`y`,l=_p.has(o)?-1:1,u=a&&c?-1:1,d=Uf(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var yp=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vp(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bp=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Uf(e,t),l={x:n,y:r},u=await mp(t,c),d=Yf(Wf(i)),f=Kf(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Hf(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Hf(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},xp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Uf(e,t),u=await mp(t,l),d=Wf(i),f=Gf(i),p=Yf(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ff(h-u[g],v),x=Ff(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=If(u.left,0),t=If(u.right,0),n=If(u.top,0),r=If(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:If(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:If(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Sp(e){let t=kf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Lf(n)!==a||Lf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Cp(e){return ff(e)?e:e.contextElement}function wp(e){let t=Cp(e);if(!pf(t))return zf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Sp(t),o=(a?Lf(n.width):n.width)/r,s=(a?Lf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Tp=zf(0);function Ep(e){let t=lf(e);return!Ef()||!t.visualViewport?Tp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lf(e)?!1:t}function Op(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Cp(e),o=zf(1);t&&(r?ff(r)&&(o=wp(r)):o=wp(e));let s=Dp(a,n,r)?Ep(a):zf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=lf(a),t=r&&ff(r)?lf(r):r,n=e,i=Pf(n);for(;i&&r&&t!==n;){let e=wp(i),t=i.getBoundingClientRect(),r=kf(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=lf(i),i=Pf(n)}}return lp({width:u,height:d,x:c,y:l})}function kp(e,t){let n=Af(e).scrollLeft;return t?t.left+n:Op(uf(e)).left+n}function Ap(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-kp(e,n),y:n.top+t.scrollTop}}function jp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=uf(r),s=t?bf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=zf(1),u=zf(0),d=pf(r);if((d||!d&&!a)&&((cf(r)!==`body`||gf(o))&&(c=Af(r)),pf(r))){let e=Op(r);l=wp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ap(o,c):zf(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Mp(e){return Array.from(e.getClientRects())}function Np(e){let t=uf(e),n=Af(e),r=e.ownerDocument.body,i=If(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=If(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+kp(e),s=-n.scrollTop;return kf(r).direction===`rtl`&&(o+=If(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Pp=25;function Fp(e,t){let n=lf(e),r=uf(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ef();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=kp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Pp&&(a-=o)}else l<=Pp&&(a+=l);return{width:a,height:o,x:s,y:c}}var Ip=new Set([`absolute`,`fixed`]);function Lp(e,t){let n=Op(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=pf(e)?wp(e):zf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Rp(e,t,n){let r;if(t===`viewport`)r=Fp(e,n);else if(t===`document`)r=Np(uf(e));else if(ff(t))r=Lp(t,n);else{let n=Ep(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lp(r)}function zp(e,t){let n=jf(e);return n===t||!ff(n)||Of(n)?!1:kf(n).position===`fixed`||zp(n,t)}function Bp(e,t){let n=t.get(e);if(n)return n;let r=Nf(e,[],!1).filter(e=>ff(e)&&cf(e)!==`body`),i=null,a=kf(e).position===`fixed`,o=a?jf(e):e;for(;ff(o)&&!Of(o);){let t=kf(o),n=wf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ip.has(i.position)||gf(o)&&!n&&zp(e,o))?r=r.filter(e=>e!==o):i=t,o=jf(o)}return t.set(e,r),r}function Vp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bf(t)?[]:Bp(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Rp(t,n,i);return e.top=If(r.top,e.top),e.right=Ff(r.right,e.right),e.bottom=Ff(r.bottom,e.bottom),e.left=If(r.left,e.left),e},Rp(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Hp(e){let{width:t,height:n}=Sp(e);return{width:t,height:n}}function Up(e,t,n){let r=pf(t),i=uf(t),a=n===`fixed`,o=Op(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=zf(0);function l(){c.x=kp(i)}if(r||!r&&!a)if((cf(t)!==`body`||gf(i))&&(s=Af(t)),r){let e=Op(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Ap(i,s):zf(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Wp(e){return kf(e).position===`static`}function Gp(e,t){if(!pf(e)||kf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return uf(e)===n&&(n=n.ownerDocument.body),n}function Kp(e,t){let n=lf(e);if(bf(e))return n;if(!pf(e)){let t=jf(e);for(;t&&!Of(t);){if(ff(t)&&!Wp(t))return t;t=jf(t)}return n}let r=Gp(e,t);for(;r&&vf(r)&&Wp(r);)r=Gp(r,t);return r&&Of(r)&&Wp(r)&&!wf(r)?n:r||Tf(e)||n}var qp=async function(e){let t=this.getOffsetParent||Kp,n=this.getDimensions,r=await n(e.floating);return{reference:Up(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jp(e){return kf(e).direction===`rtl`}var Yp={convertOffsetParentRelativeRectToViewportRelativeRect:jp,getDocumentElement:uf,getClippingRect:Vp,getOffsetParent:Kp,getElementRects:qp,getClientRects:Mp,getDimensions:Hp,getScale:wp,isElement:ff,isRTL:Jp};function Xp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zp(e,t){let n=null,r,i=uf(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Rf(d),h=Rf(i.clientWidth-(u+f)),g=Rf(i.clientHeight-(d+p)),_=Rf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:If(0,Ff(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Xp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Qp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Cp(e),u=i||a?[...l?Nf(l):[],...Nf(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zp(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Op(e):null;c&&g();function g(){let t=Op(e);h&&!Xp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $p=yp,em=bp,tm=gp,nm=xp,rm=hp,im=(e,t,n)=>{let r=new Map,i={platform:Yp,...n},a={...i.platform,_c:r};return pp(e,t,{...i,platform:a})};p();var am=r,K=function(e,t,n){return Ut.call(t,`css`)?dp(qt,Gt(e,t),n):dp(e,t,n)},q=function(e,t,n){return Ut.call(t,`css`)?dp(qt,Gt(e,t),n):dp(e,t,n)},om=e=>{let[t,n]=e.split(`:`);return{origin:t,id:n}},sm=(e,t)=>{let n=e.split(`,`).filter(Boolean).map(e=>om(e));return t?n.find(({origin:e})=>e===t):n},cm=({origin:e,id:t})=>`${e}:${t}`,lm=e=>e.join(`,`),um=e=>{let t=e.split(`:`).filter(e=>e.length);if(t[1]?.includes(`,`))throw Error(`Invalid uri: ${e}, contains "," character in id`);return t.length===2},dm=/[,/()]/,fm=e=>{let t=e.indexOf(`:`);return t>0&&!dm.test(e.slice(t+1))},pm=e=>e.split(`,`).every(um),mm=/ag:\((.*)\)(?:-(.*))?/,hm=e=>{if(!e?.startsWith(`ag:`))return!1;let t=e.match(mm);if(!t)return!1;let n=t?.[1];return!n||pm(n)},gm=e=>hm(e)||!fm(e)||!um(e)?e:ym([e]),_m=(e,t)=>{if(!e||!t||!hm(e)||!hm(t)||!Sm(e,t))return!1;let n=xm(e)?.handleUris??[],r=xm(t)?.handleUris??[];return n.length>r.length},vm=e=>{if(!e||um(e)||hm(e))return e;try{let t=decodeURIComponent(e);return um(t)||hm(t)?t:e}catch{return e}},ym=(e,t)=>`ag:(${bm(e)})${t?`-${t}`:``}`,bm=(e,t=!0)=>t?bm(sm(Array.isArray(e)?e.join(`,`):e).filter(e=>e.origin&&e.id).sort((e,t)=>e.id.localeCompare(t.id)).sort((e,t)=>e.origin.localeCompare(t.origin)).map(cm),!1):encodeURI(Array.isArray(e)?e.join(`,`):e),xm=e=>{if(typeof e!=`string`)return;let t=e.match(mm);if(!t)return;let n=sm(t[1]).filter(e=>e.origin&&e.id).sort((e,t)=>e.id.localeCompare(t.id)).sort((e,t)=>e.origin.localeCompare(t.origin));return t&&{uri:`ag:(${lm(n.map(cm))})`,origin:`ag`,id:`(${lm(n.map(cm))})`,handleUris:n.map(cm),handleUrisString:lm(n.map(cm)),handleUrisValues:n,episodeId:t[2]}},Sm=(e,t)=>{let n=xm(e),r=xm(t);return!n||!r?!1:n.handleUris.some(e=>r.handleUris.some(t=>e===t))},Cm={};(function(e){var t=Object.prototype.hasOwnProperty,n=`~`;function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if(typeof r!=`function`)throw TypeError(`The listener must be a function`);var s=new i(r,a||e,o),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function o(e,t){--e._eventsCount===0?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)t.call(r,i)&&e.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,a),!0;case 6:return c.fn.call(c.context,t,r,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn===t&&(!i||s.once)&&(!r||s.context===r)&&o(this,a);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[a]=l.length===1?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})({get exports(){return Cm},set exports(e){Cm=e}});var wm=Cm,Tm=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}},Em=class extends Error{constructor(e){super(),this.name=`AbortError`,this.message=e}},Dm=e=>globalThis.DOMException===void 0?new Em(e):new DOMException(e),Om=e=>{let t=e.reason===void 0?Dm(`This operation was aborted.`):e.reason;return t instanceof Error?t:Dm(t)};function km(e,t,n,r){let i,a=new Promise((a,o)=>{if(typeof t!=`number`||Math.sign(t)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===1/0){a(e);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){let{signal:e}=r;e.aborted&&o(Om(e)),e.addEventListener(`abort`,()=>{o(Om(e))})}i=r.customTimers.setTimeout.call(void 0,()=>{if(typeof n==`function`){try{a(n())}catch(e){o(e)}return}let r=typeof n==`string`?n:`Promise timed out after ${t} milliseconds`,i=n instanceof Error?n:new Tm(r);typeof e.cancel==`function`&&e.cancel(),o(i)},t),(async()=>{try{a(await e)}catch(e){o(e)}finally{r.customTimers.clearTimeout.call(void 0,i)}})()});return a.clear=()=>{clearTimeout(i),i=void 0},a}function Am(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var jm=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Mm,Nm=class{constructor(){Mm.set(this,[])}enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,run:e};if(this.size&&jm(this,Mm,`f`)[this.size-1].priority>=t.priority){jm(this,Mm,`f`).push(n);return}let r=Am(jm(this,Mm,`f`),n,(e,t)=>t.priority-e.priority);jm(this,Mm,`f`).splice(r,0,n)}dequeue(){return jm(this,Mm,`f`).shift()?.run}filter(e){return jm(this,Mm,`f`).filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return jm(this,Mm,`f`).length}};Mm=new WeakMap;var Pm=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},J=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh=new Tm,ch=class extends Error{},lh=class extends wm{constructor(e){if(super(),Fm.add(this),Im.set(this,void 0),Lm.set(this,void 0),Rm.set(this,0),zm.set(this,void 0),Bm.set(this,void 0),Vm.set(this,0),Hm.set(this,void 0),Um.set(this,void 0),Wm.set(this,void 0),Gm.set(this,void 0),Km.set(this,0),qm.set(this,void 0),Jm.set(this,void 0),Ym.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Nm,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);Pm(this,Im,e.carryoverConcurrencyCount,`f`),Pm(this,Lm,e.intervalCap===1/0||e.interval===0,`f`),Pm(this,zm,e.intervalCap,`f`),Pm(this,Bm,e.interval,`f`),Pm(this,Wm,new e.queueClass,`f`),Pm(this,Gm,e.queueClass,`f`),this.concurrency=e.concurrency,this.timeout=e.timeout,Pm(this,Ym,e.throwOnTimeout===!0,`f`),Pm(this,Jm,e.autoStart===!1,`f`)}get concurrency(){return J(this,qm,`f`)}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Pm(this,qm,e,`f`),J(this,Fm,`m`,ah).call(this)}async add(e,t={}){return new Promise((n,r)=>{J(this,Wm,`f`).enqueue(async()=>{var i,a;Pm(this,Km,(i=J(this,Km,`f`),i++,i),`f`),Pm(this,Rm,(a=J(this,Rm,`f`),a++,a),`f`);try{if(t.signal?.aborted){r(new ch(`The task was aborted.`));return}let i=await(this.timeout===void 0&&t.timeout===void 0?e({signal:t.signal}):km(Promise.resolve(e({signal:t.signal})),t.timeout===void 0?this.timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?J(this,Ym,`f`):t.throwOnTimeout)&&r(sh)}));n(i),this.emit(`completed`,i)}catch(e){r(e),this.emit(`error`,e)}J(this,Fm,`m`,Qm).call(this)},t),J(this,Fm,`m`,nh).call(this),this.emit(`add`)})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return J(this,Jm,`f`)?(Pm(this,Jm,!1,`f`),J(this,Fm,`m`,ah).call(this),this):this}pause(){Pm(this,Jm,!0,`f`)}clear(){Pm(this,Wm,new(J(this,Gm,`f`)),`f`)}async onEmpty(){J(this,Wm,`f`).size!==0&&await J(this,Fm,`m`,oh).call(this,`empty`)}async onSizeLessThan(e){J(this,Wm,`f`).size<e||await J(this,Fm,`m`,oh).call(this,`next`,()=>J(this,Wm,`f`).size<e)}async onIdle(){J(this,Km,`f`)===0&&J(this,Wm,`f`).size===0||await J(this,Fm,`m`,oh).call(this,`idle`)}get size(){return J(this,Wm,`f`).size}sizeBy(e){return J(this,Wm,`f`).filter(e).length}get pending(){return J(this,Km,`f`)}get isPaused(){return J(this,Jm,`f`)}};Im=new WeakMap,Lm=new WeakMap,Rm=new WeakMap,zm=new WeakMap,Bm=new WeakMap,Vm=new WeakMap,Hm=new WeakMap,Um=new WeakMap,Wm=new WeakMap,Gm=new WeakMap,Km=new WeakMap,qm=new WeakMap,Jm=new WeakMap,Ym=new WeakMap,Fm=new WeakSet,Xm=function(){return J(this,Lm,`f`)||J(this,Rm,`f`)<J(this,zm,`f`)},Zm=function(){return J(this,Km,`f`)<J(this,qm,`f`)},Qm=function(){var e;Pm(this,Km,(e=J(this,Km,`f`),e--,e),`f`),J(this,Fm,`m`,nh).call(this),this.emit(`next`)},$m=function(){this.emit(`empty`),J(this,Km,`f`)===0&&this.emit(`idle`)},eh=function(){J(this,Fm,`m`,ih).call(this),J(this,Fm,`m`,rh).call(this),Pm(this,Um,void 0,`f`)},th=function(){let e=Date.now();if(J(this,Hm,`f`)===void 0){let t=J(this,Vm,`f`)-e;if(t<0)Pm(this,Rm,J(this,Im,`f`)?J(this,Km,`f`):0,`f`);else return J(this,Um,`f`)===void 0&&Pm(this,Um,setTimeout(()=>{J(this,Fm,`m`,eh).call(this)},t),`f`),!0}return!1},nh=function(){if(J(this,Wm,`f`).size===0)return J(this,Hm,`f`)&&clearInterval(J(this,Hm,`f`)),Pm(this,Hm,void 0,`f`),J(this,Fm,`m`,$m).call(this),!1;if(!J(this,Jm,`f`)){let e=!J(this,Fm,`a`,th);if(J(this,Fm,`a`,Xm)&&J(this,Fm,`a`,Zm)){let t=J(this,Wm,`f`).dequeue();return t?(this.emit(`active`),t(),e&&J(this,Fm,`m`,rh).call(this),!0):!1}}return!1},rh=function(){J(this,Lm,`f`)||J(this,Hm,`f`)!==void 0||(Pm(this,Hm,setInterval(()=>{J(this,Fm,`m`,ih).call(this)},J(this,Bm,`f`)),`f`),Pm(this,Vm,Date.now()+J(this,Bm,`f`),`f`))},ih=function(){J(this,Rm,`f`)===0&&J(this,Km,`f`)===0&&J(this,Hm,`f`)&&(clearInterval(J(this,Hm,`f`)),Pm(this,Hm,void 0,`f`)),Pm(this,Rm,J(this,Im,`f`)?J(this,Km,`f`):0,`f`),J(this,Fm,`m`,ah).call(this)},ah=function(){for(;J(this,Fm,`m`,nh).call(this););},oh=async function(e,t){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})};var uh=Object.defineProperty,dh=(e,t)=>{let n={};for(var r in e)uh(n,r,{get:e[r],enumerable:!0});return t||uh(n,Symbol.toStringTag,{value:`Module`}),n},fh=`__OSRA_KEY__`,ph=`__OSRA_DEFAULT_KEY__`,mh=`__OSRA_BOX__`,hh=()=>globalThis.browser??globalThis.chrome,gh=()=>hh()?.runtime,_h=(e,t)=>Ph(e)&&e.__OSRA_KEY__===t,vh=(e,t)=>{if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}},yh=({listener:e,transport:t,remoteName:n,key:r=ph,origin:i=`*`,unregisterSignal:a})=>{if(a?.aborted)return;let o=Qh(t)?t.receive:t;if(typeof o==`function`){let t=o((t,i)=>{a?.aborted||_h(t,r)&&(n&&t.name!==n||e(t,i))});typeof t==`function`&&vh(a,t);return}if(Rh(o)||zh(o)||Vh(o)||Hh(o)){let t=(t,i)=>{let o=(t,a)=>{_h(t,r)&&(n&&t.name!==n||e(t,{port:i,sender:a}))};t.addListener(o),vh(a,()=>t.removeListener(o))};if(Rh(o))t(o.onMessage);else if(Vh(o)){let e=e=>t(e.onMessage,e);o.addListener(e),vh(a,()=>o.removeListener(e))}else Hh(o)?t(o):t(o.onMessage);return}let s=Mh(o)?o.port:o,c=i!==`*`&&Uh(o),l=t=>{let a=t.data;if(typeof a==`string`)try{a=JSON.parse(a)}catch{return}_h(a,r)&&(n&&a.name!==n||c&&t.origin&&t.origin!==i||e(a,{receiveTransport:o,source:t.source,origin:t.origin}))};s.addEventListener(`message`,l),s instanceof MessagePort&&s.start(),vh(a,()=>s.removeEventListener(`message`,l))},bh=(e,t,n=`*`,r=[])=>{let i=Qh(e)?e.emit:e;if(typeof i==`function`)i(t,r);else if(Uh(i))i.postMessage(t,n,r);else if(zh(i))i.postMessage(t);else if(Rh(i))i.sendMessage(t)?.catch?.(e=>{if(!String(e?.message).includes(`Receiving end does not exist`))throw e});else if(Dh(i)){let e=JSON.stringify(t);i.readyState===WebSocket.CONNECTING?i.addEventListener(`open`,()=>i.send(e),{once:!0}):i.send(e)}else Mh(i)?i.port.postMessage(t,r):i.postMessage(t,r)},xh=globalThis.Float16Array,Sh={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float16Array:xh,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Ch=Object.values(Sh),wh=e=>{let t=e.constructor.name;if(t in Sh)return t;for(let[t,n]of Object.entries(Sh))if(n&&e instanceof n)return t;throw Error(`Unknown typed array type`)},Th=e=>{let t=Sh[e];if(!t)throw Error(`Unknown typed array type`);return t},Eh=e=>Ch.some(t=>!!t&&e instanceof t),Dh=e=>e instanceof WebSocket,Oh=e=>!!globalThis.ServiceWorkerContainer&&e instanceof ServiceWorkerContainer,kh=e=>!!globalThis.ServiceWorker&&e instanceof ServiceWorker,Ah=e=>!!globalThis.Worker&&e instanceof Worker,jh=e=>{let t=globalThis.DedicatedWorkerGlobalScope;return!!t&&e instanceof t},Mh=e=>!!globalThis.SharedWorker&&e instanceof SharedWorker,Nh=e=>e instanceof MessagePort,Ph=e=>!!e&&typeof e==`object`&&`__OSRA_KEY__`in e&&!!e.__OSRA_KEY__,Fh=(e,t)=>{for(let n of t)if(n&&e instanceof n)return!0;return!1},Ih=e=>Fh(e,[globalThis.SharedArrayBuffer]),Lh=e=>Fh(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Rh=e=>{let t=gh();return t?e===t:!1},zh=(e,t=!1)=>!e||typeof e!=`object`||Uh(e)||!(`name`in e)||!(`disconnect`in e)||!(`postMessage`in e)?!1:t?`sender`in e&&`onMessage`in e&&`onDisconnect`in e:!0,Bh=e=>!!e&&typeof e==`object`&&!Uh(e)&&`addListener`in e&&`hasListener`in e&&`removeListener`in e,Vh=e=>{let t=gh();return t?e===t.onConnect||e===t.onConnectExternal:!1},Hh=e=>Bh(e),Uh=e=>{if(!e||typeof e!=`object`)return!1;try{return`window`in e&&e.window===e}catch{try{return`closed`in e&&typeof e.closed==`boolean`&&`close`in e&&typeof e.close==`function`}catch{return!1}}},Wh=e=>Dh(e)||zh(e)||Rh(e),Gh=e=>Dh(e)||zh(e)||Vh(e)||Hh(e)||Rh(e),Kh=e=>!!e&&typeof e==`object`&&!Uh(e)&&`isJson`in e&&e.isJson===!0||Wh(e)||Gh(e),qh=e=>Uh(e)||Wh(e)||kh(e)||Ah(e)||jh(e)||Mh(e)||Nh(e)||Xh(e),Jh=e=>Uh(e)||Gh(e)||Oh(e)||Ah(e)||jh(e)||Mh(e)||Nh(e)||Zh(e),Yh=e=>{if(!e||typeof e!=`object`||Uh(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Xh=e=>!Yh(e)||!(`emit`in e)?!1:qh(e.emit)||typeof e.emit==`function`,Zh=e=>!Yh(e)||!(`receive`in e)?!1:Jh(e.receive)||typeof e.receive==`function`,Qh=e=>Xh(e)||Zh(e),Y={[mh]:`revivable`},$h=e=>!!e&&typeof e==`object`&&`__OSRA_BOX__`in e&&e.__OSRA_BOX__===`revivable`,eg=(e,t)=>Kh(t.transport)?{base64Buffer:new Uint8Array(e).toBase64()}:{arrayBuffer:e},tg=e=>`arrayBuffer`in e?e.arrayBuffer:Uint8Array.fromBase64(e.base64Buffer).buffer,ng=dh({box:()=>ag,isType:()=>ig,revive:()=>og,type:()=>rg}),rg=`arrayBuffer`,ig=e=>e instanceof ArrayBuffer,ag=(e,t)=>({...Y,type:rg,...eg(e,t)}),og=(e,t)=>tg(e),sg=dh({box:()=>ug,isType:()=>lg,revive:()=>dg,type:()=>cg}),cg=`date`,lg=e=>e instanceof Date,ug=(e,t)=>({...Y,type:cg,ISOString:e.toISOString()}),dg=(e,t)=>new Date(e.ISOString),fg=dh({box:()=>hg,isType:()=>mg,revive:()=>gg,type:()=>pg}),pg=`headers`,mg=e=>e instanceof Headers,hg=(e,t)=>({...Y,type:pg,entries:[...e.entries()]}),gg=(e,t)=>new Headers(e.entries),_g=dh({box:()=>xg,isType:()=>bg,revive:()=>Sg,type:()=>vg}),vg=`error`,yg={Error,TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError},bg=e=>e instanceof Error,xg=(e,t)=>{let n=`cause`in e&&e.cause!==void 0,r=typeof AggregateError<`u`&&e instanceof AggregateError,i=typeof DOMException<`u`&&e instanceof DOMException;return{...Y,type:vg,name:e.name,message:e.message,stack:e.stack||e.toString(),...n?{cause:Cy(e.cause,t)}:{},...r?{errors:Cy(e.errors,t)}:{},...i?{isDOMException:!0}:{}}},Sg=(e,t)=>{let n=e.cause===void 0?void 0:wy(e.cause,t),r=n===void 0?void 0:{cause:n};if(e.isDOMException&&typeof DOMException<`u`){let t=new DOMException(e.message,e.name);if(e.stack)try{Object.defineProperty(t,"stack",{value:e.stack,configurable:!0})}catch{}return t}let i;if(e.errors!==void 0&&typeof AggregateError<`u`)i=AggregateError(wy(e.errors,t),e.message,r);else{let t=yg[e.name]??Error;i=r===void 0?new t(e.message):new t(e.message,r)}return e.name&&i.name!==e.name&&(i.name=e.name),e.stack&&(i.stack=e.stack),i},Cg=dh({box:()=>Eg,isType:()=>Tg,revive:()=>Dg,type:()=>wg}),wg=`typedArray`,Tg=Eh,Eg=(e,t)=>{let n=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return{...Y,type:wg,typedArrayType:wh(e),...eg(n,t)}},Dg=(e,t)=>new(Th(e.typedArrayType))(tg(e)),Og=new WeakMap,kg=new WeakSet,Ag=(e,t)=>{if(kg.has(e))return t(),()=>{};let n=Og.get(e);return n||Og.set(e,n=new Set),n.add(t),()=>n.delete(t)},jg=e=>{if(kg.has(e))return;kg.add(e);let t=Og.get(e);if(t){Og.delete(e);for(let e of t)try{e()}catch{}}},Mg=dh({box:()=>Bg,isType:()=>zg,revive:()=>Vg,transfer:()=>Rg,type:()=>Ng}),Ng=`transfer`,Pg=Symbol.for(`osra.transfer`),Fg=e=>typeof e==`object`&&!!e,Ig=e=>Fg(e)&&Pg in e&&e[Pg]===!0,Lg=e=>Fg(e)?ArrayBuffer.isView(e)?!0:Fh(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.VideoFrame,globalThis.AudioData]):!1,Rg=e=>Lg(e)?{[Pg]:!0,value:e}:e,zg=e=>Ig(e),Bg=(e,t)=>({...Y,type:Ng,inner:Cy(e.value,t),degraded:Kh(t.transport)}),Vg=(e,t)=>wy(e.inner,t),Hg=e=>Fh(e,[globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.OffscreenCanvas,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Ug=e=>$h(e)&&e.type===`transfer`,Wg=e=>{let t=[],n=new WeakSet,r=(e,i)=>{if(!(!e||typeof e!=`object`)&&!n.has(e)&&(n.add(e),!Ih(e))){if(Ug(e)){r(e.inner,i||!e.degraded);return}if(Hg(e)){t.push(e);return}if(Lh(e)){i&&t.push(e);return}if(!ArrayBuffer.isView(e)){if(Array.isArray(e)){for(let t of e)r(t,i);return}for(let t of Object.values(e))r(t,i)}}};return r(e,!1),t},Gg=class{_listeners=new Map;addEventListener(e,t,n){if(!t)return;let r=this._listeners.get(e);r||(r=new Map,this._listeners.set(e,r)),r.has(t)||r.set(t,typeof n==`object`&&!!n?.once)}removeEventListener(e,t,n){t&&this._listeners.get(e)?.delete(t)}_peer;_queue=[];_started=!1;_closed=!1;_onClose;_onmessage=null;get onmessage(){return this._onmessage}set onmessage(e){this._onmessage=e,e!==null&&this.start()}onmessageerror=null;dispatchEvent(e){e.type===`message`?this._onmessage?.call(this,e):e.type===`messageerror`&&this.onmessageerror?.call(this,e);let t=this._listeners.get(e.type);if(t)for(let[n,r]of[...t])r&&t.delete(n),typeof n==`function`?n.call(this,e):n.handleEvent(e);return!0}postMessage(e,t){let n=this._peer;!n||n._closed||queueMicrotask(()=>{if(n._closed)return;let t=new MessageEvent(`message`,{data:e});n._started?n.dispatchEvent(t):n._queue.push(t)})}start(){if(!this._started){this._started=!0;for(let e of this._queue.splice(0))this.dispatchEvent(e)}}close(){if(this._closed)return;this._closed=!0,this._queue.length=0,this._onClose?.();let e=this._peer;e&&!e._closed&&queueMicrotask(()=>{e._closed||e.dispatchEvent(new Event(`close`))})}},Kg=class{port1;port2;constructor(){let e=new Gg,t=new Gg;e._peer=t,t._peer=e,this.port1=e,this.port2=t}},qg=new FinalizationRegistry(e=>{try{e()}catch{}}),Jg=(e,t)=>{let n={};return qg.register(e,t,n),()=>qg.unregister(n)},Yg=dh({box:()=>f_,createRevivableChannel:()=>h_,init:()=>s_,isType:()=>c_,revive:()=>p_,type:()=>Xg}),Xg=`messagePort`,Zg=2048,Qg=128,$g=1024,e_=new WeakMap,t_=e=>{let t=e_.get(e);if(!t)throw Error(`osra message-port: connection state missing; did init() run?`);return t},n_=(e,t)=>{let n=e.ports.get(t);return n||(n={nextSeq:0,buffer:new Map,outSeq:0},e.ports.set(t,n),e.pendingPorts++),n},r_=(e,t)=>{let n=e.ports.get(t);if(n&&!n.handler&&e.pendingPorts--,e.ports.delete(t),e.tombstones.size>=Qg){let t=e.tombstones.values().next().value;t!==void 0&&e.tombstones.delete(t)}e.tombstones.add(t)},i_=e=>{if(e.handler)for(let t=e.buffer.get(e.nextSeq);t!==void 0;t=e.buffer.get(e.nextSeq))e.buffer.delete(e.nextSeq),e.nextSeq++,e.handler(t)},a_=(e,t)=>n_(t_(e),t).outSeq++,o_=(e,t,n)=>{let r=t_(e);if(r.tombstones.has(t)){setTimeout(()=>n({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t}));return}let i=n_(r,t);i.handler||r.pendingPorts--,i.handler=n,i_(i)},s_=e=>{let t={ports:new Map,tombstones:new Set,pendingPorts:0};e_.set(e,t),e.eventTarget.addEventListener(`message`,({detail:n})=>{if(n.type!==`message`&&n.type!==`message-port-close`||t.tombstones.has(n.portId))return;let r=t.ports.get(n.portId);if(n.seq===void 0){r?.handler?.(n);return}if(!r){if(t.pendingPorts>=$g)return;r=n_(t,n.portId)}if(!(n.seq<r.nextSeq)){if(r.buffer.size>=Zg&&!(n.seq===r.nextSeq&&r.handler)){r.buffer.clear(),r_(t,n.portId),r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n.portId});return}r.buffer.set(n.seq,n),i_(r)}}),Ag(e,()=>{for(let[n,r]of[...t.ports])r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n});t.ports.clear(),t.tombstones.clear(),t.pendingPorts=0})},c_=e=>e instanceof MessagePort||e instanceof Gg,l_=(e,t)=>{try{let n=t_(e).ports.get(t);e.sendMessage({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t,seq:n?n.outSeq++:0})}catch{}},u_=(e,t,n)=>{n?e.postMessage(t):e.postMessage(t,Wg(t))},d_=(e,t,n)=>()=>{let r=e.deref();r&&l_(r,n);let i=t.deref();i&&r_(i,n)},f_=(e,t,n)=>{let r=e instanceof Gg;if(!r&&!Kh(t.transport))return{...Y,type:Xg,port:e,...n?.autoBox?{autoBox:!0}:{}};let i=t_(t),a=e,o=globalThis.crypto.randomUUID(),s=new WeakRef(a),c=new WeakRef(t),l=new WeakRef(i),u=!1,d=()=>{if(u)return;u=!0;let e=l.deref();e&&r_(e,o),m?.();let t=s.deref();t?.removeEventListener(`message`,p),t instanceof Gg&&(t._onClose=void 0)},f=e=>{if(e.type===`message-port-close`){d(),a.dispatchEvent(new Event(`close`)),a.close();return}u_(a,wy(e.data,t),!1)};function p({data:e}){t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:Cy(e,t),portId:o,seq:a_(t,o)})}let m=Jg(a,d_(c,l,o));return a.addEventListener(`message`,p),a.start(),a instanceof Gg&&(a._onClose=()=>{u||(l_(t,o),d())}),o_(t,o,f),{...Y,type:Xg,portId:o,synthetic:r}},p_=(e,t)=>`port`in e?e.autoBox?m_(e.port,t):e.port:g_(e.portId,t,e.synthetic),m_=(e,t)=>{let n=new EventTarget,r=({data:e})=>{n.dispatchEvent(new MessageEvent(`message`,{data:wy(e,t)}))},i=()=>{n.dispatchEvent(new Event(`close`))};return e.addEventListener(`message`,r),e.addEventListener(`close`,i),n.postMessage=(n,r)=>{let i=Cy(n,t),a=Wg(i),o=Array.isArray(r)?r:[];e.postMessage(i,o.length?[...a,...o]:a)},n.start=()=>e.start(),n.close=()=>{e.removeEventListener(`message`,r),e.removeEventListener(`close`,i),e.close()},n},h_=e=>{if(Kh(e.transport)){let{port1:t,port2:n}=new Kg;return{localPort:t,boxedRemote:f_(n,e)}}let{port1:t,port2:n}=new MessageChannel;return{localPort:m_(t,e),boxedRemote:f_(n,e,{autoBox:!0})}},g_=(e,t,n)=>{let r=t_(t),{port1:i,port2:a}=n?new Kg:new MessageChannel,o=new WeakRef(i),s=new WeakRef(a),c=!1,l=()=>{if(c)return;c=!0,r_(r,e);let t=s.deref();t?.removeEventListener(`message`,d),t?.close(),f?.()},u=e=>{if(e.type===`message-port-close`){l();let e=o.deref();e?.dispatchEvent(new Event(`close`)),e?.close();return}if(!o.deref()){l();return}let r=s.deref();r&&u_(r,wy(e.data,t),n)},d=({data:n})=>{t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:Cy(n,t),portId:e,seq:a_(t,e)})},f=Jg(i,()=>{l_(t,e),l()});return i instanceof Gg&&(i._onClose=()=>{c||(l_(t,e),l())}),a.addEventListener(`message`,d),a.start(),o_(t,e,u),i},__=dh({box:()=>S_,isType:()=>x_,revive:()=>C_,type:()=>v_}),v_=`promise`,y_=e=>e instanceof Promise,b_=new Set,x_=e=>e instanceof Promise,S_=(e,t)=>{if(!y_(e))throw TypeError(`Expected Promise`);let{localPort:n,boxedRemote:r}=h_(t),i=e=>{n.postMessage(e),n.close()};return e.then(e=>i({type:`resolve`,data:e})).catch(e=>i({type:`reject`,error:e})),{...Y,type:v_,port:r}},C_=(e,t)=>{let n=p_(e.port,t);b_.add(n);let r=`portId`in e.port;return new Promise((e,i)=>{let a=()=>{n.close(),b_.delete(n),o()},o=r?Ag(t,()=>{i(Error(`osra: connection closed`)),a()}):()=>{};n.addEventListener(`message`,({data:t})=>{t.type===`resolve`?e(t.data):i(t.error),a()},{once:!0}),n.start()})},w_=dh({box:()=>O_,isType:()=>D_,revive:()=>k_,type:()=>T_}),T_=`function`,E_=new Set,D_=e=>typeof e==`function`,O_=(e,t)=>{let{port1:n,port2:r}=new Kg;return n.addEventListener(`message`,({data:n})=>{let[r,i]=n;(async()=>{let n;try{n={type:`return`,value:await e(...i)}}catch(e){n={type:`throw`,error:e}}let a=(()=>{try{return Cy(n,t)}catch(e){return Cy({type:`throw`,error:e},t)}})();r.postMessage(a,Wg(a)),queueMicrotask(()=>{try{r.close()}catch{}})})()}),n.start(),{...Y,type:T_,port:f_(r,t)}},k_=(e,t)=>{let n=p_(e.port,t);return((...e)=>new Promise((r,i)=>{let{port1:a,port2:o}=new Kg;E_.add(a);let s=()=>{a.close(),E_.delete(a),c()},c=Ag(t,()=>{i(Error(`osra: connection closed`)),s()});a.addEventListener(`message`,({data:e})=>{let t=e;t.type===`return`?r(t.value):i(t.error),s()},{once:!0}),a.start();let l=Cy([o,e],t);n.postMessage(l,Wg(l))}))},A_=dh({MAX_CREDIT_WINDOW:()=>64,box:()=>I_,isType:()=>M_,revive:()=>B_,type:()=>j_}),j_=`readableStream`,M_=e=>e instanceof ReadableStream,N_=2,P_=8,F_=4*1024*1024,I_=(e,t)=>{let{localPort:n,boxedRemote:r}=h_(t),i=e.getReader(),a=0,o=!1,s=!1,c=e=>{s=!0;try{n.postMessage(e)}catch{}n.close()},l=async()=>{if(!(o||s)){for(o=!0;a>0;){let e;try{e=await i.read()}catch(e){s||c({type:`error`,error:e});return}if(s)return;if(e.done){c({type:`end`});return}a--;try{n.postMessage({type:`chunk`,value:e.value})}catch(e){c({type:`error`,error:e}),i.cancel(e).catch(()=>{});return}}o=!1}};return n.addEventListener(`message`,({data:e})=>{e instanceof Promise||!(`type`in e)||(e.type===`pull`?n.postMessage(i.read()):e.type===`credit`?(a+=e.n,l()):e.type===`cancel`&&(s=!0,i.cancel(e.reason).catch(()=>{}),n.close()))}),n.addEventListener(`close`,()=>{s||(s=!0,i.cancel(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...Y,type:j_,credit:!0,port:r}},L_=e=>ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:typeof e==`string`?e.length*2:typeof Blob<`u`&&e instanceof Blob?e.size:void 0,R_=e=>{let t=!1,n=0,r,i=[],a=!1,o=!1,s,c,l=()=>r===void 0?P_:Math.max(N_,Math.min(64,Math.floor(F_/r))),u=()=>{let t=l(),r=n+i.length;if(r>t/2)return;let a=t-r;n+=a,e.postMessage({type:`credit`,n:a})},d=()=>{t=!0,queueMicrotask(()=>e.close())},f=e=>{if(o=!0,s=e,!c||i.length)return;let t=c;c=void 0,d(),t.reject(e)};return new ReadableStream({start:()=>{e.addEventListener(`message`,({data:o})=>{if(!(o instanceof Promise||!(`type`in o))){if(o.type===`chunk`){if(t)return;if(n<=0){i.length=0,f(Error(`osra: stream exceeded its credit window`)),queueMicrotask(()=>e.close());return}n--;let a=L_(o.value);if(a!==void 0&&(r=r===void 0?a:r*.875+a*.125),c){let e=c;c=void 0,e.controller.enqueue(o.value),e.resolve()}else i.push(o.value)}else if(o.type===`end`){if(t||(a=!0,!c||i.length))return;let e=c;c=void 0,d(),e.controller.close(),e.resolve()}else if(o.type===`error`){if(t)return;f(o.error)}}}),e.addEventListener(`close`,()=>{t||a||o||f(Error(`osra: connection closed`))},{once:!0})},pull:e=>{if(!t){if(i.length){e.enqueue(i.shift()),!a&&!o&&u();return}if(a){d(),e.close();return}return o?(d(),Promise.reject(s)):(u(),new Promise((t,n)=>{c={controller:e,resolve:t,reject:n}}))}},cancel:n=>{t=!0,i.length=0;let r=c;c=void 0,r?.resolve(),e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},z_=e=>{let t=!1;return new ReadableStream({start:n=>{e.addEventListener(`close`,()=>{if(!t){t=!0;try{n.error(Error(`osra: connection closed`))}catch{}}},{once:!0})},pull:n=>new Promise((r,i)=>{e.addEventListener(`message`,({data:a})=>{a instanceof Promise&&a.then(i=>{i.done?(t=!0,n.close(),e.postMessage({type:`cancel`}),queueMicrotask(()=>e.close())):n.enqueue(i.value),r()}).catch(e=>{t=!0,i(e)})},{once:!0}),e.postMessage({type:`pull`})}),cancel:n=>{t=!0,e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},B_=(e,t)=>{let n=p_(e.port,t);return n.start(),e.credit?R_(n):z_(n)},V_=dh({box:()=>W_,isType:()=>U_,revive:()=>G_,type:()=>H_}),H_=`writableStream`,U_=e=>e instanceof WritableStream,W_=(e,t)=>{let{localPort:n,boxedRemote:r}=h_(t),i=e.getWriter(),a=!1,o=(e,t)=>e.then(()=>n.postMessage({type:`ack`})).catch(e=>n.postMessage({type:`err`,error:e?.message??String(e)})).then(()=>{t&&(a=!0,queueMicrotask(()=>n.close()))});return n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`write`?o(i.write(e.chunk),!1):e.type===`close`?o(i.close(),!0):e.type===`abort`&&o(i.abort(e.reason),!0))}),n.addEventListener(`close`,()=>{a||(a=!0,i.abort(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...Y,type:H_,port:r}},G_=(e,t)=>{let n=p_(e.port,t);n.start();let r=new Set,i=!1;n.addEventListener(`close`,()=>{i=!0;let e=Error(`osra: connection closed`);for(let t of[...r])t(e);r.clear()},{once:!0});let a=Promise.resolve(),o=e=>{let t=a.then(()=>new Promise((t,a)=>{if(i){a(Error(`osra: connection closed`));return}let o=e=>{r.delete(a),e()};r.add(a),n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`ack`?o(t):e.type===`err`&&o(()=>a(Error(e.error))))},{once:!0}),n.postMessage(e)}));return a=t.catch(()=>{}),t};return new WritableStream({write:e=>o({type:`write`,chunk:e}),close:()=>o({type:`close`}),abort:e=>o({type:`abort`,reason:e})})},K_=dh({box:()=>X_,isType:()=>J_,revive:()=>Z_,type:()=>q_}),q_=`abortSignal`,J_=e=>e instanceof AbortSignal,Y_=new WeakMap,X_=(e,t)=>{if(e.aborted)return{...Y,type:q_,aborted:!0,reason:Cy(e.reason,t)};let{localPort:n,boxedRemote:r}=h_(t),i=()=>{n.postMessage({type:`abort`,reason:e.reason}),n.close(),a()},a=Ag(t,()=>{e.removeEventListener(`abort`,i),n.close()});return e.addEventListener(`abort`,i,{once:!0}),{...Y,type:q_,aborted:!1,reason:void 0,port:r}},Z_=(e,t)=>{let n=new AbortController;if(e.aborted||e.port===void 0)return n.abort(wy(e.reason,t)),n.signal;let r=p_(e.port,t);return Y_.set(n.signal,r),r.start(),r.addEventListener(`message`,({data:e})=>{e.type===`abort`&&(n.abort(wy(e.reason,t)),Y_.delete(n.signal),r.close())}),n.signal},Q_=dh({box:()=>tv,isType:()=>ev,revive:()=>nv,type:()=>$_}),$_=`response`,ev=e=>e instanceof Response,tv=(e,t)=>({...Y,type:$_,status:e.status,statusText:e.statusText,headers:hg(e.headers,t),body:e.body?I_(e.body,t):null,url:e.url,redirected:e.redirected}),nv=(e,t)=>{if(e.status===0)return Response.error();let n=gg(e.headers,t),r=e.body?B_(e.body,t):null,i=e.status===101||e.status===204||e.status===205||e.status===304;r&&i&&r.cancel().catch(()=>{});let a=new Response(i?null:r,{status:e.status,statusText:e.statusText,headers:n});return e.url&&Object.defineProperty(a,"url",{value:e.url,configurable:!0}),e.redirected&&Object.defineProperty(a,"redirected",{value:!0,configurable:!0}),a},rv=dh({box:()=>ov,isType:()=>av,revive:()=>sv,type:()=>iv}),iv=`request`,av=e=>e instanceof Request,ov=(e,t)=>({...Y,type:iv,method:e.method,url:e.url,headers:hg(e.headers,t),body:e.body?I_(e.body,t):null,credentials:e.credentials,cache:e.cache,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:X_(e.signal,t)}),sv=(e,t)=>{let n=gg(e.headers,t),r={method:e.method,headers:n,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:Z_(e.signal,t)};return e.mode!==`navigate`&&(r.mode=e.mode),e.body&&(r.body=B_(e.body,t),r.duplex=`half`),new Request(e.url,r)},cv=dh({box:()=>Sv,boxByReference:()=>Cv,identity:()=>gv,isType:()=>bv,revive:()=>wv,type:()=>lv}),lv=`identity`,uv=Symbol.for(`osra.identity`),dv=e=>e!==null&&(typeof e==`object`||typeof e==`function`),fv=e=>{if(e===null)return!1;let t=typeof e;return t===`object`||t===`function`?!0:t===`symbol`?Symbol.keyFor(e)===void 0:!1},pv=e=>dv(e)&&uv in e&&e[uv]===!0,mv=new WeakMap,hv=e=>{if(pv(e))return e;let t=mv.get(e);if(t)return t;let n={[uv]:!0,value:e};return mv.set(e,n),n},gv=e=>dv(e)?hv(e):e,_v=new WeakMap,vv=e=>{let t=_v.get(e);if(t)return t;let n=new WeakMap,r=new Map,i=new Map,a=new WeakMap,o={sendIds:n,idToSent:r,sendRegistry:new FinalizationRegistry(t=>{r.delete(t);try{e.sendMessage({type:`identity-dispose`,remoteUuid:e.remoteUuid,id:t})}catch{}}),receiveCache:i,revivedToId:a,listenerInstalled:!1};return _v.set(e,o),yv(e,o),Ag(e,()=>{o.receiveCache.clear(),o.idToSent.clear()}),o},yv=(e,t)=>{t.listenerInstalled||(t.listenerInstalled=!0,e.eventTarget.addEventListener(`message`,({detail:e})=>{if(e?.type!==`identity-dispose`)return;let n=t.receiveCache.get(e.id);t.receiveCache.delete(e.id),n!==void 0&&fv(n)&&t.revivedToId.delete(n)}))},bv=e=>pv(e),xv=(e,t)=>{let n=t.sendIds.get(e);if(n!==void 0)return{id:n,isExisting:!0};let r=t.revivedToId.get(e);if(r!==void 0)return{id:r,isExisting:!0};let i=globalThis.crypto.randomUUID();return t.sendIds.set(e,i),t.idToSent.set(i,new WeakRef(e)),t.sendRegistry.register(e,i),{id:i,isExisting:!1}},Sv=(e,t)=>{let n=vv(t),r=e.value,i=Cy(r,t);if(!fv(r))return{...Y,type:lv,id:globalThis.crypto.randomUUID(),inner:i};let{id:a,isExisting:o}=xv(r,n);return o?{...Y,type:lv,id:a}:{...Y,type:lv,id:a,inner:i}},Cv=(e,t,n)=>{let{id:r,isExisting:i}=xv(e,vv(n));return i?{...Y,type:lv,id:r}:{...Y,type:lv,id:r,inner:t}},wv=(e,t)=>{let n=vv(t),r=n.receiveCache.get(e.id);if(r!==void 0)return r;let i=n.idToSent.get(e.id)?.deref();if(i!==void 0)return i;if(!(`inner`in e)||e.inner===void 0)throw Error(`osra identity: received id=${e.id} with no inner payload and no cached value`);let a=wy(e.inner,t);return n.receiveCache.set(e.id,a),fv(a)&&n.revivedToId.set(a,e.id),a},Tv=dh({box:()=>Dv,isType:()=>Ev,revive:()=>Ov,type:()=>`map`}),Ev=e=>e instanceof Map,Dv=(e,t)=>({...Y,type:`map`,entries:Array.from(e,([e,n])=>[Cy(e,t),Cy(n,t)])}),Ov=(e,t)=>new Map(e.entries.map(([e,n])=>[wy(e,t),wy(n,t)])),kv=dh({box:()=>jv,isType:()=>Av,revive:()=>Mv,type:()=>`set`}),Av=e=>e instanceof Set,jv=(e,t)=>({...Y,type:`set`,values:Array.from(e,e=>Cy(e,t))}),Mv=(e,t)=>new Set(e.values.map(e=>wy(e,t))),Nv=dh({box:()=>Iv,isType:()=>Fv,revive:()=>Lv,type:()=>Pv}),Pv=`bigint`,Fv=e=>typeof e==`bigint`,Iv=(e,t)=>({...Y,type:Pv,value:e.toString()}),Lv=(e,t)=>BigInt(e.value),Rv=dh({box:()=>Vv,isType:()=>Bv,revive:()=>Hv,type:()=>zv}),zv=`event`,Bv=e=>e instanceof Event,Vv=(e,t)=>({...Y,type:zv,eventType:e.type,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,...e instanceof CustomEvent?{detail:Cy(e.detail,t)}:{}}),Hv=(e,t)=>{let n={bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed};return`detail`in e?new CustomEvent(e.eventType,{...n,detail:wy(e.detail,t)}):new Event(e.eventType,n)},Uv=dh({box:()=>Kv,isType:()=>Gv,revive:()=>Xv,type:()=>Wv}),Wv=`eventTarget`,Gv=e=>e instanceof EventTarget,Kv=(e,t)=>{let n=[],r=e=>typeof e==`boolean`?e:!!e?.capture;return{...Y,type:Wv,addListener:O_((t,i,a)=>{n.push({eventType:t,listener:i,capture:r(a)}),e.addEventListener(t,i,a)},t),removeListener:O_((t,i,a)=>{let o=r(a),s=n.findIndex(e=>e.eventType===t&&e.listener===i&&e.capture===o);s!==-1&&n.splice(s,1),e.removeEventListener(t,i,a)},t),removeAllListeners:O_(()=>{for(let{eventType:t,listener:r,capture:i}of n.splice(0))e.removeEventListener(t,r,{capture:i})},t)}},qv=new WeakMap,Jv=e=>{if(typeof e==`function`)return e;let t=qv.get(e);return t||qv.set(e,t=t=>e.handleEvent(t)),t},Yv=(e,t,n,r)=>e.find(e=>e.eventType===t&&e.listener===n&&e.capture===r),Xv=(e,t)=>{let n=k_(e.addListener,t),r=k_(e.removeListener,t),i=k_(e.removeAllListeners,t),a=new EventTarget,o=[],s=e=>{let t=o.indexOf(e);t!==-1&&o.splice(t,1)};return Object.defineProperty(a,"addEventListener",{value:(e,t,r)=>{if(t===null)return;let i=Jv(t),a=typeof r==`boolean`?r:!!r?.capture;if(Yv(o,e,i,a))return;let c=typeof r==`object`&&r?.once?e=>(s(l),i(e)):i,l={eventType:e,listener:i,capture:a,wire:c};o.push(l),(typeof r==`object`?r?.signal:void 0)?.addEventListener(`abort`,()=>s(l),{once:!0}),n(e,gv(c),r).catch(()=>{})}}),Object.defineProperty(a,"removeEventListener",{value:(e,t,n)=>{if(t===null)return;let i=Jv(t),a=typeof n==`boolean`?n:!!n?.capture,c=Yv(o,e,i,a);c&&(s(c),r(e,gv(c.wire),{capture:a}).catch(()=>{}))}}),Jg(a,()=>{i().catch(()=>{})}),a},Zv=dh({box:()=>ey,isType:()=>$v,revive:()=>ty,type:()=>Qv}),Qv=`symbol`,$v=e=>typeof e==`symbol`,ey=(e,t)=>{let n=Symbol.keyFor(e);return n===void 0?Cv(e,{...Y,type:Qv,description:e.description},t):{...Y,type:Qv,registryKey:n}},ty=(e,t)=>`registryKey`in e?Symbol.for(e.registryKey):Symbol(e.description),ny=dh({box:()=>ay,isType:()=>iy,revive:()=>oy,type:()=>ry}),ry=`asyncIterator`,iy=e=>!e||typeof e!=`object`||typeof ReadableStream<`u`&&e instanceof ReadableStream?!1:typeof e[Symbol.asyncIterator]==`function`,ay=(e,t)=>{let n=e[Symbol.asyncIterator]();return{...Y,type:ry,next:O_((e=>n.next(e)),t),return:O_((e=>n.return?.(e)??Promise.resolve({done:!0,value:e})),t),throw:O_((e=>n.throw?.(e)??Promise.reject(e)),t)}},oy=(e,t)=>{let n=k_(e.next,t),r=k_(e.return,t),i=k_(e.throw,t),a={next:(...e)=>n(...e),return:e=>r(e),throw:e=>i(e),[Symbol.asyncIterator]:()=>a};return a},sy=[globalThis.File,globalThis.FileList,globalThis.RegExp,globalThis.DataView,globalThis.ImageData,globalThis.FormData,globalThis.DOMException,globalThis.DOMMatrix,globalThis.DOMMatrixReadOnly,globalThis.DOMPoint,globalThis.DOMPointReadOnly,globalThis.DOMQuad,globalThis.DOMRect,globalThis.DOMRectReadOnly,globalThis.CryptoKey,globalThis.FileSystemHandle,globalThis.FileSystemFileHandle,globalThis.FileSystemDirectoryHandle,globalThis.RTCCertificate],cy=[globalThis.CropTarget,globalThis.EncodedAudioChunk,globalThis.EncodedVideoChunk,globalThis.FencedFrameConfig,globalThis.GPUCompilationInfo,globalThis.GPUCompilationMessage,globalThis.GPUPipelineError,globalThis.RTCEncodedAudioFrame,globalThis.RTCEncodedVideoFrame,globalThis.WebTransportError],ly={type:`clonable`,capableOnly:!0,isType:e=>Fh(e,sy)||Fh(e,cy),box:(e,t)=>e,revive:(e,t)=>e},uy=[globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.WritableStream,globalThis.TransformStream,globalThis.MediaStreamTrack,globalThis.RTCDataChannel],dy=[globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MIDIAccess,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream],fy={type:`transferable`,capableOnly:!0,isType:e=>Fh(e,uy)||Fh(e,dy),box:(e,t)=>e,revive:(e,t)=>e},py={type:`blob`,capableOnly:!0,isType:e=>typeof Blob<`u`&&e instanceof Blob,box:(e,t)=>{if(Kh(t.transport))throw TypeError(`osra: Blob is only supported on structured-clone transports, send an ArrayBuffer or Uint8Array instead`);return e},revive:(e,t)=>e},my=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},hy=[Mg,cv,ng,sg,fg,_g,Cg,__,w_,Yg,A_,V_,K_,Q_,rv,Tv,kv,Nv,Zv,Rv,ny,{type:`nonFiniteNumber`,isType:e=>typeof e==`number`&&!Number.isFinite(e),box:(e,t)=>Kh(t.transport)?{...Y,type:`nonFiniteNumber`,value:String(e)}:e,revive:(e,t)=>Number(e.value)},{type:`undefined`,isType:e=>e===void 0,box:(e,t)=>Kh(t.transport)?{...Y,type:`undefined`}:e,revive:(e,t)=>void 0},ly,fy,py,Uv,{type:`unclonable`,isType:e=>{if(typeof e!=`object`||!e||Array.isArray(e)||my(e))return!1;try{return structuredClone(e),!1}catch{return!0}},box:(e,t)=>({...Y,type:`unclonable`}),revive:(e,t)=>({})}],gy=(e,t)=>t.find(t=>t.isType(e)),_y=(e,t)=>t.find(t=>t.type===e.type),vy=e=>!!e&&typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype,yy=(e,t)=>Array.isArray(e)?e.map(e=>t(e)):vy(e)?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])):e,by=new WeakSet,xy=new WeakSet,Sy=e=>e!==null&&(typeof e==`object`||typeof e==`function`),Cy=(e,t)=>{if($h(e))return e;let n=Sy(e);if(n){if(by.has(e))throw TypeError(`osra: cannot serialize a circular structure - break the cycle or send the container by reference`);by.add(e)}try{let n=gy(e,t.revivableModules);return n?n.box(e,t):yy(e,e=>Cy(e,t))}finally{n&&by.delete(e)}},wy=(e,t)=>{let n=Sy(e);if(n){if(xy.has(e))throw TypeError(`osra: cannot revive a circular structure`);xy.add(e)}try{if($h(e)){let n=_y(e,t.revivableModules);if(n)return n.revive(e,t)}return yy(e,e=>wy(e,t))}finally{n&&xy.delete(e)}},Ty=dh({init:()=>Oy,startBidirectionalConnection:()=>Dy,type:()=>Ey}),Ey=`bidirectional`,Dy=({transport:e,value:t,remoteUuid:n,eventTarget:r,send:i,revivableModules:a})=>{let o={transport:e,remoteUuid:n,sendMessage:i,eventTarget:r,revivableModules:a};for(let e of a)e.init?.(o);let{promise:s,resolve:c}=Promise.withResolvers();return r.addEventListener(`message`,function e({detail:t}){t.type===`init`&&(c(t.data),r.removeEventListener(`message`,e))}),i({type:`init`,remoteUuid:n,data:Cy(t,o)}),{revivableContext:o,remoteValue:s.then(e=>wy(e,o))}},Oy=e=>{if(!(qh(e.transport)&&Jh(e.transport)))return;if(e.protocolEventTarget.addEventListener(`message`,({detail:{message:t,peer:n}})=>{if(t.type===`announce`){if(!t.remoteUuid){e.sendMessage({type:`announce`,remoteUuid:t.uuid});return}if(t.remoteUuid!==e.getUuid()||e.connectionContexts.has(t.uuid))return;e.sendMessage({type:`announce`,remoteUuid:t.uuid});let r=e.createConnectionEventTarget(),i={...n(),abort:()=>e.abortConnection(t.uuid)},a;try{let n=e.valueFor(i);if(e.claimPendingAbort(t.uuid)){e.sendMessage({type:`close`,remoteUuid:t.uuid});return}a=Dy({transport:e.transport,value:n,remoteUuid:t.uuid,eventTarget:r,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t.uuid}),e.rejectRemoteValue(n);return}let o={type:`bidirectional`,eventTarget:r,connection:a};e.connectionContexts.set(t.uuid,o),o.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}if(t.type===`close`){if(t.remoteUuid!==e.getUuid())return;let n=e.connectionContexts.get(t.uuid);if(!n)return;e.connectionContexts.delete(t.uuid),jg(n.connection.revivableContext),e.rejectRemoteValue(Error(`osra: peer closed the connection`));return}if(t.remoteUuid!==e.getUuid())return;let r=e.connectionContexts.get(t.uuid);r&&r.eventTarget.dispatchEvent(new CustomEvent(`message`,{detail:t}))}),e.presetRemoteUuid!==void 0){let t=e.presetRemoteUuid,n=e.createConnectionEventTarget(),r,i;try{i={abort:()=>e.abortConnection(t)};let a=e.valueFor(i);if(e.claimPendingAbort(t)){e.sendMessage({type:`close`,remoteUuid:t});return}r=Dy({transport:e.transport,value:a,remoteUuid:e.presetRemoteUuid,eventTarget:n,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t}),e.rejectRemoteValue(n);return}let a={type:`bidirectional`,eventTarget:n,connection:r};e.connectionContexts.set(e.presetRemoteUuid,a),a.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}let t=50,n,r=()=>{if(!(e.unregisterSignal?.aborted||e.connectionContexts.size>0)){try{e.sendMessage({type:`announce`},`*`)}catch{}n=setTimeout(r,t),t=Math.min(t*2,1e3)}};e.unregisterSignal?.addEventListener(`abort`,()=>clearTimeout(n),{once:!0}),r()},ky=()=>new EventTarget,Ay=e=>{let t=Qh(e),n=t?e.emit:e,r=t?e.receive:e;return{isJson:t&&`isJson`in e&&e.isJson!==void 0?e.isJson:n!==void 0&&Kh(n)||r!==void 0&&Kh(r),...n===void 0?{}:{emit:n},...r===void 0?{}:{receive:r}}},jy=e=>e?e(hy):hy,My=32,Ny=()=>{let e=[],t=new Set,n=!1,r=()=>({value:void 0,done:!0});return{push:r=>{if(!n){if(t.size===0){e.push(r),e.length>My&&e.shift();return}for(let e of t){let t=e.wake;if(t){e.wake=void 0,t({value:r,done:!1});continue}e.buffered.push(r)}}},close:()=>{n=!0;for(let e of t){let t=e.wake;e.wake=void 0,t?.(r())}},iterate:()=>{let i={buffered:[...e]};t.add(i);let a=!1;return{[Symbol.asyncIterator](){return this},next:()=>{if(a)return Promise.resolve(r());let e=i.buffered.shift();return e?Promise.resolve({value:e,done:!1}):n?Promise.resolve(r()):new Promise(e=>{i.wake=e})},return:()=>{a=!0,t.delete(i);let e=i.wake;return i.wake=void 0,e?.(r()),Promise.resolve(r())}}}}},Py=(e,t,n)=>{let r=e.then(n);r.catch(()=>{});let i=()=>{let e=t.iterate();return{[Symbol.asyncIterator](){return this},next:()=>e.next().then(e=>e.done?{value:void 0,done:!0}:{value:n(e.value),done:!1}),return:()=>e.return?.()??Promise.resolve({value:void 0,done:!0})}};return Object.assign(r,{[Symbol.asyncIterator]:i})},Fy=Symbol.for(`osra.context`),Iy=e=>typeof e==`object`&&!!e&&Fy in e,Ly=[Ty],Ry=(e,{transport:t,name:n,remoteName:r,key:i=ph,origin:a=`*`,unregisterSignal:o,revivableModules:s,uuid:c,remoteUuid:l,connection:u=({value:e})=>e})=>{let d=u,f=Ay(t);if(!(qh(f)&&Jh(f))){let e=Ny();e.close();let t=Promise.reject(Error(`osra: transport must be able to both emit and receive to establish a connection; pass a bidirectional platform transport or a custom { emit, receive } pair`));return t.catch(()=>{}),Py(t,e,d)}let p=jy(s),m=new Map,h=new Set,g=Ny(),{promise:_,resolve:v,reject:y}=Promise.withResolvers();_.catch(()=>{});let b=c??globalThis.crypto.randomUUID(),x=(e,t=a)=>{let r={[fh]:i,name:n,uuid:b,...e};bh(f,r,t,Wg(r))},S=(e,t)=>{o?.aborted||x(e,t)},C=ky(),w={transport:f,valueFor:t=>Iy(e)?e[Fy](t):e,revivableModules:p,connectionContexts:m,getUuid:()=>b,presetRemoteUuid:l,sendMessage:S,protocolEventTarget:C,rejectRemoteValue:y,abortConnection:e=>{let t=m.get(e);if(!t){h.add(e);return}m.delete(e),x({type:`close`,remoteUuid:e}),jg(t.connection.revivableContext),y(Error(`osra: connection aborted`))},claimPendingAbort:e=>h.delete(e),addConnection:(e,t)=>{let n={value:t,context:e};v(n),g.push(n)},createConnectionEventTarget:ky,unregisterSignal:o};if(yh({listener:(e,t)=>{e.uuid!==b&&C.dispatchEvent(new CustomEvent(`message`,{detail:{message:e,peer:()=>({...t.origin?{origin:t.origin}:{},...t.source?{source:t.source}:{},...t.port?{port:t.port}:{},...t.sender?{sender:t.sender}:{}})}}))},transport:f,remoteName:r,key:i,origin:a,unregisterSignal:o}),o?.aborted)return y(o.reason),g.close(),Py(_,g,d);o?.addEventListener(`abort`,()=>{for(let[e,t]of m)x({type:`close`,remoteUuid:e}),jg(t.connection.revivableContext);m.clear(),g.close(),y(o.reason)},{once:!0});for(let e of Ly)e.init(w);return Py(_,g,d)},zy=(e,t)=>Ry(e,t),By=e=>new Promise((t,n)=>{if(e.aborted)return n();e.addEventListener(`abort`,()=>{n()})}),Vy=async({publicPath:e,workerUrl:t,workerOptions:n,read:r,length:i,bufferSize:a,audioStreamIndex:o,transferReads:s=!0})=>{let c=new Worker(t,n),{makeRemuxer:l}=await zy({},{transport:c}),u=await l({publicPath:e,length:i,bufferSize:a,audioStreamIndex:o}),d=new lh({concurrency:1}),f=!1,p=(e,t)=>{f||!s||e.byteLength>0||t>=i||(f=!0,console.warn(`libav-wasm: read(${t}) returned 0 bytes, ${i-t} bytes before the end of the file. Reads are transferred, so the buffer read() returns is detached in the caller and handing back bytes you keep returns that same detached buffer. Return a copy, or pass transferReads: false.`))},m=e=>(t,n)=>e.signal.aborted?Promise.resolve({resolved:new Uint8Array().buffer,rejected:!0}):Promise.race([r(Number(t),Number(n)).then(e=>{p(e,Number(t));let n=new Uint8Array(e).buffer;return{resolved:s?Rg(n):n,rejected:!1}},()=>({resolved:new Uint8Array().buffer,rejected:!0})),By(e.signal).then(()=>({resolved:new Uint8Array().buffer,rejected:!0}),()=>({resolved:new Uint8Array().buffer,rejected:!0}))]),h=[];return{worker:c,remuxer:u,wasmRead:m,addTask:e=>{let t=[...h];h=[],d.clear(),t.forEach(e=>e.abort());let n=new AbortController;return h=[...h,n],Promise.race([d.add(async()=>e(n),{signal:n.signal}),By(n.signal).then(()=>Promise.reject(Error(`Cancelled`)),()=>Promise.reject(Error(`Cancelled`)))])},destroy:async()=>{let e=[...h];h=[],d.clear(),e.forEach(e=>e.abort()),await u.destroy(),c.terminate()}}},Hy=async e=>{let{worker:t,remuxer:n,wasmRead:r,addTask:i,destroy:a}=await Vy({...e,bufferSize:e.bufferSize??25e5});return{worker:t,init:()=>i(e=>n.init(r(e))),destroy:a,seek:e=>i(t=>n.seek(r(t),e)),read:()=>i(e=>n.read(r(e))),readKeyframe:e=>i(t=>n.readKeyframe(r(t),e)),setAudioStreamIndex:e=>n.setAudioStreamIndex(e)}},Uy=async e=>{let{worker:t,remuxer:n,wasmRead:r,addTask:i,destroy:a}=await Vy({...e,bufferSize:e.bufferSize??1e6});return{worker:t,init:()=>i(e=>n.initThumbnail(r(e))),readKeyframe:e=>i(t=>n.readKeyframe(r(t),e)),destroy:a}},Wy=typeof HTMLVideoElement<`u`?HTMLVideoElement.prototype:{},Gy=`getVideoPlaybackQuality`in Wy||`webkitDecodedFrameCount`in Wy||`mozPresentedFrames`in Wy||`mozPaintedFrames`in Wy;if(!(`requestVideoFrameCallback`in Wy)&&Gy&&typeof requestAnimationFrame==`function`){Wy._rvfcpolyfillmap={};let e=`getVideoPlaybackQuality`in Wy?e=>{let{totalFrameDelay:t,totalVideoFrames:n,droppedVideoFrames:r}=e.getVideoPlaybackQuality();return{presentedFrames:n-r,totalFrameDelay:t}}:e=>({presentedFrames:e.mozPresentedFrames||e.mozPaintedFrames||e.webkitDecodedFrameCount-(e.webkitDroppedFrameCount||0),totalFrameDelay:e.mozFrameDelay||0});Wy.requestVideoFrameCallback=function(t){let n=performance.now(),r=e(this),i=r.presentedFrames,a=(o,s)=>{let c=e(this),l=c.presentedFrames;if(l>i){let e=c.totalFrameDelay-r.totalFrameDelay||0,i=s-o;t(s,{presentationTime:s+e*1e3,expectedDisplayTime:s+i,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+i/1e3,presentedFrames:l,processingDuration:e}),delete this._rvfcpolyfillmap[n]}else this._rvfcpolyfillmap[n]=requestAnimationFrame(e=>a(s,e))};return this._rvfcpolyfillmap[n]=requestAnimationFrame(e=>a(n,e)),n},Wy.cancelVideoFrameCallback=function(e){cancelAnimationFrame(this._rvfcpolyfillmap[e]),delete this._rvfcpolyfillmap[e]}}var Ky={bt709:`BT709`,bt470bg:`BT601`,smpte170m:`BT601`},qy={BT601:{BT709:`1.0863 -0.0723 -0.014 0 0 0.0965 0.8451 0.0584 0 0 -0.0141 -0.0277 1.0418`},BT709:{BT601:`0.9137 0.0784 0.0079 0 0 -0.1049 1.1722 -0.0671 0 0 0.0096 0.0322 0.9582`},FCC:{BT709:`1.0873 -0.0736 -0.0137 0 0 0.0974 0.8494 0.0531 0 0 -0.0127 -0.0251 1.0378`,BT601:`1.001 -0.0008 -0.0002 0 0 0.0009 1.005 -0.006 0 0 0.0013 0.0027 0.996`},SMPTE240M:{BT709:`0.9993 0.0006 0.0001 0 0 -0.0004 0.9812 0.0192 0 0 -0.0034 -0.0114 1.0148`,BT601:`0.913 0.0774 0.0096 0 0 -0.1051 1.1508 -0.0456 0 0 0.0063 0.0207 0.973`}},Jy=class e extends EventTarget{constructor(t){if(super(),!globalThis.Worker)throw this.destroy(`Worker not supported`);if(!t)throw this.destroy(`No options provided`);this._loaded=new Promise(e=>{this._init=e});let n=e._test();if(this._onDemandRender=`requestVideoFrameCallback`in HTMLVideoElement.prototype&&(t.onDemandRender??!0),this._offscreenRender=`transferControlToOffscreen`in HTMLCanvasElement.prototype&&!t.canvas&&(t.offscreenRender??!0),this.timeOffset=t.timeOffset||0,this._video=t.video,this._videoHeight=0,this._videoWidth=0,this._videoColorSpace=null,this._canvas=t.canvas,this._video&&!this._canvas)this._canvasParent=document.createElement(`div`),this._canvasParent.className=`JASSUB`,this._canvasParent.style.position=`relative`,this._canvas=this._createCanvas(),this._video.insertAdjacentElement(`afterend`,this._canvasParent);else if(!this._canvas)throw this.destroy(`Don't know where to render: you should give video or canvas in options.`);if(this._bufferCanvas=document.createElement(`canvas`),this._bufferCtx=this._bufferCanvas.getContext(`2d`),!this._bufferCtx)throw this.destroy(`Canvas rendering not supported`);this._canvasctrl=this._offscreenRender?this._canvas.transferControlToOffscreen():this._canvas,this._ctx=!this._offscreenRender&&this._canvasctrl.getContext(`2d`),this._lastRenderTime=0,this.debug=!!t.debug,this.prescaleFactor=t.prescaleFactor||1,this.prescaleHeightLimit=t.prescaleHeightLimit||1080,this.maxRenderHeight=t.maxRenderHeight||0,this._boundResize=this.resize.bind(this),this._boundTimeUpdate=this._timeupdate.bind(this),this._boundSetRate=this.setRate.bind(this),this._boundUpdateColorSpace=this._updateColorSpace.bind(this),this._video&&this.setVideo(t.video),this._onDemandRender&&(this.busy=!1,this._lastDemandTime=null),this._worker=new Worker(t.workerUrl||`jassub-worker.js`),this._worker.onmessage=e=>this._onmessage(e),this._worker.onerror=e=>this._error(e),n.then(()=>{this._worker.postMessage({target:`init`,wasmUrl:e._supportsSIMD&&t.modernWasmUrl?t.modernWasmUrl:t.wasmUrl??`jassub-worker.wasm`,legacyWasmUrl:t.legacyWasmUrl??`jassub-worker.wasm.js`,asyncRender:typeof createImageBitmap<`u`&&(t.asyncRender??!0),onDemandRender:this._onDemandRender,width:this._canvasctrl.width||0,height:this._canvasctrl.height||0,blendMode:t.blendMode||`js`,subUrl:t.subUrl,subContent:t.subContent||null,fonts:t.fonts||[],availableFonts:t.availableFonts||{"liberation sans":`./default.woff2`},fallbackFont:t.fallbackFont||`liberation sans`,debug:this.debug,targetFps:t.targetFps||24,dropAllAnimations:t.dropAllAnimations,dropAllBlur:t.dropAllBlur,libassMemoryLimit:t.libassMemoryLimit||0,libassGlyphLimit:t.libassGlyphLimit||0,useLocalFonts:typeof queryLocalFonts<`u`&&(t.useLocalFonts??!0),hasBitmapBug:e._hasBitmapBug}),this._offscreenRender===!0&&this.sendMessage(`offscreenCanvas`,null,[this._canvasctrl])})}_createCanvas(){return this._canvas=document.createElement(`canvas`),this._canvas.style.display=`block`,this._canvas.style.position=`absolute`,this._canvas.style.pointerEvents=`none`,this._canvasParent.appendChild(this._canvas),this._canvas}static _supportsSIMD=null;static _hasAlphaBug=null;static _hasBitmapBug=null;static _testSIMD(){if(e._supportsSIMD===null)try{e._supportsSIMD=WebAssembly.validate(Uint8Array.of(0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11))}catch{e._supportsSIMD=!1}}static async _testImageBugs(){if(e._hasBitmapBug!==null)return;let t=document.createElement(`canvas`),n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)throw Error(`Canvas rendering not supported`);if(typeof ImageData.prototype.constructor==`function`)try{new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1)}catch{console.log(`Detected that ImageData is not constructable despite browser saying so`),self.ImageData=function(e,t,r){let i=n.createImageData(t,r);return e&&i.data.set(e),i}}let r=document.createElement(`canvas`),i=r.getContext(`2d`,{willReadFrequently:!0});if(!i)throw Error(`Canvas rendering not supported`);t.width=r.width=1,t.height=r.height=1,n.clearRect(0,0,1,1),i.clearRect(0,0,1,1);let a=i.getImageData(0,0,1,1).data;n.putImageData(new ImageData(new Uint8ClampedArray([0,255,0,0]),1,1),0,0),i.drawImage(t,0,0);let o=i.getImageData(0,0,1,1).data;if(e._hasAlphaBug=a[1]!==o[1],e._hasAlphaBug&&console.log(`Detected a browser having issue with transparent pixels, applying workaround`),typeof createImageBitmap<`u`){let t=new Uint8ClampedArray([255,0,255,0,255]).subarray(1,5);i.drawImage(await createImageBitmap(new ImageData(t,1)),0,0);let{data:n}=i.getImageData(0,0,1,1);e._hasBitmapBug=!1;for(let[r,i]of n.entries())if(Math.abs(t[r]-i)>15){e._hasBitmapBug=!0,console.log(`Detected a browser having issue with partial bitmaps, applying workaround`);break}}else e._hasBitmapBug=!1;t.remove(),r.remove()}static async _test(){e._testSIMD(),await e._testImageBugs()}resize(e=0,t=0,n=0,r=0,i=this._video?.paused){if((!e||!t)&&this._video){let i=this._getVideoPosition(),a=null;if(this._videoWidth){let e=this._video.videoWidth/this._videoWidth,t=this._video.videoHeight/this._videoHeight;a=this._computeCanvasSize((i.width||0)/e,(i.height||0)/t)}else a=this._computeCanvasSize(i.width||0,i.height||0);e=a.width,t=a.height,this._canvasParent&&(n=i.y-(this._canvasParent.getBoundingClientRect().top-this._video.getBoundingClientRect().top),r=i.x),this._canvas.style.width=i.width+`px`,this._canvas.style.height=i.height+`px`}this._canvas.style.top=n+`px`,this._canvas.style.left=r+`px`,i&&this.busy===!1?this.busy=!0:i=!1,this.sendMessage(`canvas`,{width:e,height:t,videoWidth:this._videoWidth||this._video.videoWidth,videoHeight:this._videoHeight||this._video.videoHeight,force:i})}_getVideoPosition(e=this._video.videoWidth,t=this._video.videoHeight){let n=e/t,{offsetWidth:r,offsetHeight:i}=this._video,a=r/i;e=r,t=i,a>n?e=Math.floor(i*n):t=Math.floor(r/n);let o=(r-e)/2,s=(i-t)/2;return{width:e,height:t,x:o,y:s}}_computeCanvasSize(e=0,t=0){let n=this.prescaleFactor<=0?1:this.prescaleFactor,r=self.devicePixelRatio||1;if(t<=0||e<=0)e=0,t=0;else{let i=n<1?-1:1,a=t*r;i*a*n<=i*this.prescaleHeightLimit?a*=n:i*a<i*this.prescaleHeightLimit&&(a=this.prescaleHeightLimit),this.maxRenderHeight>0&&a>this.maxRenderHeight&&(a=this.maxRenderHeight),e*=a/t,t=a}return{width:e,height:t}}_timeupdate({type:e}){let t={seeking:!0,waiting:!0,playing:!1}[e];t!=null&&(this._playstate=t),this.setCurrentTime(this._video.paused||this._playstate,this._video.currentTime+this.timeOffset)}setVideo(e){e instanceof HTMLVideoElement?(this._removeListeners(),this._video=e,this._onDemandRender?this._video.requestVideoFrameCallback(this._handleRVFC.bind(this)):(this._playstate=e.paused,e.addEventListener(`timeupdate`,this._boundTimeUpdate,!1),e.addEventListener(`progress`,this._boundTimeUpdate,!1),e.addEventListener(`waiting`,this._boundTimeUpdate,!1),e.addEventListener(`seeking`,this._boundTimeUpdate,!1),e.addEventListener(`playing`,this._boundTimeUpdate,!1),e.addEventListener(`ratechange`,this._boundSetRate,!1),e.addEventListener(`resize`,this._boundResize,!1)),`VideoFrame`in window&&(e.addEventListener(`loadedmetadata`,this._boundUpdateColorSpace,!1),e.readyState>2&&this._updateColorSpace()),e.videoWidth>0&&this.resize(),typeof ResizeObserver<`u`&&(this._ro||=new ResizeObserver(()=>this.resize()),this._ro.observe(e))):this._error(`Video element invalid!`)}runBenchmark(){this.sendMessage(`runBenchmark`)}setTrackByUrl(e){this.sendMessage(`setTrackByUrl`,{url:e}),this._reAttachOffscreen(),this._ctx&&(this._ctx.filter=`none`)}setTrack(e){this.sendMessage(`setTrack`,{content:e}),this._reAttachOffscreen(),this._ctx&&(this._ctx.filter=`none`)}freeTrack(){this.sendMessage(`freeTrack`)}setIsPaused(e){this.sendMessage(`video`,{isPaused:e})}setRate(e){this.sendMessage(`video`,{rate:e})}setCurrentTime(e,t,n){this.sendMessage(`video`,{isPaused:e,currentTime:t,rate:n,colorSpace:this._videoColorSpace})}createEvent(e){this.sendMessage(`createEvent`,{event:e})}setEvent(e,t){this.sendMessage(`setEvent`,{event:e,index:t})}removeEvent(e){this.sendMessage(`removeEvent`,{index:e})}getEvents(e){this._fetchFromWorker({target:`getEvents`},(t,{events:n})=>{e(t,n)})}styleOverride(e){this.sendMessage(`styleOverride`,{style:e})}disableStyleOverride(){this.sendMessage(`disableStyleOverride`)}createStyle(e){this.sendMessage(`createStyle`,{style:e})}setStyle(e,t){this.sendMessage(`setStyle`,{style:e,index:t})}removeStyle(e){this.sendMessage(`removeStyle`,{index:e})}getStyles(e){this._fetchFromWorker({target:`getStyles`},(t,{styles:n})=>{e(t,n)})}addFont(e){this.sendMessage(`addFont`,{font:e})}setDefaultFont(e){this.sendMessage(`defaultFont`,{font:e})}_sendLocalFont(e){try{queryLocalFonts().then(t=>{let n=t?.find(t=>t.fullName.toLowerCase()===e);n&&n.blob().then(e=>{e.arrayBuffer().then(e=>{this.addFont(new Uint8Array(e))})})})}catch(e){console.warn(`Local fonts API:`,e)}}_getLocalFont({font:e}){try{navigator?.permissions?.query?navigator.permissions.query({name:`local-fonts`}).then(t=>{t.state===`granted`&&this._sendLocalFont(e)}):this._sendLocalFont(e)}catch(e){console.warn(`Local fonts API:`,e)}}_unbusy(){this._lastDemandTime?this._demandRender(this._lastDemandTime):this.busy=!1}_handleRVFC(e,{mediaTime:t,width:n,height:r}){if(this._destroyed)return null;this.busy?this._lastDemandTime={mediaTime:t,width:n,height:r}:(this.busy=!0,this._demandRender({mediaTime:t,width:n,height:r})),this._video.requestVideoFrameCallback(this._handleRVFC.bind(this))}_demandRender({mediaTime:e,width:t,height:n}){this._lastDemandTime=null,(t!==this._videoWidth||n!==this._videoHeight)&&(this._videoWidth=t,this._videoHeight=n,this.resize()),this.sendMessage(`demand`,{time:e+this.timeOffset})}_detachOffscreen(){if(!this._offscreenRender||this._ctx)return null;this._canvas.remove(),this._createCanvas(),this._canvasctrl=this._canvas,this._ctx=this._canvasctrl.getContext(`2d`),this.sendMessage(`detachOffscreen`),this.busy=!1,this.resize(0,0,0,0,!0)}_reAttachOffscreen(){if(!this._offscreenRender||!this._ctx)return null;this._canvas.remove(),this._createCanvas(),this._canvasctrl=this._canvas.transferControlToOffscreen(),this._ctx=!1,this.sendMessage(`offscreenCanvas`,null,[this._canvasctrl]),this.resize(0,0,0,0,!0)}_updateColorSpace(){this._video.requestVideoFrameCallback(()=>{try{let e=new VideoFrame(this._video);this._videoColorSpace=Ky[e.colorSpace.matrix],e.close(),this.sendMessage(`getColorSpace`)}catch(e){console.warn(e)}})}_verifyColorSpace({subtitleColorSpace:e,videoColorSpace:t=this._videoColorSpace}){!e||!t||e!==t&&(this._detachOffscreen(),this._ctx.filter=`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='f'><feColorMatrix type='matrix' values='${qy[e][t]} 0 0 0 0 0 1 0'/></filter></svg>#f")`)}_render({images:e,asyncRender:t,times:n,width:r,height:i,colorSpace:a}){this._unbusy(),this.debug&&(n.IPCTime=Date.now()-n.JSRenderTime),(this._canvasctrl.width!==r||this._canvasctrl.height!==i)&&(this._canvasctrl.width=r,this._canvasctrl.height=i,this._verifyColorSpace({subtitleColorSpace:a})),this._ctx.clearRect(0,0,this._canvasctrl.width,this._canvasctrl.height);for(let n of e)n.image&&(t?(this._ctx.drawImage(n.image,n.x,n.y),n.image.close()):(this._bufferCanvas.width=n.w,this._bufferCanvas.height=n.h,this._bufferCtx.putImageData(new ImageData(this._fixAlpha(new Uint8ClampedArray(n.image)),n.w,n.h),0,0),this._ctx.drawImage(this._bufferCanvas,n.x,n.y)));if(this.debug){n.JSRenderTime=Date.now()-n.JSRenderTime-n.IPCTime;let t=0,r=n.bitmaps||e.length;delete n.bitmaps;for(let e in n)t+=n[e];console.log(`Bitmaps: `+r+` Total: `+(t|0)+`ms`,n)}}_fixAlpha(t){if(e._hasAlphaBug)for(let e=3;e<t.length;e+=4)t[e]=t[e]>1?t[e]:1;return t}_ready(){this._init(),this.dispatchEvent(new CustomEvent(`ready`))}async sendMessage(e,t={},n){await this._loaded,n?this._worker.postMessage({target:e,transferable:n,...t},[...n]):this._worker.postMessage({target:e,...t})}_fetchFromWorker(e,t){try{let n=e.target,r=setTimeout(()=>{a(Error(`Error: Timeout while try to fetch `+n))},5e3),i=({data:e})=>{e.target===n&&(t(null,e),this._worker.removeEventListener(`message`,i),this._worker.removeEventListener(`error`,a),clearTimeout(r))},a=e=>{t(e),this._worker.removeEventListener(`message`,i),this._worker.removeEventListener(`error`,a),clearTimeout(r)};this._worker.addEventListener(`message`,i),this._worker.addEventListener(`error`,a),this._worker.postMessage(e)}catch(e){this._error(e)}}_console({content:e,command:t}){console[t].apply(console,JSON.parse(e))}_onmessage({data:e}){this[`_`+e.target]&&this[`_`+e.target](e)}_error(e){let t=e instanceof Error?e:e instanceof ErrorEvent?e.error:Error(e),n=e instanceof Event?new ErrorEvent(e.type,e):new ErrorEvent(`error`,{error:t});return this.dispatchEvent(n),console.error(t),t}_removeListeners(){this._video&&(this._ro&&this._ro.unobserve(this._video),this._ctx&&(this._ctx.filter=`none`),this._video.removeEventListener(`timeupdate`,this._boundTimeUpdate),this._video.removeEventListener(`progress`,this._boundTimeUpdate),this._video.removeEventListener(`waiting`,this._boundTimeUpdate),this._video.removeEventListener(`seeking`,this._boundTimeUpdate),this._video.removeEventListener(`playing`,this._boundTimeUpdate),this._video.removeEventListener(`ratechange`,this._boundSetRate),this._video.removeEventListener(`resize`,this._boundResize),this._video.removeEventListener(`loadedmetadata`,this._boundUpdateColorSpace))}destroy(e){return e&&=this._error(e),this._video&&this._canvasParent&&this._video.parentNode?.removeChild(this._canvasParent),this._destroyed=!0,this._removeListeners(),this.sendMessage(`destroy`),this._worker?.terminate(),e}};function Yy(e){var t=e.toLowerCase().trim().split(/\s*;\s*/);return t[0]===`banner`?{name:t[0],delay:t[1]*1||0,leftToRight:t[2]*1||0,fadeAwayWidth:t[3]*1||0}:/^scroll\s/.test(t[0])?{name:t[0],y1:Math.min(t[1]*1,t[2]*1),y2:Math.max(t[1]*1,t[2]*1),delay:t[3]*1||0,fadeAwayHeight:t[4]*1||0}:e===``?null:{name:e}}function Xy(e){return e?e.toLowerCase().replace(/([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/g,` $1 `).replace(/([mnlbspc])/g,` $1 `).trim().replace(/\s+/g,` `).split(/\s(?=[mnlbspc])/).map(function(e){return e.split(` `).filter(function(e,t){return!(t&&isNaN(e*1))})}):[]}var Zy=`b.i.u.s.fsp.k.K.kf.ko.kt.fe.q.p.pbo.a.an.fscx.fscy.fax.fay.frx.fry.frz.fr.be.blur.bord.xbord.ybord.shad.xshad.yshad`.split(`.`).map(function(e){return{name:e,regex:RegExp(`^`+e+`-?\\d`)}});function Qy(e){for(var t,n={},r=0;r<Zy.length;r++){var i=Zy[r],a=i.name;if(i.regex.test(e))return n[a]=e.slice(a.length)*1,n}if(/^fn/.test(e))n.fn=e.slice(2);else if(/^r/.test(e))n.r=e.slice(1);else if(/^fs[\d+-]/.test(e))n.fs=e.slice(2);else if(/^\d?c&?H?[0-9a-fA-F]+|^\d?c$/.test(e)){var o=e.match(/^(\d?)c&?H?(\w*)/),s=o[1],c=o[2];n[`c`+(s||1)]=c&&(`000000`+c).slice(-6)}else if(/^\da&?H?[0-9a-fA-F]+/.test(e)){var l=e.match(/^(\d)a&?H?([0-9a-f]+)/i),u=l[1],d=l[2];n[`a`+u]=(`00`+d).slice(-2)}else if(/^alpha&?H?[0-9a-fA-F]+/.test(e))t=e.match(/^alpha&?H?([0-9a-f]+)/i),n.alpha=t[1],n.alpha=(`00`+n.alpha).slice(-2);else if(/^(?:pos|org|move|fad|fade)\([^)]+/.test(e)){var f=e.match(/^(\w+)\((.*?)\)?$/),p=f[1];n[p]=f[2].trim().split(/\s*,\s*/).map(Number)}else if(/^i?clip\([^)]+/.test(e)){var m=e.match(/^i?clip\((.*?)\)?$/)[1].trim().split(/\s*,\s*/);n.clip={inverse:/iclip/.test(e),scale:1,drawing:null,dots:null},m.length===1&&(n.clip.drawing=Xy(m[0])),m.length===2&&(n.clip.scale=m[0]*1,n.clip.drawing=Xy(m[1])),m.length===4&&(n.clip.dots=m.map(Number))}else if(/^t\(/.test(e)){var h=e.match(/^t\((.*?)\)?$/)[1].trim().replace(/\\.*/,function(e){return e.replace(/,/g,`
|
|
72
|
-
`)}).split(/\s*,\s*/);if(!h[0])return n;n.t={t1:0,t2:0,accel:1,tags:h[h.length-1].replace(/\n/g,`,`).split(`\\`).slice(1).map(Qy)},h.length===2&&(n.t.accel=h[0]*1),h.length===3&&(n.t.t1=h[0]*1,n.t.t2=h[1]*1),h.length===4&&(n.t.t1=h[0]*1,n.t.t2=h[1]*1,n.t.accel=h[2]*1)}return n}function $y(e){for(var t=[],n=0,r=``,i=e.split(`\\`).slice(1).concat(``).join(`\\`),a=0;a<i.length;a++){var o=i[a];o===`(`&&n++,o===`)`&&n--,n<0&&(n=0),!n&&o===`\\`?(r&&t.push(r),r=``):r+=o}return t.map(Qy)}function eb(e){var t=e.split(/{(.*?)}/),n=[];t[0].length&&n.push({tags:[],text:t[0],drawing:[]});for(var r=1;r<t.length;r+=2){var i=$y(t[r]),a=i.reduce(function(e,t){return t.p===void 0?e:!!t.p},!1);n.push({tags:i,text:a?``:t[r+1],drawing:a?Xy(t[r+1]):[]})}return{raw:e,combined:n.map(function(e){return e.text}).join(``),parsed:n}}function tb(e){var t=e.split(`:`);return t[0]*3600+t[1]*60+t[2]*1}function nb(e,t){var n=e.split(`,`);if(n.length>t.length){var r=n.slice(t.length-1).join();n=n.slice(0,t.length-1),n.push(r)}for(var i={},a=0;a<n.length;a++){var o=t[a],s=n[a].trim();switch(o){case`Layer`:case`MarginL`:case`MarginR`:case`MarginV`:i[o]=s*1;break;case`Start`:case`End`:i[o]=tb(s);break;case`Effect`:i[o]=Yy(s);break;case`Text`:i[o]=eb(s);break;default:i[o]=s}}return i}var rb=[`Name`,`Fontname`,`Fontsize`,`PrimaryColour`,`SecondaryColour`,`OutlineColour`,`BackColour`,`Bold`,`Italic`,`Underline`,`StrikeOut`,`ScaleX`,`ScaleY`,`Spacing`,`Angle`,`BorderStyle`,`Outline`,`Shadow`,`Alignment`,`MarginL`,`MarginR`,`MarginV`,`Encoding`],ib=[`Layer`,`Start`,`End`,`Style`,`Name`,`MarginL`,`MarginR`,`MarginV`,`Effect`,`Text`];function ab(e){var t=rb.concat(ib);return e.match(/Format\s*:\s*(.*)/i)[1].split(/\s*,\s*/).map(function(e){return t.find(function(t){return t.toLowerCase()===e.toLowerCase()})||e})}function ob(e,t){var n=e.match(/Style\s*:\s*(.*)/i)[1].split(/\s*,\s*/);return Object.assign.apply(Object,[{}].concat(t.map(function(e,t){var r;return r={},r[e]=n[t],r})))}function sb(e){for(var t={info:{},styles:{format:[],style:[]},events:{format:[],comment:[],dialogue:[]}},n=e.split(/\r?\n/),r=0,i=0;i<n.length;i++){var a=n[i].trim();if(!/^;/.test(a)&&(/^\[Script Info\]/i.test(a)?r=1:/^\[V4\+? Styles\]/i.test(a)?r=2:/^\[Events\]/i.test(a)?r=3:/^\[.*\]/.test(a)&&(r=0),r!==0)){if(r===1&&/:/.test(a)){var o=a.match(/(.*?)\s*:\s*(.*)/),s=o[1],c=o[2];t.info[s]=c}if(r===2&&(/^Format\s*:/i.test(a)&&(t.styles.format=ab(a)),/^Style\s*:/i.test(a)&&t.styles.style.push(ob(a,t.styles.format))),r===3&&(/^Format\s*:/i.test(a)&&(t.events.format=ab(a)),/^(?:Comment|Dialogue)\s*:/i.test(a))){var l=a.match(/^(\w+?)\s*:\s*(.*)/i),u=l[1],d=l[2];t.events[u.toLowerCase()].push(nb(d,t.events.format))}}}return t}var cb={M:`m`,L:`l`,C:`b`};function lb(e){return e.instructions.map(function(e){var t,n=e.type,r=e.points;return(t=[cb[n]]).concat.apply(t,r.map(function(e){return[e.x,e.y]})).join(` `)}).join(` `)}var ub=function(e){return function(t){return function(n){return``+t+e+`&H`+n+`&`}}},db=ub(`c`),fb=ub(`a`),pb={c1:db(1),c2:db(2),c3:db(3),c4:db(4),a1:fb(1),a2:fb(2),a3:fb(3),a4:fb(4),pos:function(e){return`pos(`+[e.x,e.y]+`)`},org:function(e){return`org(`+[e.x,e.y]+`)`},move:function(e){return`move(`+[e.x1,e.y1,e.x2,e.y2,e.t1,e.t2]+`)`},fade:function(e){return e.type===`fad`?`fad(`+[e.t1,e.t2]+`)`:`fade(`+[e.a1,e.a2,e.a3,e.t1,e.t2,e.t3,e.t4]+`)`},clip:function(e){return(e.inverse?`i`:``)+`clip(`+(e.dots?``+[e.dots.x1,e.dots.y1,e.dots.x2,e.dots.y2]:(e.scale===1?``:e.scale+`,`)+lb(e.drawing))+`)`},t:function(e){return e.map(function(e){return`t(`+[e.t1,e.t2,e.accel,mb(e.tag)]+`)`}).join(`\\`)}};function mb(e){return Object.keys(e).map(function(t){return`\\`+(pb[t]||(function(e){return``+t+e}))(e[t])}).join(``)}var hb=e=>Array(e.buffered.length).fill(void 0).map((t,n)=>({index:n,start:e.buffered.start(n),end:e.buffered.end(n)})),gb=e=>new Promise((t,n)=>{let r=()=>{e.removeEventListener(`updateend`,i),e.removeEventListener(`abort`,i),e.removeEventListener(`error`,a)},i=()=>{r(),t()},a=e=>{r(),n(Error(`The browser rejected a media segment`,{cause:e}))};e.addEventListener(`updateend`,i,{once:!0}),e.addEventListener(`abort`,i,{once:!0}),e.addEventListener(`error`,a,{once:!0})}),_b=(e,t)=>{let n=Promise.resolve(),r=e=>{let t=n.then(e,e);return n=t.catch(()=>{}),t};return{appendBuffer:t=>r(()=>(e.appendBuffer(t),gb(e))),unbufferRange:(t,n)=>r(()=>t>=n?Promise.resolve():(e.remove(t,n),gb(e))),updateTimestampOffset:t=>r(async()=>{e.timestampOffset=t}),endOfStream:()=>r(async()=>{if(!(t.readyState!==`open`||e.updating))try{t.endOfStream()}catch{}})}},vb=(e,t)=>e.createEvent(t),yb=e=>e===void 0?void 0:new URL(e,document.baseURI).toString(),bb=e=>new Date(e).toISOString().slice(11,22),xb=1,Sb=e=>new Map(sb(e).styles.style.map((e,t)=>[e.Name,t+xb])),Cb=(e,t)=>{let n=t.replace(/^\*+/,``),r=n.toLowerCase()==="default"?`Default`:n;return e.styles.get(r)??e.styles.get(`Default`)??0},wb=e=>{let t=e.content.match(/\r?\n\[Events\]\r?\nFormat: (.*)/)?.[0];return t?{type:`header`,streamIndex:e.streamIndex,content:e.content,eventsContent:t,styles:Sb(e.content)}:(console.warn(`subtitle stream ${e.streamIndex} has no Events format, ignoring the track`),null)},Tb=(e,t)=>{let[n,r]=t.content.split(`,`),i=Number(n),a=`Dialogue: ${r},${bb(t.start)},${bb(t.end)},${t.content.replace(`${i},${r},`,``)}`,o=sb(`${e.eventsContent}\r\n${a}`).events.dialogue[0];if(!o)throw Error(`dialogue event is undefined`);return{type:`dialogue`,streamIndex:t.streamIndex,index:i,assEvent:{...o,Style:Cb(e,o.Style),Effect:o.Effect??``,Text:o.Text.raw,Duration:(o.End-o.Start)*1e3,Start:o.Start*1e3,End:o.End*1e3,ReadOrder:i,_index:i}}},Eb=e=>{let{video:t,canvas:n,workerUrl:r}=e,i=yb(e.wasmUrl),a=yb(e.legacyWasmUrl),o=yb(e.defaultFontUrl),s,c=[],l=new Map,u=[],d=new Map,f,p=e.onStreams,m=setInterval(()=>{s?.setCurrentTime(t.paused,t.currentTime,t.playbackRate)},100),h=()=>s?.setRate(t.playbackRate),g=e=>{s=new Jy({onDemandRender:!1,video:t,canvas:n,subContent:e.content,workerUrl:r,modernWasmUrl:i,...a?{wasmUrl:a}:{},fonts:c.map(([,e])=>e),availableFonts:{...Object.fromEntries(c),...o?{"liberation sans":o}:{}}}),t.removeEventListener(`ratechange`,s._boundSetRate),t.addEventListener(`ratechange`,h)};return{pushAttachments:e=>{c=[...c,...e.map(e=>[e.filename,new Uint8Array(e.data)])]},pushFragments:e=>{for(let t of e)if(t.type===`header`){if(l.has(t.streamIndex))continue;let e=wb(t);if(!e)continue;l.set(t.streamIndex,e),u.push({streamIndex:t.streamIndex,title:t.title,language:t.language}),p?.([...u]),f===void 0&&(f=t.streamIndex),s||g(e)}else{let e=l.get(t.streamIndex);if(!e)continue;let n=d.get(t.streamIndex);n||(n=new Map,d.set(t.streamIndex,n));let r=Tb(e,t);if(n.has(r.index))continue;n.set(r.index,r),f===t.streamIndex&&s&&vb(s,r.assEvent)}},selectStream:e=>{let n=e??-1;if(n===f||!s)return;f=n,s.freeTrack();let r=l.get(n);if(r){s.setTrack(r.content);for(let e of d.get(n)?.values()??[])vb(s,e.assEvent);s.setCurrentTime(t.paused,t.currentTime,t.playbackRate)}},getStreams:()=>[...u],getSelectedStream:()=>f,setOnStreams:e=>{p=e},destroy:()=>{clearInterval(m),t.removeEventListener(`ratechange`,h),s?.destroy(),s=void 0}}},Db=class extends Error{mediaElement=!0;constructor(e,t){super(e,t),this.name=`MediaElementError`}},Ob=e=>!!e&&typeof e==`object`&&e.mediaElement===!0,kb=-20,Ab=60,jb=30,Mb=-5,Nb=20,Pb=5,Fb=15e3,Ib=1,Lb=3,Rb=12,zb=200,Bb=250,Vb=25e5,Hb=e=>{let{worker:t}=e,n=setTimeout(()=>t.terminate(),2e3);e.destroy().catch(()=>{}).finally(()=>{clearTimeout(n),t.terminate()})},Ub=async e=>{let{videoElement:t,canvasElement:n,read:r,length:i,publicPath:a,libavWorkerUrl:o,jassubWorkerUrl:s,jassubWasmUrl:c,jassubLegacyWasmUrl:l,defaultFontUrl:u,bufferSize:d=Vb,audioStreamIndex:f,onReady:p,onError:m,onRecovered:h,onSeek:g,onSubtitleStreams:_,onAudioStreams:v}=e,y=await Hy({publicPath:a,workerUrl:o,workerOptions:{type:`module`},bufferSize:d,length:i,audioStreamIndex:f,read:r}),b=[],x=!1,S=()=>{if(!x){x=!0;for(let e of[...b].reverse())try{e()}catch{}}};b.push(()=>Hb(y));try{let e=await y.init(),r=e.audioStreams??[],i=r.some(e=>e.streamIndex===f)?f:r[0]?.streamIndex??-1;v?.(r,i);let a=Eb({video:t,canvas:n,workerUrl:s,wasmUrl:c,legacyWasmUrl:l,defaultFontUrl:u,onStreams:_});if(b.push(()=>a.destroy()),e.attachments?.length&&a.pushAttachments(e.attachments),!e.info.output.videoMimeType)throw Error(`The video codec in this file could not be identified`);let o=[e.info.output.videoMimeType,e.info.output.audioMimeType].filter(Boolean).join(`,`),d=`video/mp4; codecs="${o}"`;if(!MediaSource.isTypeSupported(d))throw Error(`This browser cannot play the codecs in this file: ${o}`);let C=new MediaSource,w=URL.createObjectURL(C);b.push(()=>URL.revokeObjectURL(w)),t.src=w,b.push(()=>{try{t.pause()}catch{}t.removeAttribute(`src`),t.load()});let T=await new Promise((t,n)=>{let r=setTimeout(()=>{i(),n(Error(`The MediaSource never opened`))},Fb),i=()=>{clearTimeout(r),C.removeEventListener(`sourceopen`,a),C.removeEventListener(`sourceclose`,o),C.removeEventListener(`error`,o)},a=()=>{try{let n=C.addSourceBuffer(d);n.mode=`segments`;let r=e.info.input.duration;Number.isFinite(r)&&r>0&&(C.duration=r),i(),t(n)}catch(e){i(),n(e)}},o=()=>{i(),n(Error(`The MediaSource closed before a SourceBuffer could be created`))};C.addEventListener(`sourceopen`,a,{once:!0}),C.addEventListener(`sourceclose`,o,{once:!0}),C.addEventListener(`error`,o,{once:!0})}),{appendBuffer:E,unbufferRange:D,updateTimestampOffset:O,endOfStream:k}=_b(T,C);await E(e.data),e.subtitles?.length&&a.pushFragments(e.subtitles),p?.();let A=!1,j=!1,M=0,N,P=()=>N??t.currentTime,F=!1,ee=0,I=0,L=null,R=0,z=0,te=!1,ne=0,re=(e,t,n=!1)=>{let r=e?.message===`Cancelled`;t&&r||(console.error(e),!(te&&!n)&&(te=!0,m?.(r?Error(`Reading the video file failed`,{cause:e}):e)))},B=async(e=!1)=>{if(M>0&&!e)return;let n=t.currentTime,r=e?Mb:kb,i=e?Nb:Ab;for(let{start:e,end:t}of hb(T))e<n+r&&await D(e,n+r),t>n+i&&await D(n+i,t)},ie=()=>{let e=hb(T);if(!e.length)return!0;let t=P(),n=e.find(e=>e.start<=t+Ib&&t<e.end);return n&&n.end>=t+Ab?!1:!n||n.end<t+jb},ae=()=>{let e=t.currentTime;return hb(T).find(t=>t.start<=e+Ib&&e<t.end)},oe=()=>{let e=ae();return!!e&&e.end>=z-.1},se=()=>{let e=hb(T).map(e=>e.end);e.length&&(z=Math.max(z,...e))},ce=async e=>{j=!0,L=null,R=0,ne=e;let t=++I;try{let{data:n,pts:r,subtitles:i,finished:o}=await y.seek(e);if(x||t!==I||(o&&(F=!0),i?.length&&a.pushFragments(i),await O(r),x||t!==I))return;n.byteLength&&(await E(n),se())}catch(e){re(e,x||t!==I)}finally{t===I&&(j=!1)}},le=async()=>{let e=L;if(e)try{await E(e),se(),L===e&&(L=null,R=0)}catch(n){if(L!==e)return;if(n?.name===`QuotaExceededError`){let n=await B(!0).then(()=>!0,()=>!1);if(L!==e)return;if(n){F=!1,await ce(ae()?.end??t.currentTime);return}}if(R+=1,R<Pb)return;throw L=null,n}},ue=async()=>{if(A||j||ye!==void 0||x||!L&&(F||!ie()))return;let e=++ee,t=I,n=()=>x||e!==ee||t!==I;A=!0;try{if(!L){let{data:e,subtitles:t,finished:r}=await y.read();if(n()||(r&&(F=!0),t?.length&&a.pushFragments(t),!e.byteLength))return;L=e,R=0}await le(),!n()&&te&&(te=!1,h?.())}catch(e){re(e,n())}finally{e===ee&&(A=!1)}},V=e=>e>=ne&&!!ae(),de=e=>hb(T).some(t=>t.start<=e+Ib&&e<t.end),fe=e=>{let t=hb(T).find(t=>t.start<=e+Ib&&e<t.end);return t?t.end-e:0},pe=async e=>{if(!x&&!(fe(e)>=Lb)){F=!1,M++,N=e;try{de(e)||await ce(e);let t=I;for(let n=0;n<Rb&&!(x||t!==I||F||fe(e)>=Lb);n++){let t=fe(e);if(await ue(),fe(e)<=t)break}}finally{M--,N===e&&(N=void 0)}}},me=0,he=null,ge,_e=e=>{let t=performance.now(),n=t-me;if(n>=zb){me=t,he=null,g?.(e);return}he=e,!ge&&(ge=setTimeout(()=>{ge=void 0;let e=he;he=null,!(e===null||x)&&(me=performance.now(),g?.(e))},zb-n))};b.push(()=>{ge&&clearTimeout(ge)});let ve=0,ye;b.push(()=>{ye&&clearTimeout(ye)});let be=()=>{let n=t.currentTime,r=e.info.input.duration||t.duration;r>0&&_e(Math.min(Math.max(n/r,0),1));let i=performance.now(),a=i-ve<Bb;if(ve=i,!V(n)&&!(j&&Math.abs(n-ne)<.001)){if(F=!1,ye&&clearTimeout(ye),!a){ye=void 0,ce(n);return}ye=setTimeout(()=>{if(ye=void 0,x)return;let e=t.currentTime;V(e)||(F=!1,ce(e))},Bb)}};t.addEventListener(`seeking`,be),b.push(()=>t.removeEventListener(`seeking`,be));let xe=!1,Se=()=>{if(xe)return;xe=!0;let e=t.error;re(new Db(`the media element failed: ${e?.message??`unknown`}`,{cause:e}),!1,!0)};t.addEventListener(`error`,Se),b.push(()=>t.removeEventListener(`error`,Se));let H=setInterval(()=>{xe||t.error||(B().catch(()=>{}),ue().catch(e=>re(e,!1)),F&&!L&&oe()&&C.readyState===`open`&&k().catch(()=>{}))},100);return b.push(()=>clearInterval(H)),{destroy:S,prepareSeek:pe,videoElement:t,selectSubtitleStream:e=>a.selectStream(e),indexes:e.indexes??[],duration:e.info.input.duration,videoMimeType:e.info.output.videoMimeType,audioMimeType:e.info.output.audioMimeType}}catch(e){throw S(),e}},Wb=5,Gb=500,Kb=320,qb=1e6,Jb=3,Yb=1e4,Xb=async e=>{let{publicPath:t,workerUrl:n,length:r,read:i,onThumbnails:a,width:o=Kb}=e,s=await Uy({publicPath:t,workerUrl:n,workerOptions:{type:`module`},length:r,read:i});try{let t=await s.init(),n=t.duration,i=Math.max(e.interval??Wb,n/Gb),c=[];for(let[e,a]of t.indexes.entries()){let o=c.at(-1);o&&a.timestamp-o.timestamp<i||c.push({timestamp:a.timestamp,endTime:n,startByte:a.pos,endByte:Math.min((t.indexes[e+1]?.pos??r)+qb,r),done:!1,attempts:0})}for(let[e,t]of c.entries())t.endTime=c[e+1]?.timestamp??n;c.length>1&&c.at(-1).timestamp>n-i*2&&c.pop();let l=[],u=!1,d=Promise.resolve(),f=()=>{let e=[];for(let[t,n]of l.entries()){n.startTime-(e.at(-1)?.endTime??0)>.01&&e.push({url:``,startTime:e.at(-1)?.endTime??0,endTime:n.startTime}),e.push(n);let r=l[t+1];r&&r.startTime-n.endTime>.01&&e.push({url:``,startTime:n.endTime,endTime:r.startTime})}let t=e.at(-1)?.endTime??0;n-t>.01&&e.push({url:``,startTime:t,endTime:n}),a(e)},p=e=>{e.done=!0,d=d.then(async()=>{if(u)return;let t=await Promise.race([s.readKeyframe(e.timestamp),new Promise((e,t)=>setTimeout(()=>t(Error(`timed out`)),Yb))]),n=await createImageBitmap(new Blob([t],{type:`image/png`})),r=new OffscreenCanvas(o,Math.max(1,Math.round(n.height*(o/n.width))));r.getContext(`2d`).drawImage(n,0,0,r.width,r.height),n.close();let i=await r.convertToBlob({type:`image/webp`,quality:.7});u||(l=[...l,{url:URL.createObjectURL(i),startTime:e.timestamp,endTime:e.endTime}].sort((e,t)=>e.startTime-t.startTime),f())}).catch(()=>{e.attempts+=1,e.done=e.attempts>=Jb})};return f(),{update:e=>{if(!u)for(let t of c)t.done||(!e||e.some(([e,n])=>e<=t.startByte&&t.endByte<=n))&&p(t)},destroy:()=>{u=!0;for(let e of l)URL.revokeObjectURL(e.url);l=[],Hb(s)}}}catch(e){throw Hb(s),e}},Zb=1280,Qb=1920,$b=250,ex=100,tx=()=>typeof HTMLCanvasElement<`u`&&`captureStream`in HTMLCanvasElement.prototype,nx=()=>typeof document<`u`&&typeof HTMLVideoElement<`u`&&typeof HTMLVideoElement.prototype.requestPictureInPicture==`function`&&!!document.pictureInPictureEnabled,rx=()=>typeof HTMLVideoElement<`u`&&`mozCaptureStream`in HTMLVideoElement.prototype,ix=()=>tx()?nx()?`window`:rx()?`burn-in`:null:null,ax=e=>{let{video:t,canvas:n}=e,r=e.mode??ix()??`window`,i=e.maxWidth??(r===`burn-in`?Qb:Zb),a,o,s,c=!1,l=!1,u=!1,d=!1,f,p=()=>r===`burn-in`?!!a:!!a&&document.pictureInPictureElement===a.mirror,m=(e,r)=>{r.drawImage(t,0,0,e.width,e.height),n.width>0&&n.height>0&&r.drawImage(n,0,0,e.width,e.height)},h=()=>{a&&m(a.composite,a.context)},g=`requestVideoFrameCallback`in t,_=()=>{h(),v()},v=()=>{d||!a||(o=g?t.requestVideoFrameCallback(_):requestAnimationFrame(_))},y=()=>{o!==void 0&&(g?t.cancelVideoFrameCallback(o):cancelAnimationFrame(o)),s!==void 0&&clearInterval(s),o=void 0,s=void 0},b=()=>{`mediaSession`in navigator&&(navigator.mediaSession.playbackState=t.paused?`paused`:`playing`)},x=()=>{c||l||!t.paused||t.play().catch(()=>{})},S=()=>{c||l||(t.paused||t.pause(),r!==`burn-in`&&(c=!0,a?.mirror.play().catch(()=>{}).finally(()=>{c=!1})))},C=()=>{b(),a?.mirror.play().catch(()=>{})},w=()=>{b(),r===`burn-in`&&a?.mirror.pause()},T=()=>{if(r!==`burn-in`||!a||!t.paused||l)return;l=!0;let{mirror:e}=a;h(),e.play().then(()=>new Promise(e=>{setTimeout(e,ex)})).catch(()=>{}).finally(()=>{e.pause(),setTimeout(()=>{l=!1},ex)})},E=[[`play`,()=>{t.play().catch(()=>{})}],[`pause`,()=>t.pause()]],D=e=>{if(`mediaSession`in navigator)for(let[t,n]of E)try{navigator.mediaSession.setActionHandler(t,e?n:null)}catch{}},O=()=>{if(y(),D(!1),t.removeEventListener(`play`,C),t.removeEventListener(`pause`,w),t.removeEventListener(`seeked`,T),!a){f?.();return}let{stream:e,mirror:n}=a;n.removeEventListener(`play`,x),n.removeEventListener(`pause`,S),n.removeEventListener(`leavepictureinpicture`,k);for(let t of e.getTracks())t.stop();n.remove(),a=void 0,f?.()},k=()=>O(),A=e=>{let r=t.style.opacity,i=n.style.display;e.style.cssText=`position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:1`,t.style.opacity=`0`,n.style.display=`none`,f=()=>{f=void 0,t.style.opacity=r,n.style.display=i}},j=async()=>{let n=Math.min(t.videoWidth||i,i),o=Math.round(n*((t.videoHeight||9)/(t.videoWidth||16))),c=document.createElement(`canvas`);c.width=n,c.height=o;let l=c.getContext(`2d`);if(!l)throw Error(`the picture in picture composite has no 2d context`);let u=document.createElement(`video`);u.muted=!0,u.playsInline=!0,r===`burn-in`?A(u):u.style.cssText=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;left:-1px;top:-1px`,m(c,l);let f={composite:c,context:l,stream:c.captureStream(),mirror:u};if(a=f,u.srcObject=f.stream,(e.container??t.parentElement??document.body).appendChild(u),v(),s=setInterval(()=>{t.paused&&h()},$b),u.play().catch(()=>{}),u.readyState===0&&await new Promise(e=>{let t=()=>{clearTimeout(n),e()},n=setTimeout(t,1e3);u.addEventListener(`loadedmetadata`,t,{once:!0})}),d||a!==f){u.remove();return}if(u.addEventListener(`play`,x),u.addEventListener(`pause`,S),u.addEventListener(`leavepictureinpicture`,k),t.addEventListener(`play`,C),t.addEventListener(`pause`,w),t.addEventListener(`seeked`,T),D(!0),b(),r===`burn-in`){t.paused&&u.pause(),e.onBurnedInChange?.(!0);return}await u.requestPictureInPicture()};return{toggle:async()=>{if(!(d||u)){u=!0;try{if(p()){if(r===`burn-in`){O(),e.onBurnedInChange?.(!1);return}await document.exitPictureInPicture().catch(()=>{});return}r!==`burn-in`&&document.pictureInPictureElement&&await document.exitPictureInPicture().catch(()=>{});try{await j()}catch(t){console.warn(`subtitle compositing for picture in picture failed`,t),O(),r===`burn-in`&&e.onBurnedInChange?.(!1)}}finally{u=!1}}},mode:r,destroy:()=>{d=!0,r!==`burn-in`&&p()&&document.exitPictureInPicture().catch(()=>{}),O(),r===`burn-in`&&e.onBurnedInChange?.(!1)}}};function ox(e){return typeof e==`string`}function sx(e){return typeof e==`number`}function cx(e){return typeof e==`function`}function lx(e){return e===null}function X(e){return e===void 0}function ux(e){return typeof e==`object`&&!!e}function dx(e,t){let n={...t};for(let t in e)X(e[t])||(n[t]=e[t]);return n}function fx(e,t){let n={};for(let r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}var px=Object.prototype.hasOwnProperty;function mx(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!px.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var hx=new Map,gx=new Set;function _x(e){return e.trim().replaceAll(`_`,`-`).toLowerCase()}function vx(e){let t=e.indexOf(`-x-`),n=(t===-1?e:e.slice(0,t)).indexOf(`-u-`);return n===-1?e:e.slice(0,n)+(t===-1?``:e.slice(t))}function yx(e){if(e[0]!==`zh`)return;let t=e.find(e=>e===`hant`||e===`hans`);return t===`hant`?`zh-tw`:t===`hans`?`zh-cn`:void 0}function bx(e){return vx(_x(e))}function xx(e){let t=bx(e);if(!t)return[`en`];let n=t.split(`-`).filter(Boolean),r=[];for(let e=n.length;e>=1;e--)r.push(n.slice(0,e).join(`-`));let i=yx(n),a=r.indexOf(`zh`);i&&a!==-1&&r.splice(a,0,i);let o=[],s=new Set;for(let e of r)s.has(e)||(s.add(e),o.push(e));return s.has(`en`)||o.push(`en`),o}function Sx(e){let t={};for(let n=e.length-1;n>=0;n--){let r=e[n],i=hx.get(r);i&&Object.assign(t,i)}return t}function Cx(e){return Sx(xx(e))}function wx(e){return gx.add(e),()=>{gx.delete(e)}}function Tx(e){return typeof e==`string`?e:e.text}function Ex(e){return ux(e)&&`key`in e&&`text`in e}var Dx=/\{([^{}]+)\}/g;function Ox(e,t){return t?e.replace(Dx,(e,n)=>Object.hasOwn(t,n)?String(t[n]):e):e}function kx(e,t,n){return typeof e==`string`?e:typeof t==`function`?t(e,n):Ox(Tx(e),t??n)}function Ax(e,t){return(t,n)=>{let r=n,i=typeof t!=`string`,a=i?t.key:t,o=e[a],s=r?.default,c=r?{...r}:void 0;return c&&delete c.default,Ox(o??(i?t.text:s)??String(a),c)}}p();var jx=a(null);a(void 0);function Mx(){let e=i(jx),[t,n]=c(e=>e+1,0);E(()=>wx(()=>n()),[]);let r=w(()=>Ax(Cx(`en`),`en`),[t]);return e?e.translator:r}function Nx(){return i(jx)?.locale??`en`}function Px(e){let t=e.closest(`[dir]`)?.getAttribute(`dir`);return t?t.toLowerCase()===`rtl`:getComputedStyle(e).direction===`rtl`}function Fx(e){let t=e.composedPath();return t.length>0?t[0]:e.target}function Ix(e,t,n){return new Promise((r,i)=>{let a=()=>{i(n?.signal?.reason??`Aborted`)};if(n?.signal?.aborted){a();return}n?.signal?.addEventListener(`abort`,a,{once:!0}),e.addEventListener(t,e=>{n?.signal?.removeEventListener(`abort`,a),r(e)},{...n,once:!0})})}function Lx(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Rx(){return typeof CSS<`u`&&CSS.supports(`anchor-name: --a`)}var zx=[`button`,`input`,`select`,`textarea`,`a[href]`,`[role="button"]`,`[role="menu"]`,`[role="menuitem"]`,`[role="menuitemcheckbox"]`,`[role="menuitemradio"]`,`[role="slider"]`,`[data-interactive]`].join(`,`),Bx=[`textarea`,`select`,`input:not([type])`,...[`text`,`search`,`url`,`tel`,`email`,`password`,`number`].map(e=>`input[type="${e}"]`),`[contenteditable]:not([contenteditable="false"])`].join(`,`);function Vx(e){return e.matches(Bx)}function Hx(e){let t=Fx(e);return t instanceof Element&&Vx(t)}function Ux(e){let t=Fx(e);return t instanceof Element?t.closest(zx)!==null:!1}var Wx=new Set([` `,`Enter`]),Gx=`button,a[href],[role="slider"],[role="button"]`;function Kx(e){if(!Wx.has(e.key))return!1;let t=Fx(e);return t instanceof Element&&t.matches(Gx)}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function qx(){return typeof navigator<`u`&&/mac/i.test(navigator.userAgent)}var Jx={sideOffset:0,boundaryOffset:0},Yx={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function Xx(e,t,n,r){let i=r.boundaryOffset??0;switch(n){case`top`:return e.top-t.top-i-r.sideOffset;case`bottom`:return t.bottom-e.bottom-i-r.sideOffset;case`left`:return e.left-t.left-i-r.sideOffset;case`right`:return t.right-e.right-i-r.sideOffset}}function Zx(e,t,n,r,i=Jx){let a=r.side,o=Yx[a],s=a===`top`||a===`bottom`?t.height:t.width,c=Xx(e,n,a,i);return c>=s?a:Xx(e,n,o,i)>c?o:a}function Qx(e){try{e?.showPopover?.()}catch{}}function $x(e){try{e?.hidePopover?.()}catch{}}function eS(e){return e instanceof Node&&e.nodeType===11&&`host`in e}function tS(e,t){let n=t.trim();if(!n)return 0;let r=Number.parseFloat(n);if(!Number.isNaN(r)&&(/^-?\d*\.?\d+$/.test(n)||n.endsWith(`px`)))return r;let i=e.ownerDocument,a=i?.documentElement;if(!Number.isNaN(r)&&n.endsWith(`rem`))return r*(a&&Number.parseFloat(getComputedStyle(a).fontSize)||16);if(!Number.isNaN(r)&&n.endsWith(`em`))return r*(e instanceof HTMLElement&&Number.parseFloat(getComputedStyle(e).fontSize)||16);if(!i)return Number.isNaN(r)?0:r;let o=i.createElement(`div`);if(o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.pointerEvents=`none`,o.style.inlineSize=n,!o.style.inlineSize)return 0;o.style.blockSize=`0`,o.style.padding=`0`,o.style.border=`0`,o.style.inset=`0`;let s=getComputedStyle(e);o.style.fontSize=s.fontSize;for(let e=0;e<s.length;e++){let t=s.item(e);t.startsWith(`--`)&&o.style.setProperty(t,s.getPropertyValue(t))}let c=i.body??i.documentElement;if(!c)return Number.isNaN(r)?0:r;if(c.appendChild(o),getComputedStyle(o).inlineSize===`auto`)return o.remove(),0;let l=o.getBoundingClientRect().width;return o.remove(),Number.isFinite(l)?l:Number.isNaN(r)?0:r}function nS(e){return e.kind===`captions`||e.kind===`subtitles`}function rS(e,t){if(!(e instanceof HTMLElement))return null;for(let n of e.querySelectorAll(`track`))if(n.track===t)return n;return null}function iS(e,t){return e.textTracks?Array.from(e.textTracks).filter(t).sort(aS):[]}function aS(e,t){return e.kind>t.kind?1:e.kind<t.kind?-1:0}function oS(e){let t=[];for(let n=0;n<e.length;n++)t.push([e.start(n),e.end(n)]);return t}function sS(e,t){let n=t;for(;n;){if(n===e||e.contains(n))return!0;let t=n.getRootNode();n=eS(t)?t.host:n.parentNode}return!1}function cS(){return`WebKitPlaybackTargetAvailabilityEvent`in globalThis}function lS(e){return cS()&&`webkitCurrentPlaybackTargetIsWireless`in e}p();function uS(e,t){if(cx(e))return e(t);e!=null&&(e.current=t)}function dS(...e){let t=e.flat();return e=>{let n=t.map(t=>uS(t,e));if(n.some(cx))return()=>{for(let e=0;e<n.length;e++){let r=n[e];cx(r)?r():uS(t[e],null)}}}}function fS(...e){return d(dS(...e),[...e])}p();function pS(e,t,n,r=mx){let i=m(void 0),a=()=>{let e=n(t());return i.current!==void 0&&r(i.current,e)?i.current:(i.current=e,e)};return x(e,a,a)}function mS(e){return e}function hS(...e){}function gS(e,t,n){let r=n?.leading??!1,i=null,a,o=!1;function s(){i=setTimeout(()=>{i=null,o&&(o=!1,e(...a),s())},t)}let c=(...n)=>{if(a=n,r)i===null?(e(...a),s()):o=!0;else{if(i!==null)return;i=setTimeout(()=>{i=null,e(...a)},t)}};return c.cancel=()=>{i!==null&&(clearTimeout(i),i=null),o=!1},c}function _S(e,t,n){return pS(t=>e.subscribe(t),()=>e.current,t??mS,n)}var vS=()=>hS;function yS(e,t,n){return pS(t?t=>e.subscribe(t):vS,t?()=>e.state:()=>e,t??mS,n)}p();var bS=a(null),xS=()=>{},SS={state:{},subscribe:()=>xS};function CS({value:e,children:t}){return dp(bS.Provider,{value:e,children:t})}function wS(){let e=i(bS);if(!e)throw Error(`usePlayerContext must be used within a Player Provider`);return e}function TS(e){let{store:t}=wS();return yS(t,e)}function ES(e){let t=i(bS),n=yS(t?.store??SS,t?e:void 0);return t?n:void 0}function DS(){let{media:e}=wS();return e}function OS(){let{container:e}=wS();return e}function kS(){return i(bS)?.container??null}function AS(){return i(bS)?.popupGroup}function jS(){return i(bS)?.setMedia}function MS(){return i(bS)?.setContainer}function NS(e){if(`any`in AbortSignal)return AbortSignal.any(e);let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(n.reason),t.signal;n.addEventListener(`abort`,()=>t.abort(n.reason),{signal:t.signal})}return t.signal}var PS=class{#e=new AbortController;#t=new Map;get base(){return this.#e.signal}clear(){for(let e of this.#t.values())e.abort();this.#t.clear()}reset(){this.clear(),this.#e.abort(),this.#e=new AbortController}supersede(e){this.#t.get(e)?.abort();let t=new AbortController;return this.#t.set(e,t),NS([this.#e.signal,t.signal])}};function FS(...e){return{state:t=>{let n=e.map(e=>e.state(t));return Object.assign({},...n)},attach:t=>{for(let n of e)try{n.attach?.(t)}catch(e){t.reportError(e)}}}}var IS=class extends Error{code;cause;constructor(e,t){super(t?.message??e),this.name=`StoreError`,this.code=e,this.cause=t?.cause}};function LS(){throw new IS(`NO_TARGET`)}function RS(){throw new IS(`DESTROYED`)}var zS={target:LS,signals:new PS,get:LS,set:LS};function BS(e){let t=e.state(zS),n=Object.keys(t),r=n[0];return Object.assign(r?e=>{if(r in e)return fx(e,n)}:()=>void 0,{displayName:e.name})}function VS(){return e=>e}var HS=!1;function US(){HS||(HS=!0,queueMicrotask(GS))}var WS=new Set;function GS(){HS=!1;for(let e of WS)e.flush();WS.clear()}var KS=Object.prototype.hasOwnProperty,qS=class{#e;#t=new Set;#n=!1;constructor(e){this.#e=Object.freeze({...e})}get current(){return this.#e}patch(e){let t={...this.#e},n=!1;for(let r in e){if(!KS.call(e,r))continue;let i=e[r];Object.is(this.#e[r],i)||(t[r]=i,n=!0)}n&&(this.#e=Object.freeze(t),this.#r())}subscribe(e,t){let n=t?.signal;if(n?.aborted)return hS;if(this.#t.add(e),!n)return()=>this.#t.delete(e);let r=()=>this.#t.delete(e);return n.addEventListener(`abort`,r,{once:!0}),()=>{n.removeEventListener(`abort`,r),this.#t.delete(e)}}flush(){if(this.#n){this.#n=!1;for(let e of this.#t)e()}}#r(){this.#n=!0,WS.add(this),US()}};function JS(e){return new qS(e)}var YS=Symbol.for(`@videojs/store`);function XS(){return(e,t={})=>{let n=null,r=!1,i=new AbortController,a=new PS,o;function s(){r&&RS(),n||LS()}let c=e.state({target:()=>(s(),n),signals:a,get:()=>o.current,set:e=>o.patch(e)});o=JS(c);let l={[YS]:!0,get $state(){return o},get target(){return n},get destroyed(){return r},get state(){return o.current},attach:u,destroy:f,subscribe:p};for(let e of Object.keys(c))Object.defineProperty(l,e,{get:()=>o.current[e],enumerable:!0});try{t.onSetup?.({store:l,signal:i.signal})}catch(e){m(e)}return l;function u(i){r&&RS(),a.reset(),n=i;let s={target:i,signal:a.base,get:()=>o.current,set:e=>o.patch(e),reportError:m,store:{get state(){return o.current},subscribe:p}};try{e.attach?.(s)}catch(e){m(e)}try{t.onAttach?.({store:l,target:i,signal:a.base})}catch(e){m(e)}return d}function d(){lx(n)||(a.reset(),n=null,o.patch(c))}function f(){r||(r=!0,d(),i.abort())}function p(e,t){return o.subscribe(e,t)}function m(e){t.onError?t.onError({store:l,error:e}):console.error(`[vjs-store]`,e)}}}var ZS=VS();function QS(e,t){if(arguments.length===1)return ZS(e);let{name:n,state:r,attach:i}=e,a=e=>ZS({...X(n)?{}:{name:n},state:t=>r(t,e),...i?{attach:t=>i(t,e)}:{}}),o=a(t),s=(e=>X(e)?o:a(e));return s.state=o.state,o.attach&&(s.attach=o.attach),X(n)||Object.defineProperty(s,"name",{value:n}),s}var $S=Object.freeze({length:0,start:()=>0,end:()=>0}),eC=Object.assign(new EventTarget,{length:0,*[Symbol.iterator](){},getTrackById:()=>null}),tC=new EventTarget;Object.freeze({});var nC=class e extends Error{static MEDIA_ERR_ABORTED=1;static MEDIA_ERR_NETWORK=2;static MEDIA_ERR_DECODE=3;static MEDIA_ERR_SRC_NOT_SUPPORTED=4;static MEDIA_ERR_ENCRYPTED=5;static MEDIA_ERR_CUSTOM=100;static defaultMessages={1:`You stopped media playback before it finished.`,2:`This media could not be loaded due to a network or server issue.`,3:`This media could not be played. It may be corrupted, or your browser may not support its format.`,4:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`,5:`This media could not be played because it could not be decrypted.`};name;code;context;fatal;data;constructor(t,n=e.MEDIA_ERR_CUSTOM,r,i){super(t),this.name=`MediaError`,this.code=n,this.context=i,this.fatal=r??(n>=e.MEDIA_ERR_NETWORK&&n<=e.MEDIA_ERR_ENCRYPTED),this.message||=e.defaultMessages[this.code]??``}};function rC(e){return e.readyState>=1}function iC(e){if(!ux(e))return!1;let t=e;return!X(t.paused)&&!X(t.ended)&&cx(t.pause)}function aC(e){if(!ux(e))return!1;let t=e;return!X(t.currentTime)&&!X(t.duration)&&!X(t.seeking)}function oC(e){if(!ux(e))return!1;let t=e;return!X(t.src)&&!X(t.currentSrc)&&!X(t.readyState)&&cx(t.load)}function sC(e){if(!ux(e))return!1;let t=e;return!X(t.volume)&&!X(t.muted)}function cC(e){return ux(e)?!X(e.playbackRate):!1}function lC(e){if(!ux(e))return!1;let t=e;return!X(t.buffered)&&t.buffered!==$S&&!X(t.seekable)&&t.seekable!==$S}function uC(e){return ux(e)?!X(e.error):!1}function dC(e){if(!ux(e))return!1;let t=e;return!X(t.textTracks)&&t.textTracks!==eC}function fC(e){return ux(e)?!X(e.videoRenditions):!1}function pC(e){return ux(e)?!X(e.audioTracks):!1}function mC(e){if(!ux(e))return!1;let t=e;return!X(t.videoWidth)&&!X(t.videoHeight)}function hC(e){if(!ux(e))return!1;let t=e;return ux(t.remote)&&t.remote!==tC}function gC(e){return ux(e)?!X(e.streamType):!1}function _C(e){if(!ux(e))return!1;let t=e;return!X(t.liveEdgeStart)&&!X(t.targetLiveWindow)}function vC(e){return ux(e)&&`querySelectorAll`in e&&cx(e.querySelectorAll)}var yC={ON_DEMAND:`on-demand`,LIVE:`live`,UNKNOWN:`unknown`};function bC(e,t){return e.id||String(t)}function xC(e){return{...e.id!==void 0&&{id:e.id},...e.kind!==void 0&&{kind:e.kind},label:e.label,language:e.language,enabled:e.enabled}}var SC=QS({name:`audioTrack`,state:({target:e})=>({audioTrackList:[],selectAudioTrack(t){let{media:n}=e();if(!pC(n))return;let r=[...n.audioTracks],i=r.find((e,n)=>bC(e,n)===t);if(i)for(let e of r)e.enabled=e===i}}),attach({target:e,signal:t,set:n}){let{media:r}=e,i=null,a=null,o=()=>pC(r)?r.audioTracks:null,s=(e=o())=>{n({audioTrackList:e?[...e].map(xC):[]})},c=()=>{let e=o();if(e===i){s(e);return}a?.abort(),a=new AbortController,i=e,i&&(Z(i,`addtrack`,()=>s(i),{signal:a.signal}),Z(i,`removetrack`,()=>s(i),{signal:a.signal}),Z(i,`change`,()=>s(i),{signal:a.signal})),s(i)};c(),Z(r,`loadstart`,c,{signal:t}),t.addEventListener(`abort`,()=>a?.abort(),{once:!0})}}),CC=QS({name:`buffer`,state:()=>({buffered:[],seekable:[]}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!lC(r))return;let i=()=>n({buffered:oS(r.buffered),seekable:oS(r.seekable)});i(),Z(r,`progress`,i,{signal:t}),Z(r,`emptied`,i,{signal:t})}});function wC(e,t,n){if(n.size===0)return null;let r=e-t.left,i=t.width;if(i===0)return null;let a=r/i;return n.size===2&&n.has(`left`)&&n.has(`right`)?a<.5?`left`:`right`:n.size===3?a<1/3?`left`:a<2/3?`center`:`right`:n.has(`left`)&&a<.5?`left`:n.has(`right`)&&a>=.5?`right`:n.has(`center`)&&(n.size===1||a>=1/3&&a<2/3)?`center`:null}var TC=250,EC=class{#e;#t=[];#n=new Set;#r=null;#i=new Set;constructor(e){this.#e=e}get bindings(){return this.#t}subscribe(e){return this.#i.add(e),()=>this.#i.delete(e)}claimsTap(e,t){return Ux(e)?!1:this.#t.some(n=>n.type===`tap`&&n.action===t&&(!n.pointer||n.pointer===e.pointerType))}add(e){let t={...e,onActivate:t=>{if(this.#i.size>0){let n={type:e.type,source:`gesture`,action:e.action,value:e.value,region:e.region,pointer:e.pointer,event:t};for(let e of this.#i)try{e(n)}catch{}}e.onActivate(t)}};this.#t.push(t),this.#n.add(t.recognizer),this.#a();let n=!1;return()=>{if(n)return;n=!0;let e=this.#t.indexOf(t);e!==-1&&this.#t.splice(e,1),this.#o()}}#a(){if(this.#r)return;this.#r=new AbortController;let{signal:e}=this.#r,t=0;Z(this.#e,`pointerdown`,e=>{e.button===0&&(t=Date.now())},{signal:e}),Z(this.#e,`pointerup`,e=>{if(e.button!==0||Date.now()-t>TC||Ux(e))return;let n=e.pointerType,r=e.clientX,i=this.#e,a=this.#t,o={resolve:e=>AC(a,e,n,r,i)};for(let t of this.#n)t.handleUp(o,e)},{signal:e})}#o(){if(!(this.#t.length>0)){for(let e of this.#n)e.reset();this.#n.clear(),this.#r?.abort(),this.#r=null}}},DC=new WeakMap;function OC(e){return DC.get(e)}function kC(e){let t=DC.get(e);return t||(t=new EC(e),DC.set(e,t)),t}function AC(e,t,n,r,i){let a=i.getBoundingClientRect(),o=jC(e,t,n),s=o.size>0?wC(r,a,o):null,c=[];for(let r of e)if(!r.disabled&&r.type===t&&!(r.pointer&&r.pointer!==n)){if(r.region){if(r.region!==s)continue}else if(s!==null)continue;c.push(r)}return c}function jC(e,t,n){let r=new Set;for(let i of e)i.disabled||i.type===t&&(i.pointer&&i.pointer!==n||i.region&&r.add(i.region));return r}function MC(e){let t=e;if(ux(t.remote)&&`state`in t.remote&&`prompt`in t.remote)return t.remote}function NC(e){return MC(e)?.state===`connected`}function PC(e){return MC(e)?.state===`connecting`}async function FC(e){let t=MC(e);if(!t)throw new DOMException(`Remote playback not supported`,`NotSupportedError`);return t.prompt()}var IC=2e3,LC=250,RC=500,zC=QS({name:`controls`,state:({get:e,set:t})=>({userActive:!0,controlsVisible:!0,toggleControls(){let n=!e().userActive;return t({userActive:n,controlsVisible:n}),n}}),attach({target:e,signal:t,get:n,set:r}){let{media:i,container:a}=e;if(!iC(i)||lx(a))return;let o=e=>e||i.paused||NC(i)||PC(i),s;function c(){clearTimeout(s),s=void 0}function l(){c(),s=setTimeout(d,IC)}function u(){n().userActive||r({userActive:!0,controlsVisible:!0}),l()}function d(){c(),r({userActive:!1,controlsVisible:o(!1)})}r({toggleControls(){return n().controlsVisible?d():u(),n().controlsVisible}});let f=0,p=0,m=()=>p>0&&Date.now()-p<RC;function h(e){f=Date.now(),e.pointerType===`touch`&&(p=f)}function g(e){if(e.pointerType===`touch`&&(p=Date.now()),e.pointerType===`touch`&&Date.now()-f<LC){if(OC(a)?.claimsTap(e,`toggleControls`))return;let t=[i,a].includes(e.target);n().controlsVisible&&t?d():u()}else u()}let _=()=>{let{userActive:e}=n();r({controlsVisible:o(e)}),!i.paused&&e&&l()};function v(e){if(e.pointerType===`touch`){n().userActive&&l();return}u()}if(Z(a,`pointermove`,v,{signal:t}),Z(a,`pointerdown`,h,{signal:t}),Z(a,`pointerup`,g,{signal:t}),Z(a,`keyup`,u,{signal:t}),Z(a,`focusin`,()=>{m()||u()},{signal:t}),Z(a,`mouseleave`,()=>{m()||d()},{signal:t}),Z(i,`play`,_,{signal:t}),Z(i,`pause`,_,{signal:t}),Z(i,`ended`,_,{signal:t}),hC(i)){let e=()=>{let{userActive:e}=n();r({controlsVisible:o(e)})};Z(i.remote,`connect`,e,{signal:t}),Z(i.remote,`connecting`,e,{signal:t}),Z(i.remote,`disconnect`,e,{signal:t})}t.addEventListener(`abort`,c,{once:!0}),l()}}),BC=QS({name:`error`,state:({set:e})=>({error:null,dismissError(){e({error:null})}}),attach({target:e,signal:t,set:n}){let{media:r}=e;uC(r)&&(Z(r,`error`,()=>n({error:r.error}),{signal:t}),Z(r,`emptied`,()=>n({error:null}),{signal:t}))}});function VC(){let e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled?!0:cx(document.createElement(`video`).webkitSetPresentationMode)}function HC(){let e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}function UC(e){if(!(e instanceof Element))return!1;try{return e.matches(`:fullscreen`)}catch{return!1}}function WC(e,t){if(t.webkitPresentationMode===`fullscreen`)return!0;let n=HC();return n&&(n===e||n===t)||UC(e)||UC(t)?!0:t.isFullscreen??!1}async function GC(e,t){let n=document;if(e&&(n.fullscreenEnabled||n.webkitFullscreenEnabled)){let t=e;if(cx(t.requestFullscreen))return t.requestFullscreen();if(cx(t.webkitRequestFullscreen))return t.webkitRequestFullscreen()}let r=t;if(cx(r.webkitSetPresentationMode)){r.webkitSetPresentationMode(`fullscreen`);return}let i=t;if(cx(i.requestFullscreen))return i.requestFullscreen()}async function KC(e){let t=document,n=e;if(n.webkitPresentationMode===`fullscreen`&&cx(n.webkitSetPresentationMode)){n.webkitSetPresentationMode(`inline`);return}if(cx(t.exitFullscreen))return t.exitFullscreen();if(cx(t.webkitExitFullscreen))return t.webkitExitFullscreen();let r=e;if(cx(r.exitFullscreen))return r.exitFullscreen()}function qC(){if(document.pictureInPictureEnabled){let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent),t=typeof matchMedia==`function`&&matchMedia(`(display-mode: standalone)`).matches;return!e||!t}return cx(document.createElement(`video`).webkitSetPresentationMode)}function JC(e){return e.webkitPresentationMode===`picture-in-picture`||document.pictureInPictureElement===e?!0:e.isPictureInPicture??!1}async function YC(e){let t=e;if(cx(t.webkitSetPresentationMode)){t.webkitSetPresentationMode(`picture-in-picture`);return}let n=e;if(cx(n.requestPictureInPicture))return n.requestPictureInPicture()}async function XC(e){let t=e;if(t.webkitPresentationMode===`picture-in-picture`&&cx(t.webkitSetPresentationMode)){t.webkitSetPresentationMode(`inline`);return}if(cx(document.exitPictureInPicture))return document.exitPictureInPicture();let n=e;if(cx(n.exitPictureInPicture))return n.exitPictureInPicture()}var ZC=QS({name:`fullscreen`,state:({target:e})=>({fullscreen:!1,fullscreenAvailability:`unavailable`,async requestFullscreen(){let{media:t,container:n}=e();return JC(t)&&await XC(t),GC(n,t)},async exitFullscreen(){let{media:t}=e();return KC(t)},async toggleFullscreen(){let{media:t,container:n}=e();return WC(n,t)?KC(t):(JC(t)&&await XC(t),GC(n,t))}}),attach({target:e,signal:t,set:n}){let{media:r,container:i}=e;n({fullscreenAvailability:VC()?`available`:`unsupported`});let a=()=>n({fullscreen:WC(i,r)});a(),Z(document,`fullscreenchange`,a,{signal:t}),Z(document,`webkitfullscreenchange`,a,{signal:t}),`webkitPresentationMode`in r&&Z(r,`webkitpresentationmodechanged`,a,{signal:t})}}),QC=QS({name:`live`,state:()=>({liveEdgeStart:NaN,targetLiveWindow:NaN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!_C(r))return;let i=()=>n({liveEdgeStart:r.liveEdgeStart,targetLiveWindow:r.targetLiveWindow});i(),Z(r,`targetlivewindowchange`,i,{signal:t}),Z(r,`streamtypechange`,i,{signal:t}),Z(r,`loadedmetadata`,i,{signal:t}),Z(r,`canplay`,i,{signal:t}),Z(r,`progress`,i,{signal:t}),Z(r,`durationchange`,i,{signal:t}),Z(r,`timeupdate`,i,{signal:t}),Z(r,`emptied`,i,{signal:t})}}),$C=QS({name:`pip`,state:({target:e})=>({pip:!1,pipAvailability:`unavailable`,async requestPictureInPicture(){let{media:t,container:n}=e();return WC(n,t)&&await KC(t),YC(t)},async exitPictureInPicture(){let{media:t}=e();return XC(t)},async togglePictureInPicture(){let{media:t,container:n}=e();return JC(t)?XC(t):(WC(n,t)&&await KC(t),YC(t))}}),attach({target:e,signal:t,set:n}){let{media:r}=e;n({pipAvailability:qC()?`available`:`unsupported`});let i=()=>n({pip:JC(r)});i(),Z(r,`enterpictureinpicture`,i,{signal:t}),Z(r,`leavepictureinpicture`,i,{signal:t}),`webkitPresentationMode`in r&&Z(r,`webkitpresentationmodechanged`,i,{signal:t})}}),ew=QS({name:`playback`,state:({target:e})=>({paused:!0,ended:!1,started:!1,waiting:!1,play(){return e().media.play()},pause(){let{media:t}=e();iC(t)&&t.pause()},togglePaused(){let t=e().media;return iC(t)?t.paused?(t.play(),!0):(t.pause(),!1):!1}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!iC(r)||!aC(r)||!oC(r))return;let i=()=>n({paused:r.paused,ended:r.ended,started:!r.paused||r.currentTime>0,waiting:r.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&!r.paused});i(),Z(r,`emptied`,i,{signal:t}),Z(r,`play`,i,{signal:t}),Z(r,`pause`,i,{signal:t}),Z(r,`ended`,i,{signal:t}),Z(r,`playing`,i,{signal:t}),Z(r,`waiting`,i,{signal:t}),Z(r,`seeked`,i,{signal:t})}}),tw=[.2,.5,.7,1,1.2,1.5,1.7,2],nw=QS({name:`playbackRate`,state:({target:e})=>({playbackRates:tw,playbackRate:1,setPlaybackRate(t){let{media:n}=e();cC(n)&&(n.playbackRate=t)}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!cC(r))return;let i=()=>n({playbackRate:r.playbackRate});i(),Z(r,`ratechange`,i,{signal:t})}}),rw=`auto`;function iw(e,t){return e.id||String(t)}function aw(e){return{...e.id!==void 0&&{id:e.id},...e.width!==void 0&&{width:e.width},...e.height!==void 0&&{height:e.height},...e.bitrate!==void 0&&{bitrate:e.bitrate},...e.frameRate!==void 0&&{frameRate:e.frameRate},...e.codec!==void 0&&{codec:e.codec},selected:e.selected}}function ow(e){return e.width&&e.height?Math.min(e.width,e.height):e.height??e.width}var sw=QS({name:`quality`,state:({target:e})=>({videoRenditionList:[],activeVideoRendition:null,selectVideoRendition(t){let{media:n}=e();if(!fC(n))return;if(t===rw){n.videoRenditions.selectedIndex=-1;return}let r=[...n.videoRenditions].findIndex((e,n)=>iw(e,n)===t);r!==-1&&(n.videoRenditions.selectedIndex=r)}}),attach({target:e,signal:t,set:n}){let{media:r}=e,i=null,a=null,o=()=>fC(r)?r.videoRenditions:null,s=e=>{if(!e)return null;let t=[...e],n=t.find(e=>e.active);if(n)return n;if(!mC(r)||!r.videoWidth&&!r.videoHeight)return null;let i=ow({width:r.videoWidth||void 0,height:r.videoHeight||void 0}),a=t.filter(e=>ow(e)===i);return a.length===1?a[0]:null},c=(e=o())=>{let t=s(e);n({videoRenditionList:e?[...e].map(aw):[],activeVideoRendition:t?aw(t):null})},l=()=>{let e=o();if(e===i){c(e);return}a?.abort(),a=new AbortController,i=e,i&&(Z(i,`addrendition`,()=>c(i),{signal:a.signal}),Z(i,`removerendition`,()=>c(i),{signal:a.signal}),Z(i,`change`,()=>c(i),{signal:a.signal}),Z(i,`activechange`,()=>c(i),{signal:a.signal})),c(i)};l(),Z(r,`loadstart`,l,{signal:t}),Z(r,`resize`,()=>c(i),{signal:t}),t.addEventListener(`abort`,()=>a?.abort(),{once:!0})}}),cw=QS({name:`remotePlayback`,state:({target:e})=>({remotePlaybackState:`disconnected`,remotePlaybackAvailability:`unsupported`,async toggleRemotePlayback(){let{media:t,container:n}=e();return NC(t)?FC(t):(WC(n,t)&&await KC(t),await FC(t))}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!hC(r))return;if(lS(r)){let e=()=>{n({remotePlaybackState:r.webkitCurrentPlaybackTargetIsWireless?`connected`:`disconnected`})};Z(r,`webkitplaybacktargetavailabilitychanged`,e=>{let{availability:t}=e;n({remotePlaybackAvailability:t===`available`?`available`:`unavailable`})},{signal:t}),Z(r,`webkitcurrentplaybacktargetiswirelesschanged`,e,{signal:t}),e();return}let i=()=>n({remotePlaybackState:r.remote.state});i(),Z(r.remote,`connect`,i,{signal:t}),Z(r.remote,`connecting`,i,{signal:t}),Z(r.remote,`disconnect`,i,{signal:t}),r.remote.watchAvailability(e=>{n({remotePlaybackAvailability:e?`available`:`unavailable`})}).catch(()=>{n({remotePlaybackAvailability:`unsupported`})}),t.addEventListener(`abort`,()=>{r.remote?.cancelWatchAvailability?.().catch(()=>{})})}}),lw=QS({name:`source`,state:({target:e,signals:t})=>({source:null,canPlay:!1,loadSource(n){t.clear();let{media:r}=e();return oC(r)?(r.src=n,r.load(),n):n}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!oC(r))return;let i=()=>n({source:r.currentSrc||r.src||null,canPlay:r.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA});i(),Z(r,`canplay`,i,{signal:t}),Z(r,`canplaythrough`,i,{signal:t}),Z(r,`loadstart`,i,{signal:t}),Z(r,`emptied`,i,{signal:t})}}),uw=QS({name:`streamType`,state:()=>({streamType:yC.UNKNOWN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(gC(r)){let e=()=>n({streamType:r.streamType});e(),Z(r,`streamtypechange`,e,{signal:t});return}if(!aC(r))return;let i=()=>{let{duration:e}=r;return e===1/0?yC.LIVE:Number.isFinite(e)&&e>0?yC.ON_DEMAND:yC.UNKNOWN},a=()=>n({streamType:i()});a(),Z(r,`durationchange`,a,{signal:t}),Z(r,`loadedmetadata`,a,{signal:t}),Z(r,`emptied`,a,{signal:t}),lC(r)&&Z(r,`progress`,a,{signal:t})}});function dw(e,t){return e.id||`track:${t}:${e.kind}:${e.language}:${e.label}`}var fw=QS({name:`textTrack`,state:({target:e})=>({chaptersCues:[],thumbnailCues:[],thumbnailTrackSrc:null,textTrackList:[],subtitlesShowing:!1,toggleSubtitles(t){let{media:n}=e();if(!dC(n))return!1;let r=iS(n,nS);if(!r.length)return!1;let i=r.some(e=>e.mode===`showing`),a=t??!i;for(let e of r)e.mode=a?`showing`:`disabled`;return a},selectSubtitlesTrack(t){let{media:n}=e();if(!dC(n))return;let r=Array.from(n.textTracks).map((e,t)=>({index:t,track:e})).filter(({track:e})=>nS(e));if(!r.length)return;if(t===`off`){for(let{track:e}of r)e.mode=`disabled`;return}let i=r.find(({index:e,track:n})=>dw(n,e)===t)?.track;if(i)for(let{track:e}of r)e.mode=e===i?`showing`:`disabled`}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!dC(r))return;let i=null,a=()=>{i?.abort(),i=new AbortController;let e=null,t=null,o=[],s=!1;for(let n=0;n<r.textTracks.length;n++){let i=r.textTracks[n];!e&&i.kind===`chapters`&&(e=i),!t&&i.kind===`metadata`&&i.label===`thumbnails`&&(t=i),o.push({id:dw(i,n),kind:i.kind,label:i.label,language:i.language,mode:i.mode}),nS(i)&&i.mode===`showing`&&(s=!0)}let c=e?.cues?Array.from(e.cues):[],l=t?.cues?Array.from(t.cues):[],u=null;t&&(u=rS(r,t)?.src??null);let d=vC(r)&&r.querySelectorAll(`track`)||[],f=r instanceof HTMLElement&&r.shadowRoot?.querySelectorAll(`track`)||[];for(let e of[...d,...f])e.track?.cues?.length||Z(e,`load`,a,{signal:i.signal});n({chaptersCues:c,thumbnailCues:l,thumbnailTrackSrc:u,textTrackList:o,subtitlesShowing:s})};a();let o=r.textTracks;o instanceof EventTarget&&(Z(o,`addtrack`,a,{signal:t}),Z(o,`removetrack`,a,{signal:t}),Z(o,`change`,a,{signal:t})),Z(r,`loadstart`,a,{signal:t}),t.addEventListener(`abort`,()=>i?.abort(),{once:!0})}}),pw={seek:Symbol.for(`@videojs/seek`)},mw=QS({name:`time`,state:({target:e,signals:t,set:n})=>({currentTime:0,duration:0,seeking:!1,async seek(r){let{media:i}=e(),a=t.supersede(pw.seek);if(!aC(i)||!oC(i))return 0;if(!rC(i)&&!await Ix(i,`loadedmetadata`,{signal:a}).catch(()=>!1))return i.currentTime;let o=Math.max(0,Math.min(r,i.duration||1/0));return n({currentTime:o,seeking:!0}),i.currentTime=o,await Ix(i,`seeked`,{signal:a}).catch(hS),i.currentTime}}),attach({target:e,signal:t,set:n,get:r}){let{media:i}=e;if(!aC(i))return;let a=()=>{let{duration:e}=i;if(e===1/0&&lC(i)){let{seekable:e}=i;return e.length>0?e.end(e.length-1):0}return Number.isFinite(e)?e:0},o=()=>n({currentTime:i.currentTime,duration:a(),seeking:i.seeking}),s=()=>{r().seeking||o()};o(),Z(i,`timeupdate`,s,{signal:t}),Z(i,`durationchange`,o,{signal:t}),Z(i,`seeking`,o,{signal:t}),Z(i,`seeked`,o,{signal:t}),Z(i,`loadedmetadata`,o,{signal:t}),Z(i,`emptied`,o,{signal:t}),Z(i,`progress`,s,{signal:t})}}),hw=.25,gw=QS({name:`volume`,state:({target:e})=>({volume:1,muted:!1,volumeAvailability:`unavailable`,setVolume(t){let{media:n}=e();if(!sC(n))return 0;let r=Math.max(0,Math.min(1,t));return r>0&&n.muted&&(n.muted=!1),n.volume=r,n.volume},toggleMuted(){let{media:t}=e();return sC(t)?(t.muted||t.volume===0?(t.muted=!1,t.volume===0&&(t.volume=hw)):t.muted=!0,t.muted):!1}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!sC(r))return;n({volumeAvailability:_w()});let i=()=>n({volume:r.volume,muted:r.muted});i(),Z(r,`volumechange`,i,{signal:t})}});function _w(){let e=document.createElement(`video`);try{return e.volume=.5,e.volume===.5?`available`:`unsupported`}catch{return`unsupported`}}BS(SC);var vw=BS(CC),yw=BS(zC),bw=BS(BC),xw=BS(ZC);BS(QC);var Sw=BS($C),Cw=BS(ew),ww=BS(nw);BS(sw),BS(cw),BS(lw),BS(uw);var Tw=BS(fw),Ew=BS(mw),Dw=BS(gw),Ow={seekStep({store:e,value:t}){if(X(t))return;let n=Ew(e.state);n&&n.seek(n.currentTime+t)},volumeStep({store:e,value:t}){if(X(t))return;let n=Dw(e.state);n&&n.setVolume(n.volume+t)},speedUp({store:e}){let t=ww(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<0||i>=n.length-1?0:i+1;t.setPlaybackRate(n[a])},speedDown({store:e}){let t=ww(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<=0?n.length-1:i-1;t.setPlaybackRate(n[a])}},kw={seekStep:Ow.seekStep,volumeStep:Ow.volumeStep,speedUp:Ow.speedUp,speedDown:Ow.speedDown};function Aw(e){return kw[e]||(({store:t})=>{let n=t.state[e];cx(n)&&n()})}var jw=200,Mw=class{#e=0;#t=null;handleUp(e,t){if(e.resolve(`doubletap`).length>0){let n=Date.now();if(n-this.#e<jw){this.#n(),this.#e=0,e.resolve(`doubletap`)[0]?.onActivate(t);return}this.#e=n,this.#n(),this.#t=setTimeout(()=>{this.#t=null,this.#e=0,e.resolve(`tap`)[0]?.onActivate(t)},jw);return}e.resolve(`tap`)[0]?.onActivate(t)}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}reset(){this.#n(),this.#e=0}},Nw=new WeakMap;function Pw(e){let t=Nw.get(e);return t||(t=new Mw,Nw.set(e,t),t)}function Fw(e,t,n){return kC(e).add({type:`tap`,recognizer:Pw(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Iw(e,t,n){return kC(e).add({type:`doubletap`,recognizer:Pw(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Lw(e){return e.startsWith(`toggle`)}var Rw={togglePaused({store:e}){let t=Cw(e.state);t&&(t.paused?t.play():t.pause())},toggleMuted({store:e}){Dw(e.state)?.toggleMuted()},toggleFullscreen({store:e}){let t=xw(e.state);t&&(t.fullscreen?t.exitFullscreen():t.requestFullscreen())},toggleSubtitles({store:e}){Tw(e.state)?.toggleSubtitles()},togglePictureInPicture({store:e}){let t=Sw(e.state);t&&(t.pip?t.exitPictureInPicture():t.requestPictureInPicture())},seekStep:Ow.seekStep,volumeStep:Ow.volumeStep,speedUp:Ow.speedUp,speedDown:Ow.speedDown,seekToPercent({store:e,value:t,key:n}){let r=Ew(e.state);if(!r||r.duration<=0)return;let i;if(!X(t))i=t;else if(n>=`0`&&n<=`9`)i=Number(n)*10;else return;r.seek(i/100*r.duration)}};function zw(e){return Rw[e]}var Bw={shift:`Shift`,ctrl:`Control`,alt:`Alt`,meta:`Meta`},Vw={shift:`Shift`,ctrl:`Ctrl`,alt:`Alt`,meta:`Meta`},Hw=[`ctrl`,`shift`,`alt`,`meta`];function Uw(e){return e.map(e=>{let t=[];for(let n of Hw)e.modifiers.has(n)&&t.push(Bw[n]);return t.push(e.originalKey),t.join(`+`)}).join(` `)}function Ww(e){let t=[];for(let n of Hw)e.modifiers.has(n)&&t.push(Vw[n]);return t.push(Gw(e.originalKey)),t.join(`+`)}function Gw(e){return e.length===1?e.toUpperCase():e}var Kw=class{#e;#t=[];#n=0;#r=null;#i=null;#a=new Set;#o=new Set;#s=!1;constructor(e){this.#e=e}subscribe(e){return this.#a.add(e),()=>this.#a.delete(e)}subscribeShortcutChanges(e){return this.#o.add(e),()=>this.#o.delete(e)}add(e){let t={parsed:Jw(e.keys),options:e,id:this.#n++};this.#t.push(t),this.#c(),e.target===`document`?this.#u():this.#l(),this.#h();let n=!1;return()=>{if(n)return;n=!0;let e=this.#t.indexOf(t);e!==-1&&this.#t.splice(e,1),this.#d(),this.#h()}}getAriaKeys(e){return this.getShortcut(e).aria}getShortcut(e,t){let n=this.#p(e,t);if(!n.length)return{};let r=n.flatMap(e=>e.parsed),i=n[n.length-1];return{aria:Uw(r),shortcut:this.#m(i)}}destroy(){this.#s||(this.#s=!0,this.#r?.abort(),this.#r=null,this.#i?.abort(),this.#i=null,this.#t=[],this.#h(),this.#a.clear(),this.#o.clear())}#c(){this.#t.sort((e,t)=>{let n=t.parsed[0].modifiers.size-e.parsed[0].modifiers.size;return n===0?e.id-t.id:n})}#l(){this.#r||(this.#r=new AbortController,Z(this.#e,`keydown`,this.#f,{signal:this.#r.signal}))}#u(){this.#i||(this.#i=new AbortController,Z(document,`keydown`,this.#f,{signal:this.#i.signal}))}#d(){let e=this.#t.some(e=>e.options.target!==`document`),t=this.#t.some(e=>e.options.target===`document`);e||(this.#r?.abort(),this.#r=null),t||(this.#i?.abort(),this.#i=null)}#f=e=>{if(e.key===`Unidentified`||Kx(e)||e.defaultPrevented)return;let t=Hx(e);for(let n of this.#t){let{options:r,parsed:i}=n;if(!r.disabled&&!(e.repeat&&r.repeatable===!1)&&r.target===`document`==(e.currentTarget===document)){for(let n of i)if(Xw(n,e)&&!(t&&n.modifiers.size===0)){if(this.#a.size>0){let t={source:`hotkey`,action:r.action,value:r.value,event:e};for(let e of this.#a)try{e(t)}catch{}}e.preventDefault(),r.onActivate(e,n.originalKey);return}}}};#p(e,t){return this.#t.filter(n=>n.options.disabled||n.options.action!==e?!1:X(t)?!0:n.options.value===t).sort((e,t)=>e.id-t.id)}#m(e){return e.options.keys===`0-9`?e.options.keys:Ww(e.parsed[0])}#h(){for(let e of this.#o)e()}},qw=new Set([`shift`,`ctrl`,`alt`,`meta`]);function Jw(e){if(e===`0-9`)return Array.from({length:10},(e,t)=>({modifiers:new Set,key:String(t),originalKey:String(t)}));let t=e.split(`+`),n=t.pop(),r=new Set;for(let e of t){let t=e.toLowerCase();t===`mod`?r.add(qx()?`meta`:`ctrl`):qw.has(t)&&r.add(t)}return[{modifiers:r,key:n===`Space`?` `:n.toLowerCase(),originalKey:n}]}function Yw(e){return e.length===1&&!/[a-z]/i.test(e)}function Xw(e,t){if(t.key===`Unidentified`||t.key.toLowerCase()!==e.key)return!1;let n=Yw(t.key),r=n?t.shiftKey&&e.modifiers.has(`shift`):t.shiftKey,i=n?t.altKey&&e.modifiers.has(`alt`):t.altKey;return!(r!==e.modifiers.has(`shift`)||t.ctrlKey!==e.modifiers.has(`ctrl`)||i!==e.modifiers.has(`alt`)||t.metaKey!==e.modifiers.has(`meta`))}var Zw=new WeakMap;function Qw(e){let t=Zw.get(e);return t||(t=new Kw(e),Zw.set(e,t)),t}function $w(e,t){return Qw(e).add(t)}var eT=[ew,nw,sw,SC,gw,mw,lw,CC,ZC,$C,cw,zC,fw,BC];function tT(e){let{transition:t}=e,n=t.state,r=new AbortController,i=null;function a(){if(r.signal.aborted)return null;let{active:e,status:i}=n.current;return e&&i!==`ending`?null:(i===`ending`&&t.cancel(),t.open())}function o(e){let{active:i,status:a}=n.current;return r.signal.aborted||!i||a===`ending`?null:t.close(e)}function s(){if(c(),typeof document>`u`)return;i=new AbortController;let{signal:t}=i;Z(document,`keydown`,l,{signal:t}),e.onDocumentActive?.(t)}function c(){i?.abort(),i=null}function l(t){t.key===`Escape`&&(t.defaultPrevented||n.current.active&&(e.closeOnEscape?.()??!0)&&e.onEscapeDismiss(t))}let u=n.subscribe(()=>{n.current.active?s():c()});r.signal.addEventListener(`abort`,()=>{u(),t.destroy(),c()});function d(){r.signal.aborted||r.abort()}return{input:n,open:a,close:o,signal:r.signal,destroy:d}}function nT(e){let{onOpenChange:t}=e,n=null,r=null,i=null,a=tT({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.stopPropagation(),c()}}),o=a.input;function s(){r=document.activeElement;let i=a.open();i&&(t(!0),requestAnimationFrame(()=>{a.signal.aborted||!o.current.active||n?.focus()}),i.then(()=>{a.signal.aborted||!o.current.active||e.onOpenChangeComplete?.(!0)}))}function c(){let i=a.close(n);i&&(t(!1),i.then(()=>{a.signal.aborted||(r&&=(r.focus(),null),e.onOpenChangeComplete?.(!1))}))}function l(){if(u(),!n)return;i=new AbortController;let{signal:e}=i;Z(n,`click`,d,{signal:e})}function u(){i?.abort(),i=null}function d(e){e.target instanceof HTMLButtonElement&&c()}function f(e){n=e,l()}return a.signal.addEventListener(`abort`,()=>{u(),n=null,r=null}),{input:o,open:s,close:c,setElement:f,destroy:a.destroy}}function rT(e){let{onActivate:t,isDisabled:n}=e;return{role:`button`,tabIndex:0,onClick(e){if(n()){e.preventDefault();return}t(e)},onPointerDown(e){n()&&e.preventDefault()},onMouseDown(e){n()&&e.preventDefault()},onKeyDown(e){if(e.target===e.currentTarget){if(n()){e.key!==`Tab`&&e.preventDefault();return}e.key===`Enter`?(e.preventDefault(),t(e)):e.key===` `&&e.preventDefault()}},onKeyUp(e){e.target===e.currentTarget&&(n()||e.key===` `&&t(e))}}}var iT=`group`;function aT(e){let t=Lx(e.ownerDocument);(!t||t===e.ownerDocument.body||!sS(e,t))&&e.focus({preventScroll:!0})}var oT={transitionStarting:`data-starting-style`,transitionEnding:`data-ending-style`};function sT(e){return{transitionStarting:e===`starting`,transitionEnding:e===`ending`}}function cT(e){let{onOpenChange:t,closeOnOutsideClick:n}=e,r=null,i=null,a=null,o=new Set,s=!1,c=null,l=tT({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.preventDefault(),x(`escape`,e)},onDocumentActive(e){Z(document,`pointerdown`,w,{capture:!0,signal:e})}}),u=l.input,d={close(e){x(e)}};function f(){a!==null&&(clearTimeout(a),a=null)}function p(){return globalThis.matchMedia?.(`(hover: hover)`)?.matches??!1}function m(){return p()?globalThis.matchMedia?.(`(pointer: fine)`)?.matches??!1:!1}function h(){return e.openOnHover?.()?p():!0}function g(){s=!1,c!==null&&(clearTimeout(c),c=null)}function _(){s=!0,c!==null&&clearTimeout(c),c=setTimeout(g,500)}function v(){return s?(g(),!0):!1}function y(){return r?r.hasAttribute(`disabled`)?!0:r.getAttribute(`aria-disabled`)===`true`:!1}function b(n,r){let i=l.open();i&&(e.group?.()?.open(d),t(!0,r?{reason:n,event:r}:{reason:n}),i.then(()=>{l.signal.aborted||!u.current.active||e.onOpenChangeComplete?.(!0)}))}function x(n,r){let a=l.close(i);a&&(e.group?.()?.close(d),t(!1,r?{reason:n,event:r}:{reason:n}),a.then(()=>{l.signal.aborted||($x(i),e.onOpenChangeComplete?.(!1))}))}function S(e=`click`){b(e)}function C(e=`click`){x(e)}function w(e){if(!n()||!u.current.active)return;let t=e.composedPath();if(r&&t.includes(r)||i&&t.includes(i)){_();return}g(),x(`outside-click`,e)}l.signal.addEventListener(`abort`,()=>{e.group?.()?.close(d),f(),g(),o.clear(),r=null,i=null});let T={onClick(e){h()&&(y()||(u.current.active&&u.current.status!==`ending`?x(`click`,e):b(`click`,e)))},onPointerEnter(t){if(!e.openOnHover?.()||!p()||(f(),u.current.active))return;let n=e.delay?.()??300;a=setTimeout(()=>b(`hover`),n)},onPointerLeave(t){if(!e.openOnHover?.()||!p()||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onFocusIn(t){if(e.openOnHover?.()){if(!m())return;b(`focus`)}},onFocusOut(t){let n=t.relatedTarget;n&&(r?.contains(n)||i?.contains(n))||e.openOnHover?.()&&x(`blur`)}},E={onPointerEnter(t){e.openOnHover?.()&&f()},onPointerLeave(t){if(!e.openOnHover?.()||o.size>0||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onGotPointerCapture(e){o.add(e.pointerId)},onLostPointerCapture(e){o.delete(e.pointerId)},onFocusOut(e){let t=e.relatedTarget;if(!(t&&(r?.contains(t)||i?.contains(t)))&&!v()){if(t!==null){x(`blur`);return}requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!u.current.active||u.current.status===`ending`||u.current.status===`starting`)return;let e=document.activeElement;e&&(r?.contains(e)||i?.contains(e))||x(`blur`)})})}}};function D(e){r=e}function O(e){!e&&i&&u.current.active&&$x(i),i=e,e&&u.current.active&&Qx(e)}return{input:u,triggerProps:T,popupProps:E,get triggerElement(){return r},setTriggerElement:D,setPopupElement:O,open:S,close:C,destroy:l.destroy}}function lT(e,t,n,r){let i=e+n,a=t+r;return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e,toJSON(){return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e}}}}function uT(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return lT(n,r,Math.max(0,i-n),Math.max(0,a-r))}function dT(e){let t=document.documentElement.getBoundingClientRect();return e?uT(t,e.getBoundingClientRect()):t}function fT(e,t={}){if(!e)return null;if(!ox(e))return e;if(e===`viewport`)return null;if(e===`container`)return t.container??null;try{return(t.root??document).querySelector(e)}catch{return null}}var pT={sideOffset:`--media-popover-side-offset`,alignOffset:`--media-popover-align-offset`,boundaryOffset:`--media-popover-boundary-offset`,anchorWidth:`--media-popover-anchor-width`,anchorHeight:`--media-popover-anchor-height`,availableWidth:`--media-popover-available-width`,availableHeight:`--media-popover-available-height`};function mT(e,t,n){return Math.max(t,Math.min(n,e))}function hT(e,t,n){let r=Math.round((e-n)/t)*t+n,i=`${t}`.indexOf(`.`);return i===-1?r:Number(r.toFixed(`${t}`.length-i-1))}var gT={sideOffset:0,alignOffset:0,boundaryOffset:0},_T={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function vT(e){return`${mT(e,0,1/0)}px`}function yT(e,t,n,r){let i=n-r;return i<t?t:mT(e,t,i)}function bT(e,t,n,r,i,a,o,s){let c=a===`start`?e+o:a===`end`?t+o:e+n/2+o,l=a===`start`?`0px`:a===`end`?`-100%`:`-50%`;return{base:`${c}px`,translate:`clamp(${r+s-c}px, ${l}, calc(${i-s-c}px - 100%))`}}function xT(e,t,n,r,i,a,o=pT){if(Rx())return{...ST(e,t,o,n,i,a),...n&&i?CT(n,i,t,a,o):{}};if(n&&r){let e=a??gT;return{position:`fixed`,margin:`0`,...wT(n,r,t,e,i),...i?CT(n,i,t,e,o):{}}}return{}}function ST(e,t,n=pT,r,i,a=gT){let o=`var(${n.sideOffset}, 0px)`,s=`var(${n.alignOffset}, 0px)`,{side:c,align:l}=t,u=a.boundaryOffset??0,d={positionAnchor:`--${e}`,position:`fixed`,inset:`auto`,margin:`0`,justifySelf:`normal`,alignSelf:`normal`,marginInlineStart:`0`,marginBlockStart:`0`,translate:`none`},f=_T[c];if(c===`top`||c===`bottom`){if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=bT(r.left,r.right,r.width,i.left,i.right,l,a.alignOffset,u);return d.left=e,d.translate=`${t} 0`,d}l===`start`?d.left=`calc(anchor(left) + ${s})`:l===`end`?d.right=`calc(anchor(right) + ${s})`:(d.justifySelf=`anchor-center`,d.marginInlineStart=s)}else{if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=bT(r.top,r.bottom,r.height,i.top,i.bottom,l,a.alignOffset,u);return d.top=e,d.translate=`0 ${t}`,d}l===`start`?d.top=`calc(anchor(top) + ${s})`:l===`end`?d.bottom=`calc(anchor(bottom) + ${s})`:(d.alignSelf=`anchor-center`,d.marginBlockStart=s)}return d}function CT(e,t,n,r=gT,i=pT){let a={},{side:o}=n,s=r.boundaryOffset??0,c=t.left+s,l=t.right-s,u=t.top+s,d=t.bottom-s;if(a[i.anchorWidth]=`${e.width}px`,a[i.anchorHeight]=`${e.height}px`,o===`top`||o===`bottom`){let t=o===`top`?e.top-u:d-e.bottom;a[i.availableHeight]=vT(t-r.sideOffset),a[i.availableWidth]=vT(l-c)}else{let t=o===`left`?e.left-c:l-e.right;a[i.availableWidth]=vT(t-r.sideOffset),a[i.availableHeight]=vT(d-u)}return a}function wT(e,t,n,r={sideOffset:0,alignOffset:0},i){let{side:a,align:o}=n,{sideOffset:s,alignOffset:c}=r,l=0,u,d=0,f;if(a===`top`?u=`calc(100% - ${e.top}px + ${s}px)`:a===`bottom`?l=e.bottom+s:a===`left`?f=`calc(100% - ${e.left}px + ${s}px)`:d=e.right+s,a===`top`||a===`bottom`?d=o===`start`?e.left+c:o===`end`?e.right-t.width+c:e.left+(e.width-t.width)/2+c:l=o===`start`?e.top+c:o===`end`?e.bottom-t.height+c:e.top+(e.height-t.height)/2+c,i){let e=r.boundaryOffset??0;a===`top`||a===`bottom`?d=yT(d,i.left+e,i.right-e,t.width):l=yT(l,i.top+e,i.bottom-e,t.height)}return{top:a===`top`?`auto`:`${l}px`,bottom:u??`auto`,left:a===`left`?`auto`:`${d}px`,right:f??`auto`}}function TT(e,t=pT){let n=getComputedStyle(e);return{sideOffset:tS(e,n.getPropertyValue(t.sideOffset)),alignOffset:tS(e,n.getPropertyValue(t.alignOffset)),boundaryOffset:tS(e,n.getPropertyValue(t.boundaryOffset))}}function ET(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width,i=e.offsetHeight||n.height;return lT(n.left,n.top,t===`left`||t===`right`?Math.max(r,e.scrollWidth):r,t===`top`||t===`bottom`?Math.max(i,e.scrollHeight):i)}function DT(){let e=null;return{open(t){e!==t&&(e?.close(`group-open`),e=t)},close(t){e===t&&(e=null)}}}function OT(e,t,n,r){let i;return i=n===`vertical`?1-(e.clientY-t.top)/t.height:r?(t.right-e.clientX)/t.width:(e.clientX-t.left)/t.width,Number.isFinite(i)?mT(i*100,0,100):0}function kT(e){let t=JS({pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1}),n=new AbortController,r=e.changeThrottle??0,i=!1,a=!1,o=null,s=null,c=0,l=!1,u=r>0?gS(t=>e.onValueChange?.(t),r,{leading:!0}):null;function d(t,n){n&&u?u(t):e.onValueChange?.(t)}function f(){if(lx(s))return;let t=s;s=null;try{e.getElement().releasePointerCapture(t)}catch{}}function p(){i?(l||e.onValueCommit?.(c),i=!1,t.patch({dragging:!1,pointing:!1}),e.onDragEnd?.()):t.patch({pointing:!1}),l=!1,m()}function m(){u?.cancel(),s=null,o=null}let h={onPointerDown(n){if(e.isDisabled())return;n.stopPropagation(),n.preventDefault();let r=e.getElement();o=r.getBoundingClientRect(),a=e.isRTL(),l=!1,f(),s=n.pointerId,r.setPointerCapture(n.pointerId);let u=OT(n,o,e.getOrientation(),a);i=!0,c=u,t.patch({pointing:!0,dragging:!0,pointerPercent:u,dragPercent:u}),e.onDragStart?.(),e.onValueChange?.(u),e.getThumbElement?.()?.focus({preventScroll:!0,focusVisible:!1})},onPointerMove(n){if(e.isDisabled())return;if(!lx(s)){if(n.pointerType!==`touch`&&n.buttons===0){p();return}let r=OT(n,o,e.getOrientation(),a);c=r,t.patch({dragPercent:r,pointerPercent:r}),d(r,!0);return}let r=OT(n,e.getElement().getBoundingClientRect(),e.getOrientation(),e.isRTL());t.patch({pointing:!0,pointerPercent:r})},onPointerUp(t){if(e.isDisabled()||(t.stopPropagation(),lx(s)))return;let n=OT(t,o,e.getOrientation(),a);u?.cancel(),e.onValueChange?.(n),e.onValueCommit?.(n),l=!0},onPointerLeave(){lx(s)&&t.patch({pointing:!1})},onLostPointerCapture(){p()}},g={onKeyDown(n){if(e.isDisabled()){n.key!==`Tab`&&n.preventDefault();return}let r=e.getStepPercent(),i=e.getLargeStepPercent(),a=hT(e.getPercent(),r,0),o=e.isRTL()?-1:1,s=n.shiftKey?i:r,c=null;switch(n.key){case`ArrowRight`:c=a+s*o;break;case`ArrowLeft`:c=a-s*o;break;case`ArrowUp`:c=a+s;break;case`ArrowDown`:c=a-s;break;case`PageUp`:c=a+i;break;case`PageDown`:c=a-i;break;case`Home`:c=0;break;case`End`:c=100;break}c!==null&&(n.preventDefault(),c=mT(c,0,100),t.patch({pointerPercent:c,dragPercent:c}),e.onValueChange?.(c),e.onValueCommit?.(c))},onFocus(){t.patch({focused:!0})},onBlur(){t.patch({focused:!1})}};function _(t){if(!e.adjustPercent||t.thumbAlignment!==`edge`)return t;let n=e.getElement(),r=e.getThumbElement?.();if(!r)return t;let i=t.orientation===`horizontal`,a=i?r.offsetWidth:r.offsetHeight,o=i?n.offsetWidth:n.offsetHeight;return{...t,fillPercent:e.adjustPercent(t.fillPercent,a,o),pointerPercent:e.adjustPercent(t.pointerPercent,a,o)}}let v=null;return e.onResize&&(v=new ResizeObserver(()=>e.onResize()),v.observe(e.getElement())),{input:t,rootProps:h,rootStyle:{touchAction:`none`,userSelect:`none`},thumbProps:g,adjustForAlignment:_,destroy(){n.signal.aborted||(n.abort(),v?.disconnect(),f(),m())}}}var AT={fill:`--media-slider-fill`,pointer:`--media-slider-pointer`,buffer:`--media-slider-buffer`};function jT(e){return{[AT.fill]:`${e.fillPercent.toFixed(3)}%`,[AT.pointer]:`${e.pointerPercent.toFixed(3)}%`}}function MT(e){return{...jT(e),[AT.buffer]:`${e.bufferPercent.toFixed(3)}%`}}function NT(e,t){let n=e/2;return{position:`absolute`,left:t===`visible`?`calc(var(${AT.pointer}) - ${n}px)`:`min(max(0px, calc(var(${AT.pointer}) - ${n}px)), calc(100% - ${e}px))`,width:`max-content`,pointerEvents:`none`}}var PT=class{findActiveThumbnail(e,t){if(e.length===0)return;let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1,o=e[a];t>=o.startTime?(i=o,n=a+1):r=a-1}return i}parseConstraints(e){let t=parseFloat(e.minWidth),n=parseFloat(e.maxWidth),r=parseFloat(e.minHeight),i=parseFloat(e.maxHeight);return{minWidth:Number.isFinite(t)?t:0,maxWidth:Number.isFinite(n)?n:1/0,minHeight:Number.isFinite(r)?r:0,maxHeight:Number.isFinite(i)?i:1/0}}calculateScale(e,t,n){let{minWidth:r,maxWidth:i,minHeight:a,maxHeight:o}=n,s=Math.min(i/e,o/t),c=Math.max(r/e,a/t);return Number.isFinite(s)&&s<1?s:Number.isFinite(c)&&c>1?c:1}resize(e,t,n,r){let i=e.width??t,a=e.height??n;if(!i||!a)return;let o=this.calculateScale(i,a,r),s=e.coords?.x??0,c=e.coords?.y??0,l=o===1?0:1;return{scale:o,containerWidth:Math.max(0,Math.floor(i*o)-l*2),containerHeight:Math.max(0,Math.floor(a*o)-l*2),imageWidth:Math.ceil(t*o),imageHeight:Math.ceil(n*o),offsetX:Math.ceil(s*o)+l,offsetY:Math.ceil(c*o)+l}}getState(e,t,n){return{loading:e,error:t,hidden:!e&&!n}}getAttrs(e){return{role:`img`,"aria-hidden":`true`}}};function FT(e){let{getContainer:t,getImg:n,onStateChange:r}=e,i=new PT,a=new AbortController,o=a.signal,s=!1,c=!1,l=0,u=0,d=``,f=!1,p=null;function m(){let e=n();e&&(l=e.naturalWidth,u=e.naturalHeight),s=!1,c=!1,r()}function h(){s=!1,c=!0,r()}function g(e){Z(e,`load`,m,{signal:o}),Z(e,`error`,h,{signal:o})}function _(){if(!f){let e=n();e&&(g(e),f=!0)}if(!p){let e=t();e&&(p=new ResizeObserver(r),p.observe(e))}}function v(e){_();let t=e??``;t!==d&&(d=t,t?(s=!0,c=!1):(s=!1,c=!1,l=0,u=0))}function y(){_();let e=n();e?.complete&&d&&(e.naturalWidth>0?(l=e.naturalWidth,u=e.naturalHeight,s=!1,c=!1):(s=!1,c=!0),r())}function b(){a.abort(),p?.disconnect(),p=null}return{get loading(){return s},get error(){return c},get naturalWidth(){return l},get naturalHeight(){return u},readConstraints(){let e=t();return e?i.parseConstraints(getComputedStyle(e)):{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0}},updateSrc:v,connect:y,destroy:b}}var IT={hover:`hover`,focus:`focus`,escape:`escape`,blur:`blur`,"imperative-action":`imperative-action`};function LT(e){let t={transition:e.transition,onOpenChange(t,n){let r=IT[n.reason];if(!r)return;let i=e.group?.();t?i?.notifyOpen():i?.notifyClose();let a=n.event?{reason:r,event:n.event}:{reason:r};e.onOpenChange(t,a)},closeOnEscape:()=>!0,closeOnOutsideClick:()=>!1,openOnHover:()=>!0,delay:()=>{let t=e.group?.();return t?.shouldSkipDelay()?0:e.delay?.()??t?.delay??600},closeDelay:()=>{let t=e.group?.();return e.closeDelay?.()??t?.closeDelay??0}};e.onOpenChangeComplete&&(t.onOpenChangeComplete=e.onOpenChangeComplete);let n=cT(t),r=!1,{onClick:i,...a}=n.triggerProps,o={...a,onPointerDown(){r=!0},onPointerEnter(t){e.disabled?.()||t.pointerType!==`touch`&&a.onPointerEnter(t)},onFocusIn(t){if(!e.disabled?.()){if(r){r=!1;return}a.onFocusIn(t)}}},s={...n.popupProps,onPointerEnter(t){e.disableHoverablePopup?.()||n.popupProps.onPointerEnter(t)}};return{...n,triggerProps:o,popupProps:s,get triggerElement(){return n.triggerElement},open:()=>n.open(`hover`),close:(e=`hover`)=>n.close(e)}}function RT(){let e=JS({active:!1,status:`idle`}),t=!1,n=0,r=0;function i(i=null){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0;let a=e.current.active;return a&&e.patch({status:`idle`}),e.patch({active:!0,status:`starting`}),new Promise(o=>{n=requestAnimationFrame(()=>{n=0,a&&(BT(i),zT(i)),r=requestAnimationFrame(()=>{if(r=0,t||!e.current.active)return o();e.patch({status:`idle`}),o()})})})}function a(i){return cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.patch({status:`ending`}),new Promise(a=>{n=requestAnimationFrame(()=>{n=0,r=requestAnimationFrame(()=>{if(r=0,t)return a();VT(i).finally(()=>{if(t||e.current.status!==`ending`)return a();e.patch({active:!1,status:`idle`}),a()})})})})}function o(){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.current.status!==`idle`&&e.patch({status:`idle`})}return{state:e,open:i,close:a,cancel:o,destroy(){t||(t=!0,o())}}}function zT(e){e&&e.offsetHeight}function BT(e){let t=e?.getAnimations?.({subtree:!0})??[];for(let e of t)e.cancel()}function VT(e){if(!e)return Promise.resolve();let t=e.getAnimations?.()??[];return t.length===0?Promise.resolve():Promise.all(t.map(e=>e.finished)).then(hS,hS)}function HT(e){return{onWheel(t){if(e.isDisabled())return;let n=Math.sign(t.deltaY);if(n===0)return;t.preventDefault();let r=e.getStepPercent(),i=mT(e.getPercent()-n*r,0,100);e.onValueChange?.(i)}}}function UT(e,t){if(!t)return!1;if(cx(e.composedPath))return e.composedPath().includes(t);let n=e.target;return n instanceof Node&&t.contains(n)}function WT(e,t){let n={};for(let r in e){if(t&&!(r in t))continue;let i=t?.[r]??GT(r),a=e[r];a===!0?n[i]=``:a&&(n[i]=String(a))}return n}function GT(e){return`data-${e.toLowerCase()}`}var KT={key:`container.label`,text:`Media player`};p();var qT=S(function({children:e,tabIndex:t=0,role:n=iT,"aria-label":r,"aria-labelledby":i,...a},o){let s=MS(),c=Mx(),l=m(null),u=fS(o,l);E(()=>(s?.(l.current),()=>s?.(null)),[s]);let d=e=>{a.onPointerUp?.(e);let t=l.current;t&&aT(t)};return dp(`div`,{ref:u,role:n,tabIndex:t,...r!==void 0||i!==void 0?{"aria-label":r,"aria-labelledby":i}:{"aria-label":c(KT)},...a,onPointerUp:d,children:e})});p();function JT(e){let t=m(e);return t.current=e,t}p();function YT(e,t,n){let r=m(null),i=JT(t),a=JT(n);E(()=>(r.current===null?i.current?.():(clearTimeout(r.current),r.current=null),()=>{r.current=setTimeout(()=>{a.current?.(),e.destroy()},0)}),[e])}p();function XT(e){function t({children:t}){let[n,r]=T(()=>XS()(FS(...e.features))),[i]=T(()=>DT()),[a,o]=T(null),[s,c]=T(null);return YT(n),E(()=>{if(a){if(n.destroyed){r(XS()(FS(...e.features)));return}return n.attach({media:a,container:s})}},[a,s,n]),dp(CS,{value:w(()=>({store:n,media:a,setMedia:o,container:s,setContainer:c,popupGroup:i}),[n,a,s,i]),children:t})}function n(e){let{store:t}=wS();return yS(t,e)}return{Provider:t,Container:qT,usePlayer:n,useMedia:DS}}function ZT(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90}function QT(e,t){return ZT(e)&&(typeof t==`function`||t===void 0)}function $T(e,t){return t?e?n=>{t(n),e(n)}:t:e}function eE(e,t){return t&&e?`${t} ${e}`:t||e}function tE(e,t){return t?e?{...e,...t}:t:e}function nE(e,t){if(!t)return e;for(let n in t){let r=t[n];n===`className`?e.className=eE(e.className,r):n===`style`?e.style=tE(e.style,r):QT(n,r)?e[n]=$T(e[n],r):e[n]=r}return e}function rE(...e){let t={};for(let n of e)t=nE(t,n);return t}p();function iE(e,t){return cx(e)?e(t):e}function aE(e,t){return cx(e)?e(t):e}function oE(e){let t=e;return t.ref??t.props?.ref}function sE(e,t,n){let{className:r,style:i,render:a}=t,{state:s,ref:c,props:l,stateAttrMap:u}=n,d=iE(r,s),p=aE(i,s),m=rE(u?WT(s,u):{},...Array.isArray(l)?l:l?[l]:[]);if(d!==void 0&&(m.className=m.className?`${m.className} ${d}`:d),p!==void 0&&(m.style=m.style?{...m.style,...p}:p),cx(a)){let e=dS(c,m.ref);return a({...m,ref:e},s)}if(b(a)){let e=oE(a),t=dS(c,m.ref,e),n=rE(m,a.props);return n.ref=t,f(a,n)}return m.ref=dS(c,m.ref),o(e,m)}p();function cE(e){let{displayName:t,onActivate:n,isDisabled:r}=e,i=d(e=>{},[t]);return{getButtonProps:d(e=>rE(rT({onActivate:n,isDisabled:r}),e),[n,r]),buttonRef:i}}p();function lE(e,t){let n=OS(),[r,i]=T({});return E(()=>{if(!n||!e){i({});return}let r=Qw(n),a=()=>i(r.getShortcut(e,t));return a(),r.subscribeShortcutChanges(a)},[n,e,t]),r}p(),a(null).Provider,a(null).Provider,a(null).Provider,a(null).Provider;var uE=a(!1);uE.Provider;function dE(){return i(uE)}a(null).Provider,p();var fE=a(null),pE=fE.Provider;function mE(){let e=i(fE);if(!e)throw Error(`Tooltip compound components must be used within a Tooltip.Root`);return e}function hE(){return i(fE)}p();function gE(e,t){return e.getLabelParams?.(t)}function _E(e){let{displayName:t,core:n,stateAttrMap:r,selector:i,action:a,hotkeyAction:o,hotkeyValue:s,tooltipLabel:c,isSupported:l}=e,u=new Set(Object.keys(n.defaultProps)),d=S(function(e,d){let{render:f,className:p,style:m,...g}=e,_={},v={};for(let e of Object.keys(g))u.has(e)?_[e]=g[e]:v[e]=g[e];let y=hE(),b=dE(),x=y?.setContent,S=TS(i),C=lE(o,s?.(_)),w=Mx(),[E]=T(()=>new n);u.has(`menuTrigger`)&&X(_.menuTrigger)&&(_.menuTrigger=b),E.setProps(_);let{getButtonProps:D,buttonRef:O}=cE({displayName:t,onActivate:()=>{Promise.resolve(a(E,S)).catch(e=>{})},isDisabled:()=>!!_.disabled||!S});S&&E.setMedia(S);let k=S?E.getState():null,A=k?l?.(k)??!0:!1,j=k&&A?kx(E.getLabel(k),w,gE(E,k)):void 0,M=k&&A?c?.(E,k)??j:void 0;if(h(()=>{if(x)return x(M?{label:M,shortcut:C.shortcut}:void 0),()=>x(void 0)},[x,M,C.shortcut]),!S||!k||!A)return null;let N=E.getAttrs(k),P=N[`aria-label`],F={...N,...Ex(P)?{"aria-label":kx(P,w,gE(E,k))}:void 0,"aria-keyshortcuts":C.aria};return sE(`button`,{render:f,className:p,style:m},{state:k,stateAttrMap:r,ref:[d,O],props:[D(),F,v]})});return d.displayName=t,d}function vE(e,t){return cx(e)?e(t)||void 0:e||void 0}var yE=class{static defaultProps={open:!1,defaultOpen:!1};setProps(e){}#e=null;#t=void 0;#n=void 0;setInput(e){this.#e=e}setTitleId(e){this.#t=e}setDescriptionId(e){this.#n=e}getState(){let e=this.#e;return{open:e.active,status:e.status,titleId:this.#t,descriptionId:this.#n,...sT(e.status)}}getAttrs(e){return{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":e.titleId,"aria-describedby":e.descriptionId}}},bE={open:`data-open`,...oT},xE=class e{static defaultProps={delay:500};state=JS({visible:!1});#e={...e.defaultProps};#t=null;setProps(t){this.#e=dx(t,e.defaultProps)}destroy(){this.#n()}update(e){let t=e.waiting&&!e.paused;t&&!this.state.current.visible&&!this.#t?this.#t=setTimeout(()=>{this.#t=null,this.state.patch({visible:!0})},this.#e.delay):t||(this.#n(),this.state.patch({visible:!1}))}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}},SE={visible:`data-visible`},CE=class{#e=null;setMedia(e){this.#e=e}getState(){let e=this.#e;return{visible:e.controlsVisible,userActive:e.userActive}}},wE={visible:`data-visible`,userActive:`data-user-active`},TE=class extends yE{setProps(){}},EE=`common.`,DE={key:`${EE}empty`,text:``},OE={key:`${EE}ok`,text:`OK`},kE=`errors.`,AE={key:`${kE}aborted`,text:`You stopped media playback before it finished.`},jE={key:`${kE}network`,text:`This media could not be loaded due to a network or server issue.`},ME={key:`${kE}decode`,text:`This media could not be played. It may be corrupted, or your browser may not support its format.`},NE={key:`${kE}source`,text:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`},PE={key:`${kE}encrypted`,text:`This media could not be played because it could not be decrypted.`},FE={key:`${kE}title`,text:`Something went wrong.`},IE={key:`${kE}unexpected`,text:`An unexpected error occurred.`},LE={[nC.MEDIA_ERR_ABORTED]:AE,[nC.MEDIA_ERR_NETWORK]:jE,[nC.MEDIA_ERR_DECODE]:ME,[nC.MEDIA_ERR_SRC_NOT_SUPPORTED]:NE,[nC.MEDIA_ERR_ENCRYPTED]:PE,[nC.MEDIA_ERR_CUSTOM]:DE},RE={[nC.MEDIA_ERR_SRC_NOT_SUPPORTED]:[`Failed to open media`]};function zE(e){return e>=nC.MEDIA_ERR_ABORTED&&e<=nC.MEDIA_ERR_ENCRYPTED}function BE(){return FE}function VE(){return OE}function HE(e,t){if(e){let t=LE[e.code],n=e.message?.trim();if(n){let r=nC.defaultMessages[e.code];if(t&&r&&n===r)return t;let i=RE[e.code];return t&&zE(e.code)&&!e.context&&i?.includes(n)?t:n}if(t)return t}return t?.trim()||IE}var UE=`fullscreen.`,WE={key:`${UE}enter`,text:`Enter fullscreen`},GE={key:`${UE}exit`,text:`Exit fullscreen`},KE=class e{static defaultProps={label:``,disabled:!1};state=JS({fullscreen:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){return vE(this.#e.label,e)||(e.fullscreen?GE:WE)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.fullscreenAvailability;return this.state.patch({fullscreen:e.fullscreen,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.fullscreen?e.exitFullscreen():e.requestFullscreen()}},qE={fullscreen:`data-fullscreen`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},JE={key:`playback.rate`,text:`Playback rate {rate}`},YE=`volume.`,XE={key:`${YE}mutedValue`,text:`{percent}, muted`};`${YE}`;var ZE={key:`${YE}label`,text:`Volume`};`${YE}`;var QE=Intl.DurationFormat,$E=new Map;function eD(e,t){if(e===`digital`){let e=e=>String(e).padStart(2,`0`);return{format:n=>{let r=`${e(n.minutes??0)}:${e(n.seconds??0)}`;return t===`always`||n.hours!==void 0?`${n.hours??0}:${r}`:r}}}let n=[[`hours`,`hour`],[`minutes`,`minute`],[`seconds`,`second`]];return{format:e=>n.filter(([t])=>e[t]!==void 0).map(([t,n])=>{let r=e[t]??0;return`${r} ${n}${r===1?``:`s`}`}).join(`, `)}}function tD(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function nD(e){let t=Array.isArray(e)?e[0]:e;return t?t===`en`||t.startsWith(`en-`):!0}function rD(e,t=`long`,n){let r=`${tD(e)}:${t}:${n??``}`,i=$E.get(r);return i||(i=QE?new QE(e,n===void 0?{style:t}:{style:t,hoursDisplay:n}):eD(t,n),$E.set(r,i)),i}function iD(e){return sx(e)&&Number.isFinite(e)}function aD(e,t){if(!iD(e))return`0:00`;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s=iD(t??0)?Math.abs(t??0):0,c=Math.floor(s/3600),l=Math.floor(s/60%60),u=i>0||c>0,d=u||l>=10,f=u?{hours:i,minutes:a,seconds:o}:{minutes:a,seconds:o},p=rD(`en`,`digital`,u?`always`:`auto`).format(f);return d||(p=p.replace(/^0(?=\d:)/,``)),`${n?`-`:``}${p}`}function oD(e){if(!iD(e))return`PT0S`;let t=Math.abs(e),n=Math.floor(t/3600),r=Math.floor(t/60%60),i=Math.floor(t%60),a=`PT`;return n>0&&(a+=`${n}H`),r>0&&(a+=`${r}M`),(i>0||a===`PT`)&&(a+=`${i}S`),a}function sD(e,t){if(!iD(e))return``;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s={};i>0&&(s.hours=i),a>0&&(s.minutes=a),(o>0||i===0&&a===0)&&(s.seconds=o);let c=rD(t?.locale,t?.style??`long`).format(s);if(n){let e=t?.formatRemaining;return e?e(c):nD(t?.locale)?`${c} remaining`:c}return c}var cD=`buttons.`,lD={key:`${cD}play`,text:`Play`},uD={key:`${cD}pause`,text:`Pause`},dD={key:`${cD}replay`,text:`Replay`},fD={key:`${cD}mute`,text:`Mute`},pD={key:`${cD}unmute`,text:`Unmute`},mD=class e{static defaultProps={label:``,disabled:!1};state=JS({muted:!1,volumeLevel:`off`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){return vE(this.#e.label,e)||(e.muted?pD:fD)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({muted:e.muted||e.volume===0,volumeLevel:hD(e)}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}toggle(e){this.#e.disabled||e.toggleMuted()}};function hD(e){return e.muted||e.volume===0?`off`:e.volume<.5?`low`:e.volume<.75?`medium`:`high`}var gD={muted:`data-muted`,volumeLevel:`data-volume-level`},_D=`pip.`,vD={key:`${_D}enter`,text:`Enter picture-in-picture`},yD={key:`${_D}exit`,text:`Exit picture-in-picture`},bD=class e{static defaultProps={label:``,disabled:!1};state=JS({pip:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){return vE(this.#e.label,e)||(e.pip?yD:vD)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.pipAvailability;return this.state.patch({pip:e.pip,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.pip?e.exitPictureInPicture():e.requestPictureInPicture()}},xD={pip:`data-pip`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},SD=class e{static defaultProps={label:``,disabled:!1};state=JS({paused:!0,ended:!1,started:!1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){return vE(this.#e.label,e)||(e.ended?dD:e.paused?lD:uD)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({paused:e.paused,ended:e.ended,started:e.started}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(!this.#e.disabled){if(e.paused||e.ended)return e.play();e.pause()}}},CD={paused:`data-paused`,ended:`data-ended`,started:`data-started`},wD=class e{static defaultProps={label:``,disabled:!1,menuTrigger:!1};state=JS({rate:1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){let t=vE(this.#e.label,e);return t===void 0?JE:t}getLabelParams(e){if(vE(this.#e.label,e)===void 0)return{rate:e.rate}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({rate:e.playbackRate}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}cycle(e){if(this.#e.disabled||this.#e.menuTrigger)return;let{playbackRates:t,playbackRate:n}=e;if(t.length===0)return;let r=t.indexOf(n),i=r===-1?t.find(e=>e>n)??t[0]:t[(r+1)%t.length];e.setPlaybackRate(i)}},TD={rate:`data-rate`},ED=class e{static defaultProps={side:`top`,align:`center`,modal:!1,closeOnEscape:!0,closeOnOutsideClick:!0,open:!1,defaultOpen:!1,openOnHover:!1,delay:300,closeDelay:0};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,modal:this.#e.modal,...sT(e.status)}}getTriggerAttrs(e,t){return{"aria-expanded":e.open&&e.status!==`ending`?`true`:`false`,"aria-haspopup":`dialog`,"aria-controls":t}}getPopupAttrs(e){return{popover:`manual`,role:`dialog`,"aria-modal":e.modal===!0?`true`:void 0}}},DD={open:`data-open`,side:`data-side`,align:`data-align`,...oT},OD=`seek.`,kD={key:`${OD}forward`,text:`Seek forward {seconds} seconds`},AD={key:`${OD}backward`,text:`Seek backward {seconds} seconds`},jD=class e{static defaultProps={seconds:30,label:``,disabled:!1};state=JS({seeking:!1,direction:`forward`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}getLabel(e){let t=vE(this.#e.label,e);return t===void 0?e.direction===`backward`?AD:kD:t}getLabelParams(e){if(vE(this.#e.label,e)===void 0)return{seconds:Math.abs(this.#e.seconds)}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=this.#e.seconds<0?`backward`:`forward`;return this.state.patch({seeking:e.seeking,direction:t}),this.state.patch({label:Tx(this.getLabel(this.state.current))}),this.state.current}async seek(e){this.#e.disabled||await e.seek(e.currentTime+this.#e.seconds)}},MD={seeking:`data-seeking`,direction:`data-direction`},ND=class e{static defaultProps={label:``,step:1,largeStep:10,orientation:`horizontal`,disabled:!1,thumbAlignment:`center`,value:0,min:0,max:100};static defaultInput={pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1};#e={...e.defaultProps};#t={...e.defaultInput};get props(){return this.#e}get input(){return this.#t}constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}setInput(e){this.#t=e}getSliderState(e){let{orientation:t,disabled:n,thumbAlignment:r}=this.#e,{pointerPercent:i,dragging:a,pointing:o,focused:s}=this.#t;return{value:e,fillPercent:this.percentFromValue(e),pointerPercent:i,dragging:a,pointing:o,interactive:a||o||s,orientation:t,disabled:n,thumbAlignment:r}}getLabel(e){return vE(this.#e.label,e)||``}getAttrs(e){return{role:`slider`,tabIndex:e.disabled?-1:0,autoComplete:`off`,"aria-label":this.getLabel(e),"aria-valuemin":this.#e.min,"aria-valuemax":this.#e.max,"aria-valuenow":e.value,"aria-orientation":e.orientation,"aria-disabled":e.disabled?`true`:void 0}}valueFromPercent(e){let{min:t,max:n,step:r}=this.#e;return hT(mT(t+e/100*(n-t),t,n),r,t)}rawValueFromPercent(e){let{min:t,max:n}=this.#e;return mT(t+e/100*(n-t),t,n)}percentFromValue(e){let{min:t,max:n}=this.#e;return n===t?0:(e-t)/(n-t)*100}getStepPercent(){let{step:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}getLargeStepPercent(){let{largeStep:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}adjustPercentForAlignment(e,t,n){if(this.#e.thumbAlignment===`center`||n===0)return e;let r=t/n*100/2,i=r,a=100-r;return i+e/100*(a-i)}},PD={dragging:`data-dragging`,pointing:`data-pointing`,interactive:`data-interactive`,orientation:`data-orientation`,disabled:`data-disabled`},FD={loading:`data-loading`,error:`data-error`,hidden:`data-hidden`};function ID(e,t){let n=e.trim().split(`#`),r=n[0]??``,i=n[1],a=t?new URL(r,t).href:r;if(!i)return{url:a};let o=i.indexOf(`=`);if(o===-1)return{url:a};let s=i.slice(0,o),c=i.slice(o+1).split(`,`).map(Number),l={};for(let e=0;e<s.length;e++){let t=s[e],n=c[e];t&&sx(n)&&!Number.isNaN(n)&&(l[t]=n)}let u={url:a};return sx(l.w)&&(u.width=l.w),sx(l.h)&&(u.height=l.h),sx(l.x)&&sx(l.y)&&(u.coords={x:l.x,y:l.y}),u}function LD(e,t){let n=[];for(let r of e){let e=ID(r.text,t),i={url:e.url,startTime:r.startTime,endTime:r.endTime};e.width&&(i.width=e.width),e.height&&(i.height=e.height),e.coords&&(i.coords=e.coords),n.push(i)}return n}var RD=`time.`,zD={key:`${RD}current`,text:`Current time`},BD={key:`${RD}duration`,text:`Duration`},VD={key:`${RD}remaining`,text:`Remaining`},HD={key:`${RD}remainingSuffix`,text:`{duration} remaining`},UD={key:`${RD}showElapsed`,text:`{duration}. Show elapsed time.`},WD={key:`${RD}showDuration`,text:`{duration}. Show duration.`},GD={key:`${RD}showRemaining`,text:`{duration}. Show remaining time.`},KD={key:`${RD}position`,text:`{current} of {duration}`},qD={current:UD,duration:WD,remaining:GD},JD={current:zD,duration:BD,remaining:VD},YD=class e{static defaultProps={type:`current`,negativeSign:`-`,label:``,toggle:!1};#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}setMedia(e){this.#t=e}#n(){let e=this.#t,{type:t}=this.#e;switch(t){case`current`:return e.currentTime;case`duration`:return e.duration;case`remaining`:return e.currentTime-e.duration;default:return 0}}#r(){let e=this.#t,t=this.#n();return aD(Math.abs(t),e.duration)}#i(){let{type:e}=this.#e,t=this.#n();return sD(e===`remaining`?t<0?t:-Math.abs(t):t)}#a(){let e=this.#n();return oD(Math.abs(e))}#o(e,t){return e===`current`?t===`remaining`?`current`:`remaining`:t===`duration`?`remaining`:`duration`}getLabel(e,t=this.#e.type){let n=vE(this.#e.label,e);return n===void 0?this.#e.toggle?qD[this.#o(t,e.type)]:JD[this.#e.type]:n}getLabelParams(e){return vE(this.#e.label,e)===void 0&&this.#e.toggle?{duration:e.phrase}:void 0}getAttrs(e,t=this.#e.type){return{"aria-label":this.getLabel(e,t),role:this.#e.toggle?`button`:void 0,tabIndex:this.#e.toggle?0:void 0}}getState(){let e=this.#n();return{type:this.#e.type,seconds:e,negative:this.#e.type===`remaining`&&e<0,text:this.#r(),phrase:this.#i(),datetime:this.#a()}}},XD={type:`data-type`},ZD={key:`slider.seek`,text:`Seek`},QD=class e extends ND{static defaultProps={...ND.defaultProps,label:``,changeThrottle:100,pauseOnDrag:!1};#e={...e.defaultProps};#t=null;#n;#r=!1;constructor(e){super(),e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps),super.setProps({...t,min:0})}setMedia(e){this.#t=e}setFormatLocale(e){this.#n=e}getState(){let{duration:e,currentTime:t,seeking:n,buffered:r}=this.#t;super.setProps({...this.#e,min:0,max:e});let i=super.getSliderState(t),a=r.length>0?r[r.length-1][1]:0,o=e>0?a/e*100:0;return{...i,currentTime:t,duration:e,seeking:n,bufferPercent:o}}getLabel(e){return super.getLabel(e)||ZD}#i(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#a(e){return this.#n===void 0?sD(e):sD(e,{locale:this.#n})}getValueText(e){return Number.isFinite(e.duration)?KD:this.getValueTextParams(e).current}getValueTextParams(e){let t=this.#a(this.#i(e));return Number.isFinite(e.duration)?{current:t,duration:this.#a(e.duration)}:{current:t}}startDrag(e){this.#r=!1,this.#e.pauseOnDrag&&e&&!e.paused&&(this.#r=!0,e.pause())}endDrag(e){this.#r&&e?.play().catch(()=>{}),this.#r=!1}getAttrs(e){let t=super.getAttrs(e),n=this.#i(e);return{...t,"aria-valuenow":n,"aria-valuetext":this.getValueText(e)}}},$D={...PD,seeking:`data-seeking`},eO=class e{static defaultProps={side:`top`,align:`center`,open:!1,defaultOpen:!1,delay:600,closeDelay:0,disableHoverablePopup:!0,disabled:!1};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,...sT(e.status)}}getPopupAttrs(e){return{popover:`manual`,role:`presentation`}}},tO={sideOffset:`--media-tooltip-side-offset`,alignOffset:`--media-tooltip-align-offset`,boundaryOffset:`--media-tooltip-boundary-offset`,anchorWidth:`--media-tooltip-anchor-width`,anchorHeight:`--media-tooltip-anchor-height`,availableWidth:`--media-tooltip-available-width`,availableHeight:`--media-tooltip-available-height`},nO={open:`data-open`,side:`data-side`,align:`data-align`,...oT},rO=class e{static defaultProps={delay:600,closeDelay:0,timeout:400};#e={...e.defaultProps};#t=0;#n=!1;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=dx(t,e.defaultProps)}get delay(){return this.#e.delay}get closeDelay(){return this.#e.closeDelay}shouldSkipDelay(){return this.#n?!0:Date.now()-this.#t<this.#e.timeout}notifyOpen(){this.#n=!0}notifyClose(){this.#n=!1,this.#t=Date.now()}},iO=new Map;function aO(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function oO(e){let t=aO(e),n=iO.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),iO.set(t,n)}catch{return}return n}function sO(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function cO(e,t){let n=!sx(e)||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e));try{let e=oO(t)??oO(void 0);if(e)return e.format(n)}catch{}return sO(n)}var lO=class e extends ND{static defaultProps={...ND.defaultProps,label:``,wheelStep:5};#e=null;#t;constructor(e){super(),e&&this.setProps(e)}setProps(t){super.setProps(dx(t,e.defaultProps))}setMedia(e){this.#e=e}setFormatLocale(e){this.#t=e}getState(){let e=this.#e,{volume:t,muted:n}=e,r=n||t===0,{dragging:i,dragPercent:a}=this.input,o=t*100,s=i?this.valueFromPercent(a):o,c=super.getSliderState(s);return{...c,fillPercent:r?0:c.fillPercent,volume:t,muted:r,availability:e.volumeAvailability}}getWheelStepPercent(){let e=this.props,t=e.max-e.min;return t>0?e.wheelStep/t*100:0}getLabel(e){return super.getLabel(e)||ZE}getValueText(e){return e.muted?XE:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:cO(e.value/100,this.#t)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}},uO={...PD,availability:`data-availability`};p();var dO=a(null),fO=dO.Provider;function pO(){let e=i(dO);if(!e)throw Error(`AlertDialog compound components must be used within an AlertDialog.Root`);return e}var mO=Object.defineProperty,hO=(e,t)=>{let n={};for(var r in e)mO(n,r,{get:e[r],enumerable:!0});return t||mO(n,Symbol.toStringTag,{value:`Module`}),n};p();var gO=S(function({render:e,className:t,style:n,disabled:r,...i},a){let{dialog:o,state:s}=pO(),c=d(()=>{r||o.close()},[o,r]);return sE(`button`,{render:e,className:t,style:n},{state:s,ref:[a],props:[{type:`button`,disabled:r,onClick:c},i]})});p();function _O(e){let{displayName:t,tag:n,useContext:r,staticProps:i,getProps:a}=e,o=S(function(e,t){let{render:o,className:s,style:c,...l}=e,u=r(),d=a?.(u.state);return sE(n,{render:o,className:s,style:c},{state:u.state,stateAttrMap:u.stateAttrMap,ref:t,props:[i,d,l].filter(Boolean)})});return o.displayName=t,o}var vO=_O({displayName:`AlertDialogDescription`,tag:`p`,useContext:pO,getProps:e=>({id:e.descriptionId})});p();var yO=S(function({render:e,className:t,style:n,...r},i){let{core:a,dialog:o,state:s,stateAttrMap:c}=pO(),l=fS(i,d(e=>{o.setElement(e)},[o]));return s.open?sE(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:l,props:[{tabIndex:-1,...a.getAttrs(s)},r]}):null});p();var bO=/[^a-zA-Z0-9_-]/g;function xO(e){let t=l().replace(bO,``);return e?`${e}-${t}`:t}p();function SO({open:e,defaultOpen:t=yE.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,children:i}){let[a]=T(()=>new yE),o=e!==void 0,s=JT(n),c=JT(r),[l]=T(()=>{let e=nT({transition:RT(),onOpenChange:e=>{s.current?.(e)},onOpenChangeComplete:e=>{c.current?.(e)}});return!o&&t&&e.open(),e}),u=xO(`alert-dialog-title`),d=xO(`alert-dialog-desc`);a.setTitleId(u),a.setDescriptionId(d),E(()=>{if(e===void 0)return;let{active:t}=l.input.current;e!==t&&(e?l.open():l.close())},[e,l]),YT(l);let f=_S(l.input);return a.setInput(f),dp(fO,{value:{core:a,dialog:l,state:a.getState(),stateAttrMap:bE},children:i})}var CO=_O({displayName:`AlertDialogTitle`,tag:`h2`,useContext:pO,getProps:e=>({id:e.titleId})}),wO=hO({Close:()=>gO,Description:()=>vO,Popup:()=>yO,Root:()=>SO,Title:()=>CO});p();var TO=S(function(e,t){let{render:n,className:r,style:i,delay:a,...o}=e,s=TS(Cw),[c]=T(()=>new xE);YT(c),c.setProps({delay:a}),s&&c.update(s);let l=x(e=>c.state.subscribe(e),()=>c.state.current,()=>c.state.current);return s?sE(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:SE,ref:[t],props:[o]}):null});p();var EO=a(null),DO=EO.Provider;function OO(){let e=i(EO);if(!e)throw Error(`Controls compound components must be used within a Controls.Root`);return e}function kO(){return i(EO)}p();var AO=S(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{state:s,stateAttrMap:c}=OO(),l=o[`aria-label`]||o[`aria-labelledby`]?`group`:void 0;return sE(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:c,ref:[t],props:[{role:l,children:a},o]})});p();var jO=S(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=TS(yw),[c]=T(()=>new CE);if(!s)return null;c.setMedia(s);let l=c.getState();return dp(DO,{value:{state:l,stateAttrMap:wE},children:sE(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:wE,ref:[t],props:[{children:a},o,{"data-interactive":``}]})})}),MO=hO({Group:()=>AO,Root:()=>jO});p();var NO=a(null),PO=NO.Provider;function FO(){let e=i(NO);if(!e)throw Error(`ErrorDialog compound components must be used within an ErrorDialog.Root`);return e}p();var IO=S(function({render:e,className:t,style:n,disabled:r,children:i,...a},o){let s=Mx(),{dialog:c,state:l,stateAttrMap:u}=pO(),f=d(()=>{r||c.close()},[c,r]),p=i??kx(VE(),s);return sE(`button`,{render:e,className:t,style:n},{state:l,stateAttrMap:u,ref:o,props:[{type:`button`,disabled:r,onClick:f,children:p},a]})});p();var LO=S(function({render:e,className:t,style:n,children:r,...i},a){let o=Mx(),{state:s,stateAttrMap:c}=pO(),{lastError:l}=FO(),u=HE(l),d=r??kx(u,o);return sE(`p`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.descriptionId,children:d},i]})});p();function RO({children:e}){let[t]=T(()=>new TE),n=TS(bw),r=m(n?.error??null);n?.error&&(r.current=n.error);let i=JT(n),[a]=T(()=>nT({transition:RT(),onOpenChange:e=>{e||i.current?.dismissError()}})),o=xO(`error-dialog-title`),s=xO(`error-dialog-desc`);t.setTitleId(o),t.setDescriptionId(s),E(()=>{let e=!!n?.error,{active:t}=a.input.current;e&&!t?a.open():!e&&t&&a.close()},[n?.error,a]),YT(a);let c=_S(a.input);t.setInput(c);let l=t.getState();return n?dp(PO,{value:{lastError:r.current},children:dp(fO,{value:{core:t,dialog:a,state:l,stateAttrMap:bE},children:e})}):null}p();var zO=S(function({render:e,className:t,style:n,children:r,...i},a){let o=Mx(),{state:s,stateAttrMap:c}=pO(),l=r??kx(BE(),o);return sE(`h2`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.titleId,children:l},i]})}),BO=hO({Close:()=>IO,Description:()=>LO,Popup:()=>yO,Root:()=>RO,Title:()=>zO}),VO=_E({displayName:`FullscreenButton`,core:KE,stateAttrMap:qE,selector:xw,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleFullscreen`,isSupported:e=>!e.hidden});p();function HO({type:e,action:t,value:n,pointer:r,region:i,disabled:a}){let o=TS(),s=OS();return E(()=>{if(!s||!e||!t||a)return;let c=Aw(t);if(!c)return;let l=e=>{c({store:o,value:n,event:e})},u={pointer:r,region:i,action:t,value:n};return e===`doubletap`?Iw(s,l,u):Fw(s,l,u)},[s,o,e,t,n,r,i,a]),null}var UO=HO;p();function WO(){let[,e]=c(e=>e+1,0);return e}p();function GO(e){let t=JT(e),n=m(null),r=m(null),i=WO(),[a]=T(()=>kT({getElement:()=>n.current,getThumbElement:()=>r.current,getOrientation:()=>t.current.orientation??`horizontal`,isRTL:()=>n.current?Px(n.current):!1,isDisabled:()=>t.current.disabled??!1,getPercent:()=>t.current.getPercent(),getStepPercent:()=>t.current.getStepPercent(),getLargeStepPercent:()=>t.current.getLargeStepPercent(),changeThrottle:t.current.changeThrottle,adjustPercent:t.current.adjustPercent,onValueChange:e=>t.current.onValueChange?.(e),onValueCommit:e=>t.current.onValueCommit?.(e),onDragStart:()=>t.current.onDragStart?.(),onDragEnd:()=>t.current.onDragEnd?.()}));YT(a);let o=_S(a.input),s=e.computeState(o);return h(()=>{s.thumbAlignment===`edge`&&n.current&&r.current&&i()},[s.thumbAlignment]),{state:s,cssVars:e.getCSSVars(a.adjustForAlignment(s)),rootRef:d(e=>{n.current=e},[]),thumbRef:d(e=>{r.current=e},[]),rootProps:a.rootProps,rootStyle:a.rootStyle,thumbProps:a.thumbProps}}p();function KO({keys:e,action:t,value:n,disabled:r,target:i}){let a=TS(),o=OS();return E(()=>{if(!o||!e||!t||r)return;let s=zw(t);if(s)return $w(o,{keys:e,action:t,value:n,target:i,disabled:r,repeatable:!Lw(t),onActivate:(e,t)=>{s({store:a,key:t,value:n})}})},[o,a,e,t,n,r,i]),null}var qO=KO;p();function JO(e){let t=e.side,[n,r]=T({preferred:t,side:t}),i=e.open&&n.preferred===t?n.side:t,a=w(()=>i===t?e:{...e,side:i},[i,e,t]),o=d(e=>r(n=>n.preferred===t&&n.side===e?n:{preferred:t,side:e}),[t]);return E(()=>{e.open||o(t)},[e.open,t,o]),{state:a,preferredSide:t,setPositionedSide:o}}var YO=_E({displayName:`MuteButton`,core:mD,stateAttrMap:gD,selector:Dw,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleMuted`}),XO=_E({displayName:`PiPButton`,core:bD,stateAttrMap:xD,selector:Sw,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePictureInPicture`,isSupported:e=>!e.hidden}),ZO=_E({displayName:`PlayButton`,core:SD,stateAttrMap:CD,selector:Cw,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePaused`}),QO=_E({displayName:`PlaybackRateButton`,core:wD,stateAttrMap:TD,selector:ww,action:(e,t)=>e.cycle(t),hotkeyAction:`speedUp`});p();var $O=a(null),ek=$O.Provider;function tk(){let e=i($O);if(!e)throw Error(`Popover compound components must be used within a Popover.Root`);return e}var nk=_O({displayName:`PopoverArrow`,tag:`div`,useContext:tk,staticProps:{"aria-hidden":`true`}});p();var rk={position:`fixed`,inset:`auto`,margin:0},ik=S(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,preferredSide:c,setPositionedSide:l,stateAttrMap:u,anchorName:f,popupId:p,boundary:g,container:_}=tk(),v=m(null),y=fS(i,d(e=>{o.setPopupElement(e),e&&Rx()&&e.style.setProperty(`position-anchor`,`--${f}`)},[o,f]),v),b=w(()=>({side:c,align:s.align}),[c,s.align]),x=w(()=>{if(!Rx())return null;let{positionAnchor:e,...t}=xT(f,b);return t},[f,b]),[S,C]=T(null);h(()=>{if(!s.open){C(null);return}function e(){let e=o.triggerElement,t=v.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=fT(g,{container:_,root:r}),a=ET(t,b.side),s=dT(i),c=TT(t),u=Zx(n,a,s,b,c),{positionAnchor:d,...p}=xT(f,{...b,side:u},n,Rx()?void 0:a,s,c);C(p),l(u)}e();let t=o.triggerElement,n=v.current,r=n?fT(g,{container:_,root:n.getRootNode()}):null,i=0;function a(t){t&&UT(t,v.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let c=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&c&&c.observe(t),n&&c&&c.observe(n),r&&c&&c.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),c?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[s.open,f,b,o,g,_,l]);let E=S??x??rk;if(!s.open)return null;let{onFocusOut:D,...O}=o.popupProps;return sE(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:u,ref:y,props:[{id:p,style:E,...a.getPopupAttrs(s)},{...O,onBlur:D},r]})});p();function ak({open:e,defaultOpen:t=ED.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,openOnHover:i=ED.defaultProps.openOnHover,delay:a=ED.defaultProps.delay,closeDelay:o=ED.defaultProps.closeDelay,boundary:s=`container`,children:c,...l}){let u=kS(),d=AS(),f=kO(),[p]=T(()=>new ED(l));p.setProps(l);let m=!X(e),h=JT(n),g=JT(r),_=JT(l.closeOnEscape),v=JT(l.closeOnOutsideClick),y=JT(i),b=JT(a),x=JT(o),S=JT(d),[C]=T(()=>{let e=cT({transition:RT(),onOpenChange:(e,t)=>{h.current?.(e,t)},onOpenChangeComplete:e=>{g.current?.(e)},closeOnEscape:()=>_.current??ED.defaultProps.closeOnEscape,closeOnOutsideClick:()=>v.current??ED.defaultProps.closeOnOutsideClick,openOnHover:()=>y.current,delay:()=>b.current,closeDelay:()=>x.current,group:()=>S.current});return!m&&t&&e.open(`click`),e}),w=xO(),D=xO(`popup`);E(()=>{if(X(e))return;let{active:t}=C.input.current;e!==t&&(e?C.open(`click`):C.close(`click`))},[e,C]),E(()=>{X(f?.state.visible)||f.state.visible||C.close(`imperative-action`)},[f?.state.visible,C]),YT(C);let O=_S(C.input);p.setInput(O);let{state:k,preferredSide:A,setPositionedSide:j}=JO(p.getState());return dp(ek,{value:{core:p,popover:C,state:k,preferredSide:A,setPositionedSide:j,stateAttrMap:DD,anchorName:w,popupId:D,boundary:s,container:u},children:c})}p();var ok=S(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,stateAttrMap:c,anchorName:l,popupId:u}=tk(),f=d(e=>{o.setTriggerElement(e),e&&Rx()&&e.style.setProperty(`anchor-name`,`--${l}`)},[o,l]),{onFocusIn:p,onFocusOut:m,...h}=o.triggerProps;return sE(`button`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:[i,f],props:[{type:`button`,...a.getTriggerAttrs(s,u)},{...h,onFocus:p,onBlur:m},r]})}),sk=hO({Arrow:()=>nk,Popup:()=>ik,Root:()=>ak,Trigger:()=>ok}),ck=_E({displayName:`SeekButton`,core:jD,stateAttrMap:MD,selector:Ew,action:(e,t)=>e.seek(t),hotkeyAction:`seekStep`,hotkeyValue:e=>typeof e.seconds==`number`?e.seconds:jD.defaultProps.seconds});p();var lk=S(function(e,t){let{render:n,className:r,style:i,time:a=0,thumbnails:o,crossOrigin:s,loading:c,fetchPriority:l,...u}=e,[d]=T(()=>new PT),f=m(null),p=m(null),h=ES(Tw),[,g]=T(0),[_]=T(()=>FT({getContainer:()=>f.current,getImg:()=>p.current,onStateChange:()=>g(e=>e+1)}));YT(_,()=>_.connect());let v=w(()=>o&&o.length>0?o:h&&h.thumbnailCues.length>0?LD(h.thumbnailCues,h.thumbnailTrackSrc??void 0):[],[o,h]),y=w(()=>d.findActiveThumbnail(v,a),[d,v,a]);_.updateSrc(y?.url);let b=d.getState(_.loading,_.error,y),x={overflow:`hidden`},S;if(y&&_.naturalWidth&&_.naturalHeight){let e=_.readConstraints(),t=d.resize(y,_.naturalWidth,_.naturalHeight,e);t&&(x={overflow:`hidden`,width:t.containerWidth,height:t.containerHeight},S={width:t.imageWidth,height:t.imageHeight,maxWidth:`none`,transform:t.offsetX||t.offsetY?`translate(-${t.offsetX}px, -${t.offsetY}px)`:void 0})}return sE(`div`,{render:n,className:r,style:i},{state:b,stateAttrMap:FD,ref:[t,f],props:[d.getAttrs(b),{style:x},u,{children:dp(`img`,{ref:p,alt:``,"aria-hidden":`true`,decoding:`async`,src:y?.url,crossOrigin:s===``||s===null?void 0:s,loading:c,style:S,fetchPriority:l})}]})});p();var uk=a(null);function dk({value:e,children:t}){return dp(uk.Provider,{value:e,children:t})}function fk(){let e=i(uk);if(!e)throw Error(`Slider compound components must be used within a Slider.Root`);return e}var pk=_O({displayName:`SliderBuffer`,tag:`div`,useContext:fk}),mk=_O({displayName:`SliderFill`,tag:`div`,useContext:fk});p();var hk=S(function(e,t){let{render:n,className:r,style:i,overflow:a=`clamp`,...o}=e,s=fk(),{state:c}=s,l=m(null),[u,d]=T(0);E(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{d(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let f=NT(u,a);return sE(`div`,{render:n,className:r,style:i},{state:c,stateAttrMap:s.stateAttrMap,ref:[t,l],props:[{style:f},o]})});p();var gk=S(function(e,t){let{render:n,className:r,style:i,label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f,value:p=0,onValueChange:m,onValueCommit:h,onDragStart:g,onDragEnd:_,...v}=e,[y]=T(()=>new ND),b=Mx();y.setProps({label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f});let{state:x,cssVars:S,rootRef:C,thumbRef:w,rootProps:E,rootStyle:D,thumbProps:O}=GO({computeState:e=>(y.setInput(e),y.getSliderState(p)),getPercent:()=>y.percentFromValue(p),getStepPercent:()=>y.getStepPercent(),getLargeStepPercent:()=>y.getLargeStepPercent(),orientation:u,disabled:d,adjustPercent:(e,t,n)=>y.adjustPercentForAlignment(e,t,n),getCSSVars:jT,onValueChange:e=>m?.(y.valueFromPercent(e)),onValueCommit:e=>h?.(y.valueFromPercent(e)),onDragStart:g,onDragEnd:_});return dp(dk,{value:{state:x,pointerValue:y.valueFromPercent(x.pointerPercent),thumbRef:w,thumbProps:O,stateAttrMap:PD,getAttrs:e=>{let t=y.getAttrs(e);return{...t,"aria-label":kx(t[`aria-label`],b)}},formatValue:void 0},children:sE(`div`,{render:n,className:r,style:i},{state:x,stateAttrMap:PD,ref:[t,C],props:[{style:{...S,...D}},E,v]})})});p();var _k=S(function(e,t){let{render:n,className:r,style:i,...a}=e,o=fk(),{state:s,thumbRef:c,thumbProps:l,getAttrs:u}=o,d=u(s);return sE(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:o.stateAttrMap,ref:[t,c],props:[d,l,a]})});p();var vk=S(function(e,t){let{pointerValue:n}=fk();return dp(lk,{ref:t,...e,time:n})}),yk=_O({displayName:`SliderTrack`,tag:`div`,useContext:fk});p();var bk=S(function(e,t){let{render:n,className:r,style:i,type:a=`current`,format:o,...s}=e,c=fk(),{state:l,pointerValue:u,formatValue:d}=c,f=a===`pointer`?u:l.value,p=o?o(f):d?d(f,a):String(Math.round(f));return sE(`output`,{render:n,className:r,style:i},{state:l,stateAttrMap:c.stateAttrMap,ref:t,props:[{"aria-live":`off`,children:p},s]})}),xk=hO({Buffer:()=>pk,Fill:()=>mk,Preview:()=>hk,Root:()=>gk,Thumb:()=>_k,Thumbnail:()=>vk,Track:()=>yk,Value:()=>bk});p();var Sk=S(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e;return sE(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{children:a},o]})});p();var Ck=S(function(e,t){let{render:n,className:r,style:i,children:a=`/`,...o}=e;return sE(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{"aria-hidden":`true`,children:a},o]})});p();var wk=S(function(e,t){let{render:n,className:i,style:a,type:o,negativeSign:s,label:c,toggle:l=!1,...u}=e,d=TS(Ew),f=Mx(),p=Nx(),[m]=T(()=>new YD),h=o??YD.defaultProps.type,[g,_]=T(h);if(E(()=>{_(h)},[h,l]),m.setProps({type:g,negativeSign:s,label:c,toggle:l}),!d)return null;m.setMedia(d);let v=m.getState(),y=m.getAttrs(v,h),b=m.getLabelParams(v)?{duration:v.type===`remaining`?kx(HD,f,{duration:sD(Math.abs(v.seconds),{locale:p})}):sD(Math.abs(v.seconds),{locale:p})}:void 0,x=v.negative?dp(r,{children:[dp(`span`,{"aria-hidden":`true`,children:s??YD.defaultProps.negativeSign}),v.text]}):v.text,S=()=>{_(e=>h===`current`?e===`remaining`?`current`:`remaining`:e===`duration`?`remaining`:`duration`)},C=e=>{e.defaultPrevented||S()},w=e=>{e.defaultPrevented||!Kx(e.nativeEvent)||(e.preventDefault(),!e.repeat&&S())};return sE(`time`,{render:n,className:i,style:a},{state:v,stateAttrMap:XD,ref:[t],props:[{dateTime:v.datetime,children:x,...y,"aria-label":kx(y[`aria-label`],f,b),...l?{onClick:C,onKeyDown:w}:void 0},u]})}),Tk=hO({Group:()=>Sk,Separator:()=>Ck,Value:()=>wk});p();var Ek=()=>Promise.resolve(0),Dk=S(function(e,t){let{render:n,className:r,style:i,label:a,changeThrottle:o=QD.defaultProps.changeThrottle,step:s=QD.defaultProps.step,largeStep:c=QD.defaultProps.largeStep,orientation:l,disabled:u,thumbAlignment:d,onDragStart:f,onDragEnd:p,pauseOnDrag:m,...h}=e,g=TS(Ew),_=TS(vw),v=TS(Cw),y=Mx(),b=Nx(),[x]=T(()=>new QD);x.setProps({label:a,step:s,largeStep:c,orientation:l,disabled:u,thumbAlignment:d,pauseOnDrag:m,changeThrottle:o}),x.setFormatLocale(b);let S=JT(g&&_?{...g,..._}:null),C=JT(v);E(()=>()=>x.endDrag(C.current),[x]);let w=g?.duration??0,{state:D,cssVars:O,rootRef:k,thumbRef:A,rootProps:j,rootStyle:M,thumbProps:N}=GO({computeState:e=>(x.setInput(e),!g||!_?x.setMedia({currentTime:0,duration:0,seeking:!1,seek:Ek,buffered:[],seekable:[]}):x.setMedia({...g,..._}),x.getState()),getPercent:()=>w>0?(g?.currentTime??0)/w*100:0,getStepPercent:()=>x.getStepPercent(),getLargeStepPercent:()=>x.getLargeStepPercent(),orientation:l,disabled:u,changeThrottle:o,adjustPercent:(e,t,n)=>x.adjustPercentForAlignment(e,t,n),getCSSVars:MT,onValueCommit:e=>{let t=S.current;t&&t.seek(x.rawValueFromPercent(e))},onDragStart:()=>{x.startDrag(C.current),f?.()},onDragEnd:()=>{x.endDrag(C.current),p?.()}});return g?dp(dk,{value:{state:D,pointerValue:x.valueFromPercent(D.pointerPercent),thumbRef:A,thumbProps:N,stateAttrMap:$D,getAttrs:e=>{let t=x.getAttrs(e);return{...t,"aria-label":kx(t[`aria-label`],y),"aria-valuetext":kx(t[`aria-valuetext`],y,x.getValueTextParams(e))}},formatValue:e=>aD(e,w)},children:sE(`div`,{render:n,className:r,style:i},{state:D,stateAttrMap:$D,ref:[t,k],props:[{style:{...O,...M}},j,h]})}):null}),Ok=hO({Buffer:()=>pk,Fill:()=>mk,Preview:()=>hk,Root:()=>Dk,Thumb:()=>_k,Track:()=>yk,Value:()=>bk}),kk=_O({displayName:`TooltipArrow`,tag:`div`,useContext:mE,staticProps:{"aria-hidden":`true`}});p();var Ak=S(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=mE(),l=r===void 0?c?.label??``:r;return sE(`span`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]})});p();var jk=S(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=mE(),l=r??c?.shortcut??null;return l?sE(`kbd`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]}):null});p();var Mk={position:`fixed`,inset:`auto`,margin:0},Nk=S(function({render:e,className:t,style:n,children:i,...a},o){let{core:s,tooltip:c,state:l,preferredSide:u,setPositionedSide:f,stateAttrMap:p,anchorName:g,popupId:_,boundary:v,container:y}=mE(),b=m(null),x=fS(o,d(e=>{c.setPopupElement(e),e&&Rx()&&e.style.setProperty(`position-anchor`,`--${g}`)},[c,g]),b),S=w(()=>({side:u,align:l.align}),[u,l.align]),C=w(()=>{if(!Rx())return null;let{positionAnchor:e,...t}=xT(g,S,void 0,void 0,void 0,void 0,tO);return t},[g,S]),[E,D]=T(null);h(()=>{if(!l.open){D(null);return}function e(){let e=c.triggerElement,t=b.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=fT(v,{container:y,root:r}),a=ET(t,S.side),o=dT(i),s=TT(t,tO),l=Zx(n,a,o,S,s),{positionAnchor:u,...d}=xT(g,{...S,side:l},n,Rx()?void 0:a,o,s,tO);D(d),f(l)}e();let t=c.triggerElement,n=b.current,r=n?fT(v,{container:y,root:n.getRootNode()}):null,i=0;function a(t){t&&UT(t,b.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let o=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&o&&o.observe(t),n&&o&&o.observe(n),r&&o&&o.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),o?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[l.open,g,S,c,v,y,f]);let O=E??C??Mk;if(!l.open)return null;let k=i===void 0?dp(r,{children:[dp(Ak,{}),dp(jk,{})]}):i,{onFocusOut:A,...j}=c.popupProps;return sE(`div`,{render:e,className:t,style:n},{state:l,stateAttrMap:p,ref:x,props:[{id:_,style:O,...s.getPopupAttrs(l)},{children:k},{...j,onBlur:A},a]})});p();var Pk=a(null),Fk=Pk.Provider;function Ik(){return i(Pk)?.group}p();function Lk({delay:e,closeDelay:t,timeout:n,children:r}){let[i]=T(()=>new rO({delay:e,closeDelay:t,timeout:n}));return i.setProps({delay:e,closeDelay:t,timeout:n}),dp(Fk,{value:{group:i},children:r})}p();function Rk({open:e,defaultOpen:t=eO.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,delay:i=eO.defaultProps.delay,closeDelay:a=eO.defaultProps.closeDelay,disableHoverablePopup:o=eO.defaultProps.disableHoverablePopup,disabled:s=eO.defaultProps.disabled,boundary:c=`container`,children:l,...u}){let d=kS(),f=kO(),[p]=T(()=>new eO(u));p.setProps(u);let m=!X(e),h=Ik(),g=JT(n),_=JT(r),v=JT(i),y=JT(a),b=JT(o),x=JT(s),S=JT(h),[C]=T(()=>{let e=LT({transition:RT(),onOpenChange:(e,t)=>{g.current?.(e,t)},onOpenChangeComplete:e=>{_.current?.(e)},delay:()=>v.current,closeDelay:()=>y.current,disableHoverablePopup:()=>b.current,disabled:()=>x.current,group:()=>S.current});return!m&&t&&e.open(),e}),[w,D]=T(),O=xO(),k=xO(`tooltip`);E(()=>{if(X(e))return;let{active:t}=C.input.current;e!==t&&(e?C.open():C.close())},[e,C]),E(()=>{X(f?.state.visible)||f.state.visible||C.close(`imperative-action`)},[f?.state.visible,C]),YT(C);let A=_S(C.input);p.setInput(A);let{state:j,preferredSide:M,setPositionedSide:N}=JO(p.getState());return dp(pE,{value:{core:p,tooltip:C,state:j,preferredSide:M,setPositionedSide:N,stateAttrMap:nO,anchorName:O,popupId:k,content:w,setContent:D,boundary:c,container:d},children:l})}p();var zk=S(function({render:e,className:t,style:n,...r},i){let{tooltip:a,state:o,stateAttrMap:s,anchorName:c}=mE(),l=d(e=>{a.setTriggerElement(e),e&&Rx()&&e.style.setProperty(`anchor-name`,`--${c}`)},[a,c]),{onFocusIn:u,onFocusOut:f,...p}=a.triggerProps;return sE(`button`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:[i,l],props:[{type:`button`},{...p,onFocus:u,onBlur:f},r]})}),Bk=hO({Arrow:()=>kk,Label:()=>Ak,Popup:()=>Nk,Provider:()=>Lk,Root:()=>Rk,Shortcut:()=>jk,Trigger:()=>zk});p();var Vk={volume:0,muted:!1,volumeAvailability:`unsupported`,setVolume:()=>0,toggleMuted:()=>!1},Hk=S(function(e,t){let{render:n,className:r,style:i,label:a,orientation:o,step:s=lO.defaultProps.step,largeStep:c=lO.defaultProps.largeStep,wheelStep:l=lO.defaultProps.wheelStep,disabled:u,thumbAlignment:f,onDragStart:p,onDragEnd:h,...g}=e,_=TS(Dw),v=Mx(),y=Nx(),[b]=T(()=>new lO);b.setProps({label:a,orientation:o,step:s,largeStep:c,wheelStep:l,disabled:u,thumbAlignment:f}),b.setFormatLocale(y);let x=JT(_),S=JT(u),C=()=>(x.current?.volume??0)*100,w=()=>b.getStepPercent(),E=e=>x.current?.setVolume(e/100),{state:D,cssVars:O,rootRef:k,thumbRef:A,rootProps:j,rootStyle:M,thumbProps:N}=GO({computeState:e=>(b.setInput(e),b.setMedia(_??Vk),b.getState()),getPercent:C,getStepPercent:w,getLargeStepPercent:()=>b.getLargeStepPercent(),orientation:o,disabled:u,adjustPercent:(e,t,n)=>b.adjustPercentForAlignment(e,t,n),getCSSVars:jT,onValueChange:E,onValueCommit:E,onDragStart:p,onDragEnd:h}),[P]=T(()=>HT({isDisabled:()=>!!S.current||!x.current,getPercent:()=>(x.current?.volume??0)*100,getStepPercent:()=>b.getWheelStepPercent(),onValueChange:e=>x.current?.setVolume(e/100)})),F=m(null),ee=d(e=>{F.current?.(),F.current=null,e&&(F.current=Z(e,`wheel`,P.onWheel,{passive:!1}))},[P]);return _?dp(dk,{value:{state:D,pointerValue:b.valueFromPercent(D.pointerPercent),thumbRef:A,thumbProps:N,stateAttrMap:uO,getAttrs:e=>{let t=b.getAttrs(e);return{...t,"aria-label":kx(t[`aria-label`],v),"aria-valuetext":kx(t[`aria-valuetext`],v,b.getValueTextParams(e))}},formatValue:e=>`${Math.round(e)}%`},children:sE(`div`,{render:n,className:r,style:i},{state:D,stateAttrMap:uO,ref:[t,k,ee],props:[{style:{...O,...M}},j,g]})}):null}),Uk=hO({Fill:()=>mk,Preview:()=>hk,Root:()=>Hk,Thumb:()=>_k,Track:()=>yk,Value:()=>bk}),Wk=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Gk=n(((e,t)=>{var n=Wk();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Kk=n(((e,t)=>{t.exports=Gk()()}));p();var Q=e(Kk());function qk(){return qk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qk.apply(this,arguments)}function Jk(e,t){if(e==null)return{};var n=Yk(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yk(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Xk=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Jk(e,[`color`,`size`]);return g.createElement(`svg`,qk({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),g.createElement(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),g.createElement(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`}))});Xk.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},Xk.displayName=`AlertTriangle`,p();function Zk(){return Zk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zk.apply(this,arguments)}function Qk(e,t){if(e==null)return{};var n=$k(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $k(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var eA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=Qk(e,[`color`,`size`]);return g.createElement(`svg`,Zk({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polyline`,{points:`20 6 9 17 4 12`}))});eA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},eA.displayName=`Check`,p();function tA(){return tA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tA.apply(this,arguments)}function nA(e,t){if(e==null)return{};var n=rA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var iA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=nA(e,[`color`,`size`]);return g.createElement(`svg`,tA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polyline`,{points:`15 18 9 12 15 6`}))});iA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},iA.displayName=`ChevronLeft`,p();function aA(){return aA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aA.apply(this,arguments)}function oA(e,t){if(e==null)return{};var n=sA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var cA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=oA(e,[`color`,`size`]);return g.createElement(`svg`,aA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polyline`,{points:`9 18 15 12 9 6`}))});cA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},cA.displayName=`ChevronRight`,p();function lA(){return lA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lA.apply(this,arguments)}function uA(e,t){if(e==null)return{};var n=dA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var fA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=uA(e,[`color`,`size`]);return g.createElement(`svg`,lA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),g.createElement(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`}))});fA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},fA.displayName=`Copy`,p();function pA(){return pA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pA.apply(this,arguments)}function mA(e,t){if(e==null)return{};var n=hA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var gA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=mA(e,[`color`,`size`]);return g.createElement(`svg`,pA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3`}))});gA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},gA.displayName=`Maximize`,p();function _A(){return _A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_A.apply(this,arguments)}function vA(e,t){if(e==null)return{};var n=yA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var bA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=vA(e,[`color`,`size`]);return g.createElement(`svg`,_A({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3`}))});bA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},bA.displayName=`Minimize`,p();function xA(){return xA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xA.apply(this,arguments)}function SA(e,t){if(e==null)return{};var n=CA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var wA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=SA(e,[`color`,`size`]);return g.createElement(`svg`,xA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`}),g.createElement(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`}))});wA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},wA.displayName=`Pause`,p();function TA(){return TA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TA.apply(this,arguments)}function EA(e,t){if(e==null)return{};var n=DA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var OA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=EA(e,[`color`,`size`]);return g.createElement(`svg`,TA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polygon`,{points:`5 3 19 12 5 21 5 3`}))});OA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},OA.displayName=`Play`,p();function kA(){return kA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kA.apply(this,arguments)}function AA(e,t){if(e==null)return{};var n=jA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var MA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=AA(e,[`color`,`size`]);return g.createElement(`svg`,kA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polyline`,{points:`1 4 1 10 7 10`}),g.createElement(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`}))});MA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},MA.displayName=`RotateCcw`,p();function NA(){return NA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NA.apply(this,arguments)}function PA(e,t){if(e==null)return{};var n=FA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var IA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=PA(e,[`color`,`size`]);return g.createElement(`svg`,NA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`circle`,{cx:`12`,cy:`12`,r:`3`}),g.createElement(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z`}))});IA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},IA.displayName=`Settings`,p();function LA(){return LA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LA.apply(this,arguments)}function RA(e,t){if(e==null)return{};var n=zA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var BA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=RA(e,[`color`,`size`]);return g.createElement(`svg`,LA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),g.createElement(`path`,{d:`M15.54 8.46a5 5 0 0 1 0 7.07`}))});BA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},BA.displayName=`Volume1`,p();function VA(){return VA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VA.apply(this,arguments)}function HA(e,t){if(e==null)return{};var n=UA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var WA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=HA(e,[`color`,`size`]);return g.createElement(`svg`,VA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),g.createElement(`path`,{d:`M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07`}))});WA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},WA.displayName=`Volume2`,p();function GA(){return GA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GA.apply(this,arguments)}function KA(e,t){if(e==null)return{};var n=qA(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qA(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var JA=S(function(e,t){var n=e.color,r=n===void 0?`currentColor`:n,i=e.size,a=i===void 0?24:i,o=KA(e,[`color`,`size`]);return g.createElement(`svg`,GA({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a,height:a,viewBox:`0 0 24 24`,fill:`none`,stroke:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},o),g.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),g.createElement(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),g.createElement(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`}))});JA.propTypes={color:Q.default.string,size:Q.default.oneOfType([Q.default.string,Q.default.number])},JA.displayName=`VolumeX`;var YA=n(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));ne(),p();var XA=e(YA(),1),ZA=`react-tooltip-core-styles`,QA=`react-tooltip-base-styles`,$A={core:!1,base:!1};function ej({css:e,id:t=QA,type:n=`base`,ref:r}){if(!e||typeof document>`u`||$A[n]||n===`core`&&z!==void 0&&(z==null?void 0:{})?.REACT_TOOLTIP_DISABLE_CORE_STYLES||n!==`base`&&z!==void 0&&(z==null?void 0:{})?.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;n===`core`&&(t=ZA),r||={};let{insertAt:i}=r;if(document.getElementById(t))return;let a=document.head||document.getElementsByTagName(`head`)[0],o=document.createElement(`style`);o.id=t,o.type=`text/css`,i===`top`&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),$A[n]=!0}var tj=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r=`top`,offset:i=10,strategy:a=`absolute`,middlewares:o=[$p(Number(i)),tm({fallbackAxisSideDirection:`start`}),em({padding:5})],border:s,arrowSize:c=8})=>{if(!e||t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};let l=o;return n?(l.push(rm({element:n,padding:5})),im(e,t,{placement:r,strategy:a,middleware:l}).then((({x:e,y:t,placement:n,middlewareData:r})=>{let i={left:`${e}px`,top:`${t}px`,border:s},{x:a,y:o}=r.arrow??{x:0,y:0},l={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[n.split(`-`)[0]]??`bottom`,u=s&&{borderBottom:s,borderRight:s},d=0;if(s){let e=`${s}`.match(/(\d+)px/);d=e?.[1]?Number(e[1]):1}return{tooltipStyles:i,tooltipArrowStyles:{left:a==null?``:`${a}px`,top:o==null?``:`${o}px`,right:``,bottom:``,...u,[l]:`-${c/2+d-1}px`},place:n}}))):im(e,t,{placement:`bottom`,strategy:a,middleware:l}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})))},nj=(e,t)=>!(`CSS`in window&&`supports`in window.CSS)||window.CSS.supports(e,t),rj=(e,t,n)=>{let r=null,i=function(...i){let a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i},ij=e=>e!==null&&!Array.isArray(e)&&typeof e==`object`,aj=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>aj(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!ij(e)||!ij(t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>aj(e[n],t[n])))},oj=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;let t=getComputedStyle(e);return[`overflow`,`overflow-x`,`overflow-y`].some((e=>{let n=t.getPropertyValue(e);return n===`auto`||n===`scroll`}))},sj=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(oj(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},cj=typeof window<`u`?h:E,lj=e=>{e.current&&=(clearTimeout(e.current),null)},uj=`DEFAULT_TOOLTIP_ID`,dj={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},fj=a({getTooltipData:()=>dj});function pj(e=uj){return i(fj).getTooltipData(e)}var mj={tooltip:`core-styles-module_tooltip__3vRRp`,fixed:`core-styles-module_fixed__pcSol`,arrow:`core-styles-module_arrow__cvMwQ`,content:`core-styles-module_content__BRKdB`,noArrow:`core-styles-module_noArrow__xock6`,clickable:`core-styles-module_clickable__ZuTTB`,show:`core-styles-module_show__Nt9eE`,closing:`core-styles-module_closing__sGnxF`},hj={tooltip:`styles-module_tooltip__mnnfp`,content:`styles-module_content__ydYdI`,arrow:`styles-module_arrow__K0L3T`,dark:`styles-module_dark__xNqje`,light:`styles-module_light__Z6W-X`,success:`styles-module_success__A2AKt`,warning:`styles-module_warning__SCK0X`,error:`styles-module_error__JvumD`,info:`styles-module_info__BWdHW`},gj=({forwardRef:e,id:t,className:n,classNameArrow:r,variant:i=`dark`,anchorId:a,anchorSelect:o,place:s=`top`,offset:c=10,events:l=[`hover`],openOnClick:u=!1,positionStrategy:f=`absolute`,middlewares:p,wrapper:h,delayShow:_=0,delayHide:v=0,float:y=!1,hidden:b=!1,noArrow:x=!1,clickable:S=!1,closeOnEsc:w=!1,closeOnScroll:D=!1,closeOnResize:O=!1,openEvents:k,closeEvents:A,globalCloseEvents:j,imperativeModeOnly:M,style:N,position:P,afterShow:F,afterHide:ee,disableTooltip:I,content:L,contentWrapperRef:R,isOpen:z,defaultIsOpen:te=!1,setIsOpen:ne,previousActiveAnchor:re,activeAnchor:B,setActiveAnchor:ie,border:ae,opacity:oe,arrowColor:se,arrowSize:ce=8,role:le=`tooltip`})=>{let ue=m(null),V=m(null),de=m(null),fe=m(null),pe=m(null),[me,he]=T({tooltipStyles:{},tooltipArrowStyles:{},place:s}),[ge,_e]=T(!1),[ve,ye]=T(!1),[be,xe]=T(null),Se=m(!1),H=m(null),{anchorRefs:Ce,setActiveAnchor:we}=pj(t),Te=m(!1),[Ee,De]=T([]),Oe=m(!1),ke=u||l.includes(`click`),Ae=ke||k?.click||k?.dblclick||k?.mousedown,je=k?{...k}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!k&&ke&&Object.assign(je,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});let Me=A?{...A}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!A&&ke&&Object.assign(Me,{mouseleave:!1,blur:!1,mouseout:!1});let Ne=j?{...j}:{escape:w||!1,scroll:D||!1,resize:O||!1,clickOutsideAnchor:Ae||!1};M&&(Object.assign(je,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Me,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ne,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),cj((()=>(Oe.current=!0,()=>{Oe.current=!1})),[]);let U=e=>{Oe.current&&(e&&ye(!0),setTimeout((()=>{Oe.current&&(ne?.(e),z===void 0&&_e(e))}),10))};E((()=>{if(t){if(ge){n(re);let r=e(B),i=[...new Set([...r,t])].filter(Boolean).join(` `);B?.setAttribute(`aria-describedby`,i)}else n(B);return()=>{n(B),n(re)}}function e(e){return(e?.getAttribute(`aria-describedby`))?.split(` `)||[]}function n(n){let r=e(n).filter((e=>e!==t));r.length?n?.setAttribute(`aria-describedby`,r.join(` `)):n?.removeAttribute(`aria-describedby`)}}),[B,ge,t,re]),E((()=>{if(z===void 0)return()=>null;z&&ye(!0);let e=setTimeout((()=>{_e(z)}),10);return()=>{clearTimeout(e)}}),[z]),E((()=>{if(ge!==Se.current)if(lj(pe),Se.current=ge,ge)F?.();else{let e=(e=>{let t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;let[,n,r]=t;return Number(n)*(r===`ms`?1:1e3)})(getComputedStyle(document.body).getPropertyValue(`--rt-transition-show-delay`));pe.current=setTimeout((()=>{ye(!1),xe(null),ee?.()}),e+25)}}),[ge]);let Pe=e=>{he((t=>aj(t,e)?t:e))},Fe=(e=_)=>{lj(de),ve?U(!0):de.current=setTimeout((()=>{U(!0)}),e)},Ie=(e=v)=>{lj(fe),fe.current=setTimeout((()=>{Te.current||U(!1)}),e)},Le=e=>{if(!e)return;let t=e.currentTarget??e.target;if(!t?.isConnected)return ie(null),void we({current:null});_?Fe():U(!0),ie(t),we({current:t}),lj(fe)},Re=()=>{S?Ie(v||100):v?Ie():U(!1),lj(de)},ze=({x:e,y:t})=>{tj({place:be?.place??s,offset:c,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:ue.current,tooltipArrowReference:V.current,strategy:f,middlewares:p,border:ae,arrowSize:ce}).then((e=>{Pe(e)}))},Be=e=>{if(!e)return;let t=e,n={x:t.clientX,y:t.clientY};ze(n),H.current=n},Ve=e=>{if(!ge)return;let t=e.target;t.isConnected&&(ue.current?.contains(t)||[document.querySelector(`[id='${a}']`),...Ee].some((e=>e?.contains(t)))||(U(!1),lj(de)))},He=rj(Le,50,!0),Ue=rj(Re,50,!0),We=e=>{Ue.cancel(),He(e)},Ge=()=>{He.cancel(),Ue()},Ke=d((()=>{let e=be?.position??P;e?ze(e):y?H.current&&ze(H.current):B!=null&&B.isConnected&&tj({place:be?.place??s,offset:c,elementReference:B,tooltipReference:ue.current,tooltipArrowReference:V.current,strategy:f,middlewares:p,border:ae,arrowSize:ce}).then((e=>{Oe.current&&Pe(e)}))}),[ge,B,L,N,s,be?.place,c,f,P,be?.position,y,ce]);E((()=>{var e,t;let n=new Set(Ce);Ee.forEach((e=>{I!=null&&I(e)||n.add({current:e})}));let r=document.querySelector(`[id='${a}']`);r&&!I?.(r)&&n.add({current:r});let i=()=>{U(!1)},o=sj(B),s=sj(ue.current);Ne.scroll&&(window.addEventListener(`scroll`,i),o?.addEventListener(`scroll`,i),s?.addEventListener(`scroll`,i));let c=null;Ne.resize?window.addEventListener(`resize`,i):B&&ue.current&&(c=Qp(B,ue.current,Ke,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));let l=e=>{e.key===`Escape`&&U(!1)};Ne.escape&&window.addEventListener(`keydown`,l),Ne.clickOutsideAnchor&&window.addEventListener(`click`,Ve);let u=[],d=e=>!!(e?.target&&B?.contains(e.target)),f=e=>{ge&&d(e)||Le(e)},p=e=>{ge&&d(e)&&Re()},m=[`mouseover`,`mouseout`,`mouseenter`,`mouseleave`,`focus`,`blur`],h=[`click`,`dblclick`,`mousedown`,`mouseup`];Object.entries(je).forEach((([e,t])=>{t&&(m.includes(e)?u.push({event:e,listener:We}):h.includes(e)&&u.push({event:e,listener:f}))})),Object.entries(Me).forEach((([e,t])=>{t&&(m.includes(e)?u.push({event:e,listener:Ge}):h.includes(e)&&u.push({event:e,listener:p}))})),y&&u.push({event:`pointermove`,listener:Be});let g=()=>{Te.current=!0},_=()=>{Te.current=!1,Re()},v=S&&(Me.mouseout||Me.mouseleave);return v&&((e=ue.current)==null||e.addEventListener(`mouseover`,g),(t=ue.current)==null||t.addEventListener(`mouseout`,_)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;(r=n.current)==null||r.addEventListener(e,t)}))})),()=>{var e,t;Ne.scroll&&(window.removeEventListener(`scroll`,i),o?.removeEventListener(`scroll`,i),s?.removeEventListener(`scroll`,i)),Ne.resize?window.removeEventListener(`resize`,i):c?.(),Ne.clickOutsideAnchor&&window.removeEventListener(`click`,Ve),Ne.escape&&window.removeEventListener(`keydown`,l),v&&((e=ue.current)==null||e.removeEventListener(`mouseover`,g),(t=ue.current)==null||t.removeEventListener(`mouseout`,_)),u.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;(r=n.current)==null||r.removeEventListener(e,t)}))}))}}),[B,Ke,ve,Ce,Ee,k,A,j,ke,_,v]),E((()=>{let e=be?.anchorSelect??o??``;!e&&t&&(e=`[data-tooltip-id='${t.replace(/'/g,`\\'`)}']`);let n=new MutationObserver((n=>{let r=[],i=[];n.forEach((n=>{if(n.type===`attributes`&&n.attributeName===`data-tooltip-id`&&(n.target.getAttribute(`data-tooltip-id`)===t?r.push(n.target):n.oldValue===t&&i.push(n.target)),n.type===`childList`){if(B){let t=[...n.removedNodes].filter((e=>e.nodeType===1));if(e)try{i.push(...t.filter((t=>t.matches(e)))),i.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch{}t.some((e=>!!(e?.contains)?.call(e,B)&&(ye(!1),U(!1),ie(null),lj(de),lj(fe),!0)))}if(e)try{let t=[...n.addedNodes].filter((e=>e.nodeType===1));r.push(...t.filter((t=>t.matches(e)))),r.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch{}}})),(r.length||i.length)&&De((e=>[...e.filter((e=>!i.includes(e))),...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-tooltip-id`],attributeOldValue:!0}),()=>{n.disconnect()}}),[t,o,be?.anchorSelect,B]),E((()=>{Ke()}),[Ke]),E((()=>{if(!R?.current)return()=>null;let e=new ResizeObserver((()=>{setTimeout((()=>Ke()))}));return e.observe(R.current),()=>{e.disconnect()}}),[L,R?.current]),E((()=>{let e=document.querySelector(`[id='${a}']`),t=[...Ee,e];B&&t.includes(B)||ie(Ee[0]??e)}),[a,Ee,B]),E((()=>(te&&U(!0),()=>{lj(de),lj(fe)})),[]),E((()=>{let e=be?.anchorSelect??o;if(!e&&t&&(e=`[data-tooltip-id='${t.replace(/'/g,`\\'`)}']`),e)try{let t=Array.from(document.querySelectorAll(e));De(t)}catch{De([])}}),[t,o,be?.anchorSelect]),E((()=>{de.current&&(lj(de),Fe(_))}),[_]);let qe=be?.content??L,Je=ge&&Object.keys(me.tooltipStyles).length>0;return C(e,(()=>({open:e=>{if(e?.anchorSelect)try{document.querySelector(e.anchorSelect)}catch{console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`);return}xe(e??null),e?.delay?Fe(e.delay):U(!0)},close:e=>{e?.delay?Ie(e.delay):U(!1)},activeAnchor:B,place:me.place,isOpen:!!(ve&&!b&&qe&&Je)}))),ve&&!b&&qe?g.createElement(h,{id:t,role:le,className:(0,XA.default)(`react-tooltip`,mj.tooltip,hj.tooltip,hj[i],n,`react-tooltip__place-${me.place}`,mj[Je?`show`:`closing`],Je?`react-tooltip__show`:`react-tooltip__closing`,f===`fixed`&&mj.fixed,S&&mj.clickable),onTransitionEnd:e=>{lj(pe),ge||e.propertyName!==`opacity`||(ye(!1),xe(null),ee?.())},style:{...N,...me.tooltipStyles,opacity:oe!==void 0&&Je?oe:void 0},ref:ue},g.createElement(h,{className:(0,XA.default)(`react-tooltip-content-wrapper`,mj.content,hj.content)},qe),g.createElement(h,{className:(0,XA.default)(`react-tooltip-arrow`,mj.arrow,hj.arrow,r,x&&mj.noArrow),style:{...me.tooltipArrowStyles,background:se?`linear-gradient(to right bottom, transparent 50%, ${se} 50%)`:void 0,"--rt-arrow-size":`${ce}px`},ref:V})):null},_j=({content:e})=>g.createElement(`span`,{dangerouslySetInnerHTML:{__html:e}}),vj=g.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:a,className:o,classNameArrow:s,variant:c=`dark`,place:l=`top`,offset:u=10,wrapper:d=`div`,children:f=null,events:p=[`hover`],openOnClick:h=!1,positionStrategy:_=`absolute`,middlewares:v,delayShow:y=0,delayHide:b=0,float:x=!1,hidden:S=!1,noArrow:C=!1,clickable:w=!1,closeOnEsc:D=!1,closeOnScroll:O=!1,closeOnResize:k=!1,openEvents:A,closeEvents:j,globalCloseEvents:M,imperativeModeOnly:N=!1,style:P,position:F,isOpen:ee,defaultIsOpen:I=!1,disableStyleInjection:L=!1,border:R,opacity:z,arrowColor:te,arrowSize:ne,setIsOpen:re,afterShow:B,afterHide:ie,disableTooltip:ae,role:oe=`tooltip`},se)=>{let[ce,le]=T(r),[ue,V]=T(i),[de,fe]=T(l),[pe,me]=T(c),[he,ge]=T(u),[_e,ve]=T(y),[ye,be]=T(b),[xe,Se]=T(x),[H,Ce]=T(S),[we,Te]=T(d),[Ee,De]=T(p),[Oe,ke]=T(_),[Ae,je]=T(null),[Me,Ne]=T(null),U=m(null),Pe=m(L),{anchorRefs:Fe,activeAnchor:Ie}=pj(e),Le=e=>e?.getAttributeNames().reduce(((t,n)=>(n.startsWith(`data-tooltip-`)&&(t[n.replace(/^data-tooltip-/,``)]=e?.getAttribute(n)??null),t)),{}),Re=e=>{let t={place:e=>{fe(e??l)},content:e=>{le(e??r)},html:e=>{V(e??i)},variant:e=>{me(e??c)},offset:e=>{ge(e===null?u:Number(e))},wrapper:e=>{Te(e??d)},events:e=>{let t=e?.split(` `);De(t??p)},"position-strategy":e=>{ke(e??_)},"delay-show":e=>{ve(e===null?y:Number(e))},"delay-hide":e=>{be(e===null?b:Number(e))},float:e=>{Se(e===null?x:e===`true`)},hidden:e=>{Ce(e===null?S:e===`true`)},"class-name":e=>{je(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;(r=t[e])==null||r.call(t,n)}))};E((()=>{le(r)}),[r]),E((()=>{V(i)}),[i]),E((()=>{fe(l)}),[l]),E((()=>{me(c)}),[c]),E((()=>{ge(u)}),[u]),E((()=>{ve(y)}),[y]),E((()=>{be(b)}),[b]),E((()=>{Se(x)}),[x]),E((()=>{Ce(S)}),[S]),E((()=>{ke(_)}),[_]),E((()=>{Pe.current!==L&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[L]),E((()=>{typeof window<`u`&&window.dispatchEvent(new CustomEvent(`react-tooltip-inject-styles`,{detail:{disableCore:L===`core`,disableBase:L}}))}),[]),E((()=>{let r=new Set(Fe),i=n;if(!i&&e&&(i=`[data-tooltip-id='${e.replace(/'/g,`\\'`)}']`),i)try{document.querySelectorAll(i).forEach((e=>{r.add({current:e})}))}catch{console.warn(`[react-tooltip] "${i}" is not a valid CSS selector`)}let a=document.querySelector(`[id='${t}']`);if(a&&r.add({current:a}),!r.size)return()=>null;let o=Me??a??Ie.current,s=new MutationObserver((e=>{e.forEach((e=>{if(!o||e.type!==`attributes`||!e.attributeName?.startsWith(`data-tooltip-`))return;let t=Le(o);Re(t)}))})),c={attributes:!0,childList:!1,subtree:!1};if(o){let e=Le(o);Re(e),s.observe(o,c)}return()=>{s.disconnect()}}),[Fe,Ie,Me,t,n]),E((()=>{P!=null&&P.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),R&&!nj(`border`,`${R}`)&&console.warn(`[react-tooltip] "${R}" is not a valid \`border\`.`),P!=null&&P.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),z&&!nj(`opacity`,`${z}`)&&console.warn(`[react-tooltip] "${z}" is not a valid \`opacity\`.`)}),[]);let ze=f,Be=m(null);if(a){let e=a({content:Me?.getAttribute(`data-tooltip-content`)||ce||null,activeAnchor:Me});ze=e?g.createElement(`div`,{ref:Be,className:`react-tooltip-content-wrapper`},e):null}else ce&&(ze=ce);ue&&(ze=g.createElement(_j,{content:ue}));let Ve={forwardRef:se,id:e,anchorId:t,anchorSelect:n,className:(0,XA.default)(o,Ae),classNameArrow:s,content:ze,contentWrapperRef:Be,place:de,variant:pe,offset:he,wrapper:we,events:Ee,openOnClick:h,positionStrategy:Oe,middlewares:v,delayShow:_e,delayHide:ye,float:xe,hidden:H,noArrow:C,clickable:w,closeOnEsc:D,closeOnScroll:O,closeOnResize:k,openEvents:A,closeEvents:j,globalCloseEvents:M,imperativeModeOnly:N,style:P,position:F,isOpen:ee,defaultIsOpen:I,border:R,opacity:z,arrowColor:te,arrowSize:ne,setIsOpen:re,afterShow:B,afterHide:ie,disableTooltip:ae,activeAnchor:Me,previousActiveAnchor:U.current,setActiveAnchor:e=>{Ne((t=>(e!=null&&e.isSameNode(t)||(U.current=t),e)))},role:oe};return g.createElement(gj,{...Ve})}));typeof window<`u`&&window.addEventListener(`react-tooltip-inject-styles`,(e=>{e.detail.disableCore||ej({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.core-styles-module_content__BRKdB{position:relative;z-index:1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:`core`}),e.detail.disableBase||ej({css:`
|
|
73
|
-
.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;width:max-content}.styles-module_content__ydYdI{background:inherit;border-radius:inherit;padding:8px 16px}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:`base`})})),p();var yj={indexes:[],thumbnails:[],subtitleTracks:[],selectedSubtitleTrack:void 0,selectSubtitleTrack:()=>{},audioTracks:[],selectedAudioTrack:void 0,selectAudioTrack:()=>{},hideUI:!1,setHideUI:()=>{},togglePictureInPicture:null,pictureInPictureMode:null,burnedInSubtitles:!1,playbackError:null,playbackErrors:[],ready:!1,setSourceState:()=>{}},bj=QS({name:`source`,state:()=>({...yj}),attach({set:e}){e({setSourceState:t=>e(t),setHideUI:t=>e({hideUI:t})})}}),xj=XT({features:[...eT,bj],displayName:`MediaPlayer`}),$=xj.usePlayer,Sj=e=>{if(!(!e||e===`und`))try{return new Intl.DisplayNames([navigator.language||`en`],{type:`language`,fallback:`none`}).of(e)||void 0}catch{return}},Cj=e=>e?.replace(/_/g,` `).trim()||void 0,wj=e=>{let t=e.map(e=>Sj(e.language)??Cj(e.title)??`Track ${e.streamIndex}`),n=t.reduce((e,t)=>({...e,[t]:(e[t]??0)+1}),{});return e.map((e,r)=>{let i=t[r],a=Cj(e.title);return{track:e,label:(n[i]??0)>1&&a&&a!==i?`${i} (${a})`:i}})},Tj=e=>wj(e).map(({track:e,label:t})=>({id:e.streamIndex,label:t})),Ej=[0,250,1e3,3e3,1e4],Dj=6e4,Oj=500,kj=e=>e instanceof Error?e.message:String(e),Aj=e=>{let t=[],n=e?.cause;for(let e=0;n!=null&&e<8;e++){if(typeof MediaError<`u`&&n instanceof MediaError){t.push(`MediaError code ${n.code}${n.message?`: ${n.message}`:``}`);break}t.push(kj(n)),n=n?.cause}return t.length?t.join(`
|
|
74
|
-
`):void 0},jj=(e,t,n)=>{let r=$(),{read:i,size:a,publicPath:o=``,libavWorkerUrl:s=``,jassubWorkerUrl:c=``,jassubWasmUrl:l=``,jassubLegacyWasmUrl:u,defaultFontUrl:f,bufferSize:p,autoplay:h=!1,seekPrepareBudgetMs:g=Oj}=n??{},[_,v]=T(void 0),[y,b]=T(0),x=m({count:0,at:0}),S=m(void 0);E(()=>(x.current={count:0,at:0},r.setSourceState({playbackErrors:[]}),()=>{S.current&&clearTimeout(S.current)}),[a]);let C=m(null),w=m(null),D=m(!1),O=m(i);O.current=i;let k=m(n?.onSeek);k.current=n?.onSeek;let A=m(n?.onPlaybackError);A.current=n?.onPlaybackError;let j=d(e=>{let t=typeof e==`number`?e:void 0;D.current=!0,r.setSourceState({selectedSubtitleTrack:t}),C.current?.selectSubtitleStream(t)},[r]),M=d(e=>{let t=C.current;if(!t||g<=0){r.seek(e);return}let n=typeof window<`u`&&window.__mediaPlayerSeekDebug,i=performance.now(),a=!1,o=`prepared`,s=()=>{if(!a&&(a=!0,r.seek(e),n)){let n=t.videoElement,r=0;if(n)for(let t=0;t<n.buffered.length;t++)n.buffered.start(t)<=e+1&&e<n.buffered.end(t)&&(r=n.buffered.end(t)-e);console.warn(`[media-player] seek to ${e.toFixed(2)} moved after ${Math.round(performance.now()-i)}ms via ${o}, runway ${r.toFixed(1)}s${o===`deadline`?` (EXPOSED: moved before its data was ready)`:``}`)}},c=setTimeout(()=>{o=`deadline`,s()},g);t.prepareSeek(e).catch(()=>{}).finally(()=>{clearTimeout(c),s()})},[r,g]),N=d(e=>{typeof e==`number`&&(r.setSourceState({selectedAudioTrack:e}),v(e))},[r]),P=$(e=>e.setSourceState);E(()=>{P({selectSubtitleTrack:j,selectAudioTrack:N,requestSeek:M})},[P,j,N,M]),E(()=>{if(!e||!t||!a||!i)return;let n=!1;r.setSourceState({playbackError:null,ready:!1});let d=(t,n)=>{let i=Date.now(),a=kj(t),o=Aj(t),s=r.playbackErrors,c=s[s.length-1];if(c&&c.message===a&&c.detail===o&&c.recovered===n){let e={...c,count:c.count+1,lastAt:i};r.setSourceState({playbackErrors:[...s.slice(0,-1),e]});return}let l={at:i,lastAt:i,count:1,atMediaTime:Number.isFinite(e.currentTime)?e.currentTime:void 0,message:a,detail:o,recovered:n};r.setSourceState({playbackErrors:[...s,l]})},m=e=>{if(n)return;let t=Ob(e);if(d(e,t),t){let t=performance.now();t-x.current.at>Dj&&(x.current={count:0,at:t});let n=Ej[Math.min(x.current.count,Ej.length-1)];x.current={count:x.current.count+1,at:t},console.warn(`the media element failed; rebuilding the pipeline${n?` in ${n}ms`:``}`,e),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>b(e=>e+1),n);return}console.error(`playback failed`,e),r.setSourceState({playbackError:e}),A.current?.(e)};return(async()=>{try{let i=await Ub({videoElement:e,canvasElement:t,read:(e,t)=>O.current(e,t),length:a,publicPath:o,libavWorkerUrl:s,jassubWorkerUrl:c,jassubWasmUrl:l,jassubLegacyWasmUrl:u,defaultFontUrl:f,bufferSize:p,audioStreamIndex:_,onReady:()=>{if(n)return;r.setSourceState({ready:!0});let t=w.current;w.current=null,t&&t.size===a&&t.time>0&&(e.currentTime=t.time),h&&e.play().catch(()=>{})},onError:m,onRecovered:()=>{n||r.setSourceState({playbackError:null})},onSeek:e=>k.current?.(e),onSubtitleStreams:e=>{n||r.setSourceState({subtitleTracks:Tj(e),...D.current?{}:{selectedSubtitleTrack:e[0]?.streamIndex}})},onAudioStreams:(e,t)=>{n||r.setSourceState({audioTracks:Tj(e),selectedAudioTrack:t})}});if(n){i.destroy();return}C.current=i,r.setSourceState({indexes:i.indexes});let d=r.selectedSubtitleTrack;typeof d==`number`&&i.selectSubtitleStream(d)}catch(e){m(e)}})(),()=>{n=!0,w.current={time:e.currentTime,size:a},C.current?.destroy(),C.current=null,r.setSourceState({ready:!1})}},[r,e,t,a,o,s,c,l,u,f,p,_,h,y])},Mj=5e3,Nj=6e4,Pj=({publicPath:e,workerUrl:t,length:n,read:r,downloadedRanges:i})=>{let[a,o]=T([]),s=m(null),c=m(r);c.current=r;let l=w(()=>i?.map(({startByteOffset:e,endByteOffset:t})=>[e,t]),[i?.map(({startByteOffset:e,endByteOffset:t})=>`${e}-${t}`).join(`,`)]),u=m(l);return u.current=l,E(()=>{if(!n||!r||!e||!t)return;let i=!1,a=null,l,d=Mj,f=()=>{Xb({publicPath:e,workerUrl:t,length:n,read:(e,t)=>c.current(e,t),onThumbnails:e=>{i||o(e)}}).then(e=>{if(i){e.destroy();return}a=e,s.current=e,e.update(u.current)},()=>{i||(l=setTimeout(f,d),d=Math.min(d*2,Nj))})};return f(),()=>{i=!0,clearTimeout(l),s.current=null,a?.destroy(),o([])}},[n,e,t]),E(()=>{s.current?.update(l)},[l]),a},Fj=(e,t)=>{let n=m(null),[r,i]=T(!1),[a]=T(()=>ix());E(()=>{if(!e||!t||!a)return;let r=ax({video:e,canvas:t,mode:a,onBurnedInChange:i});return n.current=r,()=>{r.destroy(),n.current=null,i(!1)}},[e,t,a]);let o=d(()=>{n.current?.toggle().catch(e=>{console.warn(`picture in picture was refused`,e)})},[]);return{toggle:e&&t&&a?o:null,mode:a,burnedIn:r}},Ij={headings:{large:`
|
|
75
|
-
font-weight: 600;
|
|
76
|
-
font-size: calc(2.8 * var(--mp-unit));
|
|
77
|
-
line-height: calc(3.4 * var(--mp-unit));
|
|
78
|
-
@media (min-width: 960px) {
|
|
79
|
-
font-size: calc(3.4 * var(--mp-unit));
|
|
80
|
-
line-height: calc(4.1 * var(--mp-unit));
|
|
81
|
-
}
|
|
82
|
-
`,medium:`
|
|
83
|
-
font-weight: 600;
|
|
84
|
-
font-size: calc(2.4 * var(--mp-unit));
|
|
85
|
-
line-height: calc(2.9 * var(--mp-unit));
|
|
86
|
-
@media (min-width: 960px) {
|
|
87
|
-
font-size: calc(2.8 * var(--mp-unit));
|
|
88
|
-
line-height: calc(3.4 * var(--mp-unit));
|
|
89
|
-
}
|
|
90
|
-
`,small:`
|
|
91
|
-
font-weight: 500;
|
|
92
|
-
font-size: calc(1.8 * var(--mp-unit));
|
|
93
|
-
line-height: calc(1.9 * var(--mp-unit));
|
|
94
|
-
@media (min-width: 960px) {
|
|
95
|
-
font-size: calc(1.8 * var(--mp-unit));
|
|
96
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
97
|
-
}
|
|
98
|
-
@media (min-width: 2560px) {
|
|
99
|
-
font-size: calc(2.2 * var(--mp-unit));
|
|
100
|
-
line-height: calc(2.6 * var(--mp-unit));
|
|
101
|
-
}
|
|
102
|
-
`,extraSmall:`
|
|
103
|
-
font-weight: 500;
|
|
104
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
105
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
106
|
-
@media (min-width: 960px) {
|
|
107
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
108
|
-
line-height: calc(1.9 * var(--mp-unit));
|
|
109
|
-
}
|
|
110
|
-
`},bLarge:{bold:`
|
|
111
|
-
font-weight: 600;
|
|
112
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
113
|
-
line-height: calc(2 * var(--mp-unit));
|
|
114
|
-
@media (min-width: 960px) {
|
|
115
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
116
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
117
|
-
}
|
|
118
|
-
`,medium:`
|
|
119
|
-
font-weight: 500;
|
|
120
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
121
|
-
line-height: calc(2 * var(--mp-unit));
|
|
122
|
-
@media (min-width: 960px) {
|
|
123
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
124
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
125
|
-
}
|
|
126
|
-
`,regular:`
|
|
127
|
-
font-weight: 400;
|
|
128
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
129
|
-
line-height: calc(2 * var(--mp-unit));
|
|
130
|
-
@media (min-width: 960px) {
|
|
131
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
132
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
133
|
-
}
|
|
134
|
-
`},bMedium:{bold:`
|
|
135
|
-
font-weight: 600;
|
|
136
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
137
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
138
|
-
@media (min-width: 960px) {
|
|
139
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
140
|
-
line-height: calc(2 * var(--mp-unit));
|
|
141
|
-
}
|
|
142
|
-
`,medium:`
|
|
143
|
-
font-weight: 500;
|
|
144
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
145
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
146
|
-
@media (min-width: 960px) {
|
|
147
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
148
|
-
line-height: calc(2 * var(--mp-unit));
|
|
149
|
-
}
|
|
150
|
-
`,regular:`
|
|
151
|
-
font-weight: 400;
|
|
152
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
153
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
154
|
-
@media (min-width: 960px) {
|
|
155
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
156
|
-
line-height: calc(2 * var(--mp-unit));
|
|
157
|
-
}
|
|
158
|
-
`},bSmall:{bold:`
|
|
159
|
-
font-weight: 600;
|
|
160
|
-
font-size: calc(1 * var(--mp-unit));
|
|
161
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
162
|
-
@media (min-width: 960px) {
|
|
163
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
164
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
165
|
-
}
|
|
166
|
-
`,medium:`
|
|
167
|
-
font-weight: 500;
|
|
168
|
-
font-size: calc(1 * var(--mp-unit));
|
|
169
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
170
|
-
@media (min-width: 960px) {
|
|
171
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
172
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
173
|
-
}
|
|
174
|
-
`,regular:`
|
|
175
|
-
font-weight: 400;
|
|
176
|
-
font-size: calc(1 * var(--mp-unit));
|
|
177
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
178
|
-
@media (min-width: 960px) {
|
|
179
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
180
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
181
|
-
}
|
|
182
|
-
`},bExtraSmall:{bold:`
|
|
183
|
-
font-weight: 600;
|
|
184
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
185
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
186
|
-
@media (min-width: 960px) {
|
|
187
|
-
font-size: calc(1 * var(--mp-unit));
|
|
188
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
189
|
-
}
|
|
190
|
-
`,medium:`
|
|
191
|
-
font-weight: 500;
|
|
192
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
193
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
194
|
-
@media (min-width: 960px) {
|
|
195
|
-
font-size: calc(1 * var(--mp-unit));
|
|
196
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
197
|
-
}
|
|
198
|
-
`,regular:`
|
|
199
|
-
font-weight: 400;
|
|
200
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
201
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
202
|
-
@media (min-width: 960px) {
|
|
203
|
-
font-size: calc(1 * var(--mp-unit));
|
|
204
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
205
|
-
}
|
|
206
|
-
`}},Lj=Xt`
|
|
207
|
-
top: unset !important;
|
|
208
|
-
left: unset !important;
|
|
209
|
-
width: 100%;
|
|
210
|
-
height: 100%;
|
|
211
|
-
margin: auto;
|
|
212
|
-
pointer-events: none;
|
|
213
|
-
`,Rj=Xt`
|
|
214
|
-
position: absolute;
|
|
215
|
-
top: 0;
|
|
216
|
-
left: 0;
|
|
217
|
-
width: 100%;
|
|
218
|
-
padding: calc(1.2 * var(--mp-unit)) calc(1.6 * var(--mp-unit));
|
|
219
|
-
/* clears a notch once the player is fullscreen; resolves to zero everywhere else */
|
|
220
|
-
padding-top: calc(calc(1.2 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
|
|
221
|
-
${Ij.headings.small}
|
|
222
|
-
color: white;
|
|
223
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
224
|
-
z-index: 2;
|
|
225
|
-
pointer-events: none;
|
|
226
|
-
|
|
227
|
-
/* one line with an ellipsis until there is width to wrap, since a release filename would
|
|
228
|
-
otherwise run to four lines on a phone */
|
|
229
|
-
white-space: nowrap;
|
|
230
|
-
overflow: hidden;
|
|
231
|
-
text-overflow: ellipsis;
|
|
232
|
-
|
|
233
|
-
@media (min-width: 768px) {
|
|
234
|
-
padding: calc(2.4 * var(--mp-unit));
|
|
235
|
-
padding-top: calc(calc(2.4 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
|
|
236
|
-
white-space: normal;
|
|
237
|
-
overflow: visible;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.1) 80%, transparent 100%);
|
|
241
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
242
|
-
`,zj=Xt`
|
|
243
|
-
position: absolute;
|
|
244
|
-
inset: 0;
|
|
245
|
-
z-index: 2;
|
|
246
|
-
display: flex;
|
|
247
|
-
justify-content: center;
|
|
248
|
-
align-items: center;
|
|
249
|
-
pointer-events: none;
|
|
250
|
-
|
|
251
|
-
::after {
|
|
252
|
-
content: '';
|
|
253
|
-
width: calc(4 * var(--mp-unit));
|
|
254
|
-
height: calc(4 * var(--mp-unit));
|
|
255
|
-
border-radius: 50%;
|
|
256
|
-
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
257
|
-
border-top-color: #fff;
|
|
258
|
-
animation: ${Zt`
|
|
259
|
-
to { transform: rotate(360deg); }
|
|
260
|
-
`} 0.8s linear infinite;
|
|
261
|
-
}
|
|
262
|
-
`,Bj=Xt`
|
|
263
|
-
position: absolute;
|
|
264
|
-
inset: auto 0 20%;
|
|
265
|
-
z-index: 3;
|
|
266
|
-
padding: 0 calc(2 * var(--mp-unit));
|
|
267
|
-
text-align: center;
|
|
268
|
-
color: #fff;
|
|
269
|
-
${Ij.bLarge.regular}
|
|
270
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
271
|
-
pointer-events: none;
|
|
272
|
-
`,Vj=e=>e instanceof Error?e.message:typeof e==`string`?e:`Playback failed`,Hj=({onCanvasRef:e})=>{let t=$(e=>e.title),n=$(e=>e.hideUI),r=$(e=>e.playbackError),i=$(e=>e.ready),a=$(e=>e.size),o=$(e=>e.waiting);return q(am,{children:[t?K(`div`,{className:`title`,css:Rj,style:{...n?{opacity:`0`,pointerEvents:`none`}:{}},children:t}):void 0,(a?!i:o)&&!r?K(`div`,{css:zj}):void 0,r?K(`div`,{css:Bj,children:Vj(r)}):void 0,K(`canvas`,{ref:e,css:Lj})]})},Uj=1e-4,Wj=1,Gj=e=>Math.max(Uj,Math.min(Wj,e))**2,Kj=e=>Math.max(Uj,Math.min(Wj,e))**(Wj/2),qj=e=>{if(e===void 0)return`0:00`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n<10?`0`:``}${n}:${r<10?`0`:``}${r}`:`${n}:${r<10?`0`:``}${r}`},Jj=(e,t)=>`${qj(e)} / ${qj(t)}`,Yj=e=>Xt`
|
|
273
|
-
display: flex;
|
|
274
|
-
justify-content: flex-start;
|
|
275
|
-
|
|
276
|
-
/*
|
|
277
|
-
* Bounded here rather than at each call site.
|
|
278
|
-
*
|
|
279
|
-
* react-tooltip's own chip rule carries width: max-content, so with nothing opposing it a chip
|
|
280
|
-
* grows to the widest UNWRAPPED line of its content: a two sentence tooltip measured 1178px
|
|
281
|
-
* through this component. Both declarations are load bearing, since a bound with no wrapping only
|
|
282
|
-
* moves the overflow inside a narrow box. 26 units is the width control-bar.tsx was already
|
|
283
|
-
* imposing on its own two line tooltip by hand, so nothing in the bar changes shape.
|
|
284
|
-
*/
|
|
285
|
-
max-width: min(calc(26 * var(--mp-unit)), calc(100vw - calc(2.4 * var(--mp-unit))));
|
|
286
|
-
white-space: normal;
|
|
287
|
-
overflow-wrap: anywhere;
|
|
288
|
-
text-align: left;
|
|
289
|
-
|
|
290
|
-
/*
|
|
291
|
-
* The radius carries !important for the same reason the paddings below do.
|
|
292
|
-
*
|
|
293
|
-
* react-tooltip injects its stylesheet from a passive effect while emotion inserts through
|
|
294
|
-
* useInsertionEffect, which runs earlier, so react-tooltip's sheet lands in the head LAST at
|
|
295
|
-
* exactly this specificity and wins every tie. Its own radius is 3px, which is what was drawn
|
|
296
|
-
* here until this was stated.
|
|
297
|
-
*/
|
|
298
|
-
border-radius: calc(0.4 * var(--mp-unit))!important;
|
|
299
|
-
user-select: none;
|
|
300
|
-
|
|
301
|
-
z-index: 3;
|
|
302
|
-
|
|
303
|
-
* {
|
|
304
|
-
${Ij.bMedium.regular}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
${e===`sm`&&Xt`
|
|
308
|
-
padding: calc(0.4 * var(--mp-unit))!important;
|
|
309
|
-
`}
|
|
310
|
-
${e===`md`&&Xt`
|
|
311
|
-
padding: calc(0.6 * var(--mp-unit))!important;
|
|
312
|
-
`}
|
|
313
|
-
${e===`lg`&&Xt`
|
|
314
|
-
padding: calc(1.2 * var(--mp-unit))!important;
|
|
315
|
-
`}
|
|
316
|
-
`,Xj={x:-1,y:-1,anchors:0},Zj=e=>{Xj.x=e.clientX,Xj.y=e.clientY},Qj=()=>(Xj.anchors++===0&&window.addEventListener(`pointermove`,Zj,{capture:!0,passive:!0}),()=>{--Xj.anchors===0&&window.removeEventListener(`pointermove`,Zj,{capture:!0})}),$j=({id:e,toolTipText:t,text:n,delayShow:r=0,closeDelay:i=0,offset:a=20,tooltipPlace:o=`top`,disabled:s=!1,size:c=`md`})=>{let l=m(null),u=m(null);return E(()=>{let e=Qj(),t=()=>{let e=l.current;if(!e)return;let{left:t,right:n,top:r,bottom:i}=e.getBoundingClientRect();Xj.x>=t&&Xj.x<n&&Xj.y>=r&&Xj.y<i||u.current?.close()},n=[`fullscreenchange`,`webkitfullscreenchange`];for(let e of n)document.addEventListener(e,t);return()=>{e();for(let e of n)document.removeEventListener(e,t)}},[]),q(am,{children:[K(`div`,{ref:l,"data-tooltip-id":e,"data-open":!0,"data-tooltip-offset":a,"data-tooltip-delay-show":r,"data-tooltip-delay-hide":i,"data-tooltip-place":o,children:n}),!s&&K(vj,{ref:u,css:Yj(c),id:e,noArrow:!0,children:t})]})},eM=({ref:e,onChange:t,orientation:n=`horizontal`,disabled:r=!1})=>{let[i,a]=T(!1),o=m(t);o.current=t;let s=m(null),c=d((t,r)=>{let i=e.current;if(!i)return 0;let{left:a,right:o,top:s,bottom:c}=i.getBoundingClientRect(),l=n===`horizontal`?(t-a)/(o-a):(c-r)/(c-s);return Math.min(Math.max(l,0),1)},[e,n]),l=d(e=>{if(!(r||e.button>0)){s.current=e.pointerId;try{e.currentTarget.setPointerCapture?.(e.pointerId)}catch{}a(!0),o.current(c(e.clientX,e.clientY))}},[r,c]),u=d(e=>{s.current===e.pointerId&&o.current(c(e.clientX,e.clientY))},[c]),f=d(e=>{if(s.current===e.pointerId){s.current=null;try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}a(!1)}},[]);return E(()=>{r&&(s.current=null,a(!1))},[r]),{dragging:i,handlers:{onPointerDown:l,onPointerMove:u,onPointerUp:f,onPointerCancel:f,style:{touchAction:`none`}}}},tM=Xt`
|
|
317
|
-
position: relative;
|
|
318
|
-
height: calc(.4 * var(--mp-unit));
|
|
319
|
-
|
|
320
|
-
--thumbnail-width: calc(25 * var(--mp-unit));
|
|
321
|
-
--thumbnail-half: calc(12.5 * var(--mp-unit));
|
|
322
|
-
|
|
323
|
-
transition: transform .2s ease-in-out;
|
|
324
|
-
|
|
325
|
-
margin: 0 12px;
|
|
326
|
-
@media (min-width: 768px) {
|
|
327
|
-
margin: 0 16px;
|
|
328
|
-
}
|
|
329
|
-
@media (min-width: 2560px) {
|
|
330
|
-
margin: 0 24px;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
user-select: none;
|
|
334
|
-
cursor: pointer;
|
|
335
|
-
|
|
336
|
-
:hover {
|
|
337
|
-
.background-bar {
|
|
338
|
-
transform: scaleY(1.5);
|
|
339
|
-
}
|
|
340
|
-
.loaded {
|
|
341
|
-
transform: scaleY(1.5);
|
|
342
|
-
top: calc(-.1 * var(--mp-unit));
|
|
343
|
-
}
|
|
344
|
-
.play-container {
|
|
345
|
-
transform: scaleY(1.5);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
.background-bar {
|
|
351
|
-
position: absolute;
|
|
352
|
-
inset: 0;
|
|
353
|
-
background-color: hsla(0, 100%, 100%, .2);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.cursor-time {
|
|
357
|
-
display: flex;
|
|
358
|
-
justify-content: center;
|
|
359
|
-
|
|
360
|
-
/* The seekbar's other hover affordance, the thumbnail below, gets a rounded box and a drop
|
|
361
|
-
shadow. A source that ships no thumbnails, which is every source whose media the player does
|
|
362
|
-
not own, leaves this readout as the entire preview, so it carries the same treatment instead
|
|
363
|
-
of sitting as bare text on the picture. The ink comes from the player root. */
|
|
364
|
-
background-color: rgba(28, 28, 28, .95);
|
|
365
|
-
border-radius: calc(.4 * var(--mp-unit));
|
|
366
|
-
padding: 0 calc(.6 * var(--mp-unit));
|
|
367
|
-
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
368
|
-
|
|
369
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
370
|
-
${Ij.bMedium.bold}
|
|
371
|
-
|
|
372
|
-
position: absolute;
|
|
373
|
-
/* Anchored on its bottom edge rather than its top: now that it has a background its height
|
|
374
|
-
follows the font size, and a top-anchored box would grow downward into the track. */
|
|
375
|
-
bottom: calc(1.2 * var(--mp-unit));
|
|
376
|
-
/* Sized to its content, replacing a fixed 5 unit box that \`1:04:09\` overflows. Transparent, that
|
|
377
|
-
overflow was invisible; filled, it would not be. */
|
|
378
|
-
width: max-content;
|
|
379
|
-
white-space: nowrap;
|
|
380
|
-
transform: translateX(-50%);
|
|
381
|
-
|
|
382
|
-
pointer-events: none;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.loaded {
|
|
386
|
-
transform-origin: 0 0;
|
|
387
|
-
position: absolute;
|
|
388
|
-
bottom: 0;
|
|
389
|
-
height: calc(.4 * var(--mp-unit));
|
|
390
|
-
width: 100%;
|
|
391
|
-
.loaded-part {
|
|
392
|
-
transform-origin: 0 0;
|
|
393
|
-
bottom: 0;
|
|
394
|
-
height: calc(.4 * var(--mp-unit));
|
|
395
|
-
width: 100%;
|
|
396
|
-
position: absolute;
|
|
397
|
-
background-color: hsla(0, 100%, 100%, .4);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.play-container {
|
|
402
|
-
position: absolute;
|
|
403
|
-
bottom: 0;
|
|
404
|
-
width: 100%;
|
|
405
|
-
height: calc(.4 * var(--mp-unit));
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.play {
|
|
409
|
-
transform-origin: 0 0;
|
|
410
|
-
background-color: #f03;
|
|
411
|
-
position: absolute;
|
|
412
|
-
bottom: 0;
|
|
413
|
-
height: calc(.4 * var(--mp-unit));
|
|
414
|
-
width: 100%;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.padding {
|
|
418
|
-
position: absolute;
|
|
419
|
-
bottom: -7.5px;
|
|
420
|
-
height: calc(2 * var(--mp-unit));
|
|
421
|
-
width: 100%;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
.thumbnail {
|
|
425
|
-
display: flex;
|
|
426
|
-
justify-content: center;
|
|
427
|
-
|
|
428
|
-
position: absolute;
|
|
429
|
-
top: calc(calc(-3.4375 * var(--mp-unit)) - var(--thumbnail-width) * 9/16);
|
|
430
|
-
height: calc(var(--thumbnail-width) * 9/16);
|
|
431
|
-
width: var(--thumbnail-width);
|
|
432
|
-
|
|
433
|
-
margin-left: calc(var(--thumbnail-half) * -1);
|
|
434
|
-
pointer-events: none;
|
|
435
|
-
|
|
436
|
-
img {
|
|
437
|
-
border-radius: calc(.4 * var(--mp-unit));
|
|
438
|
-
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
439
|
-
|
|
440
|
-
width: 100%;
|
|
441
|
-
height: 100%;
|
|
442
|
-
object-fit: cover;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/* a thumb is far wider than a cursor, so the hit strip grows to 44px and the track thickens */
|
|
447
|
-
@media (pointer: coarse) {
|
|
448
|
-
height: calc(.6 * var(--mp-unit));
|
|
449
|
-
|
|
450
|
-
/* press feedback, coarse only: a finger has no hover, so without this the bar gives no sign
|
|
451
|
-
it is being dragged */
|
|
452
|
-
&.dragging {
|
|
453
|
-
.background-bar, .loaded, .play-container {
|
|
454
|
-
transform: scaleY(1.5);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
.loaded {
|
|
459
|
-
height: calc(.6 * var(--mp-unit));
|
|
460
|
-
.loaded-part {
|
|
461
|
-
height: calc(.6 * var(--mp-unit));
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
.play-container {
|
|
466
|
-
height: calc(.6 * var(--mp-unit));
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.play {
|
|
470
|
-
height: calc(.6 * var(--mp-unit));
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
/* grows upward into the video: centred, it would hang over the control row and win hit
|
|
474
|
-
testing against taps meant for play, mute and fullscreen */
|
|
475
|
-
.padding {
|
|
476
|
-
height: 44px;
|
|
477
|
-
bottom: 0;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/* the clamp only holds the preview inside the bar while the bar is the wider of the two, so
|
|
482
|
-
below that the preview is narrowed instead */
|
|
483
|
-
@media (max-width: 480px) {
|
|
484
|
-
--thumbnail-width: calc(18 * var(--mp-unit));
|
|
485
|
-
--thumbnail-half: calc(9 * var(--mp-unit));
|
|
486
|
-
}
|
|
487
|
-
`,nM=4,rM=()=>{let e=$(),t=$(e=>e.currentTime),n=$(e=>e.requestSeek),r=$(e=>e.duration),i=$(e=>e.size),a=$(e=>e.downloadedRanges),o=$(e=>e.indexes),s=$(e=>e.thumbnails),c=$(e=>e.thumbnailAt),l=m(null),[u,d]=T(void 0),[f,p]=T(void 0),h=m(void 0),g=m(0),_=m(void 0),v=m(void 0),y=m(!1),{dragging:b,handlers:x}=eM({ref:l,onChange:e=>{if(g.current+=1,_.current=e,v.current===void 0)v.current=e;else if(!y.current){let t=l.current?.getBoundingClientRect().width??0;Math.abs(e-v.current)*t>nM&&(y.current=!0)}d(e),h.current!==`mouse`&&p(e*r)}}),S=e=>{h.current=e.pointerType,g.current=0,v.current=void 0,y.current=!1,x.onPointerDown(e)},C=t=>{x.onPointerUp(t);let i=g.current>0?_.current:void 0;if(i!==void 0&&r){let t=i*r;n?n(t):e.seek(t)}g.current=0,y.current=!1,v.current=void 0,t.pointerType!==`mouse`&&p(void 0)},D=e=>{if(!l.current)return;let{left:t,right:n}=l.current.getBoundingClientRect();return Math.min(Math.max((e-t)/(n-t),0),1)*r},O=e=>{p(D(e.clientX))},k=()=>{l.current&&p(void 0)},A=e=>r?e/r*100:0,j=w(()=>a?.map((e,t)=>{if(!i||!r)return null;let n=o.filter(t=>e.startByteOffset<=t.pos&&t.pos<=e.endByteOffset),a=n.at(0),s=n.at(-1);if(!a||!s)return null;let c=a.timestamp/r,l=s.timestamp/r,u=Number((l-c).toFixed(2)),d=c*100;return K(`div`,{className:`loaded-part`,style:{transform:`scaleX(${u})`,marginLeft:`${d}%`}},t)})??[],[r,o.length,a?.map(({startByteOffset:e,endByteOffset:t})=>`${e}/${t}`).join(`,`)]),M=w(()=>{if(!f||f<0)return;let e=Math.floor(f/3600),t=Math.floor((f-e*3600)/60),n=Math.floor(f-e*3600-t*60);return`${e>0?`${e}:`:``}${t<10?`0`:``}${t}:${n<10?`0`:``}${n}`},[f]);E(()=>{u===void 0||!r||!b||!y.current||e.seek(u*r)},[e,b,u,r]);let N=w(()=>!r||typeof t!=`number`?0:t/r,[r,t]),P=w(()=>{if(f){if(c)return c(f);if(s.length)return s.find(({startTime:e,endTime:t})=>e<=f&&f<t)}},[s,c,f]);return q(`div`,{css:tM,ref:l,className:b?`progress-bar dragging`:`progress-bar`,onMouseMove:O,onMouseOut:k,children:[K(`div`,{className:`background-bar`}),f?K(`div`,{className:`cursor-time`,style:{left:`clamp(calc(3 * var(--mp-unit)), ${A(f)}%, calc(100% - calc(3 * var(--mp-unit))))`},children:M}):void 0,K(`div`,{className:`progress`}),K(`div`,{className:`loaded`,children:j}),K(`div`,{className:`hover`}),K(`div`,{className:`play-container`,children:K(`div`,{className:`play`,style:{transform:`scaleX(${N})`}})}),K(`div`,{className:`chapters`}),K(`div`,{className:`scrubber`}),K(`div`,{className:`padding`,...x,onPointerDown:S,onPointerUp:C,onPointerCancel:C}),K(`div`,{className:`thumbnail`,style:{left:`clamp(var(--thumbnail-half), ${A(f??1)}%, calc(100% - var(--thumbnail-half)))`},children:P?.url?K(`img`,{src:P.url}):void 0})]})},iM=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-picture-in-picture'%3e%3cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'%20/%3e%3cpath%20d='M11%2019h-6a2%202%200%200%201%20-2%20-2v-10a2%202%200%200%201%202%20-2h14a2%202%200%200%201%202%202v4'%20/%3e%3cpath%20d='M14%2014m0%201a1%201%200%200%201%201%20-1h5a1%201%200%200%201%201%201v3a1%201%200%200%201%20-1%201h-5a1%201%200%200%201%20-1%20-1z'%20/%3e%3c/svg%3e`,aM={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`},oM=e=>q(`svg`,{...aM,...e,children:[K(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`,ry:`2`}),K(`path`,{d:`M7 15h4m4 0h2M7 11h2m4 0h4`})]}),sM=e=>q(`svg`,{...aM,...e,children:[K(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`,ry:`2`}),K(`path`,{d:`M7 15h4m4 0h2M7 11h2m4 0h4`}),K(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})]}),cM=e=>q(`svg`,{...aM,...e,children:[K(`path`,{d:`M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5`}),K(`rect`,{x:`12`,y:`13`,width:`10`,height:`8`,rx:`1`,ry:`1`}),K(`path`,{d:`M14.5 18.5h2m2 0h1`})]}),lM=e=>q(`svg`,{...aM,...e,children:[K(`path`,{d:`M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5`}),K(`rect`,{x:`12`,y:`13`,width:`10`,height:`8`,rx:`1`,ry:`1`}),K(`path`,{d:`M6 9h3m2 0h2`})]}),uM=Xt`
|
|
488
|
-
.popover {
|
|
489
|
-
position: absolute;
|
|
490
|
-
/* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
|
|
491
|
-
bar, so a menu centred on it puts its own edges wherever the button happens to sit: with no
|
|
492
|
-
picture-in-picture button, which is every source whose media the player does not own, an edge
|
|
493
|
-
landed outside the box, and the root's \`overflow: hidden\` cut it off, taking the rows under it
|
|
494
|
-
out of reach. The inset matches the bar's own padding so the menu lines up with the last button. */
|
|
495
|
-
right: calc(12px + env(safe-area-inset-right, 0px));
|
|
496
|
-
bottom: calc(100% + 8px);
|
|
497
|
-
|
|
498
|
-
overflow-y: auto;
|
|
499
|
-
width: 180px;
|
|
500
|
-
/* \`100%\` is the control bar, which is the width of the PLAYER. The old \`100vw\` was the viewport,
|
|
501
|
-
which equals the player only when the player is the whole document, and it is the wrong kind of
|
|
502
|
-
guard besides: a max-width shrinks the box, it never moves it back inside. */
|
|
503
|
-
max-width: calc(100% - 24px);
|
|
504
|
-
/* Sized to its rows, capped at what fits. A fixed height left the settings menu two thirds empty
|
|
505
|
-
once subtitles moved out to its own button, and a long track list scrolls at the cap either way. */
|
|
506
|
-
height: max-content;
|
|
507
|
-
/* The room actually above the bar. A short player had the top of the menu clipped by that same
|
|
508
|
-
\`overflow: hidden\`. With no size container in the ancestry this resolves against the small
|
|
509
|
-
viewport, so it can only ever shrink the box, never grow it. */
|
|
510
|
-
max-height: min(160px, calc(100cqh - 100% - 16px));
|
|
511
|
-
@media (min-width: 768px) {
|
|
512
|
-
right: calc(16px + env(safe-area-inset-right, 0px));
|
|
513
|
-
width: 250px;
|
|
514
|
-
max-width: calc(100% - 32px);
|
|
515
|
-
}
|
|
516
|
-
@media (min-width: 2560px) {
|
|
517
|
-
right: calc(24px + env(safe-area-inset-right, 0px));
|
|
518
|
-
max-width: calc(100% - 48px);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
display: flex;
|
|
522
|
-
flex-direction: column;
|
|
523
|
-
|
|
524
|
-
border-radius: 8px;
|
|
525
|
-
background-color: rgba(28,28,28,0.95);
|
|
526
|
-
${Ij.bMedium.regular}
|
|
527
|
-
|
|
528
|
-
z-index: 4;
|
|
529
|
-
|
|
530
|
-
> div {
|
|
531
|
-
display: flex;
|
|
532
|
-
align-items: center;
|
|
533
|
-
justify-content: space-between;
|
|
534
|
-
|
|
535
|
-
color: #fff;
|
|
536
|
-
outline: none;
|
|
537
|
-
|
|
538
|
-
padding: 8px 6px 8px 12px;
|
|
539
|
-
|
|
540
|
-
width: 100%;
|
|
541
|
-
/* rows keep their own height inside the fixed height column, so a long page scrolls rather than
|
|
542
|
-
squashing every row into it */
|
|
543
|
-
flex-shrink: 0;
|
|
544
|
-
@media (pointer: coarse) {
|
|
545
|
-
box-sizing: border-box;
|
|
546
|
-
min-height: 44px;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
:first-of-type {
|
|
550
|
-
border-radius: 8px 8px 0 0;
|
|
551
|
-
}
|
|
552
|
-
:last-of-type {
|
|
553
|
-
border-radius: 0 0 8px 8px;
|
|
554
|
-
}
|
|
555
|
-
&:not(.no-hover) {
|
|
556
|
-
cursor: pointer;
|
|
557
|
-
}
|
|
558
|
-
&:not(.no-hover):hover {
|
|
559
|
-
background-color: rgba(255,255,255,.1);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
> div {
|
|
563
|
-
display: flex;
|
|
564
|
-
align-items: center;
|
|
565
|
-
justify-content: center;
|
|
566
|
-
|
|
567
|
-
.secondary {
|
|
568
|
-
color: #eee;
|
|
569
|
-
${Ij.bSmall.regular}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.back {
|
|
575
|
-
display: flex;
|
|
576
|
-
align-items: center;
|
|
577
|
-
justify-content: flex-start;
|
|
578
|
-
border-bottom: 1px solid #4D4D4E;
|
|
579
|
-
|
|
580
|
-
svg {
|
|
581
|
-
transform: translateX(-4px);
|
|
582
|
-
transition: transform 0.2s ease-in-out;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
:hover {
|
|
586
|
-
svg {
|
|
587
|
-
transform: translateX(-8px);
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
.track-list {
|
|
594
|
-
.description {
|
|
595
|
-
word-break: break-word;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
/* Dimmed and inert, but still listed. A source that names a track it cannot serve right now is
|
|
599
|
-
saying the track exists, and dropping the row would read as the source having nothing. */
|
|
600
|
-
.unavailable {
|
|
601
|
-
opacity: 0.5;
|
|
602
|
-
cursor: default;
|
|
603
|
-
:hover {
|
|
604
|
-
background-color: transparent;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
.failed {
|
|
609
|
-
border-bottom: 1px solid #4D4D4E;
|
|
610
|
-
color: #f66;
|
|
611
|
-
${Ij.bSmall.regular}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
`,dM=({title:e,tracks:t,selected:n,onSelect:r,onBack:i,offLabel:a,pending:o,failed:s})=>{let c=o!==void 0,l=(e,i,a)=>{let s=c&&o===e,l=c||t.find(t=>t.id===e)?.disabled;return q(`div`,{onClick:()=>{l||r(e??void 0)},className:[a,l?`unavailable`:null].filter(Boolean).join(` `)||void 0,children:[K(`span`,{children:i}),K(`span`,{children:s?`…`:(n??null)===e?`✓`:``})]},e??`__off__`)};return q(`div`,{className:`popover track-list`,children:[q(`div`,{className:i?`back`:`back no-hover`,onClick:i,children:[i?K(iA,{}):null,K(`span`,{children:e})]}),s?K(`div`,{className:`no-hover failed`,children:`Could not switch. Try again.`}):null,a?l(null,a):null,t.map(({id:e,label:t})=>l(e,t,`description`))]})},fM=({onReset:e}={})=>{let t=m(null),[n,r]=T(!1),[i,a]=T(void 0),[o,s]=T(!1),c=m(e);c.current=e;let l=()=>{r(!1),c.current?.()};return E(()=>{let e=e=>{n&&t.current&&!t.current.contains(e.target)&&l()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[n]),{open:n,toggle:()=>{r(e=>!e),s(!1),c.current?.()},close:l,containerRef:t,pending:i,failed:o,runSelect:(e,t)=>{if(i!==void 0)return;s(!1);let n;try{n=t()}catch(e){console.warn(`[media-player] track selection failed:`,e),s(!0);return}if(!(n instanceof Promise)){l();return}a(e),n.then(()=>{a(void 0),l()},e=>{console.warn(`[media-player] track selection failed:`,e),a(void 0),s(!0)})}}},pM=Xt`
|
|
615
|
-
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
616
|
-
which is the width of the player box, so it can be clamped to it. */
|
|
617
|
-
position: static;
|
|
618
|
-
|
|
619
|
-
.errors {
|
|
620
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
621
|
-
@media (pointer: coarse) {
|
|
622
|
-
box-sizing: border-box;
|
|
623
|
-
justify-content: center;
|
|
624
|
-
|
|
625
|
-
min-width: 44px;
|
|
626
|
-
min-height: 44px;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
${uM}
|
|
631
|
-
|
|
632
|
-
.popover.error-list {
|
|
633
|
-
/* Wider than a track menu and taller, because these rows are sentences rather than labels, and a
|
|
634
|
-
decoder message that has been ellipsized is not worth copying. */
|
|
635
|
-
width: 420px;
|
|
636
|
-
max-height: min(300px, calc(100cqh - 100% - 16px));
|
|
637
|
-
|
|
638
|
-
/* track-menu's header is a left-aligned label row; here it carries a control too, so the two
|
|
639
|
-
ends go to the two ends */
|
|
640
|
-
.back {
|
|
641
|
-
justify-content: space-between;
|
|
642
|
-
gap: 8px;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
.copy {
|
|
646
|
-
/* sits in the header row, which track-menu styles as .back */
|
|
647
|
-
display: flex;
|
|
648
|
-
align-items: center;
|
|
649
|
-
gap: 6px;
|
|
650
|
-
|
|
651
|
-
background: none;
|
|
652
|
-
border: none;
|
|
653
|
-
padding: 4px 6px;
|
|
654
|
-
border-radius: 4px;
|
|
655
|
-
|
|
656
|
-
color: #fff;
|
|
657
|
-
cursor: pointer;
|
|
658
|
-
${Ij.bSmall.regular}
|
|
659
|
-
|
|
660
|
-
&:hover {
|
|
661
|
-
background-color: rgba(255,255,255,.1);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
svg {
|
|
665
|
-
width: 14px;
|
|
666
|
-
height: 14px;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.entry {
|
|
671
|
-
/* one failure is a block of text, so it stacks instead of sitting on one line */
|
|
672
|
-
display: flex;
|
|
673
|
-
flex-direction: column;
|
|
674
|
-
align-items: flex-start;
|
|
675
|
-
gap: 2px;
|
|
676
|
-
|
|
677
|
-
.when {
|
|
678
|
-
color: #bbb;
|
|
679
|
-
${Ij.bSmall.regular}
|
|
680
|
-
|
|
681
|
-
/* the one part of the line worth scanning for, so it is the one part at full brightness */
|
|
682
|
-
.count {
|
|
683
|
-
margin-left: 6px;
|
|
684
|
-
color: #fff;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.what {
|
|
689
|
-
/* the decoder's own words, which are long and must not be cut */
|
|
690
|
-
overflow-wrap: anywhere;
|
|
691
|
-
white-space: pre-wrap;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.cause {
|
|
695
|
-
color: #ddd;
|
|
696
|
-
overflow-wrap: anywhere;
|
|
697
|
-
white-space: pre-wrap;
|
|
698
|
-
${Ij.bSmall.regular}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
`,mM=e=>new Date(e).toLocaleTimeString(),hM=e=>e===void 0||!Number.isFinite(e)?void 0:qj(Math.max(0,e)),gM=e=>e.reduce((e,t)=>e+t.count,0),_M=e=>e.map((e,t)=>{let n=hM(e.atMediaTime),r=e.count>1?`${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}`:new Date(e.at).toISOString();return[`${t+1}. ${r}${n?` (at ${n})`:``}${e.recovered?` [recovered]`:``}`,e.message,e.detail].filter(Boolean).join(`
|
|
703
|
-
`)}).join(`
|
|
704
|
-
|
|
705
|
-
`),vM=()=>{let e=$(e=>e.playbackErrors),{open:t,toggle:n,containerRef:r}=fM(),[i,a]=T(!1);if(e.length===0)return null;let o=()=>{navigator.clipboard?.writeText(_M(e)).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)},e=>console.warn(`[media-player] could not copy the errors:`,e))},s=`Playback errors (${gM(e)})`;return q(`div`,{css:pM,ref:r,children:[K($j,{id:`errors`,disabled:t,text:K(`button`,{className:`errors`,type:`button`,onClick:n,"aria-label":s,"aria-expanded":t,children:K(Xk,{className:`alert-triangle`})}),toolTipText:K(`span`,{children:s})}),t&&q(`div`,{className:`popover error-list`,children:[q(`div`,{className:`back no-hover`,children:[K(`span`,{children:s}),q(`button`,{className:`copy`,type:`button`,onClick:o,"aria-label":`Copy the errors`,children:[K(i?eA:fA,{}),K(`span`,{children:i?`Copied`:`Copy`})]})]}),e.map((e,t)=>q(`div`,{className:`entry no-hover`,children:[q(`span`,{className:`when`,children:[mM(e.at),e.count>1?` to ${mM(e.lastAt)}`:``,hM(e.atMediaTime)?` at ${hM(e.atMediaTime)}`:``,e.recovered?` recovered`:``,e.count>1?K(`span`,{className:`count`,children:`×${e.count}`}):null]}),K(`span`,{className:`what`,children:e.message}),e.detail?K(`span`,{className:`cause`,children:e.detail}):null]},`${e.at}-${t}`))]})]})},yM=Xt`
|
|
706
|
-
display: flex;
|
|
707
|
-
align-items: center;
|
|
708
|
-
justify-content: center;
|
|
709
|
-
flex-direction: column;
|
|
710
|
-
width: 100%;
|
|
711
|
-
|
|
712
|
-
.playback-slider {
|
|
713
|
-
display: flex;
|
|
714
|
-
align-items: center;
|
|
715
|
-
|
|
716
|
-
padding: 8px 4px;
|
|
717
|
-
margin: 0 2px;
|
|
718
|
-
/* a finger needs a 44px band to press, so the padding grows while the track stays 3px */
|
|
719
|
-
@media (pointer: coarse) {
|
|
720
|
-
padding: 20px 8px;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
cursor: pointer;
|
|
724
|
-
|
|
725
|
-
> div {
|
|
726
|
-
position: relative;
|
|
727
|
-
|
|
728
|
-
background: #ccc;
|
|
729
|
-
border-radius: 4px;
|
|
730
|
-
|
|
731
|
-
width: 120px;
|
|
732
|
-
max-width: 100%;
|
|
733
|
-
height: 3px;
|
|
734
|
-
@media (min-width: 768px) {
|
|
735
|
-
height: 4px;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
.playback-handle {
|
|
740
|
-
position: absolute;
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
background: #ffffff;
|
|
744
|
-
border-radius: 50%;
|
|
745
|
-
transform: translateX(-50%);
|
|
746
|
-
pointer-events: none;
|
|
747
|
-
|
|
748
|
-
width: 10px;
|
|
749
|
-
height: 10px;
|
|
750
|
-
top: -3.5px;
|
|
751
|
-
@media (min-width: 768px) {
|
|
752
|
-
width: 12px;
|
|
753
|
-
height: 12px;
|
|
754
|
-
top: -4px;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
`,bM=()=>{let e=$(),t=$(e=>e.playbackRate),n=m(null),r=m(null),i=.25,a=3-i,o=(e,t=.05)=>Math.round(e/t)*t,s=o(t||1),c=e=>(e-i)/a*100,l=e=>o(i+e*a),{handlers:u}=eM({ref:r,onChange:t=>e.setPlaybackRate(l(t))}),d=t=>{t.preventDefault();let n=.05,r=s;r=t.deltaY<0?Math.min(3,r+n):Math.max(i,r-n),e.setPlaybackRate(r)};E(()=>{let e=n.current;return e&&e.addEventListener(`wheel`,d,{passive:!1}),()=>{e&&e.removeEventListener(`wheel`,d)}},[t]);let f=c(s);return q(`div`,{css:yM,children:[q(`div`,{children:[s.toFixed(2),`x`]}),K(`div`,{className:`playback-slider`,ref:n,...u,children:K(`div`,{ref:r,style:{background:`linear-gradient(to right,
|
|
759
|
-
#fff 0% ${f}%,
|
|
760
|
-
#3A3A3A ${f}% 100%
|
|
761
|
-
)`},children:K(`div`,{className:`playback-handle`,style:{left:`${f}%`}})})})]})},xM=Xt`
|
|
762
|
-
/* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
|
|
763
|
-
as wide as the player box and can therefore be clamped to it. The outside-click check uses
|
|
764
|
-
\`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
|
|
765
|
-
tooltips already resolve against the control bar with no positioned wrapper of their own. */
|
|
766
|
-
position: static;
|
|
767
|
-
|
|
768
|
-
.settings {
|
|
769
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
770
|
-
@media (pointer: coarse) {
|
|
771
|
-
box-sizing: border-box;
|
|
772
|
-
justify-content: center;
|
|
773
|
-
|
|
774
|
-
min-width: 44px;
|
|
775
|
-
min-height: 44px;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
${uM}
|
|
780
|
-
|
|
781
|
-
.playback-rate {
|
|
782
|
-
.slider {
|
|
783
|
-
width: 100%;
|
|
784
|
-
}
|
|
785
|
-
.options {
|
|
786
|
-
display: grid;
|
|
787
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
788
|
-
align-items: center;
|
|
789
|
-
|
|
790
|
-
padding: 8px 12px;
|
|
791
|
-
/* four presets across a 180px popover leave targets 34px wide, so a finger gets two rows of two
|
|
792
|
-
until the popover is wide enough for the row of four */
|
|
793
|
-
@media (pointer: coarse) {
|
|
794
|
-
grid-template-columns: 1fr 1fr;
|
|
795
|
-
}
|
|
796
|
-
@media (pointer: coarse) and (min-width: 768px) {
|
|
797
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
> div {
|
|
801
|
-
display: flex;
|
|
802
|
-
align-items: center;
|
|
803
|
-
border-radius: 4px;
|
|
804
|
-
|
|
805
|
-
padding: 8px 6px;
|
|
806
|
-
height: 100%;
|
|
807
|
-
@media (pointer: coarse) {
|
|
808
|
-
box-sizing: border-box;
|
|
809
|
-
min-height: 44px;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
cursor: pointer;
|
|
813
|
-
:hover {
|
|
814
|
-
background-color: rgba(255,255,255,.1);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
`,SM=()=>{let e=$(),t=$(e=>e.playbackRate),n=$(e=>e.audioTracks),r=$(e=>e.selectedAudioTrack),i=$(e=>e.selectAudioTrack),[a,o]=T(0),{open:s,toggle:c,containerRef:l,pending:u,failed:d,runSelect:f}=fM({onReset:()=>o(0)}),p=t=>{e.setPlaybackRate(t),o(0)},m=e=>{e!==void 0&&f(e,()=>i(e))},h=e=>()=>{o(e)};return q(`div`,{css:xM,ref:l,children:[K($j,{id:`settings`,disabled:s,text:K(`button`,{className:`settings`,type:`button`,onClick:c,"aria-label":`Settings`,"aria-expanded":s,children:K(IA,{})}),toolTipText:K(`span`,{children:`Settings`})}),s&&a===0&&q(`div`,{className:`popover menu`,children:[n.length>1?q(`div`,{onClick:h(2),children:[K(`div`,{children:`Audio`}),K(`div`,{children:K(cA,{})})]}):null,q(`div`,{onClick:h(1),children:[K(`div`,{children:`Playback speed`}),q(`div`,{children:[K(`span`,{className:`secondary`,children:t===1?`(Default)`:t.toFixed(2)}),K(cA,{})]})]})]}),s&&a===1&&q(`div`,{className:`popover playback-rate`,children:[q(`div`,{className:`back`,onClick:h(0),children:[K(iA,{}),K(`span`,{children:`Playback speed`})]}),K(`div`,{className:`slider no-hover`,children:K(bM,{})}),q(`div`,{className:`options no-hover`,children:[K(`div`,{onClick:()=>p(.5),children:`0.5x`}),K(`div`,{onClick:()=>p(1),children:`1x`}),K(`div`,{onClick:()=>p(1.5),children:`1.5x`}),K(`div`,{onClick:()=>p(2),children:`2x`})]})]}),s&&a===2&&K(dM,{title:`Audio`,tracks:n,selected:r,onSelect:m,onBack:h(0),pending:u,failed:d})]})},CM=Xt`
|
|
821
|
-
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
822
|
-
which is the width of the player box, so it can be clamped to it. */
|
|
823
|
-
position: static;
|
|
824
|
-
|
|
825
|
-
.subtitles {
|
|
826
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
827
|
-
@media (pointer: coarse) {
|
|
828
|
-
box-sizing: border-box;
|
|
829
|
-
justify-content: center;
|
|
830
|
-
|
|
831
|
-
min-width: 44px;
|
|
832
|
-
min-height: 44px;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
${uM}
|
|
837
|
-
`,wM=()=>{let e=$(e=>e.subtitleTracks),t=$(e=>e.selectedSubtitleTrack),n=$(e=>e.selectSubtitleTrack),r=$(e=>e.subtitleOffLabel),{open:i,toggle:a,containerRef:o,pending:s,failed:c,runSelect:l}=fM();if(e.length===0)return null;let u=t!==void 0;return q(`div`,{css:CM,ref:o,children:[K($j,{id:`subtitles`,disabled:i,text:K(`button`,{className:`subtitles`,type:`button`,onClick:a,"aria-label":`Subtitles`,"aria-expanded":i,"aria-pressed":u,children:u?K(oM,{className:`captions`}):K(sM,{className:`captions-off`})}),toolTipText:K(`span`,{children:`Subtitles`})}),i&&K(dM,{title:`Subtitles`,tracks:e,selected:t,onSelect:e=>l(e??null,()=>n(e)),offLabel:r??`Disable`,pending:s,failed:c})]})},TM={primary:`#EAEBEE`,secondary:`#D0D0D9`,hover:`rgba(255, 255, 255, 0.13)`,borderPrimary:`#384F70`,backgroundTooltip:`#222222`},EM=Xt`
|
|
838
|
-
display: flex;
|
|
839
|
-
align-items: center;
|
|
840
|
-
|
|
841
|
-
padding: 16px 4px;
|
|
842
|
-
margin: 0 2px;
|
|
843
|
-
/* a finger needs a 44px band to press, so the padding grows while the track stays 3px */
|
|
844
|
-
@media (pointer: coarse) {
|
|
845
|
-
padding: 22px 4px;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
cursor: pointer;
|
|
849
|
-
|
|
850
|
-
> div {
|
|
851
|
-
position: relative;
|
|
852
|
-
|
|
853
|
-
background: #ccc;
|
|
854
|
-
border-radius: 4px;
|
|
855
|
-
|
|
856
|
-
width: 80px;
|
|
857
|
-
height: 3px;
|
|
858
|
-
/* the control bar has under 360px to fit every button once the slider is always open, so the
|
|
859
|
-
track lends some of its length back on a phone and takes it again on anything wider */
|
|
860
|
-
@media (pointer: coarse) {
|
|
861
|
-
width: 64px;
|
|
862
|
-
}
|
|
863
|
-
@media (pointer: coarse) and (min-width: 768px) {
|
|
864
|
-
width: 80px;
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
.volume-handle {
|
|
869
|
-
position: absolute;
|
|
870
|
-
top: -3.5px;
|
|
871
|
-
|
|
872
|
-
background: #ffffff;
|
|
873
|
-
border-radius: 50%;
|
|
874
|
-
transform: translateX(-50%);
|
|
875
|
-
pointer-events: none;
|
|
876
|
-
|
|
877
|
-
width: 10px;
|
|
878
|
-
height: 10px;
|
|
879
|
-
}
|
|
880
|
-
`,DM=({value:e,onChange:t})=>{let n=$(e=>e.volume),r=$(e=>e.muted),i=m(null),a=m(null),{handlers:o}=eM({ref:a,onChange:t}),s=n=>{n.preventDefault();let r=.05,i=e;i=n.deltaY<0?Math.min(1,i+r):Math.max(0,i-r),t(i)};E(()=>{let e=i.current;return e&&e.addEventListener(`wheel`,s,{passive:!1}),()=>{e&&e.removeEventListener(`wheel`,s)}},[e]);let c=e*100,l=w(()=>Math.round(r?0:Kj(n)*100),[n,r]);return K($j,{id:`volume-slider`,text:K(`div`,{ref:i,css:EM,...o,children:K(`div`,{ref:a,style:{background:`linear-gradient(to right,
|
|
881
|
-
#fff 0% ${c}%,
|
|
882
|
-
#3A3A3A ${c}% 100%
|
|
883
|
-
)`},children:K(`div`,{className:`volume-handle`,style:{left:`${e*100}%`}})})}),toolTipText:q(`div`,{className:`volume-value`,children:[l,`%`]})})},OM=Xt`
|
|
884
|
-
position: relative;
|
|
885
|
-
display: flex;
|
|
886
|
-
align-items: center;
|
|
887
|
-
|
|
888
|
-
.volume-slider-container {
|
|
889
|
-
display: flex;
|
|
890
|
-
align-items: center;
|
|
891
|
-
|
|
892
|
-
width: 0;
|
|
893
|
-
margin-right: 0;
|
|
894
|
-
overflow: hidden;
|
|
895
|
-
pointer-events: none;
|
|
896
|
-
|
|
897
|
-
transition: margin .2s cubic-bezier(0.4,0,1,1), width .2s cubic-bezier(0.4,0,1,1);
|
|
898
|
-
-webkit-transition: margin .2s cubic-bezier(0.4,0,1,1), width .2s cubic-bezier(0.4,0,1,1);
|
|
899
|
-
|
|
900
|
-
.volume-slider-background {
|
|
901
|
-
display: flex;
|
|
902
|
-
flex-direction: row;
|
|
903
|
-
align-items: center;
|
|
904
|
-
|
|
905
|
-
border-radius: 4px;
|
|
906
|
-
|
|
907
|
-
.volume-value {
|
|
908
|
-
${Ij.bMedium.regular};
|
|
909
|
-
color: #ffffff;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
&:hover .volume-slider-container {
|
|
915
|
-
width: calc(9 * var(--mp-unit));
|
|
916
|
-
|
|
917
|
-
transition: margin .2s cubic-bezier(0,0,0.2,1), width .2s cubic-bezier(0,0,0.2,1);
|
|
918
|
-
-webkit-transition: margin .2s cubic-bezier(0,0,0.2,1), width .2s cubic-bezier(0,0,0.2,1);
|
|
919
|
-
|
|
920
|
-
pointer-events: auto;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
/* a touch screen has no hover, so the slider stays open there and the button only mutes */
|
|
924
|
-
@media (pointer: coarse) {
|
|
925
|
-
/* auto, not a fixed rem: the container keeps overflow: hidden, so a narrower fixed width
|
|
926
|
-
silently clips the track and makes the clipped part unhittable */
|
|
927
|
-
.volume-slider-container,
|
|
928
|
-
&:hover .volume-slider-container {
|
|
929
|
-
width: auto;
|
|
930
|
-
|
|
931
|
-
pointer-events: auto;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
/* a 44px press target around an 18px icon, floored here because the control bar sets the
|
|
935
|
-
padding at a higher specificity */
|
|
936
|
-
.sound {
|
|
937
|
-
/* border-box explicitly, since a consumer reset cannot be assumed */
|
|
938
|
-
box-sizing: border-box;
|
|
939
|
-
justify-content: center;
|
|
940
|
-
|
|
941
|
-
min-width: 44px;
|
|
942
|
-
min-height: 44px;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
`,kM=({ref:e})=>{let t=$(),n=$(e=>e.volume),r=$(e=>e.muted),i=w(()=>Kj(n),[n]);return q(`div`,{css:OM,children:[K($j,{id:`sound`,text:K(`button`,{className:`sound`,type:`button`,onClick:()=>t.toggleMuted(),ref:e,"aria-label":`Mute`,"aria-pressed":r||n===0,children:K(r||n===0?JA:n<=.5?BA:WA,{size:18,color:`#fff`})}),toolTipText:K(`span`,{children:r?`Unmute (m)`:`Mute (m)`})}),K(`div`,{className:`volume-slider-container`,children:K(`div`,{className:`volume-slider-background`,children:K(DM,{value:r?0:i,onChange:e=>{t.setVolume(Gj(e))}})})})]})},AM=.05,jM=5,MM=Xt`
|
|
947
|
-
display: flex;
|
|
948
|
-
flex-direction: column;
|
|
949
|
-
gap: calc(0.4 * var(--mp-unit));
|
|
950
|
-
|
|
951
|
-
.hint {
|
|
952
|
-
opacity: 0.72;
|
|
953
|
-
font-size: 0.9em;
|
|
954
|
-
}
|
|
955
|
-
`,NM=Xt`
|
|
956
|
-
position: absolute;
|
|
957
|
-
bottom: 0;
|
|
958
|
-
width: 100%;
|
|
959
|
-
|
|
960
|
-
background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.45) 20%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.15) 70%, transparent 100%);
|
|
961
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
962
|
-
|
|
963
|
-
.actions {
|
|
964
|
-
display: flex;
|
|
965
|
-
justify-content: space-between;
|
|
966
|
-
|
|
967
|
-
/* repeated per breakpoint: nested at-rules are hoisted after the rule, so a shorthand inside a
|
|
968
|
-
media query would override a longhand above it and silently drop the safe-area inset */
|
|
969
|
-
padding: 6px calc(12px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
|
|
970
|
-
@media (min-width: 768px) {
|
|
971
|
-
padding: 8px calc(16px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
|
|
972
|
-
}
|
|
973
|
-
@media (min-width: 2560px) {
|
|
974
|
-
padding: 8px calc(24px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.left, .right {
|
|
978
|
-
display: flex;
|
|
979
|
-
align-items: center;
|
|
980
|
-
|
|
981
|
-
button {
|
|
982
|
-
display: flex;
|
|
983
|
-
align-items: center;
|
|
984
|
-
|
|
985
|
-
outline: none;
|
|
986
|
-
border: none;
|
|
987
|
-
background: none;
|
|
988
|
-
|
|
989
|
-
svg {
|
|
990
|
-
width: 18px;
|
|
991
|
-
height: 18px;
|
|
992
|
-
@media (min-width: 768px) {
|
|
993
|
-
width: 24px;
|
|
994
|
-
height: 24px;
|
|
995
|
-
}
|
|
996
|
-
@media (min-width: 2560px) {
|
|
997
|
-
width: 28px;
|
|
998
|
-
height: 28px;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
svg {
|
|
1003
|
-
stroke: #fff;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
/* Reads as unavailable rather than absent, so the bar does not reflow when tracks land. */
|
|
1007
|
-
&:disabled {
|
|
1008
|
-
cursor: default;
|
|
1009
|
-
opacity: .4;
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
.play, .sound, .time, .errors, .subtitles, .settings, .picture-in-picture, .full-screen {
|
|
1014
|
-
display: flex;
|
|
1015
|
-
align-items: center;
|
|
1016
|
-
|
|
1017
|
-
height: 100%;
|
|
1018
|
-
|
|
1019
|
-
border-radius: 4px;
|
|
1020
|
-
user-select: none;
|
|
1021
|
-
|
|
1022
|
-
padding: 8px;
|
|
1023
|
-
@media (min-width: 768px) {
|
|
1024
|
-
padding: 8px 12px;
|
|
1025
|
-
}
|
|
1026
|
-
@media (min-width: 2560px) {
|
|
1027
|
-
padding: 8px 12px;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
.play, .sound, .errors, .subtitles, .settings, .picture-in-picture, .full-screen {
|
|
1032
|
-
border-radius: 4px;
|
|
1033
|
-
|
|
1034
|
-
padding: 8px;
|
|
1035
|
-
@media (min-width: 768px) {
|
|
1036
|
-
padding: 8px 12px;
|
|
1037
|
-
}
|
|
1038
|
-
@media (min-width: 2560px) {
|
|
1039
|
-
padding: 8px 12px;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
cursor: pointer;
|
|
1043
|
-
|
|
1044
|
-
:hover {
|
|
1045
|
-
background-color: ${TM.hover};
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
/* the hit area grows, the icon does not, keyed on the pointer because a narrow desktop
|
|
1049
|
-
window still has a mouse */
|
|
1050
|
-
@media (pointer: coarse) {
|
|
1051
|
-
/* border-box explicitly, since a consumer reset cannot be assumed */
|
|
1052
|
-
box-sizing: border-box;
|
|
1053
|
-
min-width: 44px;
|
|
1054
|
-
min-height: 44px;
|
|
1055
|
-
justify-content: center;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.left {
|
|
1061
|
-
.time {
|
|
1062
|
-
${Ij.bMedium.regular}
|
|
1063
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
.right {
|
|
1067
|
-
.picture-in-picture {
|
|
1068
|
-
img {
|
|
1069
|
-
width: 22px;
|
|
1070
|
-
height: 22px;
|
|
1071
|
-
@media (min-width: 768px) {
|
|
1072
|
-
width: 28px;
|
|
1073
|
-
height: 28px;
|
|
1074
|
-
}
|
|
1075
|
-
@media (min-width: 2560px) {
|
|
1076
|
-
width: 32px;
|
|
1077
|
-
height: 32px;
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
`,PM=()=>{let e=$(),t=$(e=>e.paused),n=$(e=>e.currentTime),r=$(e=>e.duration),i=$(e=>e.fullscreen),a=$(e=>e.hideUI),o=$(e=>e.togglePictureInPicture),s=$(e=>e.pictureInPictureMode),c=$(e=>e.burnedInSubtitles),l=$(e=>e.subtitleTracks),u=$(e=>e.requestSeek),[f,p]=T(null),m=s===`burn-in`,h=l.length>0,g=r>0&&n===r,_=d(({direction:t,stepSize:n})=>{let r=Kj(e.volume),i=t===`up`?n:-n,a=Math.max(0,Math.min(1,r+i)),o=e.muted;e.setVolume(Gj(a)),o&&!e.muted&&e.toggleMuted()},[e]);E(()=>{let t=t=>u?u(t):e.seek(t),n=n=>{let r=n.target;if(r?.isContentEditable||/^(input|textarea|select)$/i.test(r?.tagName??``))return;let i=!0;if(n.key===`f`)e.toggleFullscreen();else if(n.key===`k`)e.togglePaused();else if(n.key===` `)e.togglePaused();else if(n.key===`m`)e.toggleMuted();else if(n.key===`ArrowUp`)_({direction:`up`,stepSize:AM});else if(n.key===`ArrowDown`)_({direction:`down`,stepSize:AM});else if(n.key===`ArrowRight`){if(!e.duration)return;t(Math.min(e.currentTime+jM,e.duration))}else n.key===`ArrowLeft`?t(Math.max(e.currentTime-jM,0)):i=!1;i&&n.preventDefault()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,_,u]);let v=d(e=>{e.preventDefault(),e.deltaY<0?_({direction:`up`,stepSize:AM}):_({direction:`down`,stepSize:AM})},[_]);return E(()=>{if(f)return f.addEventListener(`wheel`,v,{passive:!1}),()=>f.removeEventListener(`wheel`,v)},[f,v]),q(`div`,{css:NM,style:{...a?{opacity:`0`,pointerEvents:`none`}:{}},children:[K(rM,{}),q(`div`,{className:`actions`,children:[q(`div`,{className:`left`,children:[K($j,{id:`play`,tooltipPlace:`top-start`,text:K(`button`,{className:`play`,type:`button`,onClick:()=>e.togglePaused(),"aria-label":g?`Replay`:t?`Play`:`Pause`,children:K(g?MA:t?OA:wA,{})}),toolTipText:K(`span`,{children:g?`Replay (k)`:t?`Play (k)`:`Pause (k)`})}),K(kM,{ref:p}),K(`div`,{className:`time`,children:Jj(n,r)})]}),q(`div`,{className:`right`,children:[K(vM,{}),K(wM,{}),K(SM,{}),o?K($j,{id:`picture-in-picture`,tooltipPlace:`top-end`,text:K(`button`,{className:`picture-in-picture`,type:`button`,onClick:o,disabled:m&&!h,"aria-label":m?`Put the subtitles in the video`:`Picture in picture`,"aria-pressed":m?c:void 0,children:m?K(c?cM:lM,{}):K(`img`,{src:iM,alt:``})}),toolTipText:q(`span`,{css:MM,children:[K(`span`,{className:`lead`,children:m?h?c?`Subtitles are in the picture`:`Put the subtitles in the picture`:`This file has no subtitles`:`Picture in picture`}),m&&h?K(`span`,{className:`hint`,children:`Then hover the video and click your browser's own pop out button`}):null]})}):null,K($j,{id:`full-screen`,tooltipPlace:`top-end`,text:K(`button`,{className:`full-screen`,type:`button`,onClick:()=>e.toggleFullscreen(),"aria-label":`Full screen`,"aria-pressed":i,children:K(i?bA:gA,{})}),toolTipText:K(`span`,{children:i?`Exit full screen (f)`:`Full screen (f)`})})]})]})]})},FM=9e3,IM=Xt`
|
|
1084
|
-
position: absolute;
|
|
1085
|
-
inset: 0;
|
|
1086
|
-
z-index: 2;
|
|
1087
|
-
pointer-events: none;
|
|
1088
|
-
|
|
1089
|
-
.card {
|
|
1090
|
-
position: absolute;
|
|
1091
|
-
/* Where Firefox draws its own toggle: right aligned, a little past the middle of the height. */
|
|
1092
|
-
top: 52%;
|
|
1093
|
-
right: calc(7 * var(--mp-unit));
|
|
1094
|
-
transform: translateY(-50%);
|
|
1095
|
-
|
|
1096
|
-
display: flex;
|
|
1097
|
-
align-items: center;
|
|
1098
|
-
gap: calc(1.2 * var(--mp-unit));
|
|
1099
|
-
|
|
1100
|
-
max-width: min(calc(42 * var(--mp-unit)), 60%);
|
|
1101
|
-
padding: calc(1.4 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
|
|
1102
|
-
border-radius: calc(0.8 * var(--mp-unit));
|
|
1103
|
-
background-color: rgba(20, 20, 22, 0.94);
|
|
1104
|
-
box-shadow: 0 0 calc(2 * var(--mp-unit)) rgba(0, 0, 0, 0.6);
|
|
1105
|
-
|
|
1106
|
-
opacity: 0;
|
|
1107
|
-
transition: opacity 0.25s ease;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
&.show .card {
|
|
1111
|
-
opacity: 1;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
.words {
|
|
1115
|
-
display: flex;
|
|
1116
|
-
flex-direction: column;
|
|
1117
|
-
gap: calc(0.3 * var(--mp-unit));
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
.title {
|
|
1121
|
-
${Ij.bMedium.bold}
|
|
1122
|
-
color: #fff;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
.body {
|
|
1126
|
-
${Ij.bSmall.regular}
|
|
1127
|
-
color: rgba(255, 255, 255, 0.75);
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
/* Points at the edge the browser's control lives on, which is the whole message. */
|
|
1131
|
-
.arrow {
|
|
1132
|
-
flex: none;
|
|
1133
|
-
font-size: calc(2.6 * var(--mp-unit));
|
|
1134
|
-
line-height: 1;
|
|
1135
|
-
color: #fff;
|
|
1136
|
-
}
|
|
1137
|
-
`,LM=()=>{let e=$(e=>e.burnedInSubtitles),t=$(e=>e.pictureInPictureMode),[n,r]=T(!1);return E(()=>{if(t!==`burn-in`||!e){r(!1);return}r(!0);let n=setTimeout(()=>r(!1),FM);return()=>clearTimeout(n)},[t,e]),t!==`burn-in`||!e?null:K(`div`,{css:IM,className:n?`show`:``,role:`status`,children:q(`div`,{className:`card`,children:[q(`div`,{className:`words`,children:[K(`div`,{className:`title`,children:`Subtitles are in the picture`}),K(`div`,{className:`body`,children:`Now hover the video and click your browser's own pop out button`})]}),K(`div`,{className:`arrow`,"aria-hidden":`true`,children:`→`})]})})},RM=3e3,zM=Xt`
|
|
1138
|
-
position: absolute;
|
|
1139
|
-
inset: 0;
|
|
1140
|
-
z-index: 2;
|
|
1141
|
-
/* Never eats a click: click-to-pause still reaches the video underneath, and an item that needs a
|
|
1142
|
-
pointer (a tooltip anchor, a button) sets \`pointer-events: auto\` on itself. */
|
|
1143
|
-
pointer-events: none;
|
|
1144
|
-
/* visibility, not only opacity: an item that took pointer events back would otherwise stay
|
|
1145
|
-
hoverable while faded out, popping a tooltip over nothing. It cascades where pointer-events does
|
|
1146
|
-
not, and transitioning it holds the item on screen for the length of the fade. */
|
|
1147
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1), visibility 0.1s;
|
|
1148
|
-
`,BM=Xt`
|
|
1149
|
-
position: relative;
|
|
1150
|
-
background-color: black;
|
|
1151
|
-
display: flex;
|
|
1152
|
-
justify-content: center;
|
|
1153
|
-
align-items: center;
|
|
1154
|
-
height: 100%;
|
|
1155
|
-
width: 100%;
|
|
1156
|
-
|
|
1157
|
-
& > div:not(:last-of-type) {
|
|
1158
|
-
position: absolute;
|
|
1159
|
-
z-index: 2;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
canvas {
|
|
1163
|
-
height: 100%;
|
|
1164
|
-
width: 100%;
|
|
1165
|
-
pointer-events: none;
|
|
1166
|
-
position: absolute;
|
|
1167
|
-
z-index: 1;
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
.video, video {
|
|
1171
|
-
height: 100%;
|
|
1172
|
-
width: 100%;
|
|
1173
|
-
background-color: black;
|
|
1174
|
-
object-fit: contain;
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
&.hide {
|
|
1178
|
-
cursor: none;
|
|
1179
|
-
}
|
|
1180
|
-
`,VM=(e,t=``)=>u.toArray(e).flatMap((e,n)=>{let i=`${t}${b(e)&&e.key!=null?e.key:n}`;return b(e)&&e.type===r?VM(e.props.children,`${i}/`):[{key:i,item:e}]}),HM=({ref:e,onVideoRef:t,onCanvasRef:n,overlay:r,controls:i,children:a})=>{let o=$(),s=$(e=>e.hideUI),c=$(e=>e.setHideUI),l=m(void 0),u=m(`mouse`),d=m({x:-1,y:-1}),f=m(null);E(()=>()=>clearTimeout(l.current),[]);let p=t=>{f.current=t,typeof e==`function`?e(t):e&&(e.current=t)},h=()=>{if(u.current!==`mouse`)return!1;let{x:e,y:t}=d.current;if(!f.current||e<0)return!1;let n=document.elementFromPoint(e,t);return!!n&&f.current.contains(n)&&!n.closest(`.video`)},g=()=>{if(h()){l.current=setTimeout(g,RM);return}c(!0)},_=()=>{c(!1),clearTimeout(l.current),l.current=setTimeout(g,RM)};return q(`div`,{css:BM,ref:p,onPointerMove:e=>{u.current=e.pointerType,e.pointerType===`mouse`&&(d.current={x:e.clientX,y:e.clientY},_())},onPointerDown:e=>{u.current=e.pointerType},onMouseOut:e=>{let t=e.relatedTarget;if(t&&e.currentTarget.contains(t))return;let{left:n,right:r,top:i,bottom:a}=e.currentTarget.getBoundingClientRect();e.clientX>=n&&e.clientX<r&&e.clientY>=i&&e.clientY<a||(clearTimeout(l.current),c(!0))},className:s?`hide`:``,children:[K(Hj,{onCanvasRef:n}),VM(r).map(({key:e,item:t})=>K(`div`,{css:zM,style:{...s?{opacity:`0`,visibility:`hidden`,pointerEvents:`none`}:{}},children:t},e)),i===!1?null:K(PM,{}),K(LM,{}),q(`div`,{className:`video`,onClick:()=>{if(u.current===`mouse`){o.togglePaused();return}s?_():(clearTimeout(l.current),c(!0))},children:[t?K(`video`,{ref:t,playsInline:!0}):null,a]})]})},UM=({options:e,children:t})=>{let n=`media`in e?e:null,r=n?null:e,{title:i}=e,{size:a,downloadedRanges:o,publicPath:s,libavWorkerUrl:c,read:l,thumbnailRead:u,thumbnailsEnabled:d}=r??{},f=jS(),p=MS(),[h,g]=T(null),[_,v]=T(null),y=n?.media??h;E(()=>(f?.(y),()=>f?.(null)),[y,f]);let{expose:b}=e,x=b===!0?{}:b||void 0,S=m(x);S.current=x;let C=x?x.id:void 0,w=x?x.origin:void 0,D=x?x.channel:void 0;E(()=>{if(!b||!y)return;let e,t=!1;return ie(async()=>{let{exposePlayer:e}=await import(`./remote-DNcNpuT3.js`);return{exposePlayer:e}},__vite__mapDeps([5,6,2])).then(({exposePlayer:n})=>{t||(e=n(y,S.current??{}))}).catch(()=>{}),()=>{t=!0,e?.()}},[y,!!b,C,w,D]),jj(h,_,r);let O=Pj({publicPath:s,workerUrl:c,length:d===!1?void 0:a,read:u??l,downloadedRanges:o}),k=n?.thumbnails?.all??O,{toggle:A,mode:j,burnedIn:M}=Fj(h,_),N=$(e=>e.setSourceState);E(()=>{N({title:i,size:a,downloadedRanges:o})},[N,i,a,o]);let P=n?.thumbnails?.at;E(()=>{N({thumbnails:k,thumbnailAt:P,togglePictureInPicture:A,pictureInPictureMode:j,burnedInSubtitles:M})},[N,k,P,A,j,M]);let F=n?.subtitles?.selection,ee=n?.audioTracks?.selection;return E(()=>{F&&N({subtitleTracks:F.options.map(({id:e,label:t,disabled:n})=>({id:e,label:t,disabled:n})),selectedSubtitleTrack:F.selectedId??void 0,selectSubtitleTrack:e=>F.select(e==null?null:String(e)),subtitleOffLabel:F.offLabel})},[N,F]),E(()=>{ee&&N({audioTracks:ee.options.map(({id:e,label:t,disabled:n})=>({id:e,label:t,disabled:n})),selectedAudioTrack:ee.selectedId??void 0,selectAudioTrack:e=>ee.select(String(e))})},[N,ee]),K(HM,{ref:p,onVideoRef:n?void 0:g,onCanvasRef:v,overlay:e.overlay,controls:e.controls,children:t})},WM=Xt`
|
|
1181
|
-
/**
|
|
1182
|
-
* The chrome's whole scale, in one place.
|
|
1183
|
-
*
|
|
1184
|
-
* Everything inside is sized against this rather than against \`rem\`, because \`rem\` is root
|
|
1185
|
-
* relative and a library cannot own the host page's root font. The old contract was that the host
|
|
1186
|
-
* set \`html { font-size: 62.5% }\`, which silently rendered every control 1.6x too large in any app
|
|
1187
|
-
* that did not, and could not be met by an app whose own screens are sized against the default.
|
|
1188
|
-
* Override it on the player element to rescale the whole chrome.
|
|
1189
|
-
*/
|
|
1190
|
-
--mp-unit: 10px;
|
|
1191
|
-
|
|
1192
|
-
/**
|
|
1193
|
-
* The chrome's own typeface, for exactly the reason the unit above exists.
|
|
1194
|
-
*
|
|
1195
|
-
* \`font-family\` inherits, and this library declared it nowhere, so every label drew in whatever the
|
|
1196
|
-
* embedding document happened to set, and in the UA's serif where it set nothing. Not hypothetical:
|
|
1197
|
-
* stub mounts the player in a second document, \`embed.html\`, which sets no font and loads no face,
|
|
1198
|
-
* and the entire settings menu came out in Times New Roman.
|
|
1199
|
-
*
|
|
1200
|
-
* Named faces only, no bundled webfont. The chrome is a handful of short labels, so a font request
|
|
1201
|
-
* on the critical path of a document whose job is to paint video buys a round trip and a flash of
|
|
1202
|
-
* unstyled text for nothing.
|
|
1203
|
-
*
|
|
1204
|
-
* Read through \`var()\` so a host with a brand face sets \`--mp-font-family\` on any ancestor and it
|
|
1205
|
-
* inherits in. A bare \`font-family\` on the host can no longer reach the chrome: this declaration is
|
|
1206
|
-
* on the player element itself and beats anything inherited.
|
|
1207
|
-
*/
|
|
1208
|
-
font-family: var(
|
|
1209
|
-
--mp-font-family,
|
|
1210
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
1211
|
-
'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'
|
|
1212
|
-
);
|
|
1213
|
-
|
|
1214
|
-
/**
|
|
1215
|
-
* The chrome's default ink, same argument again.
|
|
1216
|
-
*
|
|
1217
|
-
* Most text here names its own colour, but the two time readouts do not: the elapsed/duration pair
|
|
1218
|
-
* and the seekbar's hover time carry a font token and a black text-shadow and nothing else.
|
|
1219
|
-
* Inherited from a host that declares none that resolves to \`canvastext\`, which is black text under
|
|
1220
|
-
* a black halo on a dark gradient.
|
|
1221
|
-
*/
|
|
1222
|
-
color: #fff;
|
|
1223
|
-
|
|
1224
|
-
/**
|
|
1225
|
-
* The settings menu scrolls, and a UA that has not been told the surface is dark paints that
|
|
1226
|
-
* scrollbar in its light theme: a white track down the side of a #1c1c1c menu. Declared here rather
|
|
1227
|
-
* than asked of the host, so it reaches the menu and nothing outside the player.
|
|
1228
|
-
*/
|
|
1229
|
-
color-scheme: dark;
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* The other half of owning the chrome's own scale.
|
|
1233
|
-
*
|
|
1234
|
-
* Every control here is authored against a border box, which this library's dev app sets globally
|
|
1235
|
-
* and a host page has no reason to. Shipped without it, anything that is \`width: 100%\` AND carries
|
|
1236
|
-
* padding overflows its own box: the top bar ran 32px past the player and clipped the right end of
|
|
1237
|
-
* whatever the app had put there. Scoped to the player's subtree so it cannot reach the host's
|
|
1238
|
-
* layout, and only \`box-sizing\`, because zeroing margins here would reach the app's own content.
|
|
1239
|
-
*/
|
|
1240
|
-
&, & *, & *::before, & *::after {
|
|
1241
|
-
box-sizing: border-box;
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
display: flex;
|
|
1245
|
-
justify-content: center;
|
|
1246
|
-
background-color: #111;
|
|
1247
|
-
height: 100%;
|
|
1248
|
-
width: 100%;
|
|
1249
|
-
overflow: hidden;
|
|
1250
|
-
`,GM=e=>K(`div`,{css:WM,children:K(xj.Provider,{children:K(UM,{options:e,children:e.children})})}),KM=`[data-testid="track-selection-button"]`,qM=`[data-testid="audio-text-track-menu"]`,JM=`.timeline-slider`,YM=`[role="menu"]`,XM=`[role="menuitemradio"]`,ZM=1e4,QM=2e4,$M=5e3,eN=100,tN=`Opens Crunchyroll audio and subtitle choices.`,nN=`Changes the Crunchyroll audio option you picked.`,rN=`Changes the Crunchyroll subtitle option you picked.`,iN=`Restores your place after changing Crunchyroll audio or subtitles.`,aN=/^(off|none|disabled)$/i,oN=e=>new Promise(t=>setTimeout(t,e)),sN=()=>!1,cN=e=>{if(e())throw Error(`Crunchyroll track operation cancelled`)},lN=(e,t)=>e.locator(qM).locator(YM).nth(t===`audio`?0:1),uN=e=>e.replace(/\s+/g,` `).trim(),dN=(e,t)=>{let n=[...new Map(t.map(e=>({...e,label:uN(e.label)})).filter(e=>e.label).map(e=>[e.id,e])).values()],r=n.find(e=>e.selected);if(!r)return;let i=e===`subtitles`?n.find(e=>aN.test(e.label)):void 0,a=n.filter(e=>e!==i).map(e=>({id:e.id,label:e.label,disabled:e.disabled||void 0}));if(!(a.length<2&&!i)&&a.length)return{options:a,selectedId:r===i?null:r.id,...i?{offLabel:i.label}:{}}},fN=async(e,t)=>{cN(t);let n=e.locator(qM);if(await n.exists({timeout:1e3})){cN(t);return}cN(t),await e.locator(KM).click({timeout:ZM,reason:tN});let r=Date.now()+ZM;for(;Date.now()<r;){if(cN(t),await n.exists({timeout:1e3}))return;await oN(eN)}throw Error(`Crunchyroll track menu did not open`)},pN=async(e,t,n)=>{cN(n);let r=lN(e,t).locator(XM),i=await r.count({timeout:1e3});cN(n);let a=await Promise.all(Array.from({length:i},async(e,t)=>{cN(n);let i=r.nth(t),[a,o,s]=await Promise.all([i.getAttribute(`aria-label`,{timeout:1e3}),i.getAttribute(`aria-checked`,{timeout:1e3}),i.getAttribute(`aria-disabled`,{timeout:1e3})]);return{label:uN(a??``),index:t,selected:o===`true`,disabled:s===`true`}})),o=new Map;for(let e of a)o.set(e.label,(o.get(e.label)??0)+1);let s=new Map;return a.map(e=>{let t=(s.get(e.label)??0)+1;return s.set(e.label,t),{...e,id:o.get(e.label)===1?e.label:`${e.label}#${t}`}})},mN=async(e,t)=>{let[n,r]=await Promise.all([pN(e,`audio`,t),pN(e,`subtitles`,t)]);return{audio:dN(`audio`,n),subtitles:dN(`subtitles`,r)}},hN=async(e,t=sN)=>(await fN(e,t),mN(e,t)),gN=async(e,t,n,r)=>(await pN(e,t,r)).find(e=>n===null?aN.test(e.label):e.id===n)?.index??-1,_N=async(e,t,n,r)=>{let i=Date.now()+QM;for(;Date.now()<i;){cN(r),await fN(e,r);let i=(await pN(e,t,r)).find(e=>e.selected);if(i&&(n===null?aN.test(i.label):i.id===n))return;await oN(eN)}throw Error(`Crunchyroll did not apply the ${t} option`)},vN=(e,t)=>{let n=Number.isFinite(e)?Math.max(0,e):0;return!Number.isFinite(t)||t<=0?n:Math.min(n,Math.max(0,t-.1))},yN=e=>({currentTime:e.currentTime,paused:e.paused,volume:e.volume,muted:e.muted,playbackRate:e.playbackRate}),bN=(e,t,n=iN)=>e.locator(JM).fill(String(t),{timeout:QM,reason:n}),xN=async(e,t,n)=>{let r=Date.now()+5e3;for(;Date.now()<r&&(cN(n),!(e.currentSrc!==t||e.readyState<2));)await oN(eN);if(e.currentSrc===t&&e.readyState>=2)return!1;let i=Date.now()+QM;for(;Date.now()<i;){if(cN(n),e.readyState>=2)return!0;await oN(eN)}throw Error(`Crunchyroll playback did not become ready after changing tracks`)},SN=async(e,t,n,r)=>{cN(r),t.volume=n.volume,t.muted=n.muted,t.playbackRate=n.playbackRate;let i=vN(n.currentTime,t.duration);Math.abs(t.currentTime-i)>2&&await bN(e,i);let a=Date.now()+QM;for(;Date.now()<a&&(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2);)cN(r),await oN(eN);if(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2)throw Error(`Crunchyroll playback position was not restored after changing tracks`);cN(r),n.paused?t.pause():await t.play();let o=Date.now()+$M;for(;Date.now()<o&&t.paused!==n.paused;)cN(r),await oN(eN);if(t.paused!==n.paused)throw Error(`Crunchyroll playback state was not restored after changing tracks`)},CN=async(e,t,n,r,i=sN)=>{await fN(e,i);let a=await gN(e,n,r,i);if(a<0)throw Error(`Crunchyroll ${n} option is no longer available`);cN(i);let o=t.currentSrc,s=yN(t);return await lN(e,n).locator(XM).nth(a).click({timeout:ZM,reason:n===`audio`?nN:rN}),await _N(e,n,r,i),await xN(t,o,i)&&await SN(e,t,s,i),hN(e,i)},wN=`Seeks the video to the point you pick on the timeline.`,TN=(e,t)=>{bN(e,t,wN).catch(e=>console.warn(`[cr] timeline seek failed:`,e))},EN=(e,t)=>new Proxy(e,{set(e,n,r,i){return n===`currentTime`&&typeof r==`number`&&Number.isFinite(r)&&TN(t,r),Reflect.set(e,n,r,i)}}),DN=({remote:e,frame:t,subtitles:n,audioTracks:r,controls:i,children:a})=>K(GM,{expose:!0,media:w(()=>e&&t?EN(e,t):null,[e,t]),subtitles:n,audioTracks:r,controls:i,children:a});s();var ON=[`crunchyroll.com`,`www.crunchyroll.com`,`sso.crunchyroll.com`,`static.crunchyroll.com`],kN=`
|
|
1251
|
-
html, body {
|
|
1252
|
-
margin: 0 !important;
|
|
1253
|
-
padding: 0 !important;
|
|
1254
|
-
width: 100% !important;
|
|
1255
|
-
height: 100% !important;
|
|
1256
|
-
background: #000 !important;
|
|
1257
|
-
}
|
|
1258
|
-
*:not(:has(.video-player-wrapper)):not(.video-player-wrapper):not(.video-player-wrapper *) {
|
|
1259
|
-
display: none !important;
|
|
1260
|
-
}
|
|
1261
|
-
div[data-testid="player-controls-root"] {
|
|
1262
|
-
display: none !important;
|
|
1263
|
-
}
|
|
1264
|
-
.video-player-wrapper,
|
|
1265
|
-
.video-player,
|
|
1266
|
-
.player-container,
|
|
1267
|
-
.video-player-wrapper > *,
|
|
1268
|
-
.video-player > *,
|
|
1269
|
-
.player-container > * {
|
|
1270
|
-
position: absolute !important;
|
|
1271
|
-
inset: 0 !important;
|
|
1272
|
-
width: 100% !important;
|
|
1273
|
-
height: 100% !important;
|
|
1274
|
-
z-index: 9999999;
|
|
1275
|
-
}
|
|
1276
|
-
.video-player-wrapper video,
|
|
1277
|
-
.video-player video,
|
|
1278
|
-
.player-container video {
|
|
1279
|
-
width: 100% !important;
|
|
1280
|
-
height: 100% !important;
|
|
1281
|
-
object-fit: contain !important;
|
|
1282
|
-
}
|
|
1283
|
-
.video-player-wrapper *:not(:has(video)):not(video):not(:has(.timeline-slider)):not(.timeline-slider) {
|
|
1284
|
-
display: none !important;
|
|
1285
|
-
}
|
|
1286
|
-
.timeline-container,
|
|
1287
|
-
.timeline-container *,
|
|
1288
|
-
.timeline-slider {
|
|
1289
|
-
opacity: 0 !important;
|
|
1290
|
-
pointer-events: none !important;
|
|
1291
|
-
}
|
|
1292
|
-
`,AN=`https://www.crunchyroll.com`,jN=`noaihdevm_6iyg0a8l0q`,MN=(e,t)=>{let{pathname:n,search:r}=new URL(e);return`https://sso.crunchyroll.com/authorize?${new URLSearchParams({client_id:jN,redirect_uri:`${AN}/callback`,response_type:`cookie`,state:t?`${n}${r}`:`/`})}`},NN=3e4,PN=6e5,FN=async()=>Pn()?`extension`:(document.readyState!==`complete`&&await new Promise(e=>{let t=()=>{clearTimeout(n),e()},n=setTimeout(()=>{window.removeEventListener(`load`,t),e()},1e4);window.addEventListener(`load`,t,{once:!0})}),await new Promise(e=>setTimeout(e,300)),Pn()?`extension`:`cloud`),IN=async(e,t)=>{let n=Date.now()+NN;for(;!t()&&Date.now()<n;){if(await e.locator(`.shell-header`).exists()){await new Promise(e=>setTimeout(e,100));continue}if(t())throw Error(`Login state check timed out`);let[n,r]=await Promise.all([e.locator(`#user-menu-anonymous`).exists(),e.locator(`#user-menu-authenticated`).exists()]);if(r||n)return{isLoggedIn:r,isLoggedOut:n};await new Promise(e=>setTimeout(e,100))}throw Error(`Login state check timed out`)},LN=async(e,t)=>{let n=Date.now()+PN,r=0,i=0;for(;!t()&&Date.now()<n;){if(await new Promise(e=>setTimeout(e,1e3)),t())return`cancelled`;let[n,a,o]=await Promise.all([e.locator(`.shell-header`).exists().catch(()=>null),e.locator(`#user-menu-authenticated`).exists().catch(()=>null),e.locator(`#user-menu-anonymous`).exists().catch(()=>null)]);if(n===null&&a===null&&o===null){if(r+=1,i=0,r>=3)return`lost`;continue}if(r=0,n){i=0;continue}if(a)return`authed`;if(i=o&&a===!1?i+1:0,i>=3)return`backout`}return`timeout`},RN=3e4,zN=async(e,t)=>{let n=Date.now()+RN;for(;!t()&&Date.now()<n;){try{if(await e.locator(`video`).exists())return t()?null:await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,100))}return null},BN=Xt`
|
|
1293
|
-
position: relative;
|
|
1294
|
-
width: 100%;
|
|
1295
|
-
height: 100%;
|
|
1296
|
-
background: #000;
|
|
1297
|
-
/* The double-tap-to-fullscreen gesture otherwise word-selects the
|
|
1298
|
-
skin's labels/time readouts, flashing them blue. Player chrome isn't
|
|
1299
|
-
meant to be selected, so suppress it across the whole player. */
|
|
1300
|
-
user-select: none;
|
|
1301
|
-
-webkit-user-select: none;
|
|
1302
|
-
|
|
1303
|
-
.cr-frame {
|
|
1304
|
-
position: absolute;
|
|
1305
|
-
inset: 0;
|
|
1306
|
-
width: 100%;
|
|
1307
|
-
height: 100%;
|
|
1308
|
-
border: none;
|
|
1309
|
-
background: #000;
|
|
1310
|
-
/* CR's own chrome is hidden, so the iframe must not swallow clicks -
|
|
1311
|
-
taps belong to the videojs gesture layer stacked above it. */
|
|
1312
|
-
pointer-events: none;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
/* The cloud in-frame sign-in renders CR's own login form inside the frame,
|
|
1316
|
-
so while that flow is active the frame must take the taps. Once the
|
|
1317
|
-
session lands and the skin's video takes over, the frame goes back to
|
|
1318
|
-
pointer-events: none. */
|
|
1319
|
-
.cr-frame.interactive {
|
|
1320
|
-
pointer-events: auto;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
.overlay {
|
|
1324
|
-
position: absolute;
|
|
1325
|
-
inset: 0;
|
|
1326
|
-
display: flex;
|
|
1327
|
-
flex-direction: column;
|
|
1328
|
-
align-items: center;
|
|
1329
|
-
justify-content: center;
|
|
1330
|
-
gap: 1.6rem;
|
|
1331
|
-
background: #000;
|
|
1332
|
-
font-size: 1.4rem;
|
|
1333
|
-
color: rgba(255, 255, 255, 0.8);
|
|
1334
|
-
/* Above the skin's own layers (its controls/error dialog top out at
|
|
1335
|
-
z-index 20) so the login/loading screen fully covers them. */
|
|
1336
|
-
z-index: 30;
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
.login-button {
|
|
1340
|
-
padding: 0.8rem 2rem;
|
|
1341
|
-
background: #f47521;
|
|
1342
|
-
color: #fff;
|
|
1343
|
-
border: none;
|
|
1344
|
-
border-radius: 0.4rem;
|
|
1345
|
-
font-size: 1.4rem;
|
|
1346
|
-
font-weight: 600;
|
|
1347
|
-
cursor: pointer;
|
|
1348
|
-
|
|
1349
|
-
&:hover {
|
|
1350
|
-
background: #e0651a;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
&:disabled {
|
|
1354
|
-
opacity: 0.6;
|
|
1355
|
-
cursor: default;
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
`,VN=({url:e})=>{let[t,n]=T(`detecting`),[r,i]=T(null),[a,o]=T(null),[s,c]=T(!0),[l,u]=T(!1),[f,p]=T(!1),[h,g]=T(),[_,v]=T(null),[y,b]=T(0),[x,S]=T(0),[C,D]=T(!1),[O,k]=T(!1),A=m(null),j=m(null),[M,N]=T(),P=m(0),F=m({generation:0,tail:Promise.resolve()}),ee=m(!0),I=d(()=>{let e=P.current+1;return P.current=e,F.current={generation:e,tail:Promise.resolve()},N(void 0),e},[]),L=d((e,t)=>{if(F.current.generation!==e)return Promise.reject(Error(`Crunchyroll track operation cancelled`));let n=F.current,r=n.tail.then(t);return n.tail=r.then(()=>{},()=>{}),r},[]);E(()=>()=>{ee.current=!1,P.current+=1},[]),E(()=>{let e=!1;return FN().then(t=>{e||n(t)}),()=>{e=!0}},[]),E(()=>{if(!r||t===`detecting`)return;let e=!1;return Xd({iframe:r,domains:ON}).then(r=>{if(e)return;let i=Pn()?`extension`:`cloud`;if(i!==t){n(i);return}o(r)}).catch(t=>{e||(console.error(`Failed to attach Crunchyroll frame`,t),g(t?.message||`Failed to load player`),c(!1))}),()=>{e=!0}},[r,t]),E(()=>{if(!a)return;let n=!1,r=()=>n;return c(!0),g(void 0),u(!1),p(!1),v(null),I(),(async()=>{if(t===`cloud`){if(await a.goto(e,{waitUntil:`load`}),n)return;let{isLoggedIn:t}=await IN(a,r);if(n)return;if(t){if(await a.addStyleTag({content:kN}),n)return;let e=await zN(a,r);if(n)return;if(c(!1),!e)throw Error(`The episode did not load a player. It may be unavailable or require a different plan.`);v(e);return}c(!1),u(!0),p(!0),await a.goto(MN(e,!0),{waitUntil:`load`});let i=await LN(a,r);if(n)return;if(p(!1),i===`backout`){u(!0),c(!1);return}if(i===`lost`)throw Error(`Lost the connection to the player frame`);if(i!==`authed`)throw Error(`Sign-in was not completed in time`);if(c(!0),u(!1),await a.goto(e,{waitUntil:`load`}),n)return;let{isLoggedIn:o}=await IN(a,r);if(n)return;if(!o){c(!1),u(!0);return}if(await a.addStyleTag({content:kN}),n)return;let s=await zN(a,r);if(n)return;if(c(!1),!s)throw Error(`The episode did not load a player. It may be unavailable or require a different plan.`);v(s);return}if(await a.goto(e,{waitUntil:`documentstart`}),n||(await a.addStyleTag({content:kN}),n))return;let{isLoggedIn:i}=await IN(a,r);if(n)return;if(!i){c(!1),u(!0);return}let o=await zN(a,r);if(!n){if(c(!1),!o)throw Error(`The episode did not load a player. It may be unavailable or require a different plan.`);v(o)}})().catch(e=>{n||(console.error(`Failed to load Crunchyroll player`,e),g(e?.message||`Failed to load player`),c(!1),p(!1))}),()=>{n=!0}},[a,e,y,t,I]),E(()=>{if(!a||!_)return;let e=I(),t=!1,n=()=>t||!ee.current||e!==P.current;return(async()=>{let t,r;for(let i=0;i<5&&!n();i+=1){try{if(r=await L(e,()=>hN(a,n)),t=void 0,n()||(N(r),r.audio&&r.subtitles))return}catch(e){t=e}await new Promise(e=>setTimeout(e,500))}if(!r&&t)throw t})().then(()=>{},e=>{n()||console.warn(`[cr] track discovery failed:`,e)}),()=>{t=!0}},[a,_,I,L]);let R=P.current,z=d((e,t)=>{if(!a||!_)return Promise.reject(Error(`Crunchyroll player is not ready`));let n=()=>!ee.current||R!==P.current;return L(R,async()=>{try{let r=await CN(a,_,e,t,n);if(n())throw Error(`Crunchyroll track operation cancelled`);N(r)}catch(e){if(!n())try{let e=await hN(a,n);n()||N(e)}catch{}throw e}})},[a,_,L,R]),te=w(()=>M?.subtitles&&{selection:{...M.subtitles,select:e=>z(`subtitles`,e)}},[M?.subtitles,z]),ne=w(()=>M?.audio&&{selection:{...M.audio,select:e=>z(`audio`,e)}},[M?.audio,z]),re=d(()=>{if(A.current!==null)return;let t=globalThis.open(MN(e,!1),`_blank`,`width=500,height=700`);if(!t){k(!0),c(!1);return}k(!1),D(!0),j.current=t;let n=setInterval(()=>{t.closed&&(clearInterval(n),A.current===n&&(A.current=null),j.current===t&&(j.current=null),D(!1),b(e=>e+1))},500);A.current=n},[e]);E(()=>()=>{A.current!==null&&(clearInterval(A.current),A.current=null)},[]),E(()=>{A.current!==null&&(clearInterval(A.current),A.current=null,D(!1)),k(!1)},[e]);let B=d(()=>{j.current!==null&&(j.current.close(),j.current=null),A.current!==null&&(clearInterval(A.current),A.current=null),o(null),g(void 0),v(null),I(),u(!1),k(!1),D(!1),c(!0),S(e=>e+1)},[I]),ie=d(()=>{u(!1),c(!0),b(e=>e+1)},[]),ae=(s||h||O||l&&!f)&&q(`div`,{className:`overlay`,children:[l&&!h&&!O&&q(am,{children:[`You need to be logged in to Crunchyroll to watch this content.`,t===`extension`?K(`button`,{className:`login-button`,onClick:re,disabled:C,children:C?`Finish signing in the popup...`:`Open Crunchyroll Login Page`}):K(`button`,{className:`login-button`,onClick:ie,children:`Try signing in again`})]}),O&&!h&&q(am,{children:[`The login popup was blocked. Allow popups for this page and try again.`,K(`button`,{className:`login-button`,onClick:re,children:`Open Crunchyroll Login Page`})]}),h&&q(am,{children:[h,K(`button`,{className:`login-button`,onClick:B,children:`Retry`})]}),s&&!h&&!l&&`Loading Crunchyroll player...`]});return q(`div`,{css:BN,children:[t!==`detecting`&&K(DN,{remote:_,frame:a,subtitles:te,audioTracks:ne,controls:!f,children:K(`iframe`,{ref:i,className:`cr-frame${f?` interactive`:``}`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`},`${t}-${x}`)}),ae]})},HN=e=>e,UN=HN(({className:e,children:t})=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,fill:`none`,"aria-hidden":`true`,className:e,children:t})),WN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`m14.051 10.723-7.985 4.964a1.98 1.98 0 0 1-2.758-.638A2.06 2.06 0 0 1 3 13.964V4.036C3 2.91 3.895 2 5 2c.377 0 .747.109 1.066.313l7.985 4.964a2.057 2.057 0 0 1 .627 2.808c-.16.257-.373.475-.627.637`})})),GN=HN(({className:e})=>q(UN,{className:e,children:[K(`rect`,{width:5,height:14,x:2,y:2,fill:`currentColor`,rx:1.75}),K(`rect`,{width:5,height:14,x:11,y:2,fill:`currentColor`,rx:1.75})]})),KN=HN(({className:e})=>q(UN,{className:e,children:[K(`path`,{fill:`currentColor`,d:`M9 17a8 8 0 0 1-8-8h2a6 6 0 1 0 1.287-3.713l1.286 1.286A.25.25 0 0 1 5.396 7H1.25A.25.25 0 0 1 1 6.75V2.604a.25.25 0 0 1 .427-.177l1.438 1.438A8 8 0 1 1 9 17`}),K(`path`,{fill:`currentColor`,d:`m11.61 9.639-3.331 2.07a.826.826 0 0 1-1.15-.266.86.86 0 0 1-.129-.452V6.849C7 6.38 7.374 6 7.834 6c.158 0 .312.045.445.13l3.331 2.071a.858.858 0 0 1 0 1.438`})]})),qN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M1 9c0 2.21.895 4.21 2.343 5.657l1.414-1.414a6 6 0 1 1 8.956-7.956l-1.286 1.286a.25.25 0 0 0 .177.427h4.146a.25.25 0 0 0 .25-.25V2.604a.25.25 0 0 0-.427-.177l-1.438 1.438A8 8 0 0 0 1 9`})})),JN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752M14.5 7.586l-1.768-1.768a1 1 0 1 0-1.414 1.414L13.085 9l-1.767 1.768a1 1 0 0 0 1.414 1.414l1.768-1.768 1.768 1.768a1 1 0 0 0 1.414-1.414L15.914 9l1.768-1.768a1 1 0 0 0-1.414-1.414z`})})),YN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})})),XN=HN(({className:e})=>q(UN,{className:e,children:[K(`path`,{fill:`currentColor`,d:`M15.6 3.3c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4C15.4 5.9 16 7.4 16 9s-.6 3.1-1.8 4.3c-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7`}),K(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})]})),ZN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M9.57 3.617A1 1 0 0 0 8.646 3H4c-.552 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1 1 1 0 0 0 .706-.293l4.647-4.647a1 1 0 0 0 .216-1.089m4.812 4.812a1 1 0 0 0-1.089.217l-4.647 4.647a.998.998 0 0 0 .708 1.706H14c.552 0 1-.449 1-1V9.353a1 1 0 0 0-.618-.924`})})),QN=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M7.883 1.93a.99.99 0 0 0-1.09.217L2.146 6.793A.998.998 0 0 0 2.853 8.5H7.5c.551 0 1-.449 1-1V2.854a1 1 0 0 0-.617-.924m7.263 7.57H10.5c-.551 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1.001 1 1 0 0 0 .706-.293l4.646-4.646a.998.998 0 0 0-.707-1.707z`})})),$N=HN(({className:e})=>q(UN,{className:e,children:[K(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.035A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.035.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),K(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),K(`path`,{fill:`currentColor`,d:`M7.129 5.547a.6.6 0 0 0-.656.13L3.677 8.473A.6.6 0 0 0 4.102 9.5h2.796c.332 0 .602-.27.602-.602V6.103a.6.6 0 0 0-.371-.556`})]})),eP=HN(({className:e})=>q(UN,{className:e,children:[K(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.036A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.036.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),K(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),K(`path`,{fill:`currentColor`,d:`M4.871 10.454a.6.6 0 0 0 .656-.131l2.796-2.796A.6.6 0 0 0 7.898 6.5H5.102a.603.603 0 0 0-.602.602v2.795a.6.6 0 0 0 .371.556`})]})),tP=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M15 2a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3zM4 11a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2zM4 8a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2zm4 0a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm6 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2`})})),nP=HN(({className:e})=>q(UN,{className:e,children:[K(`rect`,{width:16,height:12,x:1,y:3,stroke:`currentColor`,strokeWidth:2,rx:3}),K(`rect`,{width:3,height:2,x:3,y:8,fill:`currentColor`,rx:1}),K(`rect`,{width:2,height:2,x:13,y:8,fill:`currentColor`,rx:1}),K(`rect`,{width:4,height:2,x:11,y:11,fill:`currentColor`,rx:1}),K(`rect`,{width:5,height:2,x:7,y:8,fill:`currentColor`,rx:1}),K(`rect`,{width:7,height:2,x:3,y:11,fill:`currentColor`,rx:1})]})),rP=HN(({className:e})=>K(UN,{className:e,children:q(`g`,{fill:`currentColor`,children:[K(`rect`,{width:2,height:5,x:8,y:.5,opacity:.5,rx:1,children:K(`animate`,{attributeName:`opacity`,begin:`0s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:2,height:5,x:12.243,y:2.257,opacity:.45,rx:1,transform:`rotate(45 13.243 4.757)`,children:K(`animate`,{attributeName:`opacity`,begin:`0.125s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:5,height:2,x:12.5,y:8,opacity:.4,rx:1,children:K(`animate`,{attributeName:`opacity`,begin:`0.25s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:5,height:2,x:10.743,y:12.243,opacity:.35,rx:1,transform:`rotate(45 13.243 13.243)`,children:K(`animate`,{attributeName:`opacity`,begin:`0.375s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:2,height:5,x:8,y:12.5,opacity:.3,rx:1,children:K(`animate`,{attributeName:`opacity`,begin:`0.5s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:2,height:5,x:3.757,y:10.743,opacity:.25,rx:1,transform:`rotate(45 4.757 13.243)`,children:K(`animate`,{attributeName:`opacity`,begin:`0.625s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:5,height:2,x:.5,y:8,opacity:.15,rx:1,children:K(`animate`,{attributeName:`opacity`,begin:`0.75s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),K(`rect`,{width:5,height:2,x:2.257,y:3.757,opacity:.1,rx:1,transform:`rotate(45 4.757 4.757)`,children:K(`animate`,{attributeName:`opacity`,begin:`0.875s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})})]})})),iP=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M9 2a1 1 0 0 1 1 1v12a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1zm4 3a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zM5 5a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zm8 4a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1zM5 9a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1z`})})),aP=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M3 5a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm1 3a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H4z`})})),oP=HN(({className:e})=>K(UN,{className:e,children:K(`path`,{fill:`currentColor`,d:`M14.53 4.53a.75.75 0 0 0-1.06-1.06L7 9.94 4.53 7.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l7-7z`})}));s();var sP=10,cP=e=>e,lP=cP(MO.Root),uP=cP(TO),dP=cP(BO.Root),fP=cP(wO.Popup),pP=cP(wO.Title),mP=cP(wO.Close),hP=cP(BO.Description),gP=cP(Bk.Provider),_P=cP(Bk.Root),vP=cP(Bk.Trigger),yP=cP(Bk.Popup),bP=cP(sk.Root),xP=cP(sk.Trigger),SP=cP(sk.Popup),CP=cP(ZO),wP=cP(ck),TP=cP(YO),EP=cP(XO),DP=cP(VO),OP=cP(QO),kP=cP(Tk.Value),AP=cP(Ok.Root),jP=cP(xk.Track),MP=cP(xk.Fill),NP=cP(xk.Buffer),PP=cP(xk.Thumb),FP=cP(xk.Value),IP=cP(Uk.Root),LP=cP(qO),RP=cP(UO),zP=cP(qT),BP=({className:e,...t})=>K(`button`,{type:`button`,className:`media-button media-button--subtle media-button--icon${e?` ${e}`:``}`,...t}),VP=({selection:e,icon:t})=>{let[n,r]=T(!1),[i,a]=T(!1),[o,s]=T(!1);E(()=>s(!1),[e.selectedId]);let c=[...e.offLabel?[{id:null,label:e.offLabel}]:[],...e.options],l=t=>{if(t===e.selectedId){r(!1);return}s(!1),a(!0),Promise.resolve().then(()=>e.onSelect(t)).then(()=>r(!1)).catch(t=>{console.warn(`[player] ${e.label} selection failed:`,t),s(!0)}).finally(()=>a(!1))};return q(bP,{open:n,onOpenChange:e=>r(e),children:[K(xP,{render:K(BP,{className:`media-button--menu${o?` media-button--error`:``}`,"aria-label":e.label}),children:t}),K(SP,{className:`media-surface media-popover media-popover--menu`,children:q(`div`,{className:`stub-menu`,role:`menu`,"aria-label":e.label,children:[K(`div`,{className:`stub-menu__heading`,children:e.label}),c.map(t=>{let n=t.id===e.selectedId;return q(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,className:`stub-menu__item${n?` stub-menu__item--active`:``}`,disabled:i||`disabled`in t&&t.disabled,onClick:()=>l(t.id),children:[K(`span`,{className:`stub-menu__check`,children:n?K(oP,{className:`media-icon`}):null}),K(`span`,{className:`stub-menu__label`,children:t.label}),`description`in t&&t.description?K(`span`,{className:`stub-menu__description`,children:t.description}):null]},t.id??`__off__`)})]})})]})},HP=()=>q(bP,{openOnHover:!0,delay:200,closeDelay:100,side:`top`,children:[K(xP,{render:q(TP,{className:`media-button--mute`,render:K(BP,{}),children:[K(JN,{className:`media-icon media-icon--volume-off`}),K(YN,{className:`media-icon media-icon--volume-low`}),K(XN,{className:`media-icon media-icon--volume-high`})]})}),K(SP,{className:`media-surface media-popover media-popover--volume`,children:q(IP,{className:`media-slider`,orientation:`vertical`,thumbAlignment:`edge`,children:[K(jP,{className:`media-slider__track`,children:K(MP,{className:`media-slider__fill`})}),K(PP,{className:`media-slider__thumb media-slider__thumb--persistent`})]})})]}),UP=({capabilities:e,children:t,className:n,...r})=>q(zP,{className:`media-default-skin media-default-skin--video${n?` ${n}`:``}`,...r,children:[t,K(uP,{render:e=>K(`div`,{...e,className:`media-buffering-indicator`,children:K(`div`,{className:`media-surface`,children:K(rP,{className:`media-icon`})})})}),K(dP,{children:K(fP,{className:`media-error`,children:q(`div`,{className:`media-error__dialog media-surface`,children:[q(`div`,{className:`media-error__content`,children:[K(pP,{className:`media-error__title`,children:`Something went wrong.`}),K(hP,{className:`media-error__description`})]}),K(`div`,{className:`media-error__actions`,children:K(mP,{className:`media-button media-button--primary`,children:`OK`})})]})})}),K(lP,{className:`media-surface media-controls`,children:q(gP,{children:[q(`div`,{className:`media-button-group`,children:[q(_P,{side:`top`,children:[K(vP,{render:q(CP,{className:`media-button--play`,render:K(BP,{}),children:[K(KN,{className:`media-icon media-icon--restart`}),K(WN,{className:`media-icon media-icon--play`}),K(GN,{className:`media-icon media-icon--pause`})]})}),K(yP,{className:`media-surface media-tooltip`})]}),q(_P,{side:`top`,children:[K(vP,{render:K(wP,{seconds:-10,className:`media-button--seek`,render:K(BP,{}),children:q(`span`,{className:`media-icon__container`,children:[K(qN,{className:`media-icon media-icon--seek media-icon--flipped`}),K(`span`,{className:`media-icon__label`,children:sP})]})})}),q(yP,{className:`media-surface media-tooltip`,children:[`Seek backward `,sP,` seconds`]})]}),q(_P,{side:`top`,children:[K(vP,{render:K(wP,{seconds:sP,className:`media-button--seek`,render:K(BP,{}),children:q(`span`,{className:`media-icon__container`,children:[K(qN,{className:`media-icon media-icon--seek`}),K(`span`,{className:`media-icon__label`,children:sP})]})})}),q(yP,{className:`media-surface media-tooltip`,children:[`Seek forward `,sP,` seconds`]})]})]}),q(`div`,{className:`media-time-controls`,children:[K(kP,{type:`current`,className:`media-time`}),q(AP,{className:`media-slider`,children:[q(jP,{className:`media-slider__track`,children:[K(MP,{className:`media-slider__fill`}),K(NP,{className:`media-slider__buffer`})]}),K(PP,{className:`media-slider__thumb`}),K(`div`,{className:`media-surface media-thumbnail media-slider__preview`,children:K(FP,{type:`pointer`,className:`media-time media-thumbnail__time`})})]}),K(kP,{type:`duration`,className:`media-time`})]}),q(`div`,{className:`media-button-group`,children:[q(_P,{side:`top`,children:[K(vP,{render:K(OP,{className:`media-button--playback-rate`,render:K(BP,{})})}),K(yP,{className:`media-surface media-tooltip`,children:`Toggle playback rate`})]}),K(HP,{}),e?.subtitles&&K(VP,{selection:e.subtitles,icon:e.subtitles.selectedId?K(tP,{className:`media-icon`}):K(nP,{className:`media-icon`})},`subtitles`),e?.audioTracks&&K(VP,{selection:e.audioTracks,icon:K(iP,{className:`media-icon`})},`audio`),e?.qualityLevels&&K(VP,{selection:e.qualityLevels,icon:K(aP,{className:`media-icon`})},`quality`),q(_P,{side:`top`,children:[K(vP,{render:q(EP,{className:`media-button--pip`,render:K(BP,{}),children:[K($N,{className:`media-icon media-icon--pip-enter`}),K(eP,{className:`media-icon media-icon--pip-exit`})]})}),K(yP,{className:`media-surface media-tooltip`})]}),q(_P,{side:`top`,children:[K(vP,{render:q(DP,{className:`media-button--fullscreen`,render:K(BP,{}),children:[K(ZN,{className:`media-icon media-icon--fullscreen-enter`}),K(QN,{className:`media-icon media-icon--fullscreen-exit`})]})}),K(yP,{className:`media-surface media-tooltip`})]})]})]})}),K(`div`,{className:`media-overlay`}),K(LP,{keys:`Space`,action:`togglePaused`}),K(LP,{keys:`k`,action:`togglePaused`}),K(LP,{keys:`m`,action:`toggleMuted`}),K(LP,{keys:`f`,action:`toggleFullscreen`}),K(LP,{keys:`i`,action:`togglePictureInPicture`}),K(LP,{keys:`ArrowRight`,action:`seekStep`,value:5}),K(LP,{keys:`ArrowLeft`,action:`seekStep`,value:-5}),K(LP,{keys:`l`,action:`seekStep`,value:10}),K(LP,{keys:`j`,action:`seekStep`,value:-10}),K(LP,{keys:`ArrowUp`,action:`volumeStep`,value:.05}),K(LP,{keys:`ArrowDown`,action:`volumeStep`,value:-.05}),K(LP,{keys:`0-9`,action:`seekToPercent`}),K(LP,{keys:`Home`,action:`seekToPercent`,value:0}),K(LP,{keys:`End`,action:`seekToPercent`,value:100}),K(LP,{keys:`>`,action:`speedUp`}),K(LP,{keys:`<`,action:`speedDown`}),K(RP,{type:`tap`,action:`togglePaused`,pointer:`mouse`,region:`center`}),K(RP,{type:`tap`,action:`toggleControls`,pointer:`touch`}),K(RP,{type:`doubletap`,action:`seekStep`,value:-10,region:`left`}),K(RP,{type:`doubletap`,action:`toggleFullscreen`,region:`center`}),K(RP,{type:`doubletap`,action:`seekStep`,value:10,region:`right`})]});s();var{Provider:WP}=XT({features:eT}),GP=e=>`media`in e?e:{media:e},KP=({remote:e,frame:t,adapter:n})=>{let r=jS();return E(()=>{if(!r||!e||!t)return;let i=n?n(e,t):e;if(!i)return;let a=GP(i);r(a.media);let o=ae(a.media);return()=>{o(),r(null),a.dispose?.()}},[e,t,n,r]),null},qP=Xt`
|
|
1359
|
-
position: absolute;
|
|
1360
|
-
inset: 0;
|
|
1361
|
-
border-radius: 0.8rem;
|
|
1362
|
-
background: transparent !important;
|
|
1363
|
-
&.media-default-skin--video {
|
|
1364
|
-
background: transparent !important;
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
.media-popover--menu {
|
|
1368
|
-
padding: 0.4rem;
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
/**
|
|
1372
|
-
* The track menu is stub's own markup, so it carries a stub prefix rather than a media one.
|
|
1373
|
-
*
|
|
1374
|
-
* It was named \`media-menu\` when the skin had no menu of its own. videojs beta.26 added one, and
|
|
1375
|
-
* upstream's nested \`.media-default-skin .media-menu .media-menu__item\` is specificity (0,3,0)
|
|
1376
|
-
* against this file's (0,2,0), so it silently took over padding, gap, cursor and justification the
|
|
1377
|
-
* moment the dependency moved. A prefix upstream will never mint is the only durable fix; matching
|
|
1378
|
-
* their specificity would just move the race to insertion order.
|
|
1379
|
-
*/
|
|
1380
|
-
.stub-menu {
|
|
1381
|
-
display: flex;
|
|
1382
|
-
flex-direction: column;
|
|
1383
|
-
min-width: 18rem;
|
|
1384
|
-
max-height: 32rem;
|
|
1385
|
-
overflow-y: auto;
|
|
1386
|
-
}
|
|
1387
|
-
.stub-menu__heading {
|
|
1388
|
-
padding: 0.6rem 1rem 0.4rem;
|
|
1389
|
-
font-size: 1.1rem;
|
|
1390
|
-
font-weight: 600;
|
|
1391
|
-
letter-spacing: 0.04em;
|
|
1392
|
-
text-transform: uppercase;
|
|
1393
|
-
opacity: 0.6;
|
|
1394
|
-
}
|
|
1395
|
-
.stub-menu__item {
|
|
1396
|
-
display: flex;
|
|
1397
|
-
align-items: center;
|
|
1398
|
-
gap: 0.6rem;
|
|
1399
|
-
width: 100%;
|
|
1400
|
-
padding: 0.6rem 1rem;
|
|
1401
|
-
border: none;
|
|
1402
|
-
border-radius: 0.4rem;
|
|
1403
|
-
background: transparent;
|
|
1404
|
-
color: inherit;
|
|
1405
|
-
font-size: 1.3rem;
|
|
1406
|
-
text-align: left;
|
|
1407
|
-
cursor: pointer;
|
|
1408
|
-
|
|
1409
|
-
&:hover:not(:disabled) {
|
|
1410
|
-
background: rgba(255, 255, 255, 0.12);
|
|
1411
|
-
}
|
|
1412
|
-
&:disabled {
|
|
1413
|
-
opacity: 0.5;
|
|
1414
|
-
cursor: default;
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
.stub-menu__check {
|
|
1418
|
-
display: inline-flex;
|
|
1419
|
-
width: 1.6rem;
|
|
1420
|
-
flex: none;
|
|
1421
|
-
}
|
|
1422
|
-
.stub-menu__label {
|
|
1423
|
-
flex: 1;
|
|
1424
|
-
}
|
|
1425
|
-
.stub-menu__description {
|
|
1426
|
-
opacity: 0.6;
|
|
1427
|
-
font-size: 1.1rem;
|
|
1428
|
-
}
|
|
1429
|
-
.media-button--error {
|
|
1430
|
-
color: #f66;
|
|
1431
|
-
}
|
|
1432
|
-
`,JP=({remote:e,frame:t,adapter:n,capabilities:r,children:i})=>q(WP,{children:[K(KP,{remote:e,frame:t,adapter:n}),K(UP,{capabilities:r,css:qP,children:i})]}),YP=`[data-uia="timeline"]`,XP=`[data-uia="video-canvas"]`,ZP=`[data-uia="player"]`,QP=`Seeks the video to the point you pick on the timeline.`,$P=`Reveals the player controls so the timeline can be used.`,eF=140,tF=2,nF=12e3,rF=26,iF=110,aF={"still-watching":`[data-uia="interrupt-autoplay-continue"], [data-uia="interrupter-title"]`,"next-episode":`[data-uia="next-episode-seamless-button"], [data-uia="next-episode-seamless-button-draining"]`,error:`[data-uia="error-container"], [data-uia="nfp-error"]`},oF=e=>new Promise(t=>setTimeout(t,e)),sF=e=>e<0?0:e>1?1:e,cF=0,lF=()=>{let e=cF*1.1;return cF++,{x:.5+Math.cos(e)*.05,y:.5+Math.sin(e)*.05}},uF=(e,t)=>{let n=null,r,i,a=!1,o=async()=>{if(!a){a=!0;try{await Promise.all([t.locator(XP).ensure(`hover`,{reason:$P}),t.locator(ZP).ensure(`hover`,{reason:$P}),t.locator(YP).ensure(`click`,{reason:QP})])}catch(e){a=!1,console.warn(`[nf] permission request failed:`,e)}}},s=()=>{if(n==null)return;let t=e.currentTime;Number.isFinite(t)&&Math.abs(t-n)<tF&&(n=null,i&&clearTimeout(i))};e.addEventListener(`timeupdate`,s);let c=async n=>{let r=e.duration;if(!Number.isFinite(r)||r<=0){console.warn(`[nf] seek: duration unknown`,r);return}let i=sF(n/r);o();let a=t.locator(YP),s=e.paused===!0;if(s)try{await e.play()}catch{}let c=!1;for(let e=0;e<rF;e++){if(e%2==0&&(await t.locator(XP).hover({position:lF(),reason:$P}).catch(()=>{}),await t.locator(ZP).hover({position:lF(),reason:$P}).catch(()=>{})),await a.exists().catch(()=>!1)){c=!0;break}await oF(iF)}if(!c){let n=await Promise.all(Object.entries(aF).map(async([e,n])=>await t.locator(n).exists().catch(()=>!1)?e:``)).then(e=>e.filter(Boolean).join(`, `)).catch(()=>``);if(console.warn(`[nf] seek aborted: controls never revealed${n?` (blocked by ${n})`:``}`),s)try{await e.pause()}catch{}return}if(await a.click({position:{x:i,y:.5},reason:QP}).catch(e=>console.warn(`[nf] timeline click failed:`,e?.message??e)),s)try{await e.pause()}catch{}};return{media:new Proxy(e,{get(e,t,r){return t===`currentTime`&&n!=null?n:Reflect.get(e,t,r)},set(e,t,a,o){return t===`currentTime`&&typeof a==`number`&&Number.isFinite(a)?(n=a,r&&clearTimeout(r),r=setTimeout(()=>{c(a).catch(e=>console.warn(`[nf] timeline seek failed:`,e))},eF),i&&clearTimeout(i),i=setTimeout(()=>{n=null},nF),!0):Reflect.set(e,t,a,o)}}),dispose:()=>{e.removeEventListener(`timeupdate`,s),r&&clearTimeout(r),i&&clearTimeout(i)}}},dF=({remote:e,frame:t,capabilities:n,children:r})=>K(JP,{remote:e,frame:t,adapter:uF,capabilities:n,children:r});s();var fF=[`netflix.com`,`www.netflix.com`,`nflxvideo.net`,`nflxso.net`,`nflxext.com`,`nflximg.net`,`assets.nflxext.com`],pF=`https://www.netflix.com/login`,mF=`
|
|
1433
|
-
html, body {
|
|
1434
|
-
margin: 0 !important;
|
|
1435
|
-
padding: 0 !important;
|
|
1436
|
-
width: 100% !important;
|
|
1437
|
-
height: 100% !important;
|
|
1438
|
-
overflow: hidden !important;
|
|
1439
|
-
background: #000 !important;
|
|
1440
|
-
}
|
|
1441
|
-
/* Truly-unwanted chrome - collapse it entirely. */
|
|
1442
|
-
.watch-video--evidence-overlay-container,
|
|
1443
|
-
.watch-video--skip-content,
|
|
1444
|
-
.watch-video--nextEpisode-seamless-button,
|
|
1445
|
-
.watch-video--back-container,
|
|
1446
|
-
[data-uia="player-back-to-browse"],
|
|
1447
|
-
[data-uia="control-nav-back"],
|
|
1448
|
-
[data-uia="control-flag"] {
|
|
1449
|
-
display: none !important;
|
|
1450
|
-
pointer-events: none !important;
|
|
1451
|
-
}
|
|
1452
|
-
/* Keep the controls bar in LAYOUT (so the seek adapter can locate + click the
|
|
1453
|
-
[data-uia="timeline"] scrubber) but invisible and inert to real taps. NEVER
|
|
1454
|
-
display:none here, or the scrubber loses its box and the seek no-ops - mirrors
|
|
1455
|
-
Crunchyroll's opacity:0 timeline trick. The skin draws the visible controls. */
|
|
1456
|
-
[data-uia="controls-standard"],
|
|
1457
|
-
.watch-video--bottom-controls-container,
|
|
1458
|
-
.PlayerControlsNeo__layout,
|
|
1459
|
-
.PlayerControlsNeo__core-controls,
|
|
1460
|
-
.PlayerControlsNeo__button-control-row {
|
|
1461
|
-
opacity: 0 !important;
|
|
1462
|
-
pointer-events: none !important;
|
|
1463
|
-
}
|
|
1464
|
-
[data-uia="timeline"],
|
|
1465
|
-
[data-uia="timeline"] * {
|
|
1466
|
-
pointer-events: auto !important;
|
|
1467
|
-
}
|
|
1468
|
-
.watch-video,
|
|
1469
|
-
[data-uia="video-canvas"] {
|
|
1470
|
-
position: fixed !important;
|
|
1471
|
-
inset: 0 !important;
|
|
1472
|
-
width: 100% !important;
|
|
1473
|
-
height: 100% !important;
|
|
1474
|
-
z-index: 9999999 !important;
|
|
1475
|
-
}
|
|
1476
|
-
.watch-video video,
|
|
1477
|
-
[data-uia="video-canvas"] video {
|
|
1478
|
-
width: 100% !important;
|
|
1479
|
-
height: 100% !important;
|
|
1480
|
-
object-fit: contain !important;
|
|
1481
|
-
}
|
|
1482
|
-
`,hF=async(e,t=10,n=500)=>{for(let r=0;r<t;r++)try{return await e()}catch(e){if(r===t-1||!(e instanceof Error)||!e.message.includes(`not registered`))throw e;await new Promise(e=>setTimeout(e,n))}throw Error(`unreachable`)},gF=async e=>{for(let t=0;t<50;t++){if(await e.locator(`[data-uia="header"] a[href*="/login"]`).exists())return!1;if(await e.locator(`.watch-video, [data-uia="video-canvas"]`).exists())return!0;await new Promise(e=>setTimeout(e,200))}return!1},_F=async(e,t)=>{for(;!t();){try{if(await e.locator(`video`).exists())return await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,200))}return null},vF=Xt`
|
|
1483
|
-
position: relative;
|
|
1484
|
-
width: 100%;
|
|
1485
|
-
height: 100%;
|
|
1486
|
-
background: #000;
|
|
1487
|
-
user-select: none;
|
|
1488
|
-
-webkit-user-select: none;
|
|
1489
|
-
|
|
1490
|
-
.nf-frame {
|
|
1491
|
-
position: absolute;
|
|
1492
|
-
inset: 0;
|
|
1493
|
-
width: 100%;
|
|
1494
|
-
height: 100%;
|
|
1495
|
-
border: none;
|
|
1496
|
-
background: #000;
|
|
1497
|
-
/* Netflix's own chrome is hidden, so the iframe must not swallow taps -
|
|
1498
|
-
they belong to the skin's gesture layer stacked above it. */
|
|
1499
|
-
pointer-events: none;
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
.overlay {
|
|
1503
|
-
position: absolute;
|
|
1504
|
-
inset: 0;
|
|
1505
|
-
display: flex;
|
|
1506
|
-
flex-direction: column;
|
|
1507
|
-
align-items: center;
|
|
1508
|
-
justify-content: center;
|
|
1509
|
-
gap: 1.6rem;
|
|
1510
|
-
background: #000;
|
|
1511
|
-
font-size: 1.4rem;
|
|
1512
|
-
color: rgba(255, 255, 255, 0.8);
|
|
1513
|
-
z-index: 30;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
.login-button {
|
|
1517
|
-
padding: 0.8rem 2rem;
|
|
1518
|
-
background: #e50914;
|
|
1519
|
-
color: #fff;
|
|
1520
|
-
border: none;
|
|
1521
|
-
border-radius: 0.4rem;
|
|
1522
|
-
font-size: 1.4rem;
|
|
1523
|
-
font-weight: 600;
|
|
1524
|
-
cursor: pointer;
|
|
1525
|
-
|
|
1526
|
-
&:hover {
|
|
1527
|
-
background: #c11119;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
`,yF={cr:VN,nf:({url:e})=>{let[t,n]=T(null),[r,i]=T(null),[a,o]=T(!0),[s,c]=T(!1),[l,u]=T(),[f,p]=T(null),[m,h]=T(0);E(()=>{if(!t)return;let e=!1;return(async()=>{for(let n=0;!e;n++)try{let n=await Xd({iframe:t,domains:fF});if(e)return;if(!Pn()){u(`Netflix playback currently needs the FKN browser extension.`),o(!1);return}i(n);return}catch(t){if(e)return;if(n>=4){console.error(`Failed to attach Netflix frame`,t),u(t instanceof Error?t.message:`Failed to load player`),o(!1);return}await new Promise(e=>setTimeout(e,300*(n+1)))}})(),()=>{e=!0}},[t]),E(()=>{if(!r)return;let t=!1,n=()=>t;return o(!0),u(void 0),c(!1),p(null),(async()=>{if(await r.goto(e,{waitUntil:`load`}),await hF(()=>r.addStyleTag({content:mF})),t)return;o(!1);let i=await gF(r);if(t)return;if(!i){c(!0);return}let a=await _F(r,n);t||!a||p(a)})().catch(e=>{t||(console.error(`Failed to load Netflix player`,e),u(e?.message??`Failed to load player`),o(!1))}),()=>{t=!0}},[r,e,m]);let g=d(()=>{let e=globalThis.open(pF,`_blank`,`width=500,height=700`);if(!e)return;let t=setInterval(()=>{e.closed&&(clearInterval(t),h(e=>e+1))},500)},[]);return q(`div`,{css:vF,children:[K(dF,{remote:f,frame:r,children:K(`iframe`,{ref:n,className:`nf-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`})}),(s||l||a)&&q(`div`,{className:`overlay`,children:[s&&q(am,{children:[`You need to be logged in to Netflix to watch this content.`,K(`button`,{className:`login-button`,onClick:g,children:`Open Netflix Login Page`})]}),l&&!s&&l,a&&!l&&!s&&`Loading Netflix player...`]})]})}},bF=e=>yF[e];export{Nd as A,ff as C,mf as D,df as E,kc as M,Yt as N,Ef as O,Xt as P,jf as S,Of as T,nm as _,om as a,cf as b,_m as c,q as d,Qp as f,em as g,$p as h,xm as i,Wu as j,Kd as k,am as l,tm as m,gm as n,hm as o,im as p,vm as r,Sm as s,bF as t,K as u,dp as v,pf as w,Nf as x,kf as y};
|