@telepath-computer/television 1.4.15 → 1.4.16
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/dist/canonical/v2/styles.css +24 -2
- package/dist/cli.cjs +26 -9
- package/dist/skills/television/SKILL.md +8 -1
- package/dist/skills/television/theming.md +17 -12
- package/dist/web/assets/main-kmht3QeW.css +1 -0
- package/dist/web/assets/main-tAq-Xbek.js +826 -0
- package/dist/web/index.html +2 -2
- package/dist/web/views/url-unsupported/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/main-CT9O9pvW.css +0 -1
- package/dist/web/assets/main-dsjTnD1P.js +0 -843
|
@@ -1,843 +0,0 @@
|
|
|
1
|
-
var Q4=Object.defineProperty;var Iv=n=>{throw TypeError(n)};var eA=(n,t,e)=>t in n?Q4(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var I=(n,t,e)=>eA(n,typeof t!="symbol"?t+"":t,e),tf=(n,t,e)=>t.has(n)||Iv("Cannot "+e);var s=(n,t,e)=>(tf(n,t,"read from private field"),e?e.call(n):t.get(n)),m=(n,t,e)=>t.has(n)?Iv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),d=(n,t,e,r)=>(tf(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),h=(n,t,e)=>(tf(n,t,"access private method"),e);var kh=(n,t,e,r)=>({set _(i){d(n,t,i,e)},get _(){return s(n,t,r)}});import{i as tA,a as nA,b as rA,c as iA,d as sA,e as oA,f as aA,g as lA,U as cA,A as uA,h as hA}from"./artifact-bridge-BEUWXKq7.js";import{m as dA,a as pA,b as fA}from"./missing-artifact-page-DVzJ41AE.js";var Ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mA(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var t=n.default;if(typeof t=="function"){var e=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),e}var $v={},xv={},nf,Pv;function Yb(){if(Pv)return nf;Pv=1;var n=Object.prototype.toString;return nf=function(e){var r=n.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&n.call(e.callee)==="[object Function]"),i},nf}var rf,Dv;function gA(){if(Dv)return rf;Dv=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Yb(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(y){var v=y.constructor;return v&&v.prototype===y},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!u["$"+y]&&t.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{c(window[y])}catch{return!0}}catch{return!0}return!1})(),f=function(y){if(typeof window>"u"||!p)return c(y);try{return c(y)}catch{return!1}};n=function(v){var S=v!==null&&typeof v=="object",_=e.call(v)==="[object Function]",x=r(v),Z=S&&e.call(v)==="[object String]",L=[];if(!S&&!_&&!x)throw new TypeError("Object.keys called on a non-object");var z=a&&_;if(Z&&v.length>0&&!t.call(v,0))for(var P=0;P<v.length;++P)L.push(String(P));if(x&&v.length>0)for(var B=0;B<v.length;++B)L.push(String(B));else for(var F in v)!(z&&F==="prototype")&&t.call(v,F)&&L.push(String(F));if(o)for(var q=f(v),Q=0;Q<l.length;++Q)!(q&&l[Q]==="constructor")&&t.call(v,l[Q])&&L.push(l[Q]);return L}}return rf=n,rf}var sf,Lv;function vA(){if(Lv)return sf;Lv=1;var n=Array.prototype.slice,t=Yb(),e=Object.keys,r=e?function(a){return e(a)}:gA(),i=Object.keys;return r.shim=function(){if(Object.keys){var a=(function(){var l=Object.keys(arguments);return l&&l.length===arguments.length})(1,2);a||(Object.keys=function(c){return t(c)?i(n.call(c)):i(c)})}else Object.keys=r;return Object.keys||r},sf=r,sf}var of,Ov;function uh(){if(Ov)return of;Ov=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return of=n,of}var af,Mv;function Ai(){return Mv||(Mv=1,af=SyntaxError),af}var lf,Nv;function pe(){return Nv||(Nv=1,lf=TypeError),lf}var cf,zv;function yA(){return zv||(zv=1,cf=Object.getOwnPropertyDescriptor),cf}var uf,Hv;function Ul(){if(Hv)return uf;Hv=1;var n=yA();if(n)try{n([],"length")}catch{n=null}return uf=n,uf}var hf,Zv;function Kb(){if(Zv)return hf;Zv=1;var n=uh(),t=Ai(),e=pe(),r=Ul();return hf=function(o,a,l){if(!o||typeof o!="object"&&typeof o!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,f=arguments.length>6?arguments[6]:!1,y=!!r&&r(o,a);if(n)n(o,a,{configurable:p===null&&y?y.configurable:!p,enumerable:c===null&&y?y.enumerable:!c,value:l,writable:u===null&&y?y.writable:!u});else if(f||!c&&!u&&!p)o[a]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},hf}var df,Uv;function Pp(){if(Uv)return df;Uv=1;var n=uh(),t=function(){return!!n};return t.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},df=t,df}var pf,Fv;function na(){if(Fv)return pf;Fv=1;var n=vA(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,r=Array.prototype.concat,i=Kb(),o=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=Pp()(),l=function(u,p,f,y){if(p in u){if(y===!0){if(u[p]===f)return}else if(!o(y)||!y())return}a?i(u,p,f,!0):i(u,p,f)},c=function(u,p){var f=arguments.length>2?arguments[2]:{},y=n(p);t&&(y=r.call(y,Object.getOwnPropertySymbols(p)));for(var v=0;v<y.length;v+=1)l(u,y[v],p[y[v]],f[y[v]])};return c.supportsDescriptors=!!a,pf=c,pf}var lc={exports:{}},qv;function Jb(){return qv||(qv=1,typeof self<"u"?lc.exports=self:typeof window<"u"?lc.exports=window:lc.exports=Function("return this")()),lc.exports}var ff,Vv;function Xb(){if(Vv)return ff;Vv=1;var n=Jb();return ff=function(){return typeof Ks!="object"||!Ks||Ks.Math!==Math||Ks.Array!==Array?n:Ks},ff}var mf,Bv;function wA(){if(Bv)return mf;Bv=1;var n=na(),t=Ul(),e=Xb();return mf=function(){var i=e();if(n.supportsDescriptors){var o=t(i,"globalThis");(!o||o.configurable&&(o.enumerable||!o.writable||globalThis!==i))&&Object.defineProperty(i,"globalThis",{configurable:!0,enumerable:!1,value:i,writable:!0})}else(typeof globalThis!="object"||globalThis!==i)&&(i.globalThis=i);return i},mf}var gf,Wv;function _1(){if(Wv)return gf;Wv=1;var n=na(),t=Jb(),e=Xb(),r=wA(),i=e(),o=function(){return i};return n(o,{getPolyfill:e,implementation:t,shim:r}),gf=o,gf}var vf,jv;function Ei(){return jv||(jv=1,vf=function(t){return!!t&&(typeof t=="function"||typeof t=="object")}),vf}var yf,Gv;function A1(){return Gv||(Gv=1,yf=Object),yf}var wf,Yv;function Qb(){return Yv||(Yv=1,wf=Error),wf}var bf,Kv;function bA(){return Kv||(Kv=1,bf=EvalError),bf}var Sf,Jv;function SA(){return Jv||(Jv=1,Sf=RangeError),Sf}var _f,Xv;function E1(){return Xv||(Xv=1,_f=ReferenceError),_f}var Af,Qv;function _A(){return Qv||(Qv=1,Af=URIError),Af}var Ef,ey;function AA(){return ey||(ey=1,Ef=Math.abs),Ef}var kf,ty;function EA(){return ty||(ty=1,kf=Math.floor),kf}var Tf,ny;function kA(){return ny||(ny=1,Tf=Math.max),Tf}var Cf,ry;function TA(){return ry||(ry=1,Cf=Math.min),Cf}var Rf,iy;function CA(){return iy||(iy=1,Rf=Math.pow),Rf}var If,sy;function RA(){return sy||(sy=1,If=Math.round),If}var $f,oy;function k1(){return oy||(oy=1,$f=Number.isNaN||function(t){return t!==t}),$f}var xf,ay;function IA(){if(ay)return xf;ay=1;var n=k1();return xf=function(e){return n(e)||e===0?e:e<0?-1:1},xf}var Pf,ly;function Fl(){return ly||(ly=1,Pf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==i||l.enumerable!==!0)return!1}return!0}),Pf}var Df,cy;function T1(){if(cy)return Df;cy=1;var n=typeof Symbol<"u"&&Symbol,t=Fl();return Df=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Df}var Lf,uy;function e8(){return uy||(uy=1,Lf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Lf}var Of,hy;function t8(){if(hy)return Of;hy=1;var n=A1();return Of=n.getPrototypeOf||null,Of}var Mf,dy;function $A(){if(dy)return Mf;dy=1;var n="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,r="[object Function]",i=function(c,u){for(var p=[],f=0;f<c.length;f+=1)p[f]=c[f];for(var y=0;y<u.length;y+=1)p[y+c.length]=u[y];return p},o=function(c,u){for(var p=[],f=u,y=0;f<c.length;f+=1,y+=1)p[y]=c[f];return p},a=function(l,c){for(var u="",p=0;p<l.length;p+=1)u+=l[p],p+1<l.length&&(u+=c);return u};return Mf=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(n+u);for(var p=o(arguments,1),f,y=function(){if(this instanceof f){var Z=u.apply(this,i(p,arguments));return Object(Z)===Z?Z:this}return u.apply(c,i(p,arguments))},v=e(0,u.length-p.length),S=[],_=0;_<v;_++)S[_]="$"+_;if(f=Function("binder","return function ("+a(S,",")+"){ return binder.apply(this,arguments); }")(y),u.prototype){var x=function(){};x.prototype=u.prototype,f.prototype=new x,x.prototype=null}return f},Mf}var Nf,py;function hh(){if(py)return Nf;py=1;var n=$A();return Nf=Function.prototype.bind||n,Nf}var zf,fy;function C1(){return fy||(fy=1,zf=Function.prototype.call),zf}var Hf,my;function R1(){return my||(my=1,Hf=Function.prototype.apply),Hf}var Zf,gy;function xA(){return gy||(gy=1,Zf=typeof Reflect<"u"&&Reflect&&Reflect.apply),Zf}var Uf,vy;function n8(){if(vy)return Uf;vy=1;var n=hh(),t=R1(),e=C1(),r=xA();return Uf=r||n.call(e,t),Uf}var Ff,yy;function Dp(){if(yy)return Ff;yy=1;var n=hh(),t=pe(),e=C1(),r=n8();return Ff=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return r(n,e,o)},Ff}var qf,wy;function PA(){if(wy)return qf;wy=1;var n=Dp(),t=Ul(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var r=!!e&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return qf=r&&typeof r.get=="function"?n([r.get]):typeof o=="function"?function(l){return o(l==null?l:i(l))}:!1,qf}var Vf,by;function r8(){if(by)return Vf;by=1;var n=e8(),t=t8(),e=PA();return Vf=n?function(i){return n(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:e?function(i){return e(i)}:null,Vf}var Bf,Sy;function ki(){if(Sy)return Bf;Sy=1;var n=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=hh();return Bf=e.call(n,t),Bf}var Wf,_y;function Cn(){if(_y)return Wf;_y=1;var n,t=A1(),e=Qb(),r=bA(),i=SA(),o=E1(),a=Ai(),l=pe(),c=_A(),u=AA(),p=EA(),f=kA(),y=TA(),v=CA(),S=RA(),_=IA(),x=Function,Z=function(bt){try{return x('"use strict"; return ('+bt+").constructor;")()}catch{}},L=Ul(),z=uh(),P=function(){throw new l},B=L?(function(){try{return arguments.callee,P}catch{try{return L(arguments,"callee").get}catch{return P}}})():P,F=T1()(),q=r8(),Q=t8(),V=e8(),re=R1(),Ne=C1(),xe={},tt=typeof Uint8Array>"u"||!q?n:q(Uint8Array),le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":F&&q?q([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":xe,"%AsyncGenerator%":xe,"%AsyncGeneratorFunction%":xe,"%AsyncIteratorPrototype%":xe,"%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%":e,"%eval%":eval,"%EvalError%":r,"%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%":x,"%GeneratorFunction%":xe,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":F&&q?q(q([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!F||!q?n:q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":L,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!F||!q?n:q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":F&&q?q(""[Symbol.iterator]()):n,"%Symbol%":F?Symbol:n,"%SyntaxError%":a,"%ThrowTypeError%":B,"%TypedArray%":tt,"%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%":c,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":Ne,"%Function.prototype.apply%":re,"%Object.defineProperty%":z,"%Object.getPrototypeOf%":Q,"%Math.abs%":u,"%Math.floor%":p,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":v,"%Math.round%":S,"%Math.sign%":_,"%Reflect.getPrototypeOf%":V};if(q)try{null.error}catch(bt){var je=q(q(bt));le["%Error.prototype%"]=je}var Dt=function bt(Re){var Be;if(Re==="%AsyncFunction%")Be=Z("async function () {}");else if(Re==="%GeneratorFunction%")Be=Z("function* () {}");else if(Re==="%AsyncGeneratorFunction%")Be=Z("async function* () {}");else if(Re==="%AsyncGenerator%"){var Pe=bt("%AsyncGeneratorFunction%");Pe&&(Be=Pe.prototype)}else if(Re==="%AsyncIteratorPrototype%"){var Ge=bt("%AsyncGenerator%");Ge&&q&&(Be=q(Ge.prototype))}return le[Re]=Be,Be},$n={__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"]},ht=hh(),wt=ki(),Ps=ht.call(Ne,Array.prototype.concat),sa=ht.call(re,Array.prototype.splice),Ds=ht.call(Ne,String.prototype.replace),Ci=ht.call(Ne,String.prototype.slice),Ee=ht.call(Ne,RegExp.prototype.exec),Ql=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xn=/\\(\\)?/g,Ls=function(Re){var Be=Ci(Re,0,1),Pe=Ci(Re,-1);if(Be==="%"&&Pe!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(Pe==="%"&&Be!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var Ge=[];return Ds(Re,Ql,function(ce,cn,oe,at){Ge[Ge.length]=oe?Ds(at,xn,"$1"):cn||ce}),Ge},ec=function(Re,Be){var Pe=Re,Ge;if(wt($n,Pe)&&(Ge=$n[Pe],Pe="%"+Ge[0]+"%"),wt(le,Pe)){var ce=le[Pe];if(ce===xe&&(ce=Dt(Pe)),typeof ce>"u"&&!Be)throw new l("intrinsic "+Re+" exists, but is not available. Please file an issue!");return{alias:Ge,name:Pe,value:ce}}throw new a("intrinsic "+Re+" does not exist!")};return Wf=function(Re,Be){if(typeof Re!="string"||Re.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Be!="boolean")throw new l('"allowMissing" argument must be a boolean');if(Ee(/^%?[^%]*%?$/,Re)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Pe=Ls(Re),Ge=Pe.length>0?Pe[0]:"",ce=ec("%"+Ge+"%",Be),cn=ce.name,oe=ce.value,at=!1,ze=ce.alias;ze&&(Ge=ze[0],sa(Pe,Ps([0,1],ze)));for(var un=1,Pn=!0;un<Pe.length;un+=1){var Ye=Pe[un],Pr=Ci(Ye,0,1),Xn=Ci(Ye,-1);if((Pr==='"'||Pr==="'"||Pr==="`"||Xn==='"'||Xn==="'"||Xn==="`")&&Pr!==Xn)throw new a("property names with quotes must have matching quotes");if((Ye==="constructor"||!Pn)&&(at=!0),Ge+="."+Ye,cn="%"+Ge+"%",wt(le,cn))oe=le[cn];else if(oe!=null){if(!(Ye in oe)){if(!Be)throw new l("base intrinsic for "+Re+" exists, but the property is not available.");return}if(L&&un+1>=Pe.length){var Dr=L(oe,Ye);Pn=!!Dr,Pn&&"get"in Dr&&!("originalValue"in Dr.get)?oe=Dr.get:oe=oe[Ye]}else Pn=wt(oe,Ye),oe=oe[Ye];Pn&&!at&&(le[cn]=oe)}}return oe},Wf}var jf,Ay;function Is(){if(Ay)return jf;Ay=1;var n=Cn(),t=Dp(),e=t([n("%String.prototype.indexOf%")]);return jf=function(i,o){var a=n(i,!!o);return typeof a=="function"&&e(i,".prototype.")>-1?t([a]):a},jf}var Gf,Ey;function I1(){if(Ey)return Gf;Ey=1;var n=Cn(),t=n("%Array%"),e=!t.isArray&&Is()("Object.prototype.toString");return Gf=t.isArray||function(i){return e(i)==="[object Array]"},Gf}var Yf,ky;function $1(){if(ky)return Yf;ky=1;var n=Pp(),t=uh(),e=n.hasArrayLengthDefineBug(),r=e&&I1(),i=Is(),o=i("Object.prototype.propertyIsEnumerable");return Yf=function(l,c,u,p,f,y){if(!t){if(!l(y)||!y["[[Configurable]]"]||!y["[[Writable]]"]||f in p&&o(p,f)!==!!y["[[Enumerable]]"])return!1;var v=y["[[Value]]"];return p[f]=v,c(p[f],v)}return e&&f==="length"&&"[[Value]]"in y&&r(p)&&p.length!==y["[[Value]]"]?(p.length=y["[[Value]]"],p.length===y["[[Value]]"]):(t(p,f,u(y)),!0)},Yf}var Kf,Ty;function ql(){if(Ty)return Kf;Ty=1;var n=pe(),t=ki(),e={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Kf=function(i){if(!i||typeof i!="object")return!1;for(var o in i)if(t(i,o)&&!e[o])return!1;var a=t(i,"[[Value]]")||t(i,"[[Writable]]"),l=t(i,"[[Get]]")||t(i,"[[Set]]");if(a&&l)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},Kf}var Jf,Cy;function i8(){return Cy||(Cy=1,Jf=function(t){if(typeof t>"u")return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}),Jf}var Xf,Ry;function s8(){if(Ry)return Xf;Ry=1;var n=pe(),t=ql(),e=i8();return Xf=function(i){if(typeof i<"u"&&!t(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return e(i)},Xf}var Qf,Iy;function o8(){if(Iy)return Qf;Iy=1;var n=pe(),t=ki(),e=ql();return Qf=function(i){if(typeof i>"u")return!1;if(!e(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!t(i,"[[Value]]")&&!t(i,"[[Writable]]"))},Qf}var e0,$y;function Vl(){return $y||($y=1,e0=function(t){return typeof t=="string"||typeof t=="symbol"}),e0}var t0,xy;function a8(){if(xy)return t0;xy=1;var n=k1();return t0=function(e,r){return e===r?e===0?1/e===1/r:!0:n(e)&&n(r)},t0}var n0,Py;function x1(){if(Py)return n0;Py=1;var n=pe(),t=Ei(),e=$1(),r=s8(),i=o8(),o=Vl(),a=a8();return n0=function(c,u,p){if(!t(c))throw new n("Assertion failed: Type(O) is not Object");if(!o(u))throw new n("Assertion failed: P is not a Property Key");var f={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":p,"[[Writable]]":!0};return e(i,a,r,c,u,f)},n0}var r0,Dy;function l8(){if(Dy)return r0;Dy=1;var n=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,e,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,e)}catch(L){L!==r&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(z){try{var P=n.call(z);return i.test(P)}catch{return!1}},a=function(z){try{return o(z)?!1:(n.call(z),!0)}catch{return!1}},l=Object.prototype.toString,c="[object Object]",u="[object Function]",p="[object GeneratorFunction]",f="[object HTMLAllCollection]",y="[object HTML document.all class]",v="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),x=function(){return!1};if(typeof document=="object"){var Z=document.all;l.call(Z)===l.call(document.all)&&(x=function(z){if((_||!z)&&(typeof z>"u"||typeof z=="object"))try{var P=l.call(z);return(P===f||P===y||P===v||P===c)&&z("")==null}catch{}return!1})}return r0=t?function(z){if(x(z))return!0;if(!z||typeof z!="function"&&typeof z!="object")return!1;try{t(z,null,e)}catch(P){if(P!==r)return!1}return!o(z)&&a(z)}:function(z){if(x(z))return!0;if(!z||typeof z!="function"&&typeof z!="object")return!1;if(S)return a(z);if(o(z))return!1;var P=l.call(z);return P!==u&&P!==p&&!/^\[object HTML/.test(P)?!1:a(z)},r0}var i0,Ly;function DA(){return Ly||(Ly=1,i0=l8()),i0}var s0,Oy;function LA(){return Oy||(Oy=1,s0=function(t){return!!t}),s0}var o0,My;function OA(){if(My)return o0;My=1;var n=ki(),t=pe(),e=Ei(),r=DA(),i=LA();return o0=function(a){if(!e(a))throw new t("ToPropertyDescriptor requires an object");var l={};if(n(a,"enumerable")&&(l["[[Enumerable]]"]=i(a.enumerable)),n(a,"configurable")&&(l["[[Configurable]]"]=i(a.configurable)),n(a,"value")&&(l["[[Value]]"]=a.value),n(a,"writable")&&(l["[[Writable]]"]=i(a.writable)),n(a,"get")){var c=a.get;if(typeof c<"u"&&!r(c))throw new t("getter must be a function");l["[[Get]]"]=c}if(n(a,"set")){var u=a.set;if(typeof u<"u"&&!r(u))throw new t("setter must be a function");l["[[Set]]"]=u}if((n(l,"[[Get]]")||n(l,"[[Set]]"))&&(n(l,"[[Value]]")||n(l,"[[Writable]]")))throw new t("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return l},o0}var a0,Ny;function MA(){if(Ny)return a0;Ny=1;var n=pe(),t=Ei(),e=ql(),r=$1(),i=s8(),o=o8(),a=Vl(),l=a8(),c=OA();return a0=function(p,f,y){if(!t(p))throw new n("Assertion failed: Type(O) is not Object");if(!a(f))throw new n("Assertion failed: P is not a Property Key");var v=e(y)?y:c(y);if(!e(v))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return r(o,l,i,p,f,v)},a0}var l0,zy;function NA(){if(zy)return l0;zy=1;var n=pe(),t=Ei(),e=MA(),r=Vl();return l0=function(o,a,l){if(!t(o))throw new n("Assertion failed: Type(O) is not Object");if(!r(a))throw new n("Assertion failed: P is not a Property Key");var c={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":l,"[[Writable]]":!0};return e(o,a,c)},l0}var c0,Hy;function zA(){return Hy||(Hy=1,c0=typeof Reflect<"u"&&Reflect.setPrototypeOf||null),c0}var u0,Zy;function HA(){if(Zy)return u0;Zy=1;var n=A1();return u0=n.setPrototypeOf||null,u0}var h0,Uy;function ZA(){if(Uy)return h0;Uy=1;var n=Dp(),t=Ul(),e=pe(),r={};try{r.__proto__=null}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!("toString"in r),o=t&&t(Object.prototype,"__proto__");return h0=i&&(!!o&&typeof o.set=="function"&&n([o.set])||function(l,c){if(l==null)throw new e("set Object.prototype.__proto__ called on null or undefined");return l.__proto__=c,c}),h0}var d0,Fy;function UA(){if(Fy)return d0;Fy=1;var n=zA(),t=HA(),e=ZA(),r=pe();return d0=n?function(o,a){if(n(o,a))return o;throw new r("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:t||(e?function(o,a){return e(o,a),o}:null),d0}var p0,qy;function FA(){if(qy)return p0;qy=1;var n=pe(),t=Ei(),e=r8();return p0=function(i){if(!t(i))throw new n("Assertion failed: O must be an Object");if(!e)throw new n("This environment does not support fetching prototypes.");return e(i)},p0}var f0,Vy;function qA(){if(Vy)return f0;Vy=1;var n=pe(),t=UA(),e=Ei(),r=FA();return f0=function(o,a){if(a!==null&&!e(a))throw new n("Assertion failed: V must be Object or Null");try{t(o,a)}catch{return!1}return r(o)===a},f0}var m0,By;function VA(){if(By)return m0;By=1;var n=x1(),t=NA(),e=qA(),r=Pp()(),i=Qb();function o(l,c,u){var p=new i(u);return e(p,a),delete p.constructor,t(p,"error",l),t(p,"suppressed",c),p}r&&Object.defineProperty(o,"prototype",{writable:!1});var a=o.prototype;if(!n(a,"constructor",o)||!n(a,"message","")||!n(a,"name","SuppressedError"))throw new i("unable to install SuppressedError.prototype properties; please report this!");return e(o.prototype,i.prototype),m0=o,m0}var g0,Wy;function c8(){if(Wy)return g0;Wy=1;var n=VA();return g0=function(){return typeof SuppressedError=="function"?SuppressedError:n},g0}var v0,jy;function BA(){if(jy)return v0;jy=1;var n=na(),t=_1()(),e=c8();return v0=function(){var i=e();return n(t,{SuppressedError:i},{SuppressedError:function(){return t.SuppressedError!==i}}),i},v0}var Gy;function WA(){return Gy||(Gy=1,BA()()),xv}var y0,Yy;function jA(){if(Yy)return y0;Yy=1;var n=pe(),t=ql(),e=i8();return y0=function(i){if(typeof i<"u"&&!t(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return e(i)},y0}var w0,Ky;function GA(){if(Ky)return w0;Ky=1;var n=pe(),t=ki(),e=ql();return w0=function(i){if(typeof i>"u")return!1;if(!e(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!t(i,"[[Value]]")&&!t(i,"[[Writable]]"))},w0}var b0,Jy;function YA(){if(Jy)return b0;Jy=1;var n=k1();return b0=function(e,r){return e===r?e===0?1/e===1/r:!0:n(e)&&n(r)},b0}var S0,Xy;function Bl(){return Xy||(Xy=1,S0=l8()),S0}var _0,Qy;function KA(){return Qy||(Qy=1,_0=function(t){return!!t}),_0}var A0,ew;function JA(){if(ew)return A0;ew=1;var n=ki(),t=pe(),e=Ei(),r=Bl(),i=KA();return A0=function(a){if(!e(a))throw new t("ToPropertyDescriptor requires an object");var l={};if(n(a,"enumerable")&&(l["[[Enumerable]]"]=i(a.enumerable)),n(a,"configurable")&&(l["[[Configurable]]"]=i(a.configurable)),n(a,"value")&&(l["[[Value]]"]=a.value),n(a,"writable")&&(l["[[Writable]]"]=i(a.writable)),n(a,"get")){var c=a.get;if(typeof c<"u"&&!r(c))throw new t("getter must be a function");l["[[Get]]"]=c}if(n(a,"set")){var u=a.set;if(typeof u<"u"&&!r(u))throw new t("setter must be a function");l["[[Set]]"]=u}if((n(l,"[[Get]]")||n(l,"[[Set]]"))&&(n(l,"[[Value]]")||n(l,"[[Writable]]")))throw new t("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return l},A0}var E0,tw;function dh(){if(tw)return E0;tw=1;var n=pe(),t=Ei(),e=ql(),r=$1(),i=jA(),o=GA(),a=Vl(),l=YA(),c=JA();return E0=function(p,f,y){if(!t(p))throw new n("Assertion failed: Type(O) is not Object");if(!a(f))throw new n("Assertion failed: P is not a Property Key");var v=e(y)?y:c(y);if(!e(v))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return r(o,l,i,p,f,v)},E0}var k0,nw;function XA(){if(nw)return k0;nw=1;var n=Fl()();return k0=n?Symbol.dispose||Symbol("Symbol.dispose"):null,k0}var T0,rw;function P1(){if(rw)return T0;rw=1;var n=Fl(),t=XA();return T0=function(){return n()&&Symbol.dispose||t},T0}var C0,iw;function QA(){if(iw)return C0;iw=1;var n=T1(),t=dh(),e=P1();return C0=function(){var i=e();return n()&&t(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":i}),i},C0}var R0,sw;function eE(){if(sw)return R0;sw=1;var n=Fl()();return R0=n?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,R0}var I0,ow;function D1(){if(ow)return I0;ow=1;var n=Fl(),t=eE();return I0=function(){return n()&&Symbol.asyncDispose||t},I0}var $0,aw;function tE(){if(aw)return $0;aw=1;var n=T1(),t=dh(),e=D1();return $0=function(){var i=e();return n()&&t(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":i}),i},$0}var x0,lw;function nE(){return lw||(lw=1,x0=I1()),x0}var P0,cw;function Lp(){if(cw)return P0;cw=1;var n=Cn(),t=Is(),e=pe(),r=nE(),i=n("%Reflect.apply%",!0)||t("Function.prototype.apply");return P0=function(a,l){var c=arguments.length>2?arguments[2]:[];if(!r(c))throw new e("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(a,l,c)},P0}const rE={},iE=Object.freeze(Object.defineProperty({__proto__:null,default:rE},Symbol.toStringTag,{value:"Module"})),sE=mA(iE);var D0,uw;function Wl(){if(uw)return D0;uw=1;var n=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,e=n&&t&&typeof t.get=="function"?t.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,l=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,u=c?WeakMap.prototype.has:null,p=typeof WeakSet=="function"&&WeakSet.prototype,f=p?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,v=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,_=Object.prototype.toString,x=Function.prototype.toString,Z=String.prototype.match,L=String.prototype.slice,z=String.prototype.replace,P=String.prototype.toUpperCase,B=String.prototype.toLowerCase,F=RegExp.prototype.test,q=Array.prototype.concat,Q=Array.prototype.join,V=Array.prototype.slice,re=Math.floor,Ne=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xe=Object.getOwnPropertySymbols,tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",je=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===le||!0)?Symbol.toStringTag:null,Dt=Object.prototype.propertyIsEnumerable,$n=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function ht(k,C){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||F.call(/e/,C))return C;var fe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var Se=k<0?-re(-k):re(k);if(Se!==k){var ke=String(Se),te=L.call(C,ke.length+1);return z.call(ke,fe,"$&_")+"."+z.call(z.call(te,/([0-9]{3})/g,"$&_"),/_$/,"")}}return z.call(C,fe,"$&_")}var wt=sE,Ps=wt.custom,sa=ce(Ps)?Ps:null,Ds={__proto__:null,double:'"',single:"'"},Ci={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};D0=function k(C,fe,Se,ke){var te=fe||{};if(at(te,"quoteStyle")&&!at(Ds,te.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(at(te,"maxStringLength")&&(typeof te.maxStringLength=="number"?te.maxStringLength<0&&te.maxStringLength!==1/0:te.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var St=at(te,"customInspect")?te.customInspect:!0;if(typeof St!="boolean"&&St!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(at(te,"indent")&&te.indent!==null&&te.indent!==" "&&!(parseInt(te.indent,10)===te.indent&&te.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(at(te,"numericSeparator")&&typeof te.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var tr=te.numericSeparator;if(typeof C>"u")return"undefined";if(C===null)return"null";if(typeof C=="boolean")return C?"true":"false";if(typeof C=="string")return er(C,te);if(typeof C=="number"){if(C===0)return 1/0/C>0?"0":"-0";var dt=String(C);return tr?ht(C,dt):dt}if(typeof C=="bigint"){var Dn=String(C)+"n";return tr?ht(C,Dn):Dn}var oa=typeof te.depth>"u"?5:te.depth;if(typeof Se>"u"&&(Se=0),Se>=oa&&oa>0&&typeof C=="object")return Ls(C)?"[Array]":"[Object]";var Nr=Ii(te,Se);if(typeof ke>"u")ke=[];else if(Pn(ke,C)>=0)return"[Circular]";function pt(Pi,Hs,sc){if(Hs&&(ke=V.call(ke),ke.push(Hs)),sc){var oc={depth:te.depth};return at(te,"quoteStyle")&&(oc.quoteStyle=te.quoteStyle),k(Pi,oc,Se+1,ke)}return k(Pi,te,Se+1,ke)}if(typeof C=="function"&&!bt(C)){var Ms=un(C),jt=Mr(C,pt);return"[Function"+(Ms?": "+Ms:" (anonymous)")+"]"+(jt.length>0?" { "+Q.call(jt,", ")+" }":"")}if(ce(C)){var zr=le?z.call(String(C),/^(Symbol\(.*\))_[^)]*$/,"$1"):tt.call(C);return typeof C=="object"&&!le?Or(zr):zr}if(Qn(C)){for(var Hr="<"+B.call(String(C.nodeName)),Ns=C.attributes||[],aa=0;aa<Ns.length;aa++)Hr+=" "+Ns[aa].name+"="+Ee(Ql(Ns[aa].value),"double",te);return Hr+=">",C.childNodes&&C.childNodes.length&&(Hr+="..."),Hr+="</"+B.call(String(C.nodeName))+">",Hr}if(Ls(C)){if(C.length===0)return"[]";var la=Mr(C,pt);return Nr&&!tc(la)?"["+$i(la,Nr)+"]":"[ "+Q.call(la,", ")+" ]"}if(Re(C)){var zs=Mr(C,pt);return!("cause"in Error.prototype)&&"cause"in C&&!Dt.call(C,"cause")?"{ ["+String(C)+"] "+Q.call(q.call("[cause]: "+pt(C.cause),zs),", ")+" }":zs.length===0?"["+String(C)+"]":"{ ["+String(C)+"] "+Q.call(zs,", ")+" }"}if(typeof C=="object"&&St){if(sa&&typeof C[sa]=="function"&&wt)return wt(C,{depth:oa-Se});if(St!=="symbol"&&typeof C.inspect=="function")return C.inspect()}if(Ye(C)){var nc=[];return r&&r.call(C,function(Pi,Hs){nc.push(pt(Hs,C,!0)+" => "+pt(Pi,C))}),Os("Map",e.call(C),nc,Nr)}if(Dr(C)){var ca=[];return l&&l.call(C,function(Pi){ca.push(pt(Pi,C))}),Os("Set",a.call(C),ca,Nr)}if(Pr(C))return Ri("WeakMap");if(vh(C))return Ri("WeakSet");if(Xn(C))return Ri("WeakRef");if(Pe(C))return Or(pt(Number(C)));if(cn(C))return Or(pt(Ne.call(C)));if(Ge(C))return Or(S.call(C));if(Be(C))return Or(pt(String(C)));if(typeof window<"u"&&C===window)return"{ [object Window] }";if(typeof globalThis<"u"&&C===globalThis||typeof Ks<"u"&&C===Ks)return"{ [object globalThis] }";if(!ec(C)&&!bt(C)){var rc=Mr(C,pt),xi=$n?$n(C)===Object.prototype:C instanceof Object||C.constructor===Object,ic=C instanceof Object?"":"null prototype",yh=!xi&&je&&Object(C)===C&&je in C?L.call(ze(C),8,-1):ic?"Object":"",He=xi||typeof C.constructor!="function"?"":C.constructor.name?C.constructor.name+" ":"",nr=He+(yh||ic?"["+Q.call(q.call([],yh||[],ic||[]),": ")+"] ":"");return rc.length===0?nr+"{}":Nr?nr+"{"+$i(rc,Nr)+"}":nr+"{ "+Q.call(rc,", ")+" }"}return String(C)};function Ee(k,C,fe){var Se=fe.quoteStyle||C,ke=Ds[Se];return ke+k+ke}function Ql(k){return z.call(String(k),/"/g,""")}function xn(k){return!je||!(typeof k=="object"&&(je in k||typeof k[je]<"u"))}function Ls(k){return ze(k)==="[object Array]"&&xn(k)}function ec(k){return ze(k)==="[object Date]"&&xn(k)}function bt(k){return ze(k)==="[object RegExp]"&&xn(k)}function Re(k){return ze(k)==="[object Error]"&&xn(k)}function Be(k){return ze(k)==="[object String]"&&xn(k)}function Pe(k){return ze(k)==="[object Number]"&&xn(k)}function Ge(k){return ze(k)==="[object Boolean]"&&xn(k)}function ce(k){if(le)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!tt)return!1;try{return tt.call(k),!0}catch{}return!1}function cn(k){if(!k||typeof k!="object"||!Ne)return!1;try{return Ne.call(k),!0}catch{}return!1}var oe=Object.prototype.hasOwnProperty||function(k){return k in this};function at(k,C){return oe.call(k,C)}function ze(k){return _.call(k)}function un(k){if(k.name)return k.name;var C=Z.call(x.call(k),/^function\s*([\w$]+)/);return C?C[1]:null}function Pn(k,C){if(k.indexOf)return k.indexOf(C);for(var fe=0,Se=k.length;fe<Se;fe++)if(k[fe]===C)return fe;return-1}function Ye(k){if(!e||!k||typeof k!="object")return!1;try{e.call(k);try{a.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function Pr(k){if(!u||!k||typeof k!="object")return!1;try{u.call(k,u);try{f.call(k,f)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function Xn(k){if(!v||!k||typeof k!="object")return!1;try{return v.call(k),!0}catch{}return!1}function Dr(k){if(!a||!k||typeof k!="object")return!1;try{a.call(k);try{e.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function vh(k){if(!f||!k||typeof k!="object")return!1;try{f.call(k,f);try{u.call(k,u)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function Qn(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function er(k,C){if(k.length>C.maxStringLength){var fe=k.length-C.maxStringLength,Se="... "+fe+" more character"+(fe>1?"s":"");return er(L.call(k,0,C.maxStringLength),C)+Se}var ke=Ci[C.quoteStyle||"single"];ke.lastIndex=0;var te=z.call(z.call(k,ke,"\\$1"),/[\x00-\x1f]/g,Lr);return Ee(te,"single",C)}function Lr(k){var C=k.charCodeAt(0),fe={8:"b",9:"t",10:"n",12:"f",13:"r"}[C];return fe?"\\"+fe:"\\x"+(C<16?"0":"")+P.call(C.toString(16))}function Or(k){return"Object("+k+")"}function Ri(k){return k+" { ? }"}function Os(k,C,fe,Se){var ke=Se?$i(fe,Se):Q.call(fe,", ");return k+" ("+C+") {"+ke+"}"}function tc(k){for(var C=0;C<k.length;C++)if(Pn(k[C],`
|
|
2
|
-
`)>=0)return!1;return!0}function Ii(k,C){var fe;if(k.indent===" ")fe=" ";else if(typeof k.indent=="number"&&k.indent>0)fe=Q.call(Array(k.indent+1)," ");else return null;return{base:fe,prev:Q.call(Array(C+1),fe)}}function $i(k,C){if(k.length===0)return"";var fe=`
|
|
3
|
-
`+C.prev+C.base;return fe+Q.call(k,","+fe)+`
|
|
4
|
-
`+C.prev}function Mr(k,C){var fe=Ls(k),Se=[];if(fe){Se.length=k.length;for(var ke=0;ke<k.length;ke++)Se[ke]=at(k,ke)?C(k[ke],k):""}var te=typeof xe=="function"?xe(k):[],St;if(le){St={};for(var tr=0;tr<te.length;tr++)St["$"+te[tr]]=te[tr]}for(var dt in k)at(k,dt)&&(fe&&String(Number(dt))===dt&&dt<k.length||le&&St["$"+dt]instanceof Symbol||(F.call(/[^\w$]/,dt)?Se.push(C(dt,k)+": "+C(k[dt],k)):Se.push(dt+": "+C(k[dt],k))));if(typeof xe=="function")for(var Dn=0;Dn<te.length;Dn++)Dt.call(k,te[Dn])&&Se.push("["+C(te[Dn])+"]: "+C(k[te[Dn]],k));return Se}return D0}var L0,hw;function oE(){if(hw)return L0;hw=1;var n=Wl(),t=pe(),e=function(l,c,u){for(var p=l,f;(f=p.next)!=null;p=f)if(f.key===c)return p.next=f.next,u||(f.next=l.next,l.next=f),f},r=function(l,c){if(l){var u=e(l,c);return u&&u.value}},i=function(l,c,u){var p=e(l,c);p?p.value=u:l.next={key:c,next:l.next,value:u}},o=function(l,c){return l?!!e(l,c):!1},a=function(l,c){if(l)return e(l,c,!0)};return L0=function(){var c,u={assert:function(p){if(!u.has(p))throw new t("Side channel does not contain "+n(p))},delete:function(p){var f=a(c,p);return f&&c&&!c.next&&(c=void 0),!!f},get:function(p){return r(c,p)},has:function(p){return o(c,p)},set:function(p,f){c||(c={next:void 0}),i(c,p,f)}};return u},L0}var O0,dw;function u8(){if(dw)return O0;dw=1;var n=Cn(),t=Is(),e=Wl(),r=pe(),i=n("%Map%",!0),o=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),l=t("Map.prototype.has",!0),c=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return O0=!!i&&function(){var f,y={assert:function(v){if(!y.has(v))throw new r("Side channel does not contain "+e(v))},delete:function(v){if(f){var S=c(f,v);return u(f)===0&&(f=void 0),S}return!1},get:function(v){if(f)return o(f,v)},has:function(v){return f?l(f,v):!1},set:function(v,S){f||(f=new i),a(f,v,S)}};return y},O0}var M0,pw;function aE(){if(pw)return M0;pw=1;var n=Cn(),t=Is(),e=Wl(),r=u8(),i=pe(),o=n("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),c=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return M0=o?function(){var f,y,v={assert:function(S){if(!v.has(S))throw new i("Side channel does not contain "+e(S))},delete:function(S){if(o&&S&&(typeof S=="object"||typeof S=="function")){if(f)return u(f,S)}else if(r&&y)return y.delete(S);return!1},get:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&f?a(f,S):y&&y.get(S)},has:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&f?c(f,S):!!y&&y.has(S)},set:function(S,_){o&&S&&(typeof S=="object"||typeof S=="function")?(f||(f=new o),l(f,S,_)):r&&(y||(y=r()),y.set(S,_))}};return v}:r,M0}var N0,fw;function lE(){if(fw)return N0;fw=1;var n=pe(),t=Wl(),e=oE(),r=u8(),i=aE(),o=i||r||e;return N0=function(){var l,c={assert:function(u){if(!c.has(u)){var p=u&&Object(u)===u?"the given object key":t(u);throw new n("Side channel does not contain "+p)}},delete:function(u){return!!l&&l.delete(u)},get:function(u){return l&&l.get(u)},has:function(u){return!!l&&l.has(u)},set:function(u,p){l||(l=o()),l.set(u,p)}};return c},N0}var z0,mw;function L1(){if(mw)return z0;mw=1;var n=ki(),t=lE()(),e=pe(),r={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");if(t.assert(i),!r.has(i,o))throw new e("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var a=t.get(i);return a&&a["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var a=t.get(i);return!!a&&n(a,"$"+o)},set:function(i,o,a){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var l=t.get(i);l||(l={},t.set(i,l)),l["$"+o]=a}};return Object.freeze&&Object.freeze(r),z0=r,z0}var H0,gw;function O1(){if(gw)return H0;gw=1;var n=Ai(),t=L1(),e=function r(i,o){if(!(this instanceof r))return new r(i,o);if(i!=="normal"&&i!=="break"&&i!=="continue"&&i!=="return"&&i!=="throw")throw new n('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');t.set(this,"[[Type]]",i),t.set(this,"[[Value]]",o)};return e.prototype.type=function(){return t.get(this,"[[Type]]")},e.prototype.value=function(){return t.get(this,"[[Value]]")},e.prototype["?"]=function(){var i=t.get(this,"[[Type]]"),o=t.get(this,"[[Value]]");if(i==="throw")throw o;return o},e.prototype["!"]=function(){var i=t.get(this,"[[Type]]");if(i!=="normal")throw new n('Assertion failed: Completion Record is not of type "normal"');return t.get(this,"[[Value]]")},H0=e,H0}var Z0,vw;function M1(){if(vw)return Z0;vw=1;var n=O1();return Z0=function(e){return new n("normal",e)},Z0}var U0,yw;function cE(){if(yw)return U0;yw=1;var n=Fl();return U0=function(){return n()&&!!Symbol.toStringTag},U0}var F0,ww;function h8(){if(ww)return F0;ww=1;var n=Cn(),t=n("%Object.defineProperty%",!0),e=cE()(),r=ki(),i=pe(),o=e?Symbol.toStringTag:null;return F0=function(l,c){var u=arguments.length>2&&!!arguments[2]&&arguments[2].force,p=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof u<"u"&&typeof u!="boolean"||typeof p<"u"&&typeof p!="boolean")throw new i("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");o&&(u||!r(l,o))&&(t?t(l,o,{configurable:!p,enumerable:!1,value:c,writable:!1}):l[o]=c)},F0}var q0={exports:{}},V0,bw;function uE(){if(bw)return V0;bw=1;var n=Cn(),t=Kb(),e=Pp()(),r=Ul(),i=pe(),o=n("%Math.floor%");return V0=function(l,c){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||o(c)!==c)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],p=!0,f=!0;if("length"in l&&r){var y=r(l,"length");y&&!y.configurable&&(p=!1),y&&!y.writable&&(f=!1)}return(p||f||!u)&&(e?t(l,"length",c,!0,!0):t(l,"length",c)),l},V0}var B0,Sw;function hE(){if(Sw)return B0;Sw=1;var n=hh(),t=R1(),e=n8();return B0=function(){return e(n,t,arguments)},B0}var _w;function N1(){return _w||(_w=1,(function(n){var t=uE(),e=uh(),r=Dp(),i=hE();n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return t(l,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(q0)),q0.exports}var W0,Aw;function dE(){return Aw||(Aw=1,W0=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0}),W0}var j0,Ew;function pE(){if(Ew)return j0;Ew=1;var n=Object;return j0=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||n(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},j0}var G0,kw;function fE(){if(kw)return G0;kw=1;var n=ki(),t=I1(),e=dE(),r=pE();return G0=function(o){return o&&typeof o=="object"&&n(o,"[[DisposableResourceStack]]")&&t(o["[[DisposableResourceStack]]"])&&(o["[[DisposableResourceStack]]"].length===0||e(o["[[DisposableResourceStack]]"],r))},G0}var Y0,Tw;function mE(){if(Tw)return Y0;Tw=1;var n=Ei();return Y0=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(n(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},Y0}var K0,Cw;function z1(){if(Cw)return K0;Cw=1;var n=mE();return K0=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":n(e)},K0}var J0,Rw;function gE(){if(Rw)return J0;Rw=1;var n=pe(),t=Wl(),e=Vl();return J0=function(i,o){if(!e(o))throw new n("Assertion failed: P is not a Property Key, got "+t(o));return i[o]},J0}var X0,Iw;function vE(){if(Iw)return X0;Iw=1;var n=pe(),t=gE(),e=Bl(),r=Vl(),i=Wl();return X0=function(a,l){if(!r(l))throw new n("Assertion failed: P is not a Property Key");var c=t(a,l);if(c!=null){if(!e(c))throw new n(i(l)+" is not a function: "+i(c));return c}},X0}var Th={exports:{}},Q0,$w;function yE(){return $w||($w=1,Q0=Cn()),Q0}var xw;function wE(){if(xw)return Th.exports;xw=1;var n=yE(),t=n("%Reflect.construct%",!0),e=dh();try{e({},"",{"[[Get]]":function(){}})}catch{e=null}if(e&&t){var r={},i={};e(i,"length",{"[[Get]]":function(){throw r},"[[Enumerable]]":!0}),Th.exports=function(a){try{t(a,i)}catch(l){return l===r}}}else Th.exports=function(a){return typeof a=="function"&&!!a.prototype};return Th.exports}var em,Pw;function bE(){if(Pw)return em;Pw=1;var n=pe(),t=Bl(),e=wE();return em=function(i){if(!e(i))throw new n("C must be a constructor");var o={"[[Resolve]]":void 0,"[[Reject]]":void 0},a=new i(function(l,c){if(typeof o["[[Resolve]]"]<"u"||typeof o["[[Reject]]"]<"u")throw new n("executor has already been called");o["[[Resolve]]"]=l,o["[[Reject]]"]=c});if(!t(o["[[Resolve]]"])||!t(o["[[Reject]]"]))throw new n("executor must provide valid resolve and reject functions");return{"[[Promise]]":a,"[[Resolve]]":o["[[Resolve]]"],"[[Reject]]":o["[[Reject]]"]}},em}var tm,Dw;function SE(){if(Dw)return tm;Dw=1;var n=Ai(),t=pe(),e=Lp(),r=vE(),i=bE(),o=z1(),a=P1()(),l=D1()();return tm=function(u,p){if(o(u)!=="Object")throw new t("`V` must be an Object");if(p!=="SYNC-DISPOSE"&&p!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var f;if(p==="ASYNC-DISPOSE"&&l&&(f=r(u,l)),!f){if(!a)throw new n("`Symbol.dispose` is not supported");if(f=r(u,a),typeof f<"u")return function(){var y=this;if(p==="ASYNC-DISPOSE"){var v=i(Promise);try{e(f,y),e(v["[[Resolve]]"],void 0,[void 0])}catch(S){v["[[Reject]]"](S)}return v["[[Promise]]"]}e(f,y)}}return f},tm}var nm,Lw;function _E(){if(Lw)return nm;Lw=1;var n=Ai(),t=pe(),e=Bl(),r=z1(),i=SE();return nm=function(a,l){if(l!=="SYNC-DISPOSE"&&l!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var c;if(arguments.length<3)if(a==null)a=void 0,c=void 0;else{if(typeof a<"u"&&r(a)!=="Object")throw new t("`V` must be an Object, or `null` or `undefined`");if(c=i(a,l),typeof c>"u")throw new t("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(c=arguments[2],!e(c))throw new t("`method`, when provided, must be a function");return{"[[ResourceValue]]":a,"[[Hint]]":l,"[[DisposeMethod]]":c}},nm}var rm,Ow;function d8(){if(Ow)return rm;Ow=1;var n=Ai(),t=pe(),e=fE(),r=_E(),i=Is(),o=i("Array.prototype.push");return rm=function(l,c,u){if(!e(l))throw new t("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(u!=="SYNC-DISPOSE"&&u!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var p=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof p!="function")throw new t("Assertion failed: `method`, when present, must be a function");if(!l["[[DisposableResourceStack]]"])throw new t("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var f;if(arguments.length<4){if(c==null&&u==="SYNC_DISPOSE")return"UNUSED";f=r(c,u)}else{if(typeof c<"u")throw new t("Assertion failed: `V` must be undefined when `method` is present");f=r(void 0,u,p)}return o(l["[[DisposableResourceStack]]"],f),"UNUSED"},rm}var im,Mw;function H1(){if(Mw)return im;Mw=1;var n=Cn(),t=N1(),e=Ai(),r=n("%Promise.resolve%",!0),i=r&&t(r);return im=function(a,l){if(!i)throw new e("This environment does not support Promises.");return i(a,l)},im}var sm,Nw;function AE(){if(Nw)return sm;Nw=1;var n=Cn(),t=Ai(),e=n("%Promise%",!0),r=Lp(),i=H1(),o=z1();return sm=function(l,c,u){if(typeof l<"u"&&o(l)!=="Object")throw new t("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new t("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new t("Assertion failed: `method` must be `undefined` or a function");var p=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(e,p)},sm}var om,zw;function EE(){if(zw)return om;zw=1;var n=O1();return om=function(e){return new n("throw",e)},om}var am,Hw;function p8(){if(Hw)return am;Hw=1;var n=Cn(),t=Ai(),e=pe(),r=n("%Promise%",!0),i=Is(),o=i("Promise.prototype.then",!0),a=O1(),l=AE(),c=M1(),u=H1(),p=EE(),f=c8()();return am=function(v,S){if(!(S instanceof a))throw new e("`completion` must be a Completion Record");var _=v["[[DisposableResourceStack]]"];if(!_)throw new e("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var x,Z=_.length-1;Z>=0;Z-=1)if(!x)x=_[Z]["[[Hint]]"];else if(x!==_[Z]["[[Hint]]"])throw new t("mixed hint stacks are not supported");for(var L=x==="ASYNC-DISPOSE"&&u(r,S),z=function(Q){if(S.type()==="throw"){var V=S.value(),re=new f(Q,V);S=p(re)}else S=p(Q)},P=x==="ASYNC-DISPOSE"&&function(V){return o(L,function(){var re=l(V["[[ResourceValue]]"],V["[[Hint]]"],V["[[DisposeMethod]]"]);if(!re)throw new t("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return o(re,c)},z)},B=_.length-1;B>=0;B-=1)if(x==="ASYNC-DISPOSE")L=P(_[B]);else{var F=_[B];try{var q=l(F["[[ResourceValue]]"],F["[[Hint]]"],F["[[DisposeMethod]]"]);if(q)throw new t("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(Q){z(Q)}}return v["[[DisposableResourceStack]]"]=null,x==="ASYNC-DISPOSE"?L:S},am}var lm,Zw;function f8(){return Zw||(Zw=1,lm=function(){var t=[];return{"[[DisposableResourceStack]]":t}}),lm}var cm,Uw;function kE(){if(Uw)return cm;Uw=1;var n=E1(),t=pe(),e=Lp(),r=x1(),i=dh(),o=Bl(),a=M1(),l=L1(),c=h8(),u=na().supportsDescriptors,p=N1(),f=d8(),y=p8(),v=f8(),S=P1()(),_=function z(){if(!(this instanceof z)||l.has(this,"[[DisposableState]]")||l.has(this,"[[DisposeCapability]]"))throw new t("can only be used with new");l.set(this,"[[DisposableState]]","PENDING"),l.set(this,"[[DisposeCapability]]",v())},x=function(){var P=this;return l.assert(P,"[[DisposableState]]"),l.get(P,"[[DisposableState]]")==="DISPOSED"},Z=p(x);u?i(_.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":x}):_.prototype.disposed=!1;var L=function(P){l.set(P,"[[DisposableState]]","DISPOSED"),u||(P.disposed=!0)};return r(_.prototype,"dispose",function(){var P=this;if(!Z(P))return L(P),y(l.get(P,"[[DisposeCapability]]"),a())["?"]()}),r(_.prototype,"use",function(P){var B=this;if(Z(B))throw new n("a disposed stack can not use anything new");return f(l.get(B,"[[DisposeCapability]]"),P,"SYNC-DISPOSE"),P}),r(_.prototype,"adopt",function(P,B){var F=this;if(Z(F))throw new n("a disposed stack can not use anything new");if(!o(B))throw new t("`onDispose` must be a function");var q=(function(){return e(B,void 0,[P])});return f(l.get(F,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",q),P}),r(_.prototype,"defer",function(P){var B=this;if(Z(B))throw new n("a disposed stack can not defer anything new");if(!o(P))throw new t("`onDispose` must be a function");f(l.get(B,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",P)}),r(_.prototype,"move",function(){var P=this;if(Z(P))throw new n("a disposed stack can not use anything new");var B=new _;return l.set(B,"[[DisposeCapability]]",l.get(P,"[[DisposeCapability]]")),l.set(P,"[[DisposeCapability]]",v()),L(P),B}),S&&r(_.prototype,S,_.prototype.dispose),c(_.prototype,"DisposableStack"),cm=_,cm}var um,Fw;function TE(){if(Fw)return um;Fw=1;var n=kE();return um=function(){return typeof DisposableStack=="function"?DisposableStack:n},um}var hm,qw;function CE(){if(qw)return hm;qw=1;var n=na(),t=_1()(),e=TE();return hm=function(){var i=e();return n(t,{DisposableStack:i},{DisposableStack:!0}),i},hm}var dm,Vw;function RE(){if(Vw)return dm;Vw=1;var n=Cn(),t=E1(),e=pe(),r=n("%Promise%",!0),i=d8(),o=Lp(),a=x1(),l=dh(),c=p8(),u=Bl(),p=f8(),f=M1(),y=H1(),v=L1(),S=h8(),_=na().supportsDescriptors,x=N1(),Z=Is(),L=Z("Promise.prototype.then",!0),z=D1()(),P=function Q(){if(!(this instanceof Q)||v.has(this,"[[AsyncDisposableState]]")||v.has(this,"[[DisposeCapability]]"))throw new e("can only be used with new");v.set(this,"[[AsyncDisposableState]]","pending"),v.set(this,"[[DisposeCapability]]",p())},B=function(){var V=this;return v.assert(V,"[[AsyncDisposableState]]"),v.get(V,"[[AsyncDisposableState]]")==="disposed"},F=x(B);_?l(P.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":B}):P.prototype.disposed=!1;var q=function(V){v.set(V,"[[AsyncDisposableState]]","disposed"),_||(V.disposed=!0)};return a(P.prototype,"disposeAsync",function(){var V=this;return F(V)?y(r):(q(V),L(y(r,c(v.get(V,"[[DisposeCapability]]"),f())),function(re){return re["?"]()}))}),a(P.prototype,"use",function(V){var re=this;if(F(re))throw new t("a disposed stack can not use anything new");return i(v.get(re,"[[DisposeCapability]]"),V,"ASYNC-DISPOSE"),V}),a(P.prototype,"adopt",function(V,re){var Ne=this;if(F(Ne))throw new t("a disposed stack can not use anything new");if(!u(re))throw new e("`onDisposeAsync` must be a function");var xe=(function(){return o(re,void 0,[V])});return xe.value=V,i(v.get(Ne,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",xe),V}),a(P.prototype,"defer",function(V){var re=this;if(F(re))throw new t("a disposed stack can not defer anything new");if(!u(V))throw new e("`onDispose` must be a function");i(v.get(re,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",V)}),a(P.prototype,"move",function(){var V=this;if(F(V))throw new t("a disposed stack can not use anything new");var re=new P;return v.set(re,"[[DisposeCapability]]",v.get(V,"[[DisposeCapability]]")),v.set(V,"[[DisposeCapability]]",p()),q(V),re}),z&&a(P.prototype,z,P.prototype.disposeAsync),S(P.prototype,"AsyncDisposableStack"),dm=P,dm}var pm,Bw;function IE(){if(Bw)return pm;Bw=1;var n=RE();return pm=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:n},pm}var fm,Ww;function $E(){if(Ww)return fm;Ww=1;var n=na(),t=_1()(),e=IE();return fm=function(){var i=e();return n(t,{AsyncDisposableStack:i},{AsyncDisposableStack:!0}),i},fm}var mm,jw;function xE(){if(jw)return mm;jw=1;var n=QA(),t=tE(),e=CE(),r=$E();return mm=function(){n(),t(),e(),r()},mm}var Gw;function PE(){return Gw||(Gw=1,WA(),xE()()),$v}PE();const Yw=new WeakMap;function DE(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function pa(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function Kw(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function LE(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class OE{constructor(){I(this,"entries",new Map);I(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw Kw();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw Kw();if(e.constructor.name==="AsyncFunction")throw LE();this.storeFactory(t,e)}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.factory)!==void 0}resolve(t){return this.resolveAny(t)}storeFactory(t,e){const r=this.getOrCreateEntry(t);r.factory=e,r.instance=void 0,r.error=void 0}validateClassRegistration(t){const e=Yw.get(t);if(e){if(t.length!==e.length)throw new Error(`${pa(t)} cannot be registered with register(Class). @injectable(...) declared ${e.length} dependencies but constructor arity is ${t.length}. Use register(Key, () => value) instead.`);return}if(t.length!==0)throw new Error(`${pa(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=Yw.get(t);if(!e)return new t;const r=e.map(i=>this.resolveAny(i));return new t(...r)}resolveAny(t){return this.getOrCreateEntry(t).proxy}getOrCreateEntry(t){let e=this.entries.get(t);return e||(e={key:t},e.proxy=this.createProxy(e),this.entries.set(t,e),e)}createProxy(t){return new Proxy({},{get:(e,r)=>{if(r==="then")return;const i=this.getInstance(t),o=Reflect.get(i,r,i);return typeof o=="function"?o.bind(i):o},set:(e,r,i)=>{const o=this.getInstance(t);return Reflect.set(o,r,i,o)},has:(e,r)=>{const i=this.getInstance(t);return r in i}})}getInstance(t){if(t.instance)return t.instance;if(t.error)throw t.error;if(!t.factory)throw new Error(`${pa(t.key)} was resolved but never registered`);const e=this.constructionStack.indexOf(t.key);if(e!==-1){const r=[...this.constructionStack.slice(e),t.key].map(i=>pa(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if(DE(r))throw new Error(`Factory for ${pa(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${pa(t.key)} returned a non-object value. Wrap primitives in an object.`);return t.instance=r,r}catch(r){throw t.error=r,r}finally{this.constructionStack.pop()}}}const m8=new OE,ME=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function NE(n){for(const t of Object.keys(n))if(ME.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function zE(n,t){NE(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Rn(){class n extends Event{constructor(e,r){const{type:i,bubbles:o,cancelable:a,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(e,{bubbles:o,cancelable:a,composed:l}),zE(this,c)}}return n}class Ti extends globalThis.EventTarget{}const HE="X-Television-Client-Meta",ZE="telemetry-activity",UE="telemetry-signal",g8={kind:"single",full_screen:!1},v8={width:560,height:740};function FE(n){return n.layout.flatMap(t=>t.artifactIds)}function qE(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const t=[];for(const[e,r]of n.entries())VE(r,e,t);return{valid:t.length===0,errors:t}}function Vc(n){return n.flatMap(t=>t.artifactIds)}function zm(n,t){return n.flatMap(e=>{if(!e.artifactIds.includes(t))return[e];const r=e.artifactIds.filter(i=>i!==t);return r.length===0?[]:[{...e,artifactIds:r}]})}function VE(n,t,e){if(!gm(n)){e.push(`Page ${t} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&e.push(`Page ${t} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?e.push(`Page ${t} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&e.push(`Page ${t} artifact ids must be non-empty strings`),!gm(n.geometry)){e.push(`Page ${t} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&e.push(`Page ${t} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){e.push(`Page ${t} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&e.push(`Page ${t} single geometry must include a boolean full_screen`),!gm(n.size)){e.push(`Page ${t} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&e.push(`Page ${t} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&e.push(`Page ${t} size ${r} must be a finite positive number`)}}function gm(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const Bt=Rn(),Fh=Rn(),Jw=Rn(),BE=Rn(),WE=Rn(),jE=Rn();function y8(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const jl=y8("RequestError"),Xw=y8("ValidationError"),GE=200,YE=300,Ch=401;class KE{constructor(t,e){I(this,"serverURL");I(this,"token");I(this,"onUnauthorized");I(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){var a;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),o=await JE(i);if(!i.ok||i.status<GE||i.status>=YE)throw i.status===Ch&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof o.error=="string"?o.error:i.statusText,i.status);return o}async requestVoid(t,e,r){var o;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await vm(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===Ch&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await vm(r,r.statusText),r.status);return r.text()}async requestRawVoid(t,e,r){var o;const i=await this.request(t,e,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Ch&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await vm(i,i.statusText),i.status)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new jl(t,r)}async request(t,e,r,i){const o=`${this.serverURL}${e}`;try{return await fetch(o,{method:t,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[HE]=JSON.stringify(this.telemetryMeta)),Object.keys(e).length>0?e:void 0}}async function JE(n){try{return await n.json()}catch{const t=await n.text().catch(()=>"");return t?{message:t}:{}}}async function vm(n,t){try{const e=await n.json();if(typeof e.error=="string")return e.error;if(typeof e.message=="string")return e.message}catch{}return t}function XE(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var Vr,zd,w8;class QE{constructor(t){m(this,zd);m(this,Vr);d(this,Vr,t)}list(){return s(this,Vr).requestJSON("GET","/channels")}async get(t={}){const e=await h(this,zd,w8).call(this,t.channelID);return s(this,Vr).requestJSON("GET",`/channels/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),s(this,Vr).requestJSON("POST","/channels",e)}update(t){const{channelID:e,...r}=t;return s(this,Vr).requestJSON("PATCH",`/channels/${encodeURIComponent(e)}`,r)}remove(t){return s(this,Vr).requestJSON("DELETE",`/channels/${encodeURIComponent(t.channelID)}`)}}Vr=new WeakMap,zd=new WeakSet,w8=async function(t){if(t!==void 0)return t;const{channels:e}=await this.list();if(e.length===1)return e[0].id;throw e.length===0?new Xw("channelID is required, but no channels exist."):new Xw(`channelID is required when multiple channels exist. Available channels: ${XE(e)}`)};var Br;class ek{constructor(t){m(this,Br);d(this,Br,t)}create(t){const e={kind:t.kind,title:t.title};switch(t.kind){case"path":e.path=t.path;break;case"url":e.url=t.url;break}return e.channelID=t.channelID,s(this,Br).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.channelID!==void 0&&e.set("channelID",t.channelID);const r=e.toString();return s(this,Br).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return s(this,Br).requestJSON("GET",`/artifacts/${encodeURIComponent(t.artifactID)}`)}update(t){const e={};return t.title!==void 0&&(e.title=t.title),t.path!==void 0&&(e.path=t.path),t.url!==void 0&&(e.url=t.url),s(this,Br).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return s(this,Br).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}}Br=new WeakMap;var Ma;class tk{constructor(t){m(this,Ma);d(this,Ma,t)}list(){return s(this,Ma).requestJSON("GET","/themes")}refresh(){return s(this,Ma).requestJSON("POST","/themes/refresh")}}Ma=new WeakMap;var Na;class nk{constructor(t){m(this,Na);d(this,Na,t)}get(t){return s(this,Na).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return s(this,Na).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}Na=new WeakMap;var no;class rk{constructor(t){m(this,no);d(this,no,t)}status(){return s(this,no).requestJSON("GET","/telemetry")}enable(){return s(this,no).requestJSON("POST","/telemetry/enable")}disable(){return s(this,no).requestJSON("POST","/telemetry/disable")}}no=new WeakMap;var ro;class ik{constructor(t){m(this,ro);d(this,ro,t)}get(){return s(this,ro).requestJSON("GET","/display")}patch(t){const e={};return t.focusedChannelId!==void 0&&(e.focusedChannelId=t.focusedChannelId),t.pinnedChannelIds!==void 0&&(e.pinnedChannelIds=t.pinnedChannelIds),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),t.appearanceMode!==void 0&&(e.appearanceMode=t.appearanceMode),t.themeJavaScriptConsentIds!==void 0&&(e.themeJavaScriptConsentIds=t.themeJavaScriptConsentIds),s(this,ro).requestVoid("PATCH","/display",e)}focus(t){return s(this,ro).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}ro=new WeakMap;var pn;class sk{constructor(t,e={}){I(this,"channels");I(this,"artifacts");I(this,"display");I(this,"themes");I(this,"markdown");I(this,"telemetry");m(this,pn);d(this,pn,new KE(t,e)),this.channels=new QE(s(this,pn)),this.artifacts=new ek(s(this,pn)),this.display=new ik(s(this,pn)),this.themes=new tk(s(this,pn)),this.markdown=new nk(s(this,pn)),this.telemetry=new rk(s(this,pn))}health(){return s(this,pn).requestJSON("GET","/health")}demoMode(){return s(this,pn).requestJSON("GET","/demo-mode")}}pn=new WeakMap;const bd="0.0.0",ok=/^\d+\.\d+\.\d+$/,ak=3;function Op(n){return ok.test(n)}function Z1(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<ak;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function lk(n,t){return n===bd||t===bd?!1:n!==t}const ck=400,uk=404,b8=500,hk=600,dk={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ue,Jc,Xc,Wr,Je,_e,io,qi,so,jr,Jt,za,Qc,U,ir,Hm,ma,S8,Zm,_8,qh,Um,A8,ga,E8,Ur,Fm,k8,Ke;class pk extends Ti{constructor(e){super();m(this,U);m(this,ue);m(this,Jc);m(this,Xc);m(this,Wr,new Set);I(this,"pendingPageWrites",new Map);m(this,Je,new Map);m(this,_e,gk());m(this,io);m(this,qi,!1);m(this,so,!1);m(this,jr,0);m(this,Jt,!1);m(this,za,()=>{if(s(this,Jt))return;const e=s(this,ue).connection.status==="connected";e&&!s(this,so)?(d(this,so,!0),h(this,U,E8).call(this)):!e&&s(this,so)&&(d(this,so,!1),d(this,jr,s(this,jr)+1)),h(this,U,Ur).call(this)});m(this,Qc,e=>{if(s(this,Jt)||e.serverURL!==s(this,ue).connection.url)return;for(const i of s(this,Wr))i.push(e.event);const r=e.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Jw("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){s(this,qi)&&Sd(s(this,_e),s(this,Je),r.channelID,r.artifactID)&&h(this,U,Ur).call(this),this.dispatchEvent(new BE("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new WE("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new jE("appearance-changed",{appearanceMode:r.appearanceMode})),s(this,qi)&&(Rh(s(this,_e),r,this.pendingPageWrites,s(this,Je)),ym(s(this,_e),s(this,Je)),h(this,U,Ur).call(this))});d(this,ue,e.connectionOwner),d(this,Jc,e.navigationKeyHandler),d(this,Xc,e.retainedGateHalted??(()=>!1)),d(this,io,h(this,U,Fm).call(this)),s(this,ue).addEventListener("change",s(this,za)),s(this,ue).addEventListener("server-event",s(this,Qc)),s(this,za).call(this)}get snapshot(){return s(this,io)}handleNavigationKey(e){var r;h(this,U,Ke).call(this),(r=s(this,Jc))==null||r.call(this,e)}authenticate(e){return h(this,U,Ke).call(this),s(this,ue).authenticate(e)}async createChannel(e){h(this,U,Ke).call(this);const{channel:r}=await h(this,U,ir).call(this,s(this,ue).connection.client.channels.create({name:e}),()=>h(this,U,S8).call(this));return r}focusChannel(e){return h(this,U,Ke).call(this),h(this,U,ir).call(this,s(this,ue).connection.client.display.patch({focusedChannelId:e}),()=>h(this,U,ma).call(this))}setPinnedChannelIds(e){return h(this,U,Ke).call(this),h(this,U,ir).call(this,s(this,ue).connection.client.display.patch({pinnedChannelIds:[...e]}),()=>h(this,U,ma).call(this))}listThemes(){return h(this,U,Ke).call(this),s(this,ue).connection.client.themes.list()}refreshThemes(){return h(this,U,Ke).call(this),s(this,ue).connection.client.themes.refresh()}setActiveTheme(e){return h(this,U,Ke).call(this),h(this,U,ir).call(this,s(this,ue).connection.client.display.patch({activeThemeName:e}),()=>h(this,U,ma).call(this))}setAppearanceMode(e){return h(this,U,Ke).call(this),h(this,U,ir).call(this,s(this,ue).connection.client.display.patch({appearanceMode:e}),()=>h(this,U,ma).call(this))}setThemeJavaScriptConsent(e,r){h(this,U,Ke).call(this);const i=s(this,_e).display.themeJavaScriptConsentIds,o=r?i.includes(e)?[...i]:[...i,e]:i.filter(a=>a!==e);return h(this,U,ir).call(this,s(this,ue).connection.client.display.patch({themeJavaScriptConsentIds:o}),()=>h(this,U,ma).call(this))}selectPage(e,r){h(this,U,Ke).call(this),Sd(s(this,_e),s(this,Je),e,r)&&h(this,U,Ur).call(this)}async renameChannel(e,r){h(this,U,Ke).call(this),await h(this,U,ir).call(this,s(this,ue).connection.client.channels.update({channelID:e,name:r}),()=>h(this,U,Zm).call(this,e))}async deleteChannel(e){h(this,U,Ke).call(this),await h(this,U,ir).call(this,s(this,ue).connection.client.channels.remove({channelID:e}),()=>h(this,U,_8).call(this,e))}updateChannelPages(e,r){h(this,U,Ke).call(this);const i=qE(r),o=s(this,_e).channels.get(e);if(!i.valid||!o)return Promise.resolve();const a=Xs(r),l=Xs(o.channel.layout),c={previousPages:l};return Xo(s(this,Je),e,l,a),o.channel={...o.channel,layout:a},this.pendingPageWrites.set(e,c),h(this,U,Ur).call(this),s(this,ue).connection.client.channels.update({channelID:e,layout:Xs(a)}).then(()=>{this.pendingPageWrites.get(e)===c&&this.pendingPageWrites.delete(e)},async u=>{if(s(this,Jt))throw u;const p=this.pendingPageWrites.get(e)===c;if(p&&this.pendingPageWrites.delete(e),e2(u))throw await h(this,U,Hm).call(this,()=>h(this,U,Zm).call(this,e)),u;if(!p||!Sk(u))throw u;const f=s(this,_e).channels.get(e);if(!f)throw u;const y=Xs(c.previousPages);throw Xo(s(this,Je),e,f.channel.layout,y),f.channel={...f.channel,layout:y},h(this,U,Ur).call(this),u})}async deleteArtifact(e){h(this,U,Ke).call(this);const r=t2(s(this,_e),e);await h(this,U,ir).call(this,s(this,ue).connection.client.artifacts.delete({artifactID:e}),()=>h(this,U,A8).call(this,e,r))}readMarkdown(e){return h(this,U,Ke).call(this),s(this,ue).connection.client.markdown.get({artifactID:e})}writeMarkdown(e,r){return h(this,U,Ke).call(this),s(this,ue).connection.client.markdown.update({artifactID:e,content:r})}get browserDemoMode(){return s(this,ue).connection.browserDemoMode}getArtifactViewURL(e){return h(this,U,Ke).call(this),s(this,ue).connection.getViewURL(e)}getArtifactContentURL(e){return h(this,U,Ke).call(this),s(this,ue).connection.getContentURL(e)}dispose(){s(this,Jt)||(d(this,Jt,!0),d(this,jr,s(this,jr)+1),s(this,Wr).clear(),this.pendingPageWrites.clear(),s(this,Je).clear(),s(this,ue).removeEventListener("change",s(this,za)),s(this,ue).removeEventListener("server-event",s(this,Qc)))}}ue=new WeakMap,Jc=new WeakMap,Xc=new WeakMap,Wr=new WeakMap,Je=new WeakMap,_e=new WeakMap,io=new WeakMap,qi=new WeakMap,so=new WeakMap,jr=new WeakMap,Jt=new WeakMap,za=new WeakMap,Qc=new WeakMap,U=new WeakSet,ir=async function(e,r){try{return await e}catch(i){throw!s(this,Jt)&&e2(i)&&await h(this,U,Hm).call(this,r),i}},Hm=async function(e){try{await e()}catch{}},ma=function(){const e=s(this,ue).connection.client;return h(this,U,ga).call(this,()=>e.display.get(),r=>h(this,U,qh).call(this,r))},S8=function(){const e=s(this,ue).connection.client;return h(this,U,ga).call(this,async()=>{const[{channels:r},i]=await Promise.all([e.channels.list(),e.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const o=new Set(r.map(({id:a})=>a));for(const a of s(this,_e).channels.keys())o.has(a)||(this.pendingPageWrites.delete(a),s(this,Je).delete(a),s(this,_e).channels.delete(a));for(const a of r)s(this,_e).channels.has(a.id)||s(this,_e).channels.set(a.id,{channel:Da(a),artifacts:new Map});h(this,U,qh).call(this,i)})},Zm=function(e){const r=s(this,ue).connection.client;return h(this,U,ga).call(this,()=>wm(()=>r.channels.get({channelID:e})),i=>h(this,U,Um).call(this,e,i))},_8=function(e){const r=s(this,ue).connection.client;return h(this,U,ga).call(this,async()=>{const[i,o]=await Promise.all([wm(()=>r.channels.get({channelID:e})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{h(this,U,Um).call(this,e,i),h(this,U,qh).call(this,o)})},qh=function(e){s(this,_e).display=Vm(e),s(this,ue).connection.acpClient.setEnabled(e.acpEnabled)},Um=function(e,r){this.pendingPageWrites.delete(e);const i=s(this,_e).channels.get(e);if(r===null){s(this,Je).delete(e),s(this,_e).channels.delete(e);return}Xo(s(this,Je),e,(i==null?void 0:i.channel.layout)??[],r.channel.layout),s(this,_e).channels.set(e,{channel:Da(r.channel),artifacts:new Map(r.artifacts.map(o=>[o.id,structuredClone(o)]))})},A8=function(e,r){const i=s(this,ue).connection.client;return h(this,U,ga).call(this,()=>wm(()=>i.artifacts.get({artifactID:e})),o=>{const a=t2(s(this,_e),e)??r;if(o===null){a!==null&&Rh(s(this,_e),{type:"artifact-removed",channelID:a,artifactID:e},this.pendingPageWrites,s(this,Je));return}const l=a===null?void 0:s(this,_e).channels.get(a);l==null||l.artifacts.set(e,structuredClone(o.artifact))})},ga=async function(e,r){const i=s(this,jr),o=[];s(this,Wr).add(o);try{const a=await e();if(s(this,Jt)||i!==s(this,jr))return;r(a);for(const l of o)Rh(s(this,_e),l,this.pendingPageWrites,s(this,Je));ym(s(this,_e),s(this,Je)),h(this,U,Ur).call(this)}finally{s(this,Wr).delete(o)}},E8=async function(){const e=++kh(this,jr)._,r=s(this,ue).connection,i=r.client,o=[];s(this,Wr).add(o);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:f})=>i.channels.get({channelID:f})));if(s(this,Jt)||e!==s(this,jr))return;const u={channels:new Map,display:Vm(l)};for(const f of c)u.channels.set(f.channel.id,{channel:Da(f.channel),artifacts:new Map(f.artifacts.map(y=>[y.id,structuredClone(y)]))});vk(s(this,Je),s(this,_e),u);for(const f of o)Rh(u,f,this.pendingPageWrites,s(this,Je));ym(u,s(this,Je));const p=s(this,qi)?fk(s(this,_e),u):[];this.pendingPageWrites.clear(),d(this,_e,u),d(this,qi,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,U,Ur).call(this);for(const f of p)this.dispatchEvent(new Jw("artifact-content-changed",{artifactID:f}))}catch{}finally{s(this,Wr).delete(o)}},Ur=function(){s(this,Jt)||(d(this,io,h(this,U,Fm).call(this)),h(this,U,k8).call(this),this.dispatchEvent(new Bt("change")))},Fm=function(){var o;const e=[...s(this,_e).channels.values()].map(a=>wk(a,s(this,Je).get(a.channel.id))),r=e.find(({id:a})=>a===s(this,_e).display.focusedChannelId)??null,i=s(this,ue).connection;return Object.freeze({ready:s(this,qi),channels:Object.freeze(e),display:bk(s(this,_e).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||s(this,Xc).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:s(this,ue).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:mk(((o=i.updateState)==null?void 0:o.desktop)??null)})})},k8=function(){const e=s(this,io).focusedChannel;s(this,ue).connection.acpClient.setChannelContext(e?{channelID:e.id,channelName:e.name}:null)},Ke=function(){if(s(this,Jt))throw new Error("ApplicationService is disposed")};function fk(n,t){const e=t.display.focusedChannelId;if(e===null||n.display.focusedChannelId!==e)return[];const r=n.channels.get(e),i=t.channels.get(e);if(!r||!i)return[];const o=new Set(Vc(r.channel.layout));return Vc(i.channel.layout).filter(a=>{var l,c;return o.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function mk(n){return n===null?null:Object.freeze({...n})}function gk(){return{channels:new Map,display:Vm(dk)}}function Rh(n,t,e,r){switch(t.type){case"channel-created":r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:Da(t.channel),artifacts:new Map});return;case"channel-updated":{e.delete(t.channel.id);const i=n.channels.get(t.channel.id);if(!i){r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:Da(t.channel),artifacts:new Map});return}Xo(r,t.channel.id,i.channel.layout,t.channel.layout);const o=new Set(Vc(t.channel.layout));i.channel=Da(t.channel);for(const a of i.artifacts.keys())o.has(a)||i.artifacts.delete(a);return}case"channel-removed":e.delete(t.channelID),r.delete(t.channelID),n.channels.delete(t.channelID);return;case"channel-changed":n.display.focusedChannelId=t.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...t.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=t.themeName,n.display.activeThemeColorScheme=t.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...t.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=t.appearanceMode;return;case"artifact-created":{const i=n.channels.get(t.channelID);if(!i)return;const o=e.get(t.channelID);if(o&&(o.previousPages=Qw(o.previousPages,t.artifact.id)),!Vc(i.channel.layout).includes(t.artifact.id)){const a=i.channel.layout,l=Qw(a,t.artifact.id);Xo(r,t.channelID,a,l),i.channel={...i.channel,layout:l}}i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(t.artifact.id)){i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}return;case"artifact-removed":{const i=n.channels.get(t.channelID);if(!i)return;const o=e.get(t.channelID);o&&(o.previousPages=zm(o.previousPages,t.artifactID)),i.artifacts.delete(t.artifactID);const a=i.channel.layout,l=zm(a,t.artifactID);Xo(r,t.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Sd(n,r,t.channelID,t.artifactID);return;case"artifact-content-changed":return;default:return _k(t)}}function vk(n,t,e){var r;for(const i of n.keys())e.channels.has(i)||n.delete(i);for(const[i,o]of e.channels)Xo(n,i,((r=t.channels.get(i))==null?void 0:r.channel.layout)??[],o.channel.layout)}function Xo(n,t,e,r){const i=n.get(t);if(i===void 0)return;if(r.length===0){n.delete(t);return}const o=qm(r,i);if(o!==-1){n.set(t,[...r[o].artifactIds]);return}const a=qm(e,i),l=a===-1?0:Math.min(a,r.length-1);n.set(t,[...r[l].artifactIds])}function Sd(n,t,e,r){const i=n.channels.get(e),o=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!o)return!1;const a=t.get(e);return a&&yk(a,o.artifactIds)?!1:(t.set(e,[...o.artifactIds]),!0)}function ym(n,t){var i,o;const e=n.display.focusedChannelId;if(e===null||t.has(e))return;const r=(o=(i=n.channels.get(e))==null?void 0:i.channel.layout[0])==null?void 0:o.artifactIds[0];r!==void 0&&Sd(n,t,e,r)}function qm(n,t){const e=new Set(t);return n.findIndex(r=>r.artifactIds.some(i=>e.has(i)))}function yk(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function wk(n,t){const e=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=t===void 0?0:qm(n.channel.layout,t),i=e[r]??e[0]??null,o=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:e,selectedPage:i,artifacts:o};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function bk(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function Qw(n,t){return Vc(n).includes(t)?Xs(n):[...Xs(n),{artifactIds:[t],geometry:{...g8},size:{...v8}}]}function Sk(n){return n instanceof jl&&n.status!==void 0&&n.status>=ck&&n.status<b8}function e2(n){return n instanceof jl&&(n.status===void 0||n.status>=b8&&n.status<hk)}async function wm(n){try{return await n()}catch(t){if(t instanceof jl&&t.status===uk)return null;throw t}}function t2(n,t){for(const[e,r]of n.channels)if(r.artifacts.has(t))return e;return null}function Xs(n){return n.map(t=>({artifactIds:[...t.artifactIds],geometry:{...t.geometry},size:{...t.size}}))}function Da(n){return{id:n.id,name:n.name,layout:Xs(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function Vm(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function _k(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function Ak(n,t){var c;const e=n.snapshot,r=e.focusedChannel;if(t==="ArrowLeft"||t==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),p=u+(t==="ArrowLeft"?-1:1),f=(c=r.pages[p])==null?void 0:c.artifactIds[0];return u===-1||f===void 0?!1:(n2(),n.selectPage(r.id,f),!0)}const i=Ek(e),o=r===null?-1:i.indexOf(r.id),a=o+(t==="ArrowUp"?-1:1),l=i[a];return o===-1||l===void 0?!1:(n2(),n.focusChannel(l).catch(()=>{}),!0)}function Ek(n){const t=new Map(n.channels.map(o=>[o.id,o])),e=n.display.pinnedChannelIds.filter(o=>t.has(o)),r=new Set(e),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return[...e,...i]}function n2(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const T8="0123456789ABCDEFGHJKMNPQRSTVWXYZ",_d=32,kk=16,C8=10,r2=0xffffffffffff;var Qs;(function(n){n.Base32IncorrectEncoding="B32_ENC_INVALID",n.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",n.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",n.EncodeTimeNegative="ENC_TIME_NEG",n.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",n.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",n.PRNGDetectFailure="PRNG_DETECT",n.ULIDInvalid="ULID_INVALID",n.Unexpected="UNEXPECTED",n.UUIDInvalid="UUID_INVALID"})(Qs||(Qs={}));class bc extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function Tk(n){const t=Math.floor(n()*_d)%_d;return T8.charAt(t)}function Ck(n){const t=Rk(),e=t&&(t.crypto||t.msCrypto)||null;if(typeof(e==null?void 0:e.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]/256};if(typeof(e==null?void 0:e.randomBytes)=="function")return()=>e.randomBytes(1).readUInt8()/256;throw new bc(Qs.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Rk(){return xk()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Ik(n,t){let e="";for(;n>0;n--)e=Tk(t)+e;return e}function $k(n,t=C8){if(isNaN(n))throw new bc(Qs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>r2)throw new bc(Qs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${r2}: ${n}`);if(n<0)throw new bc(Qs.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new bc(Qs.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%_d,r=T8.charAt(e)+r,n=(n-e)/_d;return r}function xk(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function U1(n,t){const e=Ck(),r=Date.now();return $k(r,C8)+Ik(kk,e)}const Sc=Rn(),R8=Rn(),I8=Rn(),Pk=Rn(),bm=Rn(),Dk="store-";function Es(n){return new URL(n).origin}function Lk(){return{authTokens:{}}}var oo,ao,lo;class Ok extends Ti{constructor(e,r,i={}){super();m(this,oo);m(this,ao);m(this,lo);d(this,oo,`${Dk}${e}`),d(this,ao,i.storage??Nk());const o=s(this,ao).getItem(s(this,oo));o===null?(d(this,lo,r),s(this,ao).setItem(s(this,oo),JSON.stringify(r))):d(this,lo,zk(JSON.parse(o),r))}get(){return s(this,lo)}set(e){d(this,lo,e),s(this,ao).setItem(s(this,oo),JSON.stringify(e)),this.dispatchEvent(new Bt("change"))}}oo=new WeakMap,ao=new WeakMap,lo=new WeakMap;function i2(n,t){return n.authTokens[Es(t)]??null}function s2(n,t,e){return{authTokens:{...n.authTokens,[Es(t)]:e}}}function Mk(n,t){const e=Es(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{authTokens:r}}function Nk(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function zk(n,t){if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n.authTokens;if(typeof e!="object"||e===null||Array.isArray(e))return t;const r={};for(const[i,o]of Object.entries(e))if(typeof o=="string")try{r[Es(i)]=o}catch{}return{authTokens:r}}function R(n,t,e){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),t(l,c);const u=a.prototype,p=Object.keys(u);for(let f=0;f<p.length;f++){const y=p[f];y in l||(l[y]=u[y].bind(l))}}const i=(e==null?void 0:e.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:n});function a(l){var c;const u=e!=null&&e.Parent?new o:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,u;return e!=null&&e.Parent&&l instanceof e.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class La extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $8 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const x8={};function ks(n){return x8}function P8(n){const t=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Bm(n,t){return typeof t=="bigint"?t.toString():t}function Mp(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function F1(n){return n==null}function q1(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function Hk(n,t){const e=(n.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const o=e>i?e:i,a=Number.parseInt(n.toFixed(o).replace(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return a%l/10**o}const o2=Symbol("evaluating");function Ae(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==o2)return r===void 0&&(r=o2,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function ra(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function $s(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function a2(n){return JSON.stringify(n)}function Zk(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const D8="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Bc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const Uk=Mp(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ml(n){if(Bc(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(Bc(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function L8(n){return Ml(n)?{...n}:Array.isArray(n)?[...n]:n}const Fk=new Set(["string","number","symbol"]);function Nl(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xs(n,t,e){const r=new n._zod.constr(t??n._zod.def);return(!t||e!=null&&e.parent)&&(r._zod.parent=n),r}function K(n){const t=n;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function qk(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const Vk={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Bk(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=$s(n._zod.def,{get shape(){const a={};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=e.shape[l])}return ra(this,"shape",a),a},checks:[]});return xs(n,o)}function Wk(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=$s(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return ra(this,"shape",a),a},checks:[]});return xs(n,o)}function jk(n,t){if(!Ml(t))throw new Error("Invalid input to extend: expected a plain object");const e=n._zod.def.checks;if(e&&e.length>0){const o=n._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=$s(n._zod.def,{get shape(){const o={...n._zod.def.shape,...t};return ra(this,"shape",o),o}});return xs(n,i)}function Gk(n,t){if(!Ml(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=$s(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return ra(this,"shape",r),r}});return xs(n,e)}function Yk(n,t){const e=$s(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return ra(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return xs(n,e)}function Kk(n,t,e){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=$s(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(e)for(const u in e){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return ra(this,"shape",c),c},checks:[]});return xs(t,a)}function Jk(n,t,e){const r=$s(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(e)for(const a in e){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new n({type:"nonoptional",innerType:i[a]});return ra(this,"shape",o),o}});return xs(t,r)}function $a(n,t=0){var e;if(n.aborted===!0)return!0;for(let r=t;r<n.issues.length;r++)if(((e=n.issues[r])==null?void 0:e.continue)!==!0)return!0;return!1}function xa(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function Ih(n){return typeof n=="string"?n:n==null?void 0:n.message}function Ts(n,t,e){var i,o,a,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const p=Ih((a=(o=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,n))??Ih((l=t==null?void 0:t.error)==null?void 0:l.call(t,n))??Ih((c=e.customError)==null?void 0:c.call(e,n))??Ih((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=p}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function V1(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Wc(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const O8=(n,t)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:t,enumerable:!1}),n.message=JSON.stringify(t,Bm,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},M8=R("$ZodError",O8),N8=R("$ZodError",O8,{Parent:Error});function Xk(n,t=e=>e.message){const e={},r=[];for(const i of n.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}function Qk(n,t=e=>e.message){const e={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)e._errors.push(t(o));else{let a=e,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),e}const B1=n=>(t,e,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:e,issues:[]},o);if(a instanceof Promise)throw new La;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>Ts(c,o,ks())));throw D8(l,i==null?void 0:i.callee),l}return a.value},W1=n=>async(t,e,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:e,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>Ts(c,o,ks())));throw D8(l,i==null?void 0:i.callee),l}return a.value},Np=n=>(t,e,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:e,issues:[]},i);if(o instanceof Promise)throw new La;return o.issues.length?{success:!1,error:new(n??M8)(o.issues.map(a=>Ts(a,i,ks())))}:{success:!0,data:o.value}},eT=Np(N8),zp=n=>async(t,e,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:e,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(a=>Ts(a,i,ks())))}:{success:!0,data:o.value}},tT=zp(N8),nT=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return B1(n)(t,e,i)},rT=n=>(t,e,r)=>B1(n)(t,e,r),iT=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return W1(n)(t,e,i)},sT=n=>async(t,e,r)=>W1(n)(t,e,r),oT=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Np(n)(t,e,i)},aT=n=>(t,e,r)=>Np(n)(t,e,r),lT=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(t,e,i)},cT=n=>async(t,e,r)=>zp(n)(t,e,r),uT=/^[cC][^\s-]{8,}$/,hT=/^[0-9a-z]+$/,dT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pT=/^[0-9a-vA-V]{20}$/,fT=/^[A-Za-z0-9]{27}$/,mT=/^[a-zA-Z0-9_-]{21}$/,gT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l2=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,yT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function bT(){return new RegExp(wT,"u")}const ST=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_T=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,AT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ET=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,z8=/^[A-Za-z0-9_-]*$/,TT=/^\+[1-9]\d{6,14}$/,H8="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",CT=new RegExp(`^${H8}$`);function Z8(n){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${t}`:n.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${n.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function RT(n){return new RegExp(`^${Z8(n)}$`)}function IT(n){const t=Z8({precision:n.precision}),e=["Z"];n.local&&e.push(""),n.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${e.join("|")})`;return new RegExp(`^${H8}T(?:${r})$`)}const $T=n=>{const t=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xT=/^-?\d+$/,U8=/^-?\d+(?:\.\d+)?$/,PT=/^(?:true|false)$/i,DT=/^[^A-Z]*$/,LT=/^[^a-z]*$/,Wt=R("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),F8={number:"number",bigint:"bigint",object:"date"},q8=R("$ZodCheckLessThan",(n,t)=>{Wt.init(n,t);const e=F8[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:e,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),V8=R("$ZodCheckGreaterThan",(n,t)=>{Wt.init(n,t);const e=F8[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:e,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),OT=R("$ZodCheckMultipleOf",(n,t)=>{Wt.init(n,t),n._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),n._zod.check=e=>{if(typeof e.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof e.value=="bigint"?e.value%t.value===BigInt(0):Hk(e.value,t.value)===0)||e.issues.push({origin:typeof e.value,code:"not_multiple_of",divisor:t.value,input:e.value,inst:n,continue:!t.abort})}}),MT=R("$ZodCheckNumberFormat",(n,t)=>{var a;Wt.init(n,t),t.format=t.format||"float64";const e=(a=t.format)==null?void 0:a.includes("int"),r=e?"int":"number",[i,o]=Vk[t.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=o,e&&(c.pattern=xT)}),n._zod.check=l=>{const c=l.value;if(e){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!t.abort})}}),NT=R("$ZodCheckMaxLength",(n,t)=>{var e;Wt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!F1(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=V1(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),zT=R("$ZodCheckMinLength",(n,t)=>{var e;Wt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!F1(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=V1(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),HT=R("$ZodCheckLengthEquals",(n,t)=>{var e;Wt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!F1(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),n._zod.check=r=>{const i=r.value,o=i.length;if(o===t.length)return;const a=V1(i),l=o>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),Hp=R("$ZodCheckStringFormat",(n,t)=>{var e,r;Wt.init(n,t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(e=n._zod).check??(e.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:n,continue:!t.abort})}):(r=n._zod).check??(r.check=()=>{})}),ZT=R("$ZodCheckRegex",(n,t)=>{Hp.init(n,t),n._zod.check=e=>{t.pattern.lastIndex=0,!t.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:"regex",input:e.value,pattern:t.pattern.toString(),inst:n,continue:!t.abort})}}),UT=R("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=DT),Hp.init(n,t)}),FT=R("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=LT),Hp.init(n,t)}),qT=R("$ZodCheckIncludes",(n,t)=>{Wt.init(n,t);const e=Nl(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${e}`:e);t.pattern=r,n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),n._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:n,continue:!t.abort})}}),VT=R("$ZodCheckStartsWith",(n,t)=>{Wt.init(n,t);const e=new RegExp(`^${Nl(t.prefix)}.*`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:n,continue:!t.abort})}}),BT=R("$ZodCheckEndsWith",(n,t)=>{Wt.init(n,t);const e=new RegExp(`.*${Nl(t.suffix)}$`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:n,continue:!t.abort})}}),WT=R("$ZodCheckOverwrite",(n,t)=>{Wt.init(n,t),n._zod.check=e=>{e.value=t.tx(e.value)}});class jT{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
5
|
-
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,e=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...e,i.join(`
|
|
6
|
-
`))}}const GT={major:4,minor:3,patch:6},Ue=R("$ZodType",(n,t)=>{var i;var e;n??(n={}),n._zod.def=t,n._zod.bag=n._zod.bag||{},n._zod.version=GT;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const o of r)for(const a of o._zod.onattach)a(n);if(r.length===0)(e=n._zod).deferred??(e.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const o=(l,c,u)=>{let p=$a(l),f;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(p)continue;const v=l.issues.length,S=y._zod.check(l);if(S instanceof Promise&&(u==null?void 0:u.async)===!1)throw new La;if(f||S instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await S,l.issues.length!==v&&(p||(p=$a(l,v)))});else{if(l.issues.length===v)continue;p||(p=$a(l,v))}}return f?f.then(()=>l):l},a=(l,c,u)=>{if($a(l))return l.aborted=!0,l;const p=o(c,r,u);if(p instanceof Promise){if(u.async===!1)throw new La;return p.then(f=>n._zod.parse(f,u))}return n._zod.parse(p,u)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const p=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return p instanceof Promise?p.then(f=>a(f,l,c)):a(p,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new La;return u.then(p=>o(p,r,c))}return o(u,r,c)}}Ae(n,"~standard",()=>({validate:o=>{var a;try{const l=eT(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return tT(n,o).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),j1=R("$ZodString",(n,t)=>{var e;Ue.init(n,t),n._zod.pattern=[...((e=n==null?void 0:n._zod.bag)==null?void 0:e.patterns)??[]].pop()??$T(n._zod.bag),n._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),Me=R("$ZodStringFormat",(n,t)=>{Hp.init(n,t),j1.init(n,t)}),YT=R("$ZodGUID",(n,t)=>{t.pattern??(t.pattern=vT),Me.init(n,t)}),KT=R("$ZodUUID",(n,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=l2(r))}else t.pattern??(t.pattern=l2());Me.init(n,t)}),JT=R("$ZodEmail",(n,t)=>{t.pattern??(t.pattern=yT),Me.init(n,t)}),XT=R("$ZodURL",(n,t)=>{Me.init(n,t),n._zod.check=e=>{try{const r=e.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:e.value,inst:n,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:e.value,inst:n,continue:!t.abort})),t.normalize?e.value=i.href:e.value=r;return}catch{e.issues.push({code:"invalid_format",format:"url",input:e.value,inst:n,continue:!t.abort})}}}),QT=R("$ZodEmoji",(n,t)=>{t.pattern??(t.pattern=bT()),Me.init(n,t)}),eC=R("$ZodNanoID",(n,t)=>{t.pattern??(t.pattern=mT),Me.init(n,t)}),tC=R("$ZodCUID",(n,t)=>{t.pattern??(t.pattern=uT),Me.init(n,t)}),nC=R("$ZodCUID2",(n,t)=>{t.pattern??(t.pattern=hT),Me.init(n,t)}),rC=R("$ZodULID",(n,t)=>{t.pattern??(t.pattern=dT),Me.init(n,t)}),iC=R("$ZodXID",(n,t)=>{t.pattern??(t.pattern=pT),Me.init(n,t)}),sC=R("$ZodKSUID",(n,t)=>{t.pattern??(t.pattern=fT),Me.init(n,t)}),oC=R("$ZodISODateTime",(n,t)=>{t.pattern??(t.pattern=IT(t)),Me.init(n,t)}),aC=R("$ZodISODate",(n,t)=>{t.pattern??(t.pattern=CT),Me.init(n,t)}),lC=R("$ZodISOTime",(n,t)=>{t.pattern??(t.pattern=RT(t)),Me.init(n,t)}),cC=R("$ZodISODuration",(n,t)=>{t.pattern??(t.pattern=gT),Me.init(n,t)}),uC=R("$ZodIPv4",(n,t)=>{t.pattern??(t.pattern=ST),Me.init(n,t),n._zod.bag.format="ipv4"}),hC=R("$ZodIPv6",(n,t)=>{t.pattern??(t.pattern=_T),Me.init(n,t),n._zod.bag.format="ipv6",n._zod.check=e=>{try{new URL(`http://[${e.value}]`)}catch{e.issues.push({code:"invalid_format",format:"ipv6",input:e.value,inst:n,continue:!t.abort})}}}),dC=R("$ZodCIDRv4",(n,t)=>{t.pattern??(t.pattern=AT),Me.init(n,t)}),pC=R("$ZodCIDRv6",(n,t)=>{t.pattern??(t.pattern=ET),Me.init(n,t),n._zod.check=e=>{const r=e.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{e.issues.push({code:"invalid_format",format:"cidrv6",input:e.value,inst:n,continue:!t.abort})}}});function B8(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const fC=R("$ZodBase64",(n,t)=>{t.pattern??(t.pattern=kT),Me.init(n,t),n._zod.bag.contentEncoding="base64",n._zod.check=e=>{B8(e.value)||e.issues.push({code:"invalid_format",format:"base64",input:e.value,inst:n,continue:!t.abort})}});function mC(n){if(!z8.test(n))return!1;const t=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),e=t.padEnd(Math.ceil(t.length/4)*4,"=");return B8(e)}const gC=R("$ZodBase64URL",(n,t)=>{t.pattern??(t.pattern=z8),Me.init(n,t),n._zod.bag.contentEncoding="base64url",n._zod.check=e=>{mC(e.value)||e.issues.push({code:"invalid_format",format:"base64url",input:e.value,inst:n,continue:!t.abort})}}),vC=R("$ZodE164",(n,t)=>{t.pattern??(t.pattern=TT),Me.init(n,t)});function yC(n,t=null){try{const e=n.split(".");if(e.length!==3)return!1;const[r]=e;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const wC=R("$ZodJWT",(n,t)=>{Me.init(n,t),n._zod.check=e=>{yC(e.value,t.alg)||e.issues.push({code:"invalid_format",format:"jwt",input:e.value,inst:n,continue:!t.abort})}}),W8=R("$ZodNumber",(n,t)=>{Ue.init(n,t),n._zod.pattern=n._zod.bag.pattern??U8,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=Number(e.value)}catch{}const i=e.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return e;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return e.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...o?{received:o}:{}}),e}}),bC=R("$ZodNumberFormat",(n,t)=>{MT.init(n,t),W8.init(n,t)}),SC=R("$ZodBoolean",(n,t)=>{Ue.init(n,t),n._zod.pattern=PT,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=!!e.value}catch{}const i=e.value;return typeof i=="boolean"||e.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),e}}),_C=R("$ZodUnknown",(n,t)=>{Ue.init(n,t),n._zod.parse=e=>e}),AC=R("$ZodNever",(n,t)=>{Ue.init(n,t),n._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:n}),e)});function c2(n,t,e){n.issues.length&&t.issues.push(...xa(e,n.issues)),t.value[e]=n.value}const EC=R("$ZodArray",(n,t)=>{Ue.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Array.isArray(i))return e.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),e;e.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const l=i[a],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?o.push(c.then(u=>c2(u,e,a))):c2(c,e,a)}return o.length?Promise.all(o).then(()=>e):e}});function Ad(n,t,e,r,i){if(n.issues.length){if(i&&!(e in r))return;t.issues.push(...xa(e,n.issues))}n.value===void 0?e in r&&(t.value[e]=void 0):t.value[e]=n.value}function j8(n){var r,i,o,a;const t=Object.keys(n.shape);for(const l of t)if(!((a=(o=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const e=qk(n.shape);return{...n,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(e)}}function G8(n,t,e,r,i,o){const a=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,p=c.optout==="optional";for(const f in t){if(l.has(f))continue;if(u==="never"){a.push(f);continue}const y=c.run({value:t[f],issues:[]},r);y instanceof Promise?n.push(y.then(v=>Ad(v,e,f,t,p))):Ad(y,e,f,t,p)}return a.length&&e.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),n.length?Promise.all(n).then(()=>e):e}const kC=R("$ZodObject",(n,t)=>{Ue.init(n,t);const e=Object.getOwnPropertyDescriptor(t,"shape");if(!(e!=null&&e.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Mp(()=>j8(t));Ae(n._zod,"propValues",()=>{const l=t.shape,c={};for(const u in l){const p=l[u]._zod;if(p.values){c[u]??(c[u]=new Set);for(const f of p.values)c[u].add(f)}}return c});const i=Bc,o=t.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const p=[],f=a.shape;for(const y of a.keys){const v=f[y],S=v._zod.optout==="optional",_=v._zod.run({value:u[y],issues:[]},c);_ instanceof Promise?p.push(_.then(x=>Ad(x,l,y,u,S))):Ad(_,l,y,u,S)}return o?G8(p,u,l,c,r.value,n):p.length?Promise.all(p).then(()=>l):l}}),TC=R("$ZodObjectJIT",(n,t)=>{kC.init(n,t);const e=n._zod.parse,r=Mp(()=>j8(t)),i=y=>{var z;const v=new jT(["shape","payload","ctx"]),S=r.value,_=P=>{const B=a2(P);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};v.write("const input = payload.value;");const x=Object.create(null);let Z=0;for(const P of S.keys)x[P]=`key_${Z++}`;v.write("const newResult = {};");for(const P of S.keys){const B=x[P],F=a2(P),q=y[P],Q=((z=q==null?void 0:q._zod)==null?void 0:z.optout)==="optional";v.write(`const ${B} = ${_(P)};`),Q?v.write(`
|
|
7
|
-
if (${B}.issues.length) {
|
|
8
|
-
if (${F} in input) {
|
|
9
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
10
|
-
...iss,
|
|
11
|
-
path: iss.path ? [${F}, ...iss.path] : [${F}]
|
|
12
|
-
})));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (${B}.value === undefined) {
|
|
17
|
-
if (${F} in input) {
|
|
18
|
-
newResult[${F}] = undefined;
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
newResult[${F}] = ${B}.value;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
`):v.write(`
|
|
25
|
-
if (${B}.issues.length) {
|
|
26
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
27
|
-
...iss,
|
|
28
|
-
path: iss.path ? [${F}, ...iss.path] : [${F}]
|
|
29
|
-
})));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (${B}.value === undefined) {
|
|
33
|
-
if (${F} in input) {
|
|
34
|
-
newResult[${F}] = undefined;
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
newResult[${F}] = ${B}.value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const L=v.compile();return(P,B)=>L(y,P,B)};let o;const a=Bc,l=!x8.jitless,u=l&&Uk.value,p=t.catchall;let f;n._zod.parse=(y,v)=>{f??(f=r.value);const S=y.value;return a(S)?l&&u&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(o||(o=i(t.shape)),y=o(y,v),p?G8([],S,y,v,f,n):y):e(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:S,inst:n}),y)}});function u2(n,t,e,r){for(const o of n)if(o.issues.length===0)return t.value=o.value,t;const i=n.filter(o=>!$a(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:e,errors:n.map(o=>o.issues.map(a=>Ts(a,r,ks())))}),t)}const Y8=R("$ZodUnion",(n,t)=>{Ue.init(n,t),Ae(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ae(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ae(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ae(n._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>q1(o.source)).join("|")})$`)}});const e=t.options.length===1,r=t.options[0]._zod.run;n._zod.parse=(i,o)=>{if(e)return r(i,o);let a=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>u2(c,i,n,o)):u2(l,i,n,o)}}),CC=R("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,Y8.init(n,t);const e=n._zod.parse;Ae(n._zod,"propValues",()=>{const i={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Mp(()=>{var a;const i=t.options,o=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,l)}}return o});n._zod.parse=(i,o)=>{const a=i.value;if(!Bc(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[t.discriminator]);return l?l._zod.run(i,o):t.unionFallback?e(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:n}),i)}}),RC=R("$ZodIntersection",(n,t)=>{Ue.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>h2(e,c,u)):h2(e,o,a)}});function Wm(n,t){if(n===t)return{valid:!0,data:n};if(n instanceof Date&&t instanceof Date&&+n==+t)return{valid:!0,data:n};if(Ml(n)&&Ml(t)){const e=Object.keys(t),r=Object.keys(n).filter(o=>e.indexOf(o)!==-1),i={...n,...t};for(const o of r){const a=Wm(n[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return{valid:!1,mergeErrorPath:[]};const e=[];for(let r=0;r<n.length;r++){const i=n[r],o=t[r],a=Wm(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};e.push(a.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function h2(n,t,e){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of e.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&n.issues.push({...i,keys:o}),$a(n))return n;const a=Wm(t.value,e.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const IC=R("$ZodRecord",(n,t)=>{Ue.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Ml(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const o=[],a=t.keyType._zod.values;if(a){e.value={};const l=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?o.push(p.then(f=>{f.issues.length&&e.issues.push(...xa(u,f.issues)),e.value[u]=f.value})):(p.issues.length&&e.issues.push(...xa(u,p.issues)),e.value[u]=p.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&e.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{e.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&U8.test(l)&&c.issues.length){const f=t.keyType._zod.run({value:Number(l),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?e.value[l]=i[l]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>Ts(f,r,ks())),input:l,path:[l],inst:n});continue}const p=t.valueType._zod.run({value:i[l],issues:[]},r);p instanceof Promise?o.push(p.then(f=>{f.issues.length&&e.issues.push(...xa(l,f.issues)),e.value[c.value]=f.value})):(p.issues.length&&e.issues.push(...xa(l,p.issues)),e.value[c.value]=p.value)}}return o.length?Promise.all(o).then(()=>e):e}}),$C=R("$ZodEnum",(n,t)=>{Ue.init(n,t);const e=P8(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>Fk.has(typeof i)).map(i=>typeof i=="string"?Nl(i):i.toString()).join("|")})$`),n._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:e,input:a,inst:n}),i}}),xC=R("$ZodLiteral",(n,t)=>{if(Ue.init(n,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const e=new Set(t.values);n._zod.values=e,n._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Nl(r):r?Nl(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const o=r.value;return e.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:n}),r}}),PC=R("$ZodTransform",(n,t)=>{Ue.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new $8(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(e.value=a,e));if(i instanceof Promise)throw new La;return e.value=i,e}});function d2(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const K8=R("$ZodOptional",(n,t)=>{Ue.init(n,t),n._zod.optin="optional",n._zod.optout="optional",Ae(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${q1(e.source)})?$`):void 0}),n._zod.parse=(e,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(o=>d2(o,e.value)):d2(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),DC=R("$ZodExactOptional",(n,t)=>{K8.init(n,t),Ae(n._zod,"values",()=>t.innerType._zod.values),Ae(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),LC=R("$ZodNullable",(n,t)=>{Ue.init(n,t),Ae(n._zod,"optin",()=>t.innerType._zod.optin),Ae(n._zod,"optout",()=>t.innerType._zod.optout),Ae(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${q1(e.source)}|null)$`):void 0}),Ae(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),n._zod.parse=(e,r)=>e.value===null?e:t.innerType._zod.run(e,r)}),OC=R("$ZodDefault",(n,t)=>{Ue.init(n,t),n._zod.optin="optional",Ae(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);if(e.value===void 0)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(o=>p2(o,t)):p2(i,t)}});function p2(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const MC=R("$ZodPrefault",(n,t)=>{Ue.init(n,t),n._zod.optin="optional",Ae(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>(r.direction==="backward"||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),NC=R("$ZodNonOptional",(n,t)=>{Ue.init(n,t),Ae(n._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(r=>r!==void 0)):void 0}),n._zod.parse=(e,r)=>{const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(o=>f2(o,n)):f2(i,n)}});function f2(n,t){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:t}),n}const zC=R("$ZodCatch",(n,t)=>{Ue.init(n,t),Ae(n._zod,"optin",()=>t.innerType._zod.optin),Ae(n._zod,"optout",()=>t.innerType._zod.optout),Ae(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(a=>Ts(a,r,ks()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(o=>Ts(o,r,ks()))},input:e.value}),e.issues=[]),e)}}),HC=R("$ZodPipe",(n,t)=>{Ue.init(n,t),Ae(n._zod,"values",()=>t.in._zod.values),Ae(n._zod,"optin",()=>t.in._zod.optin),Ae(n._zod,"optout",()=>t.out._zod.optout),Ae(n._zod,"propValues",()=>t.in._zod.propValues),n._zod.parse=(e,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(e,r);return o instanceof Promise?o.then(a=>$h(a,t.in,r)):$h(o,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(o=>$h(o,t.out,r)):$h(i,t.out,r)}});function $h(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const ZC=R("$ZodReadonly",(n,t)=>{Ue.init(n,t),Ae(n._zod,"propValues",()=>t.innerType._zod.propValues),Ae(n._zod,"values",()=>t.innerType._zod.values),Ae(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),Ae(n._zod,"optout",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optout}),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(m2):m2(i)}});function m2(n){return n.value=Object.freeze(n.value),n}const UC=R("$ZodCustom",(n,t)=>{Wt.init(n,t),Ue.init(n,t),n._zod.parse=(e,r)=>e,n._zod.check=e=>{const r=e.value,i=t.fn(r);if(i instanceof Promise)return i.then(o=>g2(o,e,r,n));g2(i,e,r,n)}});function g2(n,t,e,r){if(!n){const i={code:"custom",input:e,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Wc(i))}}var v2;class FC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qC(){return new FC}(v2=globalThis).__zod_globalRegistry??(v2.__zod_globalRegistry=qC());const _c=globalThis.__zod_globalRegistry;function VC(n,t){return new n({type:"string",...K(t)})}function BC(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function y2(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function WC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function jC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function GC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function YC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function KC(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function JC(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function XC(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function QC(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function eR(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function tR(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function nR(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function rR(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function iR(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function sR(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function oR(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function aR(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function lR(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function cR(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function uR(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function hR(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}function dR(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function pR(n,t){return new n({type:"string",format:"date",check:"string_format",...K(t)})}function fR(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function mR(n,t){return new n({type:"string",format:"duration",check:"string_format",...K(t)})}function gR(n,t){return new n({type:"number",checks:[],...K(t)})}function vR(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function yR(n,t){return new n({type:"boolean",...K(t)})}function wR(n){return new n({type:"unknown"})}function bR(n,t){return new n({type:"never",...K(t)})}function w2(n,t){return new q8({check:"less_than",...K(t),value:n,inclusive:!1})}function Sm(n,t){return new q8({check:"less_than",...K(t),value:n,inclusive:!0})}function b2(n,t){return new V8({check:"greater_than",...K(t),value:n,inclusive:!1})}function _m(n,t){return new V8({check:"greater_than",...K(t),value:n,inclusive:!0})}function S2(n,t){return new OT({check:"multiple_of",...K(t),value:n})}function J8(n,t){return new NT({check:"max_length",...K(t),maximum:n})}function Ed(n,t){return new zT({check:"min_length",...K(t),minimum:n})}function X8(n,t){return new HT({check:"length_equals",...K(t),length:n})}function SR(n,t){return new ZT({check:"string_format",format:"regex",...K(t),pattern:n})}function _R(n){return new UT({check:"string_format",format:"lowercase",...K(n)})}function AR(n){return new FT({check:"string_format",format:"uppercase",...K(n)})}function ER(n,t){return new qT({check:"string_format",format:"includes",...K(t),includes:n})}function kR(n,t){return new VT({check:"string_format",format:"starts_with",...K(t),prefix:n})}function TR(n,t){return new BT({check:"string_format",format:"ends_with",...K(t),suffix:n})}function Gl(n){return new WT({check:"overwrite",tx:n})}function CR(n){return Gl(t=>t.normalize(n))}function RR(){return Gl(n=>n.trim())}function IR(){return Gl(n=>n.toLowerCase())}function $R(){return Gl(n=>n.toUpperCase())}function xR(){return Gl(n=>Zk(n))}function PR(n,t,e){return new n({type:"array",element:t,...K(e)})}function DR(n,t,e){return new n({type:"custom",check:"custom",fn:t,...K(e)})}function LR(n){const t=OR(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(Wc(r,e.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=e.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),e.issues.push(Wc(i))}},n(e.value,e)));return t}function OR(n,t){const e=new Wt({check:"custom",...K(t)});return e._zod.check=n,e}function Q8(n){let t=(n==null?void 0:n.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??_c,target:t,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Qe(n,t,e={path:[],schemaPath:[]}){var p,f;var r;const i=n._zod.def,o=t.seen.get(n);if(o)return o.count++,e.schemaPath.includes(n)&&(o.cycle=e.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,a);const l=(f=(p=n._zod).toJSONSchema)==null?void 0:f.call(p);if(l)a.schema=l;else{const y={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,a.schema,y);else{const S=a.schema,_=t.processors[i.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);_(n,t,S,y)}const v=n._zod.parent;v&&(a.ref||(a.ref=v),Qe(v,t,y),t.seen.get(v).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),t.io==="input"&&At(n)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(n).schema}function e6(n,t){var a,l,c,u;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const p of n.seen.entries()){const f=(a=n.metadataRegistry.get(p[0]))==null?void 0:a.id;if(f){const y=r.get(f);if(y&&y!==p[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,p[0])}}const i=p=>{var _;const f=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(_=n.external.registry.get(p[0]))==null?void 0:_.id,Z=n.external.uri??(z=>z);if(x)return{ref:Z(x)};const L=p[1].defId??p[1].schema.id??`schema${n.counter++}`;return p[1].defId=L,{defId:L,ref:`${Z("__shared")}#/${f}/${L}`}}if(p[1]===e)return{ref:"#"};const v=`#/${f}/`,S=p[1].schema.id??`__schema${n.counter++}`;return{defId:S,ref:v+S}},o=p=>{if(p[1].schema.$ref)return;const f=p[1],{ref:y,defId:v}=i(p);f.def={...f.schema},v&&(f.defId=v);const S=f.schema;for(const _ in S)delete S[_];S.$ref=y};if(n.cycles==="throw")for(const p of n.seen.entries()){const f=p[1];if(f.cycle)throw new Error(`Cycle detected: #/${(l=f.cycle)==null?void 0:l.join("/")}/<root>
|
|
41
|
-
|
|
42
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of n.seen.entries()){const f=p[1];if(t===p[0]){o(p);continue}if(n.external){const v=(c=n.external.registry.get(p[0]))==null?void 0:c.id;if(t!==p[0]&&v){o(p);continue}}if((u=n.metadataRegistry.get(p[0]))==null?void 0:u.id){o(p);continue}if(f.cycle){o(p);continue}if(f.count>1&&n.reused==="ref"){o(p);continue}}}function t6(n,t){var a,l,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const p=n.seen.get(u);if(p.ref===null)return;const f=p.def??p.schema,y={...f},v=p.ref;if(p.ref=null,v){r(v);const _=n.seen.get(v),x=_.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(x)):Object.assign(f,x),Object.assign(f,y),u._zod.parent===v)for(const L in f)L==="$ref"||L==="allOf"||L in y||delete f[L];if(x.$ref&&_.def)for(const L in f)L==="$ref"||L==="allOf"||L in _.def&&JSON.stringify(f[L])===JSON.stringify(_.def[L])&&delete f[L]}const S=u._zod.parent;if(S&&S!==v){r(S);const _=n.seen.get(S);if(_!=null&&_.schema.$ref&&(f.$ref=_.schema.$ref,_.def))for(const x in f)x==="$ref"||x==="allOf"||x in _.def&&JSON.stringify(f[x])===JSON.stringify(_.def[x])&&delete f[x]}n.override({zodSchema:u,jsonSchema:f,path:p.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(a=n.external)!=null&&a.uri){const u=(l=n.external.registry.get(t))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,e.def??e.schema);const o=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const p=u[1];p.def&&p.defId&&(o[p.defId]=p.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:kd(t,"input",n.processors),output:kd(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function At(n,t){const e=t??{seen:new Set};if(e.seen.has(n))return!1;e.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return At(r.element,e);if(r.type==="set")return At(r.valueType,e);if(r.type==="lazy")return At(r.getter(),e);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return At(r.innerType,e);if(r.type==="intersection")return At(r.left,e)||At(r.right,e);if(r.type==="record"||r.type==="map")return At(r.keyType,e)||At(r.valueType,e);if(r.type==="pipe")return At(r.in,e)||At(r.out,e);if(r.type==="object"){for(const i in r.shape)if(At(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(At(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(At(i,e))return!0;return!!(r.rest&&At(r.rest,e))}return!1}const MR=(n,t={})=>e=>{const r=Q8({...e,processors:t});return Qe(n,r),e6(r,n),t6(r,n)},kd=(n,t,e={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=Q8({...i??{},target:o,io:t,processors:e});return Qe(n,a),e6(a,n),t6(a,n)},NR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zR=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:o,maximum:a,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=NR[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const p=[...c];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},HR=(n,t,e,r)=>{const i=e,{minimum:o,maximum:a,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:p}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof o=="number"&&(i.minimum=o,typeof p=="number"&&t.target!=="draft-04"&&(p>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},ZR=(n,t,e,r)=>{e.type="boolean"},UR=(n,t,e,r)=>{e.not={}},FR=(n,t,e,r)=>{},qR=(n,t,e,r)=>{const i=n._zod.def,o=P8(i.entries);o.every(a=>typeof a=="number")&&(e.type="number"),o.every(a=>typeof a=="string")&&(e.type="string"),e.enum=o},VR=(n,t,e,r)=>{const i=n._zod.def,o=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];e.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[a]:e.const=a}else o.every(a=>typeof a=="number")&&(e.type="number"),o.every(a=>typeof a=="string")&&(e.type="string"),o.every(a=>typeof a=="boolean")&&(e.type="boolean"),o.every(a=>a===null)&&(e.type="null"),e.enum=o},BR=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},WR=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},jR=(n,t,e,r)=>{const i=e,o=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Qe(o.element,t,{...r,path:[...r.path,"items"]})},GR=(n,t,e,r)=>{var u;const i=e,o=n._zod.def;i.type="object",i.properties={};const a=o.shape;for(const p in a)i.properties[p]=Qe(a[p],t,{...r,path:[...r.path,"properties",p]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(p=>{const f=o.shape[p]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Qe(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},YR=(n,t,e,r)=>{const i=n._zod.def,o=i.inclusive===!1,a=i.options.map((l,c)=>Qe(l,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?e.oneOf=a:e.anyOf=a},KR=(n,t,e,r)=>{const i=n._zod.def,o=Qe(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=Qe(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];e.allOf=c},JR=(n,t,e,r)=>{const i=e,o=n._zod.def;i.type="object";const a=o.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(o.mode==="loose"&&c&&c.size>0){const p=Qe(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const f of c)i.patternProperties[f.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Qe(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Qe(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=a._zod.values;if(u){const p=[...u].filter(f=>typeof f=="string"||typeof f=="number");p.length>0&&(i.required=p)}},XR=(n,t,e,r)=>{const i=n._zod.def,o=Qe(i.innerType,t,r),a=t.seen.get(n);t.target==="openapi-3.0"?(a.ref=i.innerType,e.nullable=!0):e.anyOf=[o,{type:"null"}]},QR=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType},e3=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},t3=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,t.io==="input"&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},n3=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=a},r3=(n,t,e,r)=>{const i=n._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Qe(o,t,r);const a=t.seen.get(n);a.ref=o},i3=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,e.readOnly=!0},n6=(n,t,e,r)=>{const i=n._zod.def;Qe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType},s3=R("ZodISODateTime",(n,t)=>{oC.init(n,t),qe.init(n,t)});function o3(n){return dR(s3,n)}const a3=R("ZodISODate",(n,t)=>{aC.init(n,t),qe.init(n,t)});function l3(n){return pR(a3,n)}const c3=R("ZodISOTime",(n,t)=>{lC.init(n,t),qe.init(n,t)});function u3(n){return fR(c3,n)}const h3=R("ZodISODuration",(n,t)=>{cC.init(n,t),qe.init(n,t)});function d3(n){return mR(h3,n)}const r6=(n,t)=>{M8.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>Qk(n,e)},flatten:{value:e=>Xk(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,Bm,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,Bm,2)}},isEmpty:{get(){return n.issues.length===0}}})},_2=R("ZodError",r6),In=R("ZodError",r6,{Parent:Error}),p3=B1(In),f3=W1(In),m3=Np(In),g3=zp(In),v3=nT(In),y3=rT(In),w3=iT(In),b3=sT(In),S3=oT(In),_3=aT(In),A3=lT(In),E3=cT(In),Fe=R("ZodType",(n,t)=>(Ue.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:kd(n,"input"),output:kd(n,"output")}}),n.toJSONSchema=MR(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone($s(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(e,r)=>xs(n,e,r),n.brand=()=>n,n.register=((e,r)=>(e.add(n,r),n)),n.parse=(e,r)=>p3(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>m3(n,e,r),n.parseAsync=async(e,r)=>f3(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>g3(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>v3(n,e,r),n.decode=(e,r)=>y3(n,e,r),n.encodeAsync=async(e,r)=>w3(n,e,r),n.decodeAsync=async(e,r)=>b3(n,e,r),n.safeEncode=(e,r)=>S3(n,e,r),n.safeDecode=(e,r)=>_3(n,e,r),n.safeEncodeAsync=async(e,r)=>A3(n,e,r),n.safeDecodeAsync=async(e,r)=>E3(n,e,r),n.refine=(e,r)=>n.check(gI(e,r)),n.superRefine=e=>n.check(vI(e)),n.overwrite=e=>n.check(Gl(e)),n.optional=()=>k2(n),n.exactOptional=()=>rI(n),n.nullable=()=>T2(n),n.nullish=()=>k2(T2(n)),n.nonoptional=e=>cI(n,e),n.array=()=>G(n),n.or=e=>ae([n,e]),n.and=e=>Zp(n,e),n.transform=e=>C2(n,tI(e)),n.default=e=>oI(n,e),n.prefault=e=>lI(n,e),n.catch=e=>hI(n,e),n.pipe=e=>C2(n,e),n.readonly=()=>fI(n),n.describe=e=>{const r=n.clone();return _c.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=_c.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return _c.get(n);const r=n.clone();return _c.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),i6=R("_ZodString",(n,t)=>{j1.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>zR(n,r,i);const e=n._zod.bag;n.format=e.format??null,n.minLength=e.minimum??null,n.maxLength=e.maximum??null,n.regex=(...r)=>n.check(SR(...r)),n.includes=(...r)=>n.check(ER(...r)),n.startsWith=(...r)=>n.check(kR(...r)),n.endsWith=(...r)=>n.check(TR(...r)),n.min=(...r)=>n.check(Ed(...r)),n.max=(...r)=>n.check(J8(...r)),n.length=(...r)=>n.check(X8(...r)),n.nonempty=(...r)=>n.check(Ed(1,...r)),n.lowercase=r=>n.check(_R(r)),n.uppercase=r=>n.check(AR(r)),n.trim=()=>n.check(RR()),n.normalize=(...r)=>n.check(CR(...r)),n.toLowerCase=()=>n.check(IR()),n.toUpperCase=()=>n.check($R()),n.slugify=()=>n.check(xR())}),k3=R("ZodString",(n,t)=>{j1.init(n,t),i6.init(n,t),n.email=e=>n.check(BC(T3,e)),n.url=e=>n.check(KC(C3,e)),n.jwt=e=>n.check(hR(F3,e)),n.emoji=e=>n.check(JC(R3,e)),n.guid=e=>n.check(y2(A2,e)),n.uuid=e=>n.check(WC(xh,e)),n.uuidv4=e=>n.check(jC(xh,e)),n.uuidv6=e=>n.check(GC(xh,e)),n.uuidv7=e=>n.check(YC(xh,e)),n.nanoid=e=>n.check(XC(I3,e)),n.guid=e=>n.check(y2(A2,e)),n.cuid=e=>n.check(QC($3,e)),n.cuid2=e=>n.check(eR(x3,e)),n.ulid=e=>n.check(tR(P3,e)),n.base64=e=>n.check(lR(H3,e)),n.base64url=e=>n.check(cR(Z3,e)),n.xid=e=>n.check(nR(D3,e)),n.ksuid=e=>n.check(rR(L3,e)),n.ipv4=e=>n.check(iR(O3,e)),n.ipv6=e=>n.check(sR(M3,e)),n.cidrv4=e=>n.check(oR(N3,e)),n.cidrv6=e=>n.check(aR(z3,e)),n.e164=e=>n.check(uR(U3,e)),n.datetime=e=>n.check(o3(e)),n.date=e=>n.check(l3(e)),n.time=e=>n.check(u3(e)),n.duration=e=>n.check(d3(e))});function g(n){return VC(k3,n)}const qe=R("ZodStringFormat",(n,t)=>{Me.init(n,t),i6.init(n,t)}),T3=R("ZodEmail",(n,t)=>{JT.init(n,t),qe.init(n,t)}),A2=R("ZodGUID",(n,t)=>{YT.init(n,t),qe.init(n,t)}),xh=R("ZodUUID",(n,t)=>{KT.init(n,t),qe.init(n,t)}),C3=R("ZodURL",(n,t)=>{XT.init(n,t),qe.init(n,t)}),R3=R("ZodEmoji",(n,t)=>{QT.init(n,t),qe.init(n,t)}),I3=R("ZodNanoID",(n,t)=>{eC.init(n,t),qe.init(n,t)}),$3=R("ZodCUID",(n,t)=>{tC.init(n,t),qe.init(n,t)}),x3=R("ZodCUID2",(n,t)=>{nC.init(n,t),qe.init(n,t)}),P3=R("ZodULID",(n,t)=>{rC.init(n,t),qe.init(n,t)}),D3=R("ZodXID",(n,t)=>{iC.init(n,t),qe.init(n,t)}),L3=R("ZodKSUID",(n,t)=>{sC.init(n,t),qe.init(n,t)}),O3=R("ZodIPv4",(n,t)=>{uC.init(n,t),qe.init(n,t)}),M3=R("ZodIPv6",(n,t)=>{hC.init(n,t),qe.init(n,t)}),N3=R("ZodCIDRv4",(n,t)=>{dC.init(n,t),qe.init(n,t)}),z3=R("ZodCIDRv6",(n,t)=>{pC.init(n,t),qe.init(n,t)}),H3=R("ZodBase64",(n,t)=>{fC.init(n,t),qe.init(n,t)}),Z3=R("ZodBase64URL",(n,t)=>{gC.init(n,t),qe.init(n,t)}),U3=R("ZodE164",(n,t)=>{vC.init(n,t),qe.init(n,t)}),F3=R("ZodJWT",(n,t)=>{wC.init(n,t),qe.init(n,t)}),s6=R("ZodNumber",(n,t)=>{W8.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>HR(n,r,i),n.gt=(r,i)=>n.check(b2(r,i)),n.gte=(r,i)=>n.check(_m(r,i)),n.min=(r,i)=>n.check(_m(r,i)),n.lt=(r,i)=>n.check(w2(r,i)),n.lte=(r,i)=>n.check(Sm(r,i)),n.max=(r,i)=>n.check(Sm(r,i)),n.int=r=>n.check(E2(r)),n.safe=r=>n.check(E2(r)),n.positive=r=>n.check(b2(0,r)),n.nonnegative=r=>n.check(_m(0,r)),n.negative=r=>n.check(w2(0,r)),n.nonpositive=r=>n.check(Sm(0,r)),n.multipleOf=(r,i)=>n.check(S2(r,i)),n.step=(r,i)=>n.check(S2(r,i)),n.finite=()=>n;const e=n._zod.bag;n.minValue=Math.max(e.minimum??Number.NEGATIVE_INFINITY,e.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(e.maximum??Number.POSITIVE_INFINITY,e.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(e.format??"").includes("int")||Number.isSafeInteger(e.multipleOf??.5),n.isFinite=!0,n.format=e.format??null});function ie(n){return gR(s6,n)}const q3=R("ZodNumberFormat",(n,t)=>{bC.init(n,t),s6.init(n,t)});function E2(n){return vR(q3,n)}const V3=R("ZodBoolean",(n,t)=>{SC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>ZR(n,e,r)});function lt(n){return yR(V3,n)}const B3=R("ZodUnknown",(n,t)=>{_C.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>FR()});function E(){return wR(B3)}const W3=R("ZodNever",(n,t)=>{AC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>UR(n,e,r)});function j3(n){return bR(W3,n)}const G3=R("ZodArray",(n,t)=>{EC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>jR(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(Ed(e,r)),n.nonempty=e=>n.check(Ed(1,e)),n.max=(e,r)=>n.check(J8(e,r)),n.length=(e,r)=>n.check(X8(e,r)),n.unwrap=()=>n.element});function G(n,t){return PR(G3,n,t)}const o6=R("ZodObject",(n,t)=>{TC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>GR(n,e,r,i),Ae(n,"shape",()=>t.shape),n.keyof=()=>c6(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:E()}),n.loose=()=>n.clone({...n._zod.def,catchall:E()}),n.strict=()=>n.clone({...n._zod.def,catchall:j3()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>jk(n,e),n.safeExtend=e=>Gk(n,e),n.merge=e=>Yk(n,e),n.pick=e=>Bk(n,e),n.omit=e=>Wk(n,e),n.partial=(...e)=>Kk(u6,n,e[0]),n.required=(...e)=>Jk(h6,n,e[0])});function a6(n,t){const e={type:"object",shape:n??{},...K(t)};return new o6(e)}function b(n,t){return new o6({type:"object",shape:n,catchall:E(),...K(t)})}const l6=R("ZodUnion",(n,t)=>{Y8.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>YR(n,e,r,i),n.options=t.options});function ae(n,t){return new l6({type:"union",options:n,...K(t)})}const Y3=R("ZodDiscriminatedUnion",(n,t)=>{l6.init(n,t),CC.init(n,t)});function K3(n,t,e){return new Y3({type:"union",options:t,discriminator:n,...K(e)})}const J3=R("ZodIntersection",(n,t)=>{RC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>KR(n,e,r,i)});function Zp(n,t){return new J3({type:"intersection",left:n,right:t})}const X3=R("ZodRecord",(n,t)=>{IC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>JR(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function T(n,t,e){return new X3({type:"record",keyType:n,valueType:t,...K(e)})}const jm=R("ZodEnum",(n,t)=>{$C.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>qR(n,r,i),n.enum=t.entries,n.options=Object.values(t.entries);const e=new Set(Object.keys(t.entries));n.extract=(r,i)=>{const o={};for(const a of r)if(e.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new jm({...t,checks:[],...K(i),entries:o})},n.exclude=(r,i)=>{const o={...t.entries};for(const a of r)if(e.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new jm({...t,checks:[],...K(i),entries:o})}});function c6(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new jm({type:"enum",entries:e,...K(t)})}const Q3=R("ZodLiteral",(n,t)=>{xC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>VR(n,e,r),n.values=new Set(t.values),Object.defineProperty(n,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function D(n,t){return new Q3({type:"literal",values:Array.isArray(n)?n:[n],...K(t)})}const eI=R("ZodTransform",(n,t)=>{PC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>WR(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new $8(n.constructor.name);e.addIssue=o=>{if(typeof o=="string")e.issues.push(Wc(o,e.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=e.value),a.inst??(a.inst=n),e.issues.push(Wc(a))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>(e.value=o,e)):(e.value=i,e)}});function tI(n){return new eI({type:"transform",transform:n})}const u6=R("ZodOptional",(n,t)=>{K8.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>n6(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function k2(n){return new u6({type:"optional",innerType:n})}const nI=R("ZodExactOptional",(n,t)=>{DC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>n6(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function rI(n){return new nI({type:"optional",innerType:n})}const iI=R("ZodNullable",(n,t)=>{LC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>XR(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function T2(n){return new iI({type:"nullable",innerType:n})}const sI=R("ZodDefault",(n,t)=>{OC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>e3(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function oI(n,t){return new sI({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():L8(t)}})}const aI=R("ZodPrefault",(n,t)=>{MC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>t3(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function lI(n,t){return new aI({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():L8(t)}})}const h6=R("ZodNonOptional",(n,t)=>{NC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>QR(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function cI(n,t){return new h6({type:"nonoptional",innerType:n,...K(t)})}const uI=R("ZodCatch",(n,t)=>{zC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>n3(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function hI(n,t){return new uI({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const dI=R("ZodPipe",(n,t)=>{HC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>r3(n,e,r,i),n.in=t.in,n.out=t.out});function C2(n,t){return new dI({type:"pipe",in:n,out:t})}const pI=R("ZodReadonly",(n,t)=>{ZC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>i3(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function fI(n){return new pI({type:"readonly",innerType:n})}const mI=R("ZodCustom",(n,t)=>{UC.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>BR(n,e)});function gI(n,t={}){return DR(mI,n,t)}function vI(n){return LR(n)}const yI=[".md",".markdown"];function d6(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function p6(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function wI(n){return p6(n).toLowerCase()}function bI(n,t){const e=wI(n);return t.some(r=>e.endsWith(r))}function Gm(n){return!d6(n)&&bI(n,yI)}function SI(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function qr(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const _I=a6({id:g().min(1),kind:D("path"),title:g(),path:g()}).strict(),AI=a6({id:g().min(1),kind:D("url"),title:g(),url:g().refine(SI,{message:"url must be an http(s) URL"})}).strict();K3("kind",[_I,AI]);const EI=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function kI(n,t){try{const e=new URL(t),r=new URL(n,e);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:EI.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function R2(n,t){return kI(n,t).kind==="web"}const TI="/views/markdown/",CI="/views/url-unsupported/";function RI(n){try{const{protocol:t}=new URL(n);return t==="http:"||t==="https:"}catch{return!1}}function f6(n){return`/artifact/${encodeURIComponent(n)}`}function II(n,t){return`${f6(n)}/${encodeURIComponent(t)}`}function $I(n){return`/markdown/${encodeURIComponent(n)}`}function Td(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:qr(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:t.browserDemo&&RI(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:CI,contentURL:null};if(Gm(n.path)){const r={viewURL:TI,contentURL:$I(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=d6(n.path)?`${f6(n.id)}/`:II(n.id,p6(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const xI="serverURL",PI="token",DI="mode",LI="desktopAppVersion",OI="electron";function MI(n=window.location.search,t=window.location.origin){const r=new URLSearchParams(n).get(xI);return r?new URL(r).origin:new URL(t).origin}function NI(n=window.location.search){return new URLSearchParams(n).get(PI)}function wi(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(DI)===OI}function m6(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(LI)}const I2="tv.telemetry.clientId",zI=5,HI=60,ZI=1e3,UI=zI*HI*ZI,$2=["pointerdown","scroll","keydown"],x2=["focus"],P2=["visibilitychange"],FI="hidden";function qI(n,t=GI){const e=n.getItem(I2);if(e)return e;const r=t();return n.setItem(I2,r),r}function VI(n){return{clientId:qI(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function BI(n){const t=new URLSearchParams;return t.set("clientId",n.clientId),t.set("userAgent",n.userAgent),t.set("clientApp",n.clientApp),n.desktopAppVersion&&t.set("desktopAppVersion",n.desktopAppVersion),t}function WI(n){return new jI(n)}var eu,Gr,Vi,tu,nu,fn,co,ru,Hd,g6;class jI{constructor(t){m(this,Hd);m(this,eu);m(this,Gr);m(this,Vi);m(this,tu);m(this,nu);m(this,fn);m(this,co,!1);m(this,ru,Number.NEGATIVE_INFINITY);d(this,eu,t.meta),d(this,Gr,t.documentTarget),d(this,Vi,t.windowTarget),d(this,tu,t.send),d(this,nu,t.nowMs??Date.now),d(this,fn,()=>h(this,Hd,g6).call(this))}start(){if(!s(this,co)){d(this,co,!0);for(const t of $2)s(this,Vi).addEventListener(t,s(this,fn)),s(this,Gr).addEventListener(t,s(this,fn));for(const t of x2)s(this,Vi).addEventListener(t,s(this,fn));for(const t of P2)s(this,Gr).addEventListener(t,s(this,fn))}}stop(){if(s(this,co)){d(this,co,!1);for(const t of $2)s(this,Vi).removeEventListener(t,s(this,fn)),s(this,Gr).removeEventListener(t,s(this,fn));for(const t of x2)s(this,Vi).removeEventListener(t,s(this,fn));for(const t of P2)s(this,Gr).removeEventListener(t,s(this,fn))}}}eu=new WeakMap,Gr=new WeakMap,Vi=new WeakMap,tu=new WeakMap,nu=new WeakMap,fn=new WeakMap,co=new WeakMap,ru=new WeakMap,Hd=new WeakSet,g6=function(){if(s(this,Gr).visibilityState===FI)return;const t=s(this,nu).call(this);t-s(this,ru)<UI||(d(this,ru,t),s(this,tu).call(this,{type:ZE,clientId:s(this,eu).clientId}))};function GI(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():U1().toLowerCase()}const De={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},Zr={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},YI=1,KI=b({_meta:T(g(),E()).nullish(),terminal:lt().optional().default(!1)}),JI=b({_meta:T(g(),E()).nullish(),label:g().nullish(),name:g(),optional:lt().optional().default(!1),secret:lt().optional().default(!0)}),XI=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:g(),name:g()}),QI=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:g(),link:g().nullish(),name:g(),vars:G(JI)}),e$=b({_meta:T(g(),E()).nullish(),args:G(g()).optional(),description:g().nullish(),env:T(g(),g()).optional(),id:g(),name:g()}),t$=ae([QI.and(b({type:D("env_var")})),e$.and(b({type:D("terminal")})),XI]),n$=b({_meta:T(g(),E()).nullish(),methodId:g()}),r$=b({_meta:T(g(),E()).nullish()}),i$=b({_meta:T(g(),E()).nullish(),blob:g(),mimeType:g().nullish(),uri:g()}),s$=b({default:lt().nullish(),description:g().nullish(),title:g().nullish()}),o$=b({_meta:T(g(),E()).nullish()}),a$=b({_meta:T(g(),E()).nullish()}),l$=b({amount:ie(),currency:g()}),c$=b({_meta:T(g(),E()).nullish(),terminalId:g()}),u$=b({_meta:T(g(),E()).nullish(),newText:g(),oldText:g().nullish(),path:g()}),h$=ae([g(),ie(),ie(),lt(),G(g())]),d$=b({content:T(g(),h$).nullish()}),p$=ae([d$.and(b({action:D("accept")})),b({action:D("decline")}),b({action:D("cancel")})]),f$=b({_meta:T(g(),E()).nullish()}),v6=g(),m$=b({_meta:T(g(),E()).nullish(),elicitationId:v6}),g$=b({_meta:T(g(),E()).nullish(),action:p$}),v$=D("object"),y$=D("string"),w$=b({_meta:T(g(),E()).nullish()}),b$=b({_meta:T(g(),E()).nullish(),form:f$.nullish(),url:w$.nullish()}),S$=b({elicitationId:v6,url:g().url()}),y6=b({const:g(),title:g()}),w6=b({_meta:T(g(),E()).nullish(),name:g(),value:g()}),_$=ae([D(-32700),D(-32600),D(-32601),D(-32602),D(-32603),D(-32800),D(-32e3),D(-32002),D(-32042),ie().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),b6=b({code:_$,data:E().optional(),message:g()}),S6=E(),_6=E(),A6=E(),A$=b({_meta:T(g(),E()).nullish(),readTextFile:lt().optional().default(!1),writeTextFile:lt().optional().default(!1)}),E6=b({_meta:T(g(),E()).nullish(),name:g(),value:g()}),k6=b({_meta:T(g(),E()).nullish(),name:g(),title:g().nullish(),version:g()}),E$=b({default:ie().nullish(),description:g().nullish(),maximum:ie().nullish(),minimum:ie().nullish(),title:g().nullish()}),k$=b({_meta:T(g(),E()).nullish()}),T$=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cursor:g().nullish(),cwd:g().nullish()}),C$=b({_meta:T(g(),E()).nullish()}),R$=b({_meta:T(g(),E()).nullish(),logout:C$.nullish()}),I$=b({_meta:T(g(),E()).nullish()}),$$=b({_meta:T(g(),E()).nullish()}),x$=b({_meta:T(g(),E()).nullish(),http:lt().optional().default(!1),sse:lt().optional().default(!1)}),P$=b({_meta:T(g(),E()).nullish(),headers:G(E6),name:g(),url:g()}),D$=b({_meta:T(g(),E()).nullish(),headers:G(E6),name:g(),url:g()}),L$=b({_meta:T(g(),E()).nullish(),args:G(g()),command:g(),env:G(w6),name:g()}),Up=ae([P$.and(b({type:D("http")})),D$.and(b({type:D("sse")})),L$]),G1=g(),O$=b({_meta:T(g(),E()).nullish(),description:g().nullish(),modelId:G1,name:g()}),M$=ae([D("error"),D("warning"),D("information"),D("hint")]),N$=b({_meta:T(g(),E()).nullish()}),z$=b({_meta:T(g(),E()).nullish()}),H$=b({_meta:T(g(),E()).nullish()}),Z$=b({_meta:T(g(),E()).nullish()}),U$=b({_meta:T(g(),E()).nullish()}),F$=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),q$=b({diff:g(),uri:g()}),V$=b({endLine:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:g()}),B$=b({_meta:T(g(),E()).nullish()}),W$=b({_meta:T(g(),E()).nullish()}),j$=b({languageId:g(),text:g(),uri:g()}),G$=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Y$=ae([D("rejected"),D("ignored"),D("replaced"),D("cancelled")]),K$=b({excerpts:G(V$),uri:g()}),J$=b({_meta:T(g(),E()).nullish()}),X$=b({_meta:T(g(),E()).nullish()}),Q$=b({name:g(),owner:g(),remoteUrl:g()}),ex=b({_meta:T(g(),E()).nullish()}),tx=b({_meta:T(g(),E()).nullish(),jump:B$.nullish(),rename:X$.nullish(),searchAndReplace:ex.nullish()}),nx=b({id:g(),isRegex:lt().nullish(),replace:g(),search:g(),uri:g()}),rx=ae([D("automatic"),D("diagnostic"),D("manual")]),ix=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),sx=b({_meta:T(g(),E()).nullish(),diagnostics:N$.nullish(),editHistory:F$.nullish(),openFiles:W$.nullish(),recentFiles:G$.nullish(),relatedSnippets:J$.nullish(),userActions:ix.nullish()}),ox=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(Up)}),ax=b({default:ie().nullish(),description:g().nullish(),maximum:ie().nullish(),minimum:ie().nullish(),title:g().nullish()}),T6=g(),lx=ae([D("allow_once"),D("allow_always"),D("reject_once"),D("reject_always")]),cx=b({_meta:T(g(),E()).nullish(),kind:lx,name:g(),optionId:T6}),ux=ae([D("high"),D("medium"),D("low")]),hx=ae([D("pending"),D("in_progress"),D("completed")]),dx=b({_meta:T(g(),E()).nullish(),content:g(),priority:ux,status:hx}),px=b({_meta:T(g(),E()).nullish(),entries:G(dx)}),Cs=b({character:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),fx=b({id:g(),position:Cs,uri:g()}),mx=b({id:g(),newName:g(),position:Cs,uri:g()}),gx=b({action:g(),position:Cs,timestampMs:ie(),uri:g()}),C6=ae([D("utf-16"),D("utf-32"),D("utf-8")]),vx=b({_meta:T(g(),E()).nullish(),auth:KI.optional().default({terminal:!1}),elicitation:b$.nullish(),fs:A$.optional().default({readTextFile:!1,writeTextFile:!1}),nes:tx.nullish(),positionEncodings:G(C6).optional(),terminal:lt().optional().default(!1)}),yx=b({_meta:T(g(),E()).nullish(),audio:lt().optional().default(!1),embeddedContext:lt().optional().default(!1),image:lt().optional().default(!1)}),R6=ie().int().gte(0).lte(65535),wx=b({_meta:T(g(),E()).nullish(),clientCapabilities:vx.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:k6.nullish(),protocolVersion:R6}),Yl=b({end:Cs,start:Cs}),bx=b({message:g(),range:Yl,severity:M$,uri:g()}),Sx=b({languageId:g(),lastFocusedMs:ie().nullish(),uri:g(),visibleRange:Yl.nullish()}),_x=b({_meta:T(g(),E()).nullish(),diagnostics:G(bx).nullish(),editHistory:G(q$).nullish(),openFiles:G(Sx).nullish(),recentFiles:G(j$).nullish(),relatedSnippets:G(K$).nullish(),userActions:G(gx).nullish()}),Ax=b({newText:g(),range:Yl}),Ex=b({cursorPosition:Cs.nullish(),edits:G(Ax),id:g(),uri:g()}),kx=ae([Ex.and(b({kind:D("edit")})),fx.and(b({kind:D("jump")})),mx.and(b({kind:D("rename")})),nx.and(b({kind:D("searchAndReplace")}))]),Tx=b({_meta:T(g(),E()).nullish(),content:g()}),Cx=b({_meta:T(g(),E()).nullish()}),Qo=ae([ie(),g()]).nullable();b({_meta:T(g(),E()).nullish(),requestId:Qo});const Rx=c6(["assistant","user"]),ph=b({_meta:T(g(),E()).nullish(),audience:G(Rx).nullish(),lastModified:g().nullish(),priority:ie().nullish()}),Ix=b({_meta:T(g(),E()).nullish(),annotations:ph.nullish(),data:g(),mimeType:g()}),$x=b({_meta:T(g(),E()).nullish(),annotations:ph.nullish(),data:g(),mimeType:g(),uri:g().nullish()}),xx=b({_meta:T(g(),E()).nullish(),annotations:ph.nullish(),description:g().nullish(),mimeType:g().nullish(),name:g(),size:ie().nullish(),title:g().nullish(),uri:g()}),Px=b({_meta:T(g(),E()).nullish(),optionId:T6}),Dx=ae([b({outcome:D("cancelled")}),Px.and(b({outcome:D("selected")}))]),Lx=b({_meta:T(g(),E()).nullish(),outcome:Dx}),Ox=b({_meta:T(g(),E()).nullish()}),Mx=b({_meta:T(g(),E()).nullish()}),Nx=b({currentValue:lt()}),zx=g(),I6=g(),Hx=ae([D("mode"),D("model"),D("thought_level"),g()]),Y1=g(),$6=b({_meta:T(g(),E()).nullish(),description:g().nullish(),name:g(),value:Y1}),Zx=b({_meta:T(g(),E()).nullish(),group:zx,name:g(),options:G($6)}),Ux=ae([G($6),G(Zx)]),Fx=b({currentValue:Y1,options:Ux}),Kl=Zp(ae([Fx.and(b({type:D("select")})),Nx.and(b({type:D("boolean")}))]),b({_meta:T(g(),E()).nullish(),category:Hx.nullish(),description:g().nullish(),id:I6,name:g()})),qx=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl)}),Vx=b({_meta:T(g(),E()).nullish()}),be=g(),Bx=b({_meta:T(g(),E()).nullish(),id:g(),sessionId:be}),Wx=b({_meta:T(g(),E()).nullish(),sessionId:be}),jx=b({_meta:T(g(),E()).nullish(),sessionId:be}),Gx=b({_meta:T(g(),E()).nullish(),sessionId:be}),x6=b({_meta:T(g(),E()).nullish(),args:G(g()).optional(),command:g(),cwd:g().nullish(),env:G(w6).optional(),outputByteLimit:ie().nullish(),sessionId:be}),Yx=b({_meta:T(g(),E()).nullish(),sessionId:be,uri:g()}),Kx=b({_meta:T(g(),E()).nullish(),position:Cs,sessionId:be,uri:g(),version:ie(),visibleRange:Yl}),Jx=b({_meta:T(g(),E()).nullish(),languageId:g(),sessionId:be,text:g(),uri:g(),version:ie()}),Xx=b({_meta:T(g(),E()).nullish(),sessionId:be,uri:g()}),Qx=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(Up).optional(),sessionId:be}),P6=b({_meta:T(g(),E()).nullish(),sessionId:be,terminalId:g()}),eP=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(Up),sessionId:be}),D6=b({_meta:T(g(),E()).nullish(),limit:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:g(),sessionId:be}),tP=b({_meta:T(g(),E()).nullish(),id:g(),reason:Y$.nullish(),sessionId:be}),L6=b({_meta:T(g(),E()).nullish(),sessionId:be,terminalId:g()}),nP=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(Up).optional(),sessionId:be}),rP=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),sessionId:be,title:g().nullish(),updatedAt:g().nullish()}),iP=b({_meta:T(g(),E()).nullish(),nextCursor:g().nullish(),sessions:G(rP)}),sP=b({_meta:T(g(),E()).nullish(),title:g().nullish(),updatedAt:g().nullish()}),oP=b({_meta:T(g(),E()).nullish()}),Fp=g(),aP=b({_meta:T(g(),E()).nullish(),currentModeId:Fp}),lP=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:Fp,name:g()}),qp=b({_meta:T(g(),E()).nullish(),availableModes:G(lP),currentModeId:Fp}),Vp=b({_meta:T(g(),E()).nullish(),availableModels:G(O$),currentModelId:G1}),cP=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl).nullish(),models:Vp.nullish(),modes:qp.nullish(),sessionId:be}),uP=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl).nullish(),models:Vp.nullish(),modes:qp.nullish()}),hP=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl).nullish(),models:Vp.nullish(),modes:qp.nullish(),sessionId:be}),dP=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl).nullish(),models:Vp.nullish(),modes:qp.nullish()}),pP=b({_meta:T(g(),E()).nullish()}),fP=b({_meta:T(g(),E()).nullish(),additionalDirectories:Ox.nullish(),close:Mx.nullish(),fork:Vx.nullish(),list:oP.nullish(),resume:pP.nullish()}),mP=Zp(ae([b({type:D("boolean"),value:lt()}),b({value:Y1})]),b({_meta:T(g(),E()).nullish(),configId:I6,sessionId:be})),gP=b({_meta:T(g(),E()).nullish(),configOptions:G(Kl)}),vP=b({_meta:T(g(),E()).nullish(),modeId:Fp,sessionId:be}),yP=b({_meta:T(g(),E()).nullish()}),wP=b({_meta:T(g(),E()).nullish(),modelId:G1,sessionId:be}),bP=b({_meta:T(g(),E()).nullish()}),SP=b({_meta:T(g(),E()).nullish(),sessionId:be}),_P=ae([D("end_turn"),D("max_tokens"),D("max_turn_requests"),D("refusal"),D("cancelled")]),AP=ae([D("email"),D("uri"),D("date"),D("date-time")]),EP=b({default:g().nullish(),description:g().nullish(),enum:G(g()).nullish(),format:AP.nullish(),maxLength:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:G(y6).nullish(),pattern:g().nullish(),title:g().nullish()}),kP=b({_meta:T(g(),E()).nullish(),context:_x.nullish(),position:Cs,selection:Yl.nullish(),sessionId:be,triggerKind:rx,uri:g(),version:ie()}),TP=b({_meta:T(g(),E()).nullish(),suggestions:G(kx)}),CP=b({_meta:T(g(),E()).nullish(),terminalId:g()}),RP=b({_meta:T(g(),E()).nullish(),exitCode:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:g().nullish()}),O6=b({_meta:T(g(),E()).nullish(),sessionId:be,terminalId:g()}),IP=b({_meta:T(g(),E()).nullish(),exitStatus:RP.nullish(),output:g(),truncated:lt()}),$P=b({_meta:T(g(),E()).nullish(),annotations:ph.nullish(),text:g()}),xP=b({range:Yl.nullish(),text:g()}),PP=b({_meta:T(g(),E()).nullish(),contentChanges:G(xP),sessionId:be,uri:g(),version:ie()});b({method:g(),params:ae([Wx,Jx,PP,Yx,Xx,Kx,Bx,tP,S6]).nullish()});const DP=ae([D("full"),D("incremental")]),LP=b({_meta:T(g(),E()).nullish(),syncKind:DP}),OP=b({_meta:T(g(),E()).nullish(),didChange:LP.nullish(),didClose:z$.nullish(),didFocus:H$.nullish(),didOpen:Z$.nullish(),didSave:U$.nullish()}),MP=b({_meta:T(g(),E()).nullish(),document:OP.nullish()}),NP=b({_meta:T(g(),E()).nullish(),context:sx.nullish(),events:MP.nullish()}),zP=b({_meta:T(g(),E()).nullish(),auth:R$.optional().default({}),loadSession:lt().optional().default(!1),mcpCapabilities:x$.optional().default({http:!1,sse:!1}),nes:NP.nullish(),positionEncoding:C6.nullish(),promptCapabilities:yx.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:fP.optional().default({})}),HP=b({_meta:T(g(),E()).nullish(),agentCapabilities:zP.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:k6.nullish(),authMethods:G(t$).optional().default([]),protocolVersion:R6}),ZP=b({_meta:T(g(),E()).nullish(),mimeType:g().nullish(),text:g(),uri:g()}),UP=ae([ZP,i$]),FP=b({_meta:T(g(),E()).nullish(),annotations:ph.nullish(),resource:UP}),K1=ae([$P.and(b({type:D("text")})),$x.and(b({type:D("image")})),Ix.and(b({type:D("audio")})),xx.and(b({type:D("resource_link")})),FP.and(b({type:D("resource")}))]),qP=b({_meta:T(g(),E()).nullish(),content:K1}),Am=b({_meta:T(g(),E()).nullish(),content:K1,messageId:g().nullish()}),VP=b({_meta:T(g(),E()).nullish(),messageId:g().nullish(),prompt:G(K1),sessionId:be}),BP=b({anyOf:G(y6)}),M6=ae([qP.and(b({type:D("content")})),u$.and(b({type:D("diff")})),CP.and(b({type:D("terminal")}))]),N6=g(),z6=b({_meta:T(g(),E()).nullish(),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:g()}),H6=ae([D("pending"),D("in_progress"),D("completed"),D("failed")]),Z6=ae([D("read"),D("edit"),D("delete"),D("move"),D("search"),D("execute"),D("think"),D("fetch"),D("switch_mode"),D("other")]),WP=b({_meta:T(g(),E()).nullish(),content:G(M6).optional(),kind:Z6.optional(),locations:G(z6).optional(),rawInput:E().optional(),rawOutput:E().optional(),status:H6.optional(),title:g(),toolCallId:N6}),U6=b({_meta:T(g(),E()).nullish(),content:G(M6).nullish(),kind:Z6.nullish(),locations:G(z6).nullish(),rawInput:E().optional(),rawOutput:E().optional(),status:H6.nullish(),title:g().nullish(),toolCallId:N6}),F6=b({_meta:T(g(),E()).nullish(),options:G(cx),sessionId:be,toolCall:U6}),jP=b({_meta:T(g(),E()).nullish(),hint:g()}),GP=jP,YP=b({_meta:T(g(),E()).nullish(),description:g(),input:GP.nullish(),name:g()}),KP=b({_meta:T(g(),E()).nullish(),availableCommands:G(YP)}),JP=b({enum:G(g()),type:y$}),XP=ae([JP,BP]),QP=b({default:G(g()).nullish(),description:g().nullish(),items:XP,maxItems:ie().nullish(),minItems:ie().nullish(),title:g().nullish()}),e5=ae([EP.and(b({type:D("string")})),ax.and(b({type:D("number")})),E$.and(b({type:D("integer")})),s$.and(b({type:D("boolean")})),QP.and(b({type:D("array")}))]),t5=b({description:g().nullish(),properties:T(g(),e5).optional().default({}),required:G(g()).nullish(),title:g().nullish(),type:v$.optional().default("object")}),n5=b({requestedSchema:t5}),r5=Zp(ae([n5.and(b({mode:D("form")})),S$.and(b({mode:D("url")}))]),b({_meta:T(g(),E()).nullish(),message:g(),sessionId:be})),i5=b({cachedReadTokens:ie().nullish(),cachedWriteTokens:ie().nullish(),inputTokens:ie(),outputTokens:ie(),thoughtTokens:ie().nullish(),totalTokens:ie()}),s5=b({_meta:T(g(),E()).nullish(),stopReason:_P,usage:i5.nullish(),userMessageId:g().nullish()});ae([b({id:Qo,result:ae([HP,r$,$$,hP,uP,iP,cP,dP,a$,yP,gP,s5,bP,SP,TP,o$,A6])}),b({error:b6,id:Qo})]);const o5=b({_meta:T(g(),E()).nullish(),cost:l$.nullish(),size:ie(),used:ie()}),a5=ae([Am.and(b({sessionUpdate:D("user_message_chunk")})),Am.and(b({sessionUpdate:D("agent_message_chunk")})),Am.and(b({sessionUpdate:D("agent_thought_chunk")})),WP.and(b({sessionUpdate:D("tool_call")})),U6.and(b({sessionUpdate:D("tool_call_update")})),px.and(b({sessionUpdate:D("plan")})),KP.and(b({sessionUpdate:D("available_commands_update")})),aP.and(b({sessionUpdate:D("current_mode_update")})),qx.and(b({sessionUpdate:D("config_option_update")})),sP.and(b({sessionUpdate:D("session_info_update")})),o5.and(b({sessionUpdate:D("usage_update")}))]),q6=b({_meta:T(g(),E()).nullish(),sessionId:be,update:a5});b({method:g(),params:ae([q6,m$,S6]).nullish()});const V6=b({_meta:T(g(),E()).nullish(),sessionId:be,terminalId:g()}),l5=b({_meta:T(g(),E()).nullish(),exitCode:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:g().nullish()}),c5=b({name:g(),uri:g()}),u5=b({_meta:T(g(),E()).nullish(),repository:Q$.nullish(),workspaceFolders:G(c5).nullish(),workspaceUri:g().nullish()});b({id:Qo,method:g(),params:ae([wx,n$,I$,ox,eP,T$,Qx,nP,Gx,vP,mP,VP,wP,u5,kP,jx,_6]).nullish()});const B6=b({_meta:T(g(),E()).nullish(),content:g(),path:g(),sessionId:be});b({id:Qo,method:g(),params:ae([B6,D6,F6,x6,O6,L6,V6,P6,r5,_6]).nullish()});const h5=b({_meta:T(g(),E()).nullish()});ae([b({id:Qo,result:ae([h5,Tx,Lx,c$,IP,Cx,l5,k$,g$,A6])}),b({error:b6,id:Qo})]);var we;class d5{constructor(t,e){m(this,we);const r=t(this),i=async(a,l)=>{var c,u,p,f,y,v,S;switch(a){case Zr.fs_write_text_file:{const _=B6.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,_)}case Zr.fs_read_text_file:{const _=D6.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,_)}case Zr.session_request_permission:{const _=F6.parse(l);return r.requestPermission(_)}case Zr.terminal_create:{const _=x6.parse(l);return(p=r.createTerminal)==null?void 0:p.call(r,_)}case Zr.terminal_output:{const _=O6.parse(l);return(f=r.terminalOutput)==null?void 0:f.call(r,_)}case Zr.terminal_release:{const _=L6.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,_))??{}}case Zr.terminal_wait_for_exit:{const _=V6.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,_)}case Zr.terminal_kill:{const _=P6.parse(l);return await((S=r.killTerminal)==null?void 0:S.call(r,_))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw rt.methodNotFound(a)}},o=async(a,l)=>{switch(a){case Zr.session_update:{const c=q6.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw rt.methodNotFound(a)}};d(this,we,new p5(i,o,e))}async initialize(t){return await s(this,we).sendRequest(De.initialize,t)}async newSession(t){return await s(this,we).sendRequest(De.session_new,t)}async loadSession(t){return await s(this,we).sendRequest(De.session_load,t)??{}}async unstable_forkSession(t){return await s(this,we).sendRequest(De.session_fork,t)}async listSessions(t){return await s(this,we).sendRequest(De.session_list,t)}async unstable_resumeSession(t){return await s(this,we).sendRequest(De.session_resume,t)}async unstable_closeSession(t){return await s(this,we).sendRequest(De.session_close,t)}async setSessionMode(t){return await s(this,we).sendRequest(De.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await s(this,we).sendRequest(De.session_set_model,t)??{}}async setSessionConfigOption(t){return await s(this,we).sendRequest(De.session_set_config_option,t)}async authenticate(t){return await s(this,we).sendRequest(De.authenticate,t)??{}}async unstable_logout(t){return await s(this,we).sendRequest(De.logout,t)??{}}async prompt(t){return await s(this,we).sendRequest(De.session_prompt,t)}async cancel(t){return await s(this,we).sendNotification(De.session_cancel,t)}async unstable_startNes(t){return await s(this,we).sendRequest(De.nes_start,t)}async unstable_suggestNes(t){return await s(this,we).sendRequest(De.nes_suggest,t)}async unstable_closeNes(t){return await s(this,we).sendRequest(De.nes_close,t)??{}}async unstable_didOpenDocument(t){return await s(this,we).sendNotification(De.document_did_open,t)}async unstable_didChangeDocument(t){return await s(this,we).sendNotification(De.document_did_change,t)}async unstable_didCloseDocument(t){return await s(this,we).sendNotification(De.document_did_close,t)}async unstable_didSaveDocument(t){return await s(this,we).sendNotification(De.document_did_save,t)}async unstable_didFocusDocument(t){return await s(this,we).sendNotification(De.document_did_focus,t)}async unstable_acceptNes(t){return await s(this,we).sendNotification(De.nes_accept,t)}async unstable_rejectNes(t){return await s(this,we).sendNotification(De.nes_reject,t)}async extMethod(t,e){return await s(this,we).sendRequest(t,e)}async extNotification(t,e){return await s(this,we).sendNotification(t,e)}get signal(){return s(this,we).signal}get closed(){return s(this,we).closed}}we=new WeakMap;var Bi,Zd,iu,su,Ha,Za,or,ou,Ze,W6,Ym,j6,G6,Y6,K6,Km,Ac;class p5{constructor(t,e,r){m(this,Ze);m(this,Bi,new Map);m(this,Zd,0);m(this,iu);m(this,su);m(this,Ha);m(this,Za,Promise.resolve());m(this,or,new AbortController);m(this,ou);d(this,iu,t),d(this,su,e),d(this,Ha,r),d(this,ou,new Promise(i=>{s(this,or).signal.addEventListener("abort",()=>i())})),h(this,Ze,W6).call(this)}get signal(){return s(this,or).signal}get closed(){return s(this,ou)}async sendRequest(t,e){h(this,Ze,Km).call(this);const r=kh(this,Zd)._++,i=new Promise((o,a)=>{s(this,Bi).set(r,{resolve:o,reject:a})});return await h(this,Ze,Ac).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){h(this,Ze,Km).call(this),await h(this,Ze,Ac).call(this,{jsonrpc:"2.0",method:t,params:e})}}Bi=new WeakMap,Zd=new WeakMap,iu=new WeakMap,su=new WeakMap,Ha=new WeakMap,Za=new WeakMap,or=new WeakMap,ou=new WeakMap,Ze=new WeakSet,W6=async function(){let t;try{const e=s(this,Ha).readable.getReader();try{for(;!s(this,or).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{h(this,Ze,j6).call(this,r)}catch(o){console.error("Unexpected error during message processing:",r,o),"id"in r&&r.id!==void 0&&h(this,Ze,Ac).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{h(this,Ze,Ym).call(this,t)}},Ym=function(t){if(s(this,or).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of s(this,Bi).values())r.reject(e);s(this,Bi).clear(),s(this,or).abort(e)},j6=async function(t){if("method"in t&&"id"in t){const e=await h(this,Ze,G6).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await h(this,Ze,Ac).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await h(this,Ze,Y6).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?h(this,Ze,K6).call(this,t):console.error("Invalid message",{message:t})},G6=async function(t,e){try{return{result:await s(this,iu).call(this,t,e)??null}}catch(r){if(r instanceof rt)return r.toResult();if(r instanceof _2)return rt.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return rt.internalError(i?JSON.parse(i):{}).toResult()}catch{return rt.internalError({details:i}).toResult()}}},Y6=async function(t,e){try{return await s(this,su).call(this,t,e),{result:null}}catch(r){if(r instanceof rt)return r.toResult();if(r instanceof _2)return rt.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return rt.internalError(i?JSON.parse(i):{}).toResult()}catch{return rt.internalError({details:i}).toResult()}}},K6=function(t){const e=s(this,Bi).get(t.id);if(e){if("result"in t)e.resolve(t.result);else if("error"in t){const{code:r,message:i,data:o}=t.error;e.reject(new rt(r,i,o))}s(this,Bi).delete(t.id)}else console.error("Got response to unknown request",t.id)},Km=function(){if(s(this,or).signal.aborted)throw s(this,or).signal.reason??new Error("ACP connection closed")},Ac=async function(t){return d(this,Za,s(this,Za).then(async()=>{const e=s(this,Ha).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{h(this,Ze,Ym).call(this,e)})),s(this,Za)};class rt extends Error{constructor(e,r,i){super(r);I(this,"code");I(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new rt(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new rt(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new rt(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new rt(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new rt(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new rt(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new rt(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function f5(n,t,e){const r=n.dispose.bind(n);n.dispose=(()=>{if(!t())return e(),r()})}function J6(n){var e;class t extends n{constructor(...o){super(...o);m(this,e,!1);f5(this,()=>s(this,e),()=>{d(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,e)}}return e=new WeakMap,t}const m5=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,g5=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,v5=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,y5=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,w5=/^[A-Za-z0-9_@%+=:,./-]+$/,b5=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,S5="single_session",_5={name:"television-acp-client",version:"0.0.0"},X6="agent:main:television",A5=J6(Ti);var Ua,ar,Xt,lr,Wi,On,Yr,cr,Mn,ji,Nn,Fa,qa,ur,Et,Kr,Va,uo,Jr,Gi,au,zn,hr,Ud,dr,O,Jm,Q6,eS,tS,Vh,nS,rS,iS,sS,oS,aS,lS,Vs,va,ya,Fr,cS,wa,Xm,Qm,Bh,uS,Wh,eg,tg,lu,cu,jh,ba,ng,hS;class E5 extends A5{constructor(e){super();m(this,O);m(this,Ua,"disconnected");m(this,ar,null);m(this,Xt,new Map);m(this,lr,null);m(this,Wi,null);m(this,On,null);m(this,Yr,null);m(this,cr,null);m(this,Mn,null);m(this,ji);m(this,Nn,null);m(this,Fa,0);m(this,qa,1);m(this,ur,null);m(this,Et,null);m(this,Kr,!1);m(this,Va,!1);m(this,uo,!1);m(this,Jr,null);m(this,Gi,new Set);m(this,au);m(this,zn);m(this,hr);m(this,Ud,e=>{h(this,O,eS).call(this,e)});m(this,dr,null);m(this,lu,()=>{h(this,O,ba).call(this,"ACP bridge websocket closed")});m(this,cu,()=>{h(this,O,ba).call(this,"ACP bridge websocket error")});d(this,zn,e),d(this,hr,e.sessionMode??S5),d(this,ji,e.mappedSessionStore??k5()),d(this,au,e.createSocket??(r=>new WebSocket(r)))}get status(){return s(this,Ua)}get messages(){return[...s(this,Xt).values()]}get enabled(){return s(this,zn).enabled??!1}setToken(e){s(this,zn).token=e??""}setEnabled(e){s(this,zn).enabled=e,e||(h(this,O,jh).call(this),d(this,ar,null),h(this,O,Fr).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){s(this,Wi)===null&&(d(this,ar,null),d(this,Wi,h(this,O,Q6).call(this)));try{await s(this,Wi),await h(this,O,Vh).call(this)}catch(e){throw h(this,O,ba).call(this,Em(e)),e}}}dispose(){h(this,O,jh).call(this),d(this,ar,null),h(this,O,Fr).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,O,Jm).call(this,"ready")),(s(this,cr)===null||s(this,Nn)!==h(this,O,Wh).call(this))&&await h(this,O,Vh).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=e.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,O,va).call(this,{id:h(this,O,wa).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,O,Fr).call(this,"running");try{const i=await h(this,O,Bh).call(this).prompt({sessionId:h(this,O,Qm).call(this),prompt:[{type:"text",text:h(this,O,cS).call(this,r)}]});h(this,O,Vs).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,O,Fr).call(this,"ready")}catch(i){throw h(this,O,hS).call(this)||(h(this,O,Vs).call(this,"error"),h(this,O,Fr).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,O,Jm).call(this,"ready"));const e=h(this,O,Wh).call(this);((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="mapped"?s(this,ji).clearActualSessionId(e):d(this,Fa,s(this,Fa)+1),d(this,On,null),d(this,Yr,null),d(this,cr,null),d(this,Nn,null),h(this,O,ng).call(this)}async cancel(){this.status==="running"&&(h(this,O,Fr).call(this,"cancelling"),await h(this,O,Bh).call(this).cancel({sessionId:h(this,O,Qm).call(this)}))}setChannelContext(e){var o,a,l;if(e===null){if(s(this,Et)===null)return;d(this,Et,null),d(this,Kr,!1);return}const r={channelID:e.channelID,channelName:e.channelName};if(((o=s(this,Et))==null?void 0:o.channelID)===r.channelID&&((a=s(this,Et))==null?void 0:a.channelName)===r.channelName)return;const i=((l=s(this,Et))==null?void 0:l.channelID)??null;if(d(this,Et,r),s(this,hr)==="single_session"){(!s(this,Nn)||i!==r.channelID)&&d(this,Kr,!0);return}s(this,Nn)!==h(this,O,eg).call(this,r.channelID)&&(d(this,On,null),d(this,Yr,null),s(this,lr)&&this.status==="ready"&&h(this,O,Vh).call(this).catch(c=>{h(this,O,ba).call(this,Em(c))}))}}Ua=new WeakMap,ar=new WeakMap,Xt=new WeakMap,lr=new WeakMap,Wi=new WeakMap,On=new WeakMap,Yr=new WeakMap,cr=new WeakMap,Mn=new WeakMap,ji=new WeakMap,Nn=new WeakMap,Fa=new WeakMap,qa=new WeakMap,ur=new WeakMap,Et=new WeakMap,Kr=new WeakMap,Va=new WeakMap,uo=new WeakMap,Jr=new WeakMap,Gi=new WeakMap,au=new WeakMap,zn=new WeakMap,hr=new WeakMap,Ud=new WeakMap,dr=new WeakMap,O=new WeakSet,Jm=async function(e){if(this.status!==e){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(s(this,ar)??"ACPClient is disconnected");await new Promise((r,i)=>{const o=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===e){o(),r();return}if(this.status==="disposed"){o(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(o(),i(new Error(s(this,ar)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},Q6=async function(){try{const{stream:e,socket:r,metadata:i}=await I5({serverURL:s(this,zn).serverURL,token:s(this,zn).token,createSocket:s(this,au),onDisconnect:s(this,Ud)});d(this,Mn,i),d(this,dr,r),r.addEventListener("close",s(this,lu)),r.addEventListener("error",s(this,cu)),d(this,lr,new d5(o=>({connection:o,sessionUpdate:async a=>{await h(this,O,rS).call(this,a)},requestPermission:async a=>h(this,O,iS).call(this,a)}),e)),await s(this,lr).initialize({protocolVersion:YI,clientCapabilities:{},clientInfo:_5})}catch(e){throw e}},eS=function(e){h(this,O,ba).call(this,Em(e))},tS=function(e){const r=e==null?void 0:e.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(o=>o.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},Vh=async function(){const e=h(this,O,Wh).call(this);if(s(this,On)&&s(this,Yr)===e){await s(this,On);return}d(this,Yr,e),d(this,On,h(this,O,nS).call(this,e)),await s(this,On)},nS=async function(e){var c;const r=h(this,O,Bh).call(this);h(this,O,ng).call(this);let i,o=!1,a=null;const l={cwd:h(this,O,uS).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(d(this,uo,!0),d(this,Jr,null),((c=s(this,Mn))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=s(this,ji).getActualSessionId(e);if(u)try{const p=await r.loadSession({...l,sessionId:u});if(T5(p))throw new Error("Mapped ACP session was not found");a=p,i=u,o=!0}catch{const p=await r.newSession(l);a=p,i=p.sessionId,s(this,ji).setActualSessionId(e,i),o=!1}else{const p=await r.newSession(l);a=p,i=p.sessionId,s(this,ji).setActualSessionId(e,i),o=!1}}else try{a=await r.loadSession({...l,sessionId:e}),i=e,o=s(this,Xt).size>0}catch{const u=await r.newSession(l);a=u,i=u.sessionId,o=!1}}finally{d(this,uo,!1),d(this,Jr,null),h(this,O,Vs).call(this,"final")}h(this,O,tS).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,cr,i),d(this,Nn,e),d(this,Va,!0),o?(s(this,Gi).add(e),s(this,hr)==="single_session"&&d(this,Kr,!1)):(s(this,Gi).delete(e),d(this,Kr,s(this,hr)==="single_session")),d(this,ar,null),h(this,O,Fr).call(this,"ready")},rS=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,O,lS).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,O,sS).call(this,r.content.text);return;case"tool_call":h(this,O,oS).call(this,r);return;case"tool_call_update":h(this,O,aS).call(this,r);return;case"agent_thought_chunk":return;default:return}},iS=async function(e){return{outcome:{outcome:"cancelled"}}},sS=function(e){d(this,Jr,null);const r=R5(e);if(!r)return;if(!s(this,ur)){const o={id:h(this,O,wa).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,ur,o.id),h(this,O,va).call(this,o);return}const i=s(this,Xt).get(s(this,ur));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,O,ya).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},oS=function(e){h(this,O,Vs).call(this,"final");const r=h(this,O,Xm).call(this,e.toolCallId),i=L2("content"in e?e.content:void 0),o={id:(r==null?void 0:r.id)??h(this,O,wa).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:e.title,toolKind:e.kind??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,O,ya).call(this,o);return}h(this,O,va).call(this,o)},aS=function(e){const r=h(this,O,Xm).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",o=L2(e.content),a=o?`${i}${o}`:i,l={id:(r==null?void 0:r.id)??h(this,O,wa).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:(r==null?void 0:r.title)??e.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:a,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,O,ya).call(this,l);return}h(this,O,va).call(this,l)},lS=function(e){if(h(this,O,Vs).call(this,"final"),!e)return;const r=s(this,uo)?s(this,Jr):null;if(!r){const o=D2(e);if(!o)return;const a={id:h(this,O,wa).call(this,"user"),kind:"user",text:o,status:"final"};h(this,O,va).call(this,a),s(this,uo)&&d(this,Jr,a.id);return}const i=s(this,Xt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,O,ya).call(this,{...i,text:D2(`${i.text}${e}`)})},Vs=function(e){if(!s(this,ur))return;const r=s(this,Xt).get(s(this,ur));(r==null?void 0:r.kind)==="assistant"&&h(this,O,ya).call(this,{...r,status:e}),d(this,ur,null)},va=function(e){s(this,Xt).set(e.id,e),this.dispatchEvent(new bm("messages-changed"))},ya=function(e){s(this,Xt).set(e.id,e),this.dispatchEvent(new bm("messages-changed"))},Fr=function(e){s(this,Ua)!==e&&(d(this,Ua,e),this.dispatchEvent(new Pk("status-changed")))},cS=function(e){var u;const r=s(this,Nn);if(!r)return e;const i=s(this,Et)?s(this,hr)==="single_session"?s(this,Kr)||!s(this,Gi).has(r):!s(this,Gi).has(r):!1,o=s(this,Va)&&(s(this,Et)!==null||y5.test(e));if(!(o||i))return e;o&&d(this,Va,!1),i&&(d(this,Kr,!1),s(this,Gi).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."],c=((u=s(this,Mn))==null?void 0:u.tvArgs)??[];return c.length>0&&l.push(`To reach this Television server, add these arguments to each tv command that contacts it: ${c.map(P5).join(" ")}`),s(this,Et)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${s(this,Et).channelID}`),l.push(`channel_name: ${s(this,Et).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",e),l.join(`
|
|
43
|
-
`)},wa=function(e){const r=`${e}-${s(this,qa)}`;return d(this,qa,s(this,qa)+1),r},Xm=function(e){for(const r of s(this,Xt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},Qm=function(){if(!s(this,cr))throw new Error("ACP session is not ready");return s(this,cr)},Bh=function(){if(!s(this,lr))throw new Error("ACP connection is not ready");return s(this,lr)},uS=function(){var r;const e=(r=s(this,Mn))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},Wh=function(){var r;if(s(this,hr)==="single_session")return h(this,O,tg).call(this,`${X6}-${(s(this,zn).clientGUID??"default-client").toLowerCase()}`);const e=(r=s(this,Et))==null?void 0:r.channelID;if(!e)throw new Error("Channel context is required for per-channel session mode");return h(this,O,eg).call(this,e)},eg=function(e){return h(this,O,tg).call(this,C5(s(this,hr),e,s(this,zn).clientGUID??"default-client"))},tg=function(e){var r;return((r=s(this,Mn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&s(this,Fa)>0?`${e}:epoch-${s(this,Fa)}`:e},lu=new WeakMap,cu=new WeakMap,jh=function(){d(this,lr,null),d(this,Wi,null),d(this,On,null),d(this,Yr,null),d(this,cr,null),d(this,Nn,null),d(this,Mn,null),s(this,dr)&&(s(this,dr).removeEventListener("close",s(this,lu)),s(this,dr).removeEventListener("error",s(this,cu)),s(this,dr).close(),d(this,dr,null))},ba=function(e){const r=s(this,lr)!==null||s(this,Wi)!==null||s(this,On)!==null||s(this,Yr)!==null||s(this,cr)!==null||s(this,Nn)!==null||s(this,Mn)!==null||s(this,dr)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,O,Vs).call(this,"error"),h(this,O,jh).call(this),d(this,ar,e??null),h(this,O,Fr).call(this,"disconnected"))},ng=function(){const e=s(this,Xt).size>0;d(this,ur,null),d(this,Jr,null),d(this,qa,1),s(this,Xt).clear(),e&&this.dispatchEvent(new bm("messages-changed"))},hS=function(){return this.status==="disconnected"};function k5(){const n=new Map;return{getActualSessionId(t){return n.get(t)??null},setActualSessionId(t,e){n.set(t,e)},clearActualSessionId(t){n.delete(t)}}}function T5(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function C5(n,t,e){return n==="single_session"?`${X6}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function dS(n){return n.replace(/^(?:\s*\n)+/,"")}function D2(n){let t=n;return t=t.replace(m5,""),t=t.replace(g5,""),t=t.replace(v5,""),t=dS(t),t}function R5(n){let t=n;return t=t.replace(b5,""),t=dS(t),t}function L2(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function I5(n){const t=n.createSocket(L5(n.serverURL,n.token));let e=!1,r,i;const o=new Promise((u,p)=>{r=u,i=p}),a=new ReadableStream({start(u){let p=!1;const f=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},y=_=>{const x=D5(_);if(!x)return;let Z;try{Z=JSON.parse(x)}catch(L){const z=L instanceof Error?L:new Error(String(L));i(z),u.error(z);return}switch(Z.type){case"acp-bridge-status":if(Z.status==="ready"){let L;try{L=$5(Z)}catch(z){const P=z instanceof Error?z:new Error(String(z));e||i(P),u.error(P);return}e||(e=!0,r(L));return}if(Z.status==="error"||Z.status==="exited"){const L=new Error(Z.error??`ACP bridge ${Z.status}`);e||i(L),u.error(L)}return;case"acp-bridge-message":u.enqueue(Z.message);return}},v=()=>{var x;if(p)return;p=!0;const _=new Error("ACP bridge websocket closed");e||i(_),(x=n.onDisconnect)==null||x.call(n,_),u.close()},S=()=>{var x;if(p)return;p=!0;const _=new Error("ACP bridge websocket error");e||i(_),(x=n.onDisconnect)==null||x.call(n,_),u.error(_)};t.addEventListener("open",f),t.addEventListener("message",y),t.addEventListener("close",v),t.addEventListener("error",S)}}),l=new WritableStream({async write(u){await o,t.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){t.close()},abort(){t.close()}}),c=await o;return{stream:{readable:a,writable:l},socket:t,metadata:c}}function $5(n){const{agent:t,sessionIdStrategy:e,sessionCwd:r,tvArgs:i}=n;if((t==="openclaw"||t==="hermes")&&(e==="deterministic"||e==="mapped")&&typeof r=="string"&&r.length>0&&x5(i))return{agent:t,sessionIdStrategy:e,sessionCwd:r,tvArgs:i};throw new Error("ACP bridge ready status missing bootstrap metadata")}function x5(n){return Array.isArray(n)&&n.every(t=>typeof t=="string")}function P5(n){return w5.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`}function D5(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const t=n.data;if(typeof t=="string")return t;if(t instanceof Uint8Array)return new TextDecoder().decode(t);if(Array.isArray(t))return Buffer.concat(t).toString("utf8")}return null}function L5(n,t){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname="/acp",e.search="",e.searchParams.set("token",t),e.hash="",e.toString()}function Em(n){return n instanceof Error?n.message:String(n)}const O2="television.acpClientGUID",M2="television.acpMappedSessions",N2=1;var Ba;class O5{constructor(){m(this,Ba,new Map)}getActualSessionId(t){return s(this,Ba).get(t)??null}setActualSessionId(t,e){s(this,Ba).set(t,e)}clearActualSessionId(t){s(this,Ba).delete(t)}}Ba=new WeakMap;var Wa,uu,sn,Gh,Yh,rg;class M5{constructor(t,e){m(this,sn);m(this,Wa);m(this,uu);d(this,Wa,t),d(this,uu,e)}getActualSessionId(t){const e=h(this,sn,Yh).call(this)[h(this,sn,Gh).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=h(this,sn,Yh).call(this);r[h(this,sn,Gh).call(this,t)]=e,h(this,sn,rg).call(this,r)}clearActualSessionId(t){const e=h(this,sn,Yh).call(this);delete e[h(this,sn,Gh).call(this,t)],h(this,sn,rg).call(this,e)}}Wa=new WeakMap,uu=new WeakMap,sn=new WeakSet,Gh=function(t){return JSON.stringify([s(this,uu),t])},Yh=function(){const t=s(this,Wa).getItem(M2);if(!t)return{};let e;try{e=JSON.parse(t)}catch{return{}}if(typeof e!="object"||e===null||Array.isArray(e))return{};const r=e;return r.version!==N2?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},rg=function(t){const e={version:N2,entries:t};s(this,Wa).setItem(M2,JSON.stringify(e))};function pS(){return typeof window>"u"?null:window.localStorage}function N5(n){const t=n.getItem(O2);if(t)return t;const e=U1().toLowerCase();return n.setItem(O2,e),e}const z2=4401,z5=401,Ph=1e3,H5=3e4;class Kh extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class Z5 extends Ti{constructor(e){var a,l;super();I(this,"url");I(this,"name");I(this,"telemetryMeta");I(this,"status","unauthorized");I(this,"channels",new Map);I(this,"client");I(this,"acpClient");I(this,"_token");I(this,"attempting",!1);I(this,"nextRetryAt",null);I(this,"hasEverConnected",!1);I(this,"browserDemoMode",!1);I(this,"hasAuthRejected",!1);I(this,"hasAuthTokenRejected",!1);I(this,"bootState","pending");I(this,"serverVersion",null);I(this,"updateState",null);I(this,"decideBoot");I(this,"navigationPending");I(this,"createSocket");I(this,"createClient");I(this,"socket",null);I(this,"connectAttempt",0);I(this,"autoReconnect",!1);I(this,"retryTimer",null);I(this,"retryDelay",Ph);I(this,"visibilityEventTarget");I(this,"networkEventTarget");I(this,"onVisibilityChange");I(this,"onNetworkOnline");I(this,"telemetryActivityAgent");this.url=Es(e.url),this.name=e.name,this.decideBoot=e.decideBoot??null,this.navigationPending=e.navigationPending??(()=>!1),this._token=e.token??null,this.telemetryMeta=e.telemetryMeta??null,this.createSocket=e.createSocket??(c=>new WebSocket(c)),this.createClient=e.createClient??((c,u,p)=>new sk(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...p?{telemetryMeta:p}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new M5(e.acpStorage,this.url):new O5);this.acpClient=new E5({serverURL:this.url,token:this._token??"",...e.createACPSocket?{createSocket:e.createACPSocket}:e.createSocket?{createSocket:e.createSocket}:{},...e.clientGUID?{clientGUID:e.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=e.visibilityEventTarget!==void 0?e.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=e.networkEventTarget!==void 0?e.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(a=this.visibilityEventTarget)==null||a.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=e.telemetryDocumentTarget!==void 0?e.telemetryDocumentTarget:typeof document<"u"?document:null,o=e.telemetryWindowTarget!==void 0?e.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&o?WI({meta:this.telemetryMeta,documentTarget:i,windowTarget:o,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(e){this._token=e,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Ph,this.autoReconnect=!0,await this.attempt()}dispose(){var e,r,i,o;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(e=this.socket)==null||e.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(o=this.telemetryActivityAgent)==null||o.stop(),this.acpClient.dispose()}getViewURL(e){const r=Td(e,this.renderOptions());return wi()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}async readDemoMode(){try{return await this.client.demoMode()}catch{return null}}renderOptions(){return{electron:wi(),browserDemo:this.browserDemoMode}}getContentURL(e){const r=Td(e,this.renderOptions()).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(e){const{channel:r}=await this.client.channels.create({name:e});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"channel-created":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Sc("channels-changed"));break;case"channel-updated":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Sc("channels-changed"));break;case"channel-removed":this.channels.delete(e.channelID),this.dispatchEvent(new Sc("channels-changed"));break;case"artifact-created":{const r=this.channels.get(e.channelID);r&&!FE(r).includes(e.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[e.artifact.id],geometry:{...g8},size:{...v8}}]);break}case"artifact-removed":{const r=this.channels.get(e.channelID);r&&(r.layout=zm(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return U5(e,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const e=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new Bt("change"));const r=this.createSocket(F5(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((o,a)=>{let l=!1;const c=()=>{var f;l||this.connectAttempt!==e||(l=!0,this.retryDelay=Ph,this.hasEverConnected=!0,this.setStatus("connected"),(f=this.telemetryActivityAgent)==null||f.start(),o())},u=f=>{l||this.connectAttempt!==e||(l=!0,a(f))},p=async()=>{const f=this.hasEverConnected;try{const[{channels:y},v,S]=await Promise.all([this.client.channels.list(),this.client.display.get(),f?null:this.readDemoMode()]);f||(this.browserDemoMode=(S==null?void 0:S.browserExternalPages)===!0),this.channels=new Map(y.map(_=>[_.id,structuredClone(_)])),this.acpClient.setEnabled(v.acpEnabled),this.dispatchEvent(new Bt("change")),f&&this.dispatchEvent(new Sc("channels-changed")),this.dispatchEvent(new Fh("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:v.focusedChannelId}})),this.dispatchEvent(new Fh("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...v.pinnedChannelIds]}})),c(),f&&this.connectAttempt===e&&this.dispatchEvent(new R8("server-reconnected",{serverURL:this.url}))}catch(y){if(G5(y)){u(new Kh);return}u(y instanceof Error?y:new Error(String(y)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||p())}),r.addEventListener("message",f=>{const y=j5(f);if(!y)return;if(y.type==="server-status"){const S=y;this.serverVersion=S.version,this.updateState=S.update??null;let _=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(S)==="boot"?(this.bootState="booted",_=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new I8("server-status",{serverURL:this.url,message:S})),_?this.navigationPending()||p():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new Bt("change"));return}if(!W5(y.type))return;const v=y;this.applyServerEvent(v),this.dispatchEvent(new Fh("server-event",{serverURL:this.url,event:v}))}),r.addEventListener("close",f=>{if(this.connectAttempt!==e)return;this.socket=null;const y=q5(f);if(!l){u(y===z2?new Kh:new Error("Connection closed before initialization"));return}if(y===z2){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},o=>{throw this.attempting=!1,this.handleAttemptFailure(o),o})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof Kh){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(e){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const e=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,H5),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new Bt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new Bt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Ph,this.attempt().catch(()=>{})))}sendTelemetryActivity(e){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(e)))}sendTelemetrySignal(e,r){var o;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:UE,clientId:this.telemetryMeta.clientId,event:e,properties:r};(o=this.socket)==null||o.send(JSON.stringify(i))}setStatus(e){this.status!==e&&(this.status=e,this.dispatchEvent(new Bt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function U5(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function F5(n,t,e=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",t&&r.searchParams.set("token",t),e)for(const[i,o]of BI(e))r.searchParams.set(i,o);return r.hash="",r.toString()}function q5(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const V5={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"appearance-changed":!0,"artifact-focus":!0},B5=new Set(Object.keys(V5));function W5(n){return B5.has(n)}function j5(n){const t=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||!("type"in e)||typeof e.type!="string"?null:e}function G5(n){return n instanceof jl&&n.status===z5}const Y5="Local";var mn,Hn,$r,ig,sg,fS,hu,du,pu,fu,mu;class K5 extends Ti{constructor(e){super();m(this,$r);I(this,"connection");I(this,"clientGUID");I(this,"acpStorage");I(this,"connectError",null);m(this,mn);m(this,Hn,!1);m(this,hu,()=>{s(this,Hn)||(h(this,$r,fS).call(this),this.dispatchEvent(new Bt("change")))});m(this,du,e=>{s(this,Hn)||this.dispatchEvent(new Fh("server-event",{serverURL:e.serverURL,event:e.event}))});m(this,pu,()=>{s(this,Hn)||this.dispatchEvent(new Sc("channels-changed"))});m(this,fu,e=>{s(this,Hn)||this.dispatchEvent(new R8("server-reconnected",{serverURL:e.serverURL}))});m(this,mu,e=>{s(this,Hn)||this.dispatchEvent(new I8("server-status",{serverURL:e.serverURL,message:e.message}))});d(this,mn,e.localStore),this.acpStorage=e.acpStorage===void 0?pS():e.acpStorage,this.clientGUID=e.clientGUID??(this.acpStorage?N5(this.acpStorage):U1().toLowerCase());const r=Es(e.serverURL);e.launchToken!==void 0&&e.launchToken!==null&&s(this,mn).set(s2(s(this,mn).get(),r,e.launchToken));const i=e.launchToken??i2(s(this,mn).get(),r),o=e.createSocket??(l=>new WebSocket(l)),a=e.createConnection??(l=>new Z5(l));this.connection=a({url:r,name:e.connectionName??Y5,token:i,createSocket:o,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:e.telemetryMeta??null,decideBoot:e.decideBoot,navigationPending:e.navigationPending}),this.connection.addEventListener("change",s(this,hu)),this.connection.addEventListener("server-event",s(this,du)),this.connection.addEventListener("channels-changed",s(this,pu)),this.connection.addEventListener("server-reconnected",s(this,fu)),this.connection.addEventListener("server-status",s(this,mu))}get storedAuthToken(){return i2(s(this,mn).get(),this.connection.url)}async connect(){await h(this,$r,ig).call(this,this.connection.token)}async authenticate(e){s(this,mn).set(s2(s(this,mn).get(),this.connection.url,e)),await h(this,$r,ig).call(this,e)}dispose(){s(this,Hn)||(d(this,Hn,!0),this.connection.removeEventListener("change",s(this,hu)),this.connection.removeEventListener("server-event",s(this,du)),this.connection.removeEventListener("channels-changed",s(this,pu)),this.connection.removeEventListener("server-reconnected",s(this,fu)),this.connection.removeEventListener("server-status",s(this,mu)),this.connection.dispose())}}mn=new WeakMap,Hn=new WeakMap,$r=new WeakSet,ig=async function(e){if(!s(this,Hn)){h(this,$r,sg).call(this,null);try{await this.connection.connect(e)}catch(r){h(this,$r,sg).call(this,r instanceof Kh?null:r instanceof Error?r.message:String(r))}}},sg=function(e){this.connectError!==e&&(this.connectError=e,this.dispatchEvent(new Bt("change")))},fS=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const e=s(this,mn).get(),r=Mk(e,this.connection.url);r!==e&&s(this,mn).set(r),this.connection.token!==null&&this.connection.clearToken()},hu=new WeakMap,du=new WeakMap,pu=new WeakMap,fu=new WeakMap,mu=new WeakMap;const og="tv-nav:",zl="tv-reload",H2=100,J5=1e3,X5=60,Q5=60,eD=24,tD=30,nD=tD*eD*Q5*X5*J5;function bi(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(zl);return t.searchParams.delete(zl),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var gu,ja,$e,Ce,ho,Xe,mS,Mi,gS,ag,lg;class rD extends Ti{constructor(e,r){super();m(this,Xe);m(this,gu);m(this,ja);m(this,$e,[]);m(this,Ce,-1);m(this,ho,0);d(this,gu,e),d(this,ja,bi(r)),h(this,Xe,mS).call(this)}get currentURL(){var e;return s(this,Ce)===-1?null:((e=s(this,$e)[s(this,Ce)])==null?void 0:e.url)??null}get canGoBack(){return s(this,Ce)>-1}get canGoForward(){return s(this,Ce)<s(this,$e).length-1}get entries(){return s(this,$e).map(e=>({...e}))}get cursor(){return s(this,Ce)}navigate(e){const r=bi(e);if(r===s(this,ja)){if(s(this,Ce)===-1)return;d(this,Ce,-1),h(this,Xe,Mi).call(this);return}s(this,Ce)<s(this,$e).length-1&&d(this,$e,s(this,$e).slice(0,s(this,Ce)+1)),s(this,$e).push({url:r}),d(this,Ce,s(this,$e).length-1),h(this,Xe,ag).call(this),h(this,Xe,Mi).call(this)}replace(e){var i;if(s(this,Ce)===-1){this.navigate(e);return}const r=bi(e);if(r===s(this,ja)){d(this,$e,s(this,$e).filter((o,a)=>a!==s(this,Ce))),d(this,Ce,-1),h(this,Xe,Mi).call(this);return}((i=s(this,$e)[s(this,Ce)])==null?void 0:i.url)!==r&&(d(this,$e,s(this,$e).map((o,a)=>a===s(this,Ce)?{url:r}:o)),h(this,Xe,Mi).call(this))}back(){s(this,Ce)!==-1&&(d(this,Ce,s(this,Ce)-1),h(this,Xe,Mi).call(this))}forward(){this.canGoForward&&(d(this,Ce,s(this,Ce)+1),h(this,Xe,Mi).call(this))}reset(){s(this,Ce)===-1&&s(this,$e).length===0||(d(this,$e,[]),d(this,Ce,-1),h(this,Xe,Mi).call(this))}}gu=new WeakMap,ja=new WeakMap,$e=new WeakMap,Ce=new WeakMap,ho=new WeakMap,Xe=new WeakSet,mS=function(){const e=localStorage.getItem(s(this,Xe,lg));if(e!==null)try{const r=JSON.parse(e);if(!vS(r))return;d(this,$e,r.entries.map(i=>({url:i.url}))),d(this,Ce,r.cursor),d(this,ho,r.lastWritten),h(this,Xe,ag).call(this)}catch{d(this,$e,[]),d(this,Ce,-1),d(this,ho,0)}},Mi=function(){d(this,ho,Date.now());try{localStorage.setItem(s(this,Xe,lg),JSON.stringify(h(this,Xe,gS).call(this)))}catch(e){if(!oD(e))throw e}this.dispatchEvent(new Bt("change"))},gS=function(){return{v:1,entries:s(this,$e).map(e=>({...e})),cursor:s(this,Ce),lastWritten:s(this,ho)}},ag=function(){if(s(this,$e).length<=H2)return;const e=s(this,$e).length-H2;d(this,$e,s(this,$e).slice(e)),d(this,Ce,Math.max(-1,s(this,Ce)-e))},lg=function(){return iD(s(this,gu))};function iD(n){return`${og}${n}`}function sD(n){const t=Date.now()-nD,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(og)))continue;const o=i.slice(og.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{e.push(i);continue}if(!vS(l)){e.push(i);continue}!n.has(o)&&l.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function oD(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function vS(n){if(typeof n!="object"||n===null)return!1;const t=n;if(t.v!==1||!Array.isArray(t.entries))return!1;const e=t.cursor;return typeof e!="number"||!Number.isInteger(e)||typeof t.lastWritten!="number"||!Number.isFinite(t.lastWritten)||e<-1||e>=t.entries.length?!1:t.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const km="tv-channel-sidebar-collapsed";var po;class aD{constructor(t){m(this,po);d(this,po,t)}read(){return s(this,po).getItem(km)==="true"}setCollapsed(t){try{t?s(this,po).setItem(km,"true"):s(this,po).removeItem(km)}catch{}}}po=new WeakMap;const Tm="tv-channel-sidebar-width",cg=160,ug=350,Dh=260,lD=/^-?\d+$/;var fo;class cD{constructor(t){m(this,fo);d(this,fo,t)}read(){const t=s(this,fo).getItem(Tm);if(t===null||!lD.test(t))return null;const e=BigInt(t);return e<BigInt(cg)?cg:e>BigInt(ug)?ug:Number(e)}commit(t){const e=yS(Math.round(t));try{s(this,fo).setItem(Tm,String(e))}catch{}return e}clear(){try{s(this,fo).removeItem(Tm)}catch{}}}fo=new WeakMap;function yS(n){return Math.min(Math.max(n,cg),ug)}const uD="1.4.15";function J1(n=uD){return n!==void 0&&n.length>0?n:"0.0.0"}function X1(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const hg="tv-reload-attempted";function hD(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:lk(n.bundleVersion,n.serverVersion)?n.marker!==null&&n.marker.serverVersion===n.serverVersion?{action:"none"}:{action:"reload",marker:{serverVersion:n.serverVersion,fromVersion:n.bundleVersion}}:{action:"none"}:{action:"none"}}function dD(n){const t=n.getItem(hg);if(t===null)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;const r=e;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function pD(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??X1(),i=n.bundleVersion??J1();if(t===null)return{dispose(){}};let o=null;const a=()=>{if(o===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const p=o;o=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:p.fromVersion,to_version:p.toVersion})},l=u=>{if(r.pending)return;const p=hD({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:dD(t)});switch(p.action){case"reload":t.setItem(hg,JSON.stringify(p.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(hg),o={fromVersion:p.fromVersion,toVersion:p.toVersion},a();return;case"none":return}},c=()=>{a()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function fD(n){const t=wi(n.search),e=m6(n.search),r=e!==null&&Op(e)?e:null;return{electron:t,shellVersion:r}}function mD(n){return!n.electron||n.requiredDesktopVersion===null||!Op(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===bd?!1:Z1(n.requiredDesktopVersion,n.shellVersion)}const gD=`# Desktop app update required
|
|
44
|
-
|
|
45
|
-
This version of the Television desktop app does not work with this server and needs to be updated. The new version has already downloaded and installs when you restart the app.`,vD=`# Desktop app update required
|
|
46
|
-
|
|
47
|
-
This version of the Television desktop app does not work with this server and needs to be updated. [Download the latest version for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64) and install it.`;function wS(n,t=!1){return t?gD:n===null?vD:n.upgradeMarkdown}function yD(n){const t=mD(n);return{gated:t,instructionsMarkdown:t?wS(n.desktop):null,suppressUpdateToast:t}}function wD(n){const t=n.reload??(()=>location.reload()),e=n.navigationLatch??X1();let r=null,i=!1;const o=new Set,a=p=>{var f;return yD({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:p.requiredDesktopVersion,desktop:((f=p.update)==null?void 0:f.desktop)??null})};function l(){var p;(p=n.presentation)==null||p.suppressToasts()}function c(p){const f=p.requiredDesktopVersion;if(f===null||o.has(f))return;o.add(f);const y=r==null?void 0:r.connection;(y==null?void 0:y.url)===n.primaryServerURL&&y.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:f})}const u=p=>{e.pending||p.serverURL===n.primaryServerURL&&(a(p.message).gated?(i=!0,l(),c(p.message)):i&&e.begin(t))};return{get gated(){return i},decideBoot(p){return a(p).gated?"halt":"boot"},attach(p){r=p,p.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var Ga;class bD extends Ti{constructor(){super(...arguments);m(this,Ga,!1)}get toastsSuppressed(){return s(this,Ga)}suppressToasts(){s(this,Ga)||(d(this,Ga,!0),this.dispatchEvent(new Bt("change")))}}Ga=new WeakMap;const SD=`### Desktop app update ready
|
|
48
|
-
|
|
49
|
-
Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,_D="tv-desktop-self-update-dismissed";function AD(n){return SD.replace("{version}",n)}var vu,Ya,yu,mo,Ka;class ED extends Ti{constructor({electron:e,bridge:r}){super();m(this,vu);m(this,Ya);m(this,yu,!1);m(this,mo,null);m(this,Ka,!1);d(this,vu,e),d(this,Ya,r??null)}get version(){return s(this,mo)}get restarting(){return s(this,Ka)}subscribe(){if(s(this,yu))return;d(this,yu,!0);const e=s(this,Ya);!s(this,vu)||typeof(e==null?void 0:e.onDesktopUpdateDownloaded)!="function"||e.onDesktopUpdateDownloaded(r=>{typeof r!="string"||r.length===0||r===s(this,mo)||(d(this,mo,r),this.dispatchEvent(new Bt("change")))})}restart(){var e,r;s(this,mo)===null||s(this,Ka)||(d(this,Ka,!0),(r=(e=s(this,Ya))==null?void 0:e.restartToInstallUpdate)==null||r.call(e),this.dispatchEvent(new Bt("change")))}}vu=new WeakMap,Ya=new WeakMap,yu=new WeakMap,mo=new WeakMap,Ka=new WeakMap;function kD(n,t=window){const e=t.__televisionAppearanceResolver;if(e!==void 0)return e;const r=t.matchMedia("(prefers-color-scheme: dark)");let i=n;const o=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;t.document.documentElement.dataset.theme=c},l={setPreference(c){o(c)&&(i=c,a())}};return t.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function bS(n){return typeof n=="object"&&n!==null}function SS(n){return!bS(n)||n.type!=="ready"?!1:!("id"in n)}function _S(n){return!(!bS(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const AS=Rn(),ES="No handler registered for update-content",kS="handleUpdateContent: handler already registered",Z2="television-artifact-bridge";function TS(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const CS=J6(Ti);var Ja,Xa,Qa,go,vo,el,it,dg,RS,IS,Sa,Jh,Gb;let TD=(Gb=class extends CS{constructor(e){super();m(this,it);m(this,Ja);m(this,Xa);m(this,Qa);m(this,go,null);m(this,vo,null);m(this,el,!1);d(this,Ja,e);const r=e.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,Xa,r),d(this,Qa,i=>h(this,it,RS).call(this,i)),s(this,Xa).addEventListener("message",s(this,Qa))}get content(){return s(this,vo)}set content(e){h(this,it,Jh).call(this),d(this,vo,e),s(this,el)&&h(this,it,dg).call(this,e)}handleUpdateContent(e){if(h(this,it,Jh).call(this),s(this,go)!==null)throw new Error(kS);d(this,go,e)}notifyStylesChanged(){if(h(this,it,Jh).call(this),!s(this,el))return;const e={type:"styles-changed"};h(this,it,Sa).call(this,e)}dispose(){s(this,Xa).removeEventListener("message",s(this,Qa)),d(this,go,null)}},Ja=new WeakMap,Xa=new WeakMap,Qa=new WeakMap,go=new WeakMap,vo=new WeakMap,el=new WeakMap,it=new WeakSet,dg=function(e){const r={type:"content-updated",content:e};h(this,it,Sa).call(this,r)},RS=function(e){if(this.disposed||e.source!==s(this,Ja).contentWindow)return;const r=e.data;if(SS(r)){d(this,el,!0),this.dispatchEvent(new AS("ready")),s(this,vo)!==null&&h(this,it,dg).call(this,s(this,vo));return}if(_S(r)){h(this,it,IS).call(this,r);return}},IS=async function(e){const r=s(this,go);if(r===null){h(this,it,Sa).call(this,{type:"response",id:e.id,error:{message:ES}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,it,Sa).call(this,{type:"response",id:e.id,error:{message:TS(i)}});return}this.disposed||h(this,it,Sa).call(this,{type:"response",id:e.id,result:{}})},Sa=function(e){const r=s(this,Ja).contentWindow;r&&r.postMessage(e,"*")},Jh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},Gb);var yo,tl,wo,bo,nl,st,pg,$S,xS,_a,Xh;class CD extends CS{constructor(e){super();m(this,st);m(this,yo);m(this,tl);m(this,wo,null);m(this,bo,null);m(this,nl,!1);d(this,yo,e),d(this,tl,r=>h(this,st,$S).call(this,r)),s(this,yo).addEventListener("ipc-message",s(this,tl))}get content(){return s(this,bo)}set content(e){h(this,st,Xh).call(this),d(this,bo,e),s(this,nl)&&h(this,st,pg).call(this,e)}handleUpdateContent(e){if(h(this,st,Xh).call(this),s(this,wo)!==null)throw new Error(kS);d(this,wo,e)}notifyStylesChanged(){if(h(this,st,Xh).call(this),!s(this,nl))return;const e={type:"styles-changed"};h(this,st,_a).call(this,e)}dispose(){s(this,yo).removeEventListener("ipc-message",s(this,tl)),d(this,wo,null)}}yo=new WeakMap,tl=new WeakMap,wo=new WeakMap,bo=new WeakMap,nl=new WeakMap,st=new WeakSet,pg=function(e){const r={type:"content-updated",content:e};h(this,st,_a).call(this,r)},$S=function(e){var o;if(this.disposed)return;const r=e.detail??e;if(!r||r.channel!==Z2)return;const i=(o=r.args)==null?void 0:o[0];if(SS(i)){d(this,nl,!0),this.dispatchEvent(new AS("ready")),s(this,bo)!==null&&h(this,st,pg).call(this,s(this,bo));return}if(_S(i)){h(this,st,xS).call(this,i);return}},xS=async function(e){const r=s(this,wo);if(r===null){h(this,st,_a).call(this,{type:"response",id:e.id,error:{message:ES}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,st,_a).call(this,{type:"response",id:e.id,error:{message:TS(i)}});return}this.disposed||h(this,st,_a).call(this,{type:"response",id:e.id,result:{}})},_a=function(e){var r,i;(i=(r=s(this,yo)).send)==null||i.call(r,Z2,e)},Xh=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
|
|
50
|
-
* @license
|
|
51
|
-
* Copyright 2017 Google LLC
|
|
52
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
-
*/const Uc=globalThis,U2=n=>n,Cd=Uc.trustedTypes,F2=Cd?Cd.createPolicy("lit-html",{createHTML:n=>n}):void 0,PS="$lit$",Ui=`lit$${Math.random().toFixed(9).slice(2)}$`,DS="?"+Ui,RD=`<${DS}>`,ea=document,jc=()=>ea.createComment(""),Gc=n=>n===null||typeof n!="object"&&typeof n!="function",Q1=Array.isArray,ID=n=>Q1(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Cm=`[
|
|
54
|
-
\f\r]`,cc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q2=/-->/g,V2=/>/g,Us=RegExp(`>|${Cm}(?:([^\\s"'>=/]+)(${Cm}*=${Cm}*(?:[^
|
|
55
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),B2=/'/g,W2=/"/g,LS=/^(?:script|style|textarea|title)$/i,$D=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),j=$D(1),$t=Symbol.for("lit-noChange"),he=Symbol.for("lit-nothing"),j2=new WeakMap,eo=ea.createTreeWalker(ea,129);function OS(n,t){if(!Q1(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return F2!==void 0?F2.createHTML(t):t}const xD=(n,t)=>{const e=n.length-1,r=[];let i,o=t===2?"<svg>":t===3?"<math>":"",a=cc;for(let l=0;l<e;l++){const c=n[l];let u,p,f=-1,y=0;for(;y<c.length&&(a.lastIndex=y,p=a.exec(c),p!==null);)y=a.lastIndex,a===cc?p[1]==="!--"?a=q2:p[1]!==void 0?a=V2:p[2]!==void 0?(LS.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=Us):p[3]!==void 0&&(a=Us):a===Us?p[0]===">"?(a=i??cc,f=-1):p[1]===void 0?f=-2:(f=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?Us:p[3]==='"'?W2:B2):a===W2||a===B2?a=Us:a===q2||a===V2?a=cc:(a=Us,i=void 0);const v=a===Us&&n[l+1].startsWith("/>")?" ":"";o+=a===cc?c+RD:f>=0?(r.push(u),c.slice(0,f)+PS+c.slice(f)+Ui+v):c+Ui+(f===-2?l:v)}return[OS(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class Yc{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,a=0;const l=t.length-1,c=this.parts,[u,p]=xD(t,e);if(this.el=Yc.createElement(u,r),eo.currentNode=this.el.content,e===2||e===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=eo.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const f of i.getAttributeNames())if(f.endsWith(PS)){const y=p[a++],v=i.getAttribute(f).split(Ui),S=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:S[2],strings:v,ctor:S[1]==="."?DD:S[1]==="?"?LD:S[1]==="@"?OD:Wp}),i.removeAttribute(f)}else f.startsWith(Ui)&&(c.push({type:6,index:o}),i.removeAttribute(f));if(LS.test(i.tagName)){const f=i.textContent.split(Ui),y=f.length-1;if(y>0){i.textContent=Cd?Cd.emptyScript:"";for(let v=0;v<y;v++)i.append(f[v],jc()),eo.nextNode(),c.push({type:2,index:++o});i.append(f[y],jc())}}}else if(i.nodeType===8)if(i.data===DS)c.push({type:2,index:o});else{let f=-1;for(;(f=i.data.indexOf(Ui,f+1))!==-1;)c.push({type:7,index:o}),f+=Ui.length-1}o++}}static createElement(t,e){const r=ea.createElement("template");return r.innerHTML=t,r}}function Hl(n,t,e=n,r){var a,l;if(t===$t)return t;let i=r!==void 0?(a=e._$Co)==null?void 0:a[r]:e._$Cl;const o=Gc(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=Hl(n,i._$AS(n,t.values),i,r)),t}class PD{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??ea).importNode(e,!0);eo.currentNode=i;let o=eo.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new Bp(o,o.nextSibling,this,t):c.type===1?u=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(u=new MD(o,this,t)),this._$AV.push(u),c=r[++l]}a!==(c==null?void 0:c.index)&&(o=eo.nextNode(),a++)}return eo.currentNode=ea,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}let Bp=class MS{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=he,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Hl(this,t,e),Gc(t)?t===he||t==null||t===""?(this._$AH!==he&&this._$AR(),this._$AH=he):t!==this._$AH&&t!==$t&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ID(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==he&&Gc(this._$AH)?this._$AA.nextSibling.data=t:this.T(ea.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Yc.createElement(OS(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const a=new PD(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(t){let e=j2.get(t.strings);return e===void 0&&j2.set(t.strings,e=new Yc(t)),e}k(t){Q1(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const o of t)i===e.length?e.push(r=new MS(this.O(jc()),this.O(jc()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t!==this._$AB;){const i=U2(t).nextSibling;U2(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Wp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,o){this.type=1,this._$AH=he,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=he}_$AI(t,e=this,r,i){const o=this.strings;let a=!1;if(o===void 0)t=Hl(this,t,e,0),a=!Gc(t)||t!==this._$AH&&t!==$t,a&&(this._$AH=t);else{const l=t;let c,u;for(t=o[0],c=0;c<o.length-1;c++)u=Hl(this,l[r+c],e,c),u===$t&&(u=this._$AH[c]),a||(a=!Gc(u)||u!==this._$AH[c]),u===he?t=he:t!==he&&(t+=(u??"")+o[c+1]),this._$AH[c]=u}a&&!i&&this.j(t)}j(t){t===he?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},DD=class extends Wp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===he?void 0:t}},LD=class extends Wp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==he)}},OD=class extends Wp{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){if((t=Hl(this,t,e,0)??he)===$t)return;const r=this._$AH,i=t===he&&r!==he||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==he&&(r===he||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class MD{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Hl(this,t)}}const ND={I:Bp},Rm=Uc.litHtmlPolyfillSupport;Rm==null||Rm(Yc,Bp),(Uc.litHtmlVersions??(Uc.litHtmlVersions=[])).push("3.3.2");const Qh=(n,t,e)=>{const r=t;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Bp(t.insertBefore(jc(),null),null,void 0,{})),i._$AI(n),i};/**
|
|
56
|
-
* @license
|
|
57
|
-
* Copyright 2020 Google LLC
|
|
58
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/const{I:zD}=ND,G2=n=>n,NS=n=>n.strings===void 0,Y2=()=>document.createComment(""),uc=(n,t,e)=>{var o;const r=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const a=r.insertBefore(Y2(),i),l=r.insertBefore(Y2(),i);e=new zD(a,l,n,n.options)}else{const a=e._$AB.nextSibling,l=e._$AM,c=l!==n;if(c){let u;(o=e._$AQ)==null||o.call(e,n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==l._$AU&&e._$AP(u)}if(a!==i||c){let u=e._$AA;for(;u!==a;){const p=G2(u).nextSibling;G2(r).insertBefore(u,i),u=p}}}return e},Fs=(n,t,e=n)=>(n._$AI(t,e),n),HD={},zS=(n,t=HD)=>n._$AH=t,ZD=n=>n._$AH,Im=n=>{n._$AR(),n._$AA.remove()};/**
|
|
60
|
-
* @license
|
|
61
|
-
* Copyright 2017 Google LLC
|
|
62
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const Ir={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Jl=n=>(...t)=>({_$litDirective$:n,values:t});let fh=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
64
|
-
* @license
|
|
65
|
-
* Copyright 2017 Google LLC
|
|
66
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
-
*/const Fc=(n,t)=>{var r;const e=n._$AN;if(e===void 0)return!1;for(const i of e)(r=i._$AO)==null||r.call(i,t,!1),Fc(i,t);return!0},Rd=n=>{let t,e;do{if((t=n._$AM)===void 0)break;e=t._$AN,e.delete(n),n=t}while((e==null?void 0:e.size)===0)},HS=n=>{for(let t;t=n._$AM;n=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(n))break;e.add(n),qD(t)}};function UD(n){this._$AN!==void 0?(Rd(this),this._$AM=n,HS(this)):this._$AM=n}function FD(n,t=!1,e=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)Fc(r[o],!1),Rd(r[o]);else r!=null&&(Fc(r,!1),Rd(r));else Fc(this,n)}const qD=n=>{n.type==Ir.CHILD&&(n._$AP??(n._$AP=FD),n._$AQ??(n._$AQ=UD))};class ZS extends fh{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),HS(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(Fc(this,t),Rd(this))}setValue(t){if(NS(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}var wu,bu,Yi,So;class an extends ZS{constructor(){super(...arguments);m(this,wu,[]);m(this,bu,!1);m(this,Yi,!1);m(this,So,!1)}connected(){}template(...e){return $t}render(...e){return!this.isConnected||s(this,Yi)||this.setValue(e.length?e[0]:this.template(...s(this,wu))),$t}update(e,r){d(this,wu,r),d(this,So,!1),d(this,Yi,!0);try{return s(this,bu)||(d(this,bu,!0),this.connected()),this.template(...r)}finally{d(this,Yi,!1)}}reconnected(){d(this,Yi,!0);try{this.connected()}finally{d(this,Yi,!1)}d(this,So,!0),queueMicrotask(()=>{s(this,So)&&(d(this,So,!1),this.render())})}}wu=new WeakMap,bu=new WeakMap,Yi=new WeakMap,So=new WeakMap;function ln(n){return Jl(n)}function VD(n,t){var r;const e=n.connection;return e.authorizationRequired?e.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:e.gateHalted?{kind:"needs-upgrade",instructions:e.upgradeInstructions}:e.status!=="connected"?e.hasEverConnected?{kind:"disconnected",nextRetryAt:e.nextRetryAt}:e.firstConnectError!==null?{kind:"error",serverURL:t,message:e.firstConnectError}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}const BD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',WD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',jD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',GD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',YD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',KD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',JD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',XD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',QD='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',eL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',tL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',nL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',rL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',iL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',sL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',oL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',aL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',lL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',cL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',uL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',hL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',dL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',pL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',fL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',mL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',gL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',vL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',yL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',wL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',bL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',SL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',_L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',AL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',EL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',kL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',TL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',CL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',RL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',IL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',$L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',xL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',PL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',DL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',LL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',OL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',ML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',NL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',zL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',HL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',ZL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',UL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',FL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',qL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',VL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',BL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',WL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',jL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',GL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',YL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',KL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',JL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',XL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',QL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',eO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',tO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',nO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',rO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',iO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',sO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',oO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',aO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',lO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',cO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',uO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',hO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',dO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',pO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',fO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',mO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"/></svg>',gO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.58,128.84,160,91.06V48a32,32,0,0,0-64,0V91.06L20.42,128.84A8,8,0,0,0,16,136v32a8,8,0,0,0,9.57,7.84L96,161.76v18.93L82.34,194.34A8,8,0,0,0,80,200v32a8,8,0,0,0,11,7.43l37-14.81,37,14.81A8,8,0,0,0,176,232V200a8,8,0,0,0-2.34-5.66L160,180.69V161.76l70.43,14.08A8,8,0,0,0,240,168V136A8,8,0,0,0,235.58,128.84ZM224,158.24l-70.43-14.08A8,8,0,0,0,144,152v32a8,8,0,0,0,2.34,5.66L160,203.31v16.87l-29-11.61a8,8,0,0,0-5.94,0L96,220.18V203.31l13.66-13.65A8,8,0,0,0,112,184V152a8,8,0,0,0-9.57-7.84L32,158.24v-17.3l75.58-37.78A8,8,0,0,0,112,96V48a16,16,0,0,1,32,0V96a8,8,0,0,0,4.42,7.16L224,140.94Z"/></svg>',vO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,104H229.2L201.42,41.5A16,16,0,0,0,186.8,32H69.2a16,16,0,0,0-14.62,9.5L26.8,104H16a8,8,0,0,0,0,16h8v80a16,16,0,0,0,16,16H64a16,16,0,0,0,16-16V184h96v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V120h8a8,8,0,0,0,0-16ZM69.2,48H186.8l24.89,56H44.31ZM64,200H40V184H64Zm128,0V184h24v16Zm24-32H40V120H216ZM56,144a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16H64A8,8,0,0,1,56,144Zm112,0a8,8,0,0,1,8-8h16a8,8,0,0,1,0,16H176A8,8,0,0,1,168,144Z"/></svg>',yO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A32,32,0,0,0,40,64V208a16,16,0,0,0,16,16H80a16,16,0,0,0,16-16V192h64v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V64A32,32,0,0,0,184,32ZM56,176V120H200v56Zm0-96H200v24H56ZM72,48H184a16,16,0,0,1,16,16H56A16,16,0,0,1,72,48Zm8,160H56V192H80Zm96,0V192h24v16Zm-72-60a12,12,0,1,1-12-12A12,12,0,0,1,104,148Zm72,0a12,12,0,1,1-12-12A12,12,0,0,1,176,148Zm72-68v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0ZM24,80v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0Z"/></svg>',wO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H32V48a8,8,0,0,0-16,0V208a8,8,0,0,0,16,0V176H240v32a8,8,0,0,0,16,0V112A40,40,0,0,0,216,72ZM32,88h72v72H32Zm88,72V88h96a24,24,0,0,1,24,24v48Z"/></svg>',bO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M72,88V40a8,8,0,0,1,16,0V88a8,8,0,0,1-16,0ZM216,40V224a8,8,0,0,1-16,0V176H152a8,8,0,0,1-8-8,268.75,268.75,0,0,1,7.22-56.88c9.78-40.49,28.32-67.63,53.63-78.47A8,8,0,0,1,216,40ZM200,53.9c-32.17,24.57-38.47,84.42-39.7,106.1H200ZM119.89,38.69a8,8,0,1,0-15.78,2.63L112,88.63a32,32,0,0,1-64,0l7.88-47.31a8,8,0,1,0-15.78-2.63l-8,48A8.17,8.17,0,0,0,32,88a48.07,48.07,0,0,0,40,47.32V224a8,8,0,0,0,16,0V135.32A48.07,48.07,0,0,0,128,88a8.17,8.17,0,0,0-.11-1.31Z"/></svg>',SO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,112a24,24,0,0,0-24-24H136V79a32.06,32.06,0,0,0,24-31c0-28-26.44-45.91-27.56-46.66a8,8,0,0,0-8.88,0C122.44,2.09,96,20,96,48a32.06,32.06,0,0,0,24,31v9H48a24,24,0,0,0-24,24v23.33a40.84,40.84,0,0,0,8,24.24V200a24,24,0,0,0,24,24H200a24,24,0,0,0,24-24V159.57a40.84,40.84,0,0,0,8-24.24ZM112,48c0-13.57,10-24.46,16-29.79,6,5.33,16,16.22,16,29.79a16,16,0,0,1-32,0ZM40,112a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8v23.33c0,13.25-10.46,24.31-23.32,24.66A24,24,0,0,1,168,136a8,8,0,0,0-16,0,24,24,0,0,1-48,0,8,8,0,0,0-16,0,24,24,0,0,1-24.68,24C50.46,159.64,40,148.58,40,135.33Zm160,96H56a8,8,0,0,1-8-8V172.56A38.77,38.77,0,0,0,62.88,176a39.69,39.69,0,0,0,29-11.31A40.36,40.36,0,0,0,96,160a40,40,0,0,0,64,0,40.36,40.36,0,0,0,4.13,4.67A39.67,39.67,0,0,0,192,176c.38,0,.76,0,1.14,0A38.77,38.77,0,0,0,208,172.56V200A8,8,0,0,1,200,208Z"/></svg>',_O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M255.31,188.75l-64-144A8,8,0,0,0,184,40H72a8,8,0,0,0-7.27,4.69.21.21,0,0,0,0,.06l0,.12,0,0L.69,188.75A8,8,0,0,0,8,200H248a8,8,0,0,0,7.31-11.25ZM64,184H20.31L64,85.7Zm16,0V85.7L123.69,184Zm61.2,0L84.31,56H178.8l56.89,128Z"/></svg>',AO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"/></svg>',EO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm64,24V200H96V72ZM40,72H80V200H40ZM216,200H176V72h40V200Z"/></svg>',kO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"/></svg>',TO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',CO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',RO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24a104,104,0,0,0,0,208c21.51,0,44.1-6.48,60.43-17.33a8,8,0,0,0-8.86-13.33C166,210.38,146.21,216,128,216a88,88,0,1,1,88-88c0,26.45-10.88,32-20,32s-20-5.55-20-32V88a8,8,0,0,0-16,0v4.26a48,48,0,1,0,5.93,65.1c6,12,16.35,18.64,30.07,18.64,22.54,0,36-17.94,36-48A104.11,104.11,0,0,0,128,24Zm0,136a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"/></svg>',IO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96ZM216,72v41.61A184,184,0,0,1,128,136a184.07,184.07,0,0,1-88-22.38V72Zm0,128H40V131.64A200.19,200.19,0,0,0,128,152a200.25,200.25,0,0,0,88-20.37V200ZM104,112a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,112Z"/></svg>',$O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,112a47.81,47.81,0,0,0-16.93,3.09L165.93,72H192a8,8,0,0,1,8,8,8,8,0,0,0,16,0,24,24,0,0,0-24-24H152a8,8,0,0,0-6.91,12l11.65,20H99.26L82.91,60A8,8,0,0,0,76,56H48a8,8,0,0,0,0,16H71.41L85.12,95.51,69.41,117.06a48.13,48.13,0,1,0,12.92,9.44l11.59-15.9L125.09,164A8,8,0,1,0,138.91,156l-30.32-52h57.48l11.19,19.17A48,48,0,1,0,208,112ZM80,160a32,32,0,1,1-20.21-29.74l-18.25,25a8,8,0,1,0,12.92,9.42l18.25-25A31.88,31.88,0,0,1,80,160Zm128,32a32,32,0,0,1-22.51-54.72L201.09,164A8,8,0,1,0,214.91,156L199.3,129.21A32,32,0,1,1,208,192Z"/></svg>',xO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,24H72A32,32,0,0,0,40,56V184a32,32,0,0,0,32,32h8L65.6,235.2a8,8,0,1,0,12.8,9.6L100,216h56l21.6,28.8a8,8,0,1,0,12.8-9.6L176,216h8a32,32,0,0,0,32-32V56A32,32,0,0,0,184,24ZM56,120V80h64v40Zm80-40h64v40H136ZM72,40H184a16,16,0,0,1,16,16v8H56V56A16,16,0,0,1,72,40ZM184,200H72a16,16,0,0,1-16-16V136H200v48A16,16,0,0,1,184,200ZM96,172a12,12,0,1,1-12-12A12,12,0,0,1,96,172Zm88,0a12,12,0,1,1-12-12A12,12,0,0,1,184,172Z"/></svg>',PO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"/></svg>',DO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"/></svg>',LO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"/></svg>',OO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z"/></svg>',MO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,75.64V40a16,16,0,0,0-16-16H72A16,16,0,0,0,56,40V76a16.07,16.07,0,0,0,6.4,12.8L114.67,128,62.4,167.2A16.07,16.07,0,0,0,56,180v36a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V180.36a16.09,16.09,0,0,0-6.35-12.77L141.27,128l52.38-39.6A16.05,16.05,0,0,0,200,75.64ZM184,216H72V180l56-42,56,42.35Zm0-140.36L128,118,72,76V40H184Z"/></svg>',NO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M214.67,72H200V40a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8V72H41.33C27.36,72,16,82.77,16,96v80a8,8,0,0,0,8,8H56v32a8,8,0,0,0,8,8H192a8,8,0,0,0,8-8V184h32a8,8,0,0,0,8-8V96C240,82.77,228.64,72,214.67,72ZM72,48H184V72H72ZM184,208H72V160H184Zm40-40H200V152a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8v16H32V96c0-4.41,4.19-8,9.33-8H214.67c5.14,0,9.33,3.59,9.33,8Zm-24-52a12,12,0,1,1-12-12A12,12,0,0,1,200,116Z"/></svg>',zO=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media(prefers-reduced-motion:reduce){:host([spinning])>svg{animation:none}}',US=new CSSStyleSheet;US.replaceSync(zO);const FS={check:BD,close:WD,copy:jD,pin:GD,search:YD,add:KD,more:JD,settings:XD,expand:QD,collapse:eL,"collapse-up":tL,select:nL,skills:rL,notification:iL,artifact:sL,spinner:oL,locked:aL,unpin:lL,back:cL,forward:uL,television:hL,calendar:dL,grid:pL,hash:fL,delete:mL,edit:gL,link:vL,external:yL,download:wL,reload:bL,warning:SL,info:_L,file:AL,folder:EL,clock:kL,user:TL,upload:CL,star:RL,home:IL,send:$L,filter:xL,sort:PL,help:DL,chart:LL,image:OL,chat:ML,location:NL,play:zL,pause:HL,stop:ZL,video:UL,music:FL,error:qL,email:VL,phone:BL,web:WL,tag:jL,bookmark:GL,table:YL,code:KL,group:JL,up:XL,down:QL,money:eO,bank:tO,card:nO,wallet:rO,gauge:iO,activity:sO,"trend-up":oO,"trend-down":aO,database:lO,server:cO,deploy:uO,list:hO,terminal:dO,branch:pO,shield:fO,sidebar:mO,plane:gO,car:vO,bus:yO,bed:wO,food:bO,cake:SO,tent:_O,microphone:AO,luggage:EO,key:kO,sun:TO,moon:CO,at:RO,briefcase:IO,bicycle:$O,train:xO,gift:PO,book:DO,camera:LO,inbox:OO,hourglass:MO,printer:NO};function HO(n){return n!==null&&Object.hasOwn(FS,n)}var Su,fg;class qS extends HTMLElement{constructor(){super(...arguments);m(this,Su)}connectedCallback(){h(this,Su,fg).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Su,fg).call(this)}}Su=new WeakSet,fg=function(){const e=this.shadowRoot??this.attachShadow({mode:"open"});e.adoptedStyleSheets=[US],this.replaceChildren();const r=this.getAttribute("name");e.innerHTML=HO(r)?FS[r]:""},I(qS,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",qS);function jp(n){return j`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function Gp(n,t){let e=!1;const r=o=>{o.preventDefault(),t("escape")},i=o=>{if(o.target!==n)return;const a=n.getBoundingClientRect();o.clientX>=a.left&&o.clientX<=a.right&&o.clientY>=a.top&&o.clientY<=a.bottom||t("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const o of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))o.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){e||(e=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}function Kc(n){n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:"nearest"})}function VS(n,t){if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||t.length===0)return!1;const e=t.indexOf(t[0].ownerDocument.activeElement),r=n.key==="ArrowDown",i=e<0?r?0:t.length-1:Math.max(0,Math.min(t.length-1,e+(r?1:-1)));return n.preventDefault(),n.stopImmediatePropagation(),Kc(t[i]),!0}const mg=new WeakMap;function Aa(n,t,e){e===null?n.hasAttribute(t)&&n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}var Xr,_u,Au,rl,Ki,Rs,gg,Fd,qd,Vd,Bd,Wd,vg;class ZO{constructor(t){m(this,Rs);I(this,"document");I(this,"panels",new Set);m(this,Xr,new Map);m(this,_u,new WeakMap);m(this,Au,new AbortController);m(this,rl);m(this,Ki,0);m(this,Fd,t=>{if(!(t.target instanceof Element))return;const e=t.target;s(this,_u).set(t,{inside:new Set([...this.panels].filter(r=>{var i;return this.contains(r,e)||((i=r.trigger)==null?void 0:i.contains(e))})),open:[...this.panels].filter(r=>r.open)})});m(this,qd,t=>{var o,a,l;if(!(t.target instanceof Element))return;const e=t.target,r=s(this,_u).get(t),i=[...this.panels].find(c=>{var u;return(u=c.trigger)==null?void 0:u.contains(e)});for(const c of(r==null?void 0:r.open)??[])c.open&&!c.manual&&c!==i&&!(r!=null&&r.inside.has(c))&&c.close();if(i&&!((o=i.trigger)!=null&&o.disabled))i.toggle(t.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(e)&&((l=(a=c.behavior).click)==null||l.call(a,e))});m(this,Vd,t=>{var e,r;if(t.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(t.target)&&((r=(e=i.behavior).pointermove)==null||r.call(e,t.target))});m(this,Bd,t=>{var o,a,l,c;const e=h(this,Rs,gg).call(this),r=e.find(u=>u.behavior.select),i=r??e.find(u=>u.behavior.keydown);if(!((a=i==null?void 0:(o=i.behavior).keydown)!=null&&a.call(o,t))){if(t.key==="Escape"&&r){h(this,Rs,vg).call(this,t,e,r);return}for(const u of this.panels)if(!u.open&&u.trigger===this.document.activeElement&&((c=(l=u.behavior).keydown)!=null&&c.call(l,t)))return}});m(this,Wd,t=>{if(t.key!=="Escape"||t.defaultPrevented)return;const e=h(this,Rs,gg).call(this);h(this,Rs,vg).call(this,t,e)});this.document=t;const e={signal:s(this,Au).signal};t.addEventListener("click",s(this,Fd),{...e,capture:!0}),t.addEventListener("click",s(this,qd),e),t.addEventListener("keydown",s(this,Bd),{...e,capture:!0}),t.addEventListener("keydown",s(this,Wd),e),t.addEventListener("pointermove",s(this,Vd),e),d(this,rl,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),s(this,rl).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(s(this,Ki))return;const t=()=>{d(this,Ki,0);for(const e of this.panels)e.open&&e.place();[...this.panels].some(e=>e.open)&&d(this,Ki,this.document.defaultView.requestAnimationFrame(t))};d(this,Ki,this.document.defaultView.requestAnimationFrame(t))}remove(t){this.closed(t),this.panels.delete(t),!this.panels.size&&(s(this,Au).abort(),s(this,rl).disconnect(),this.document.defaultView.cancelAnimationFrame(s(this,Ki)),mg.delete(this.document))}prepareOpen(t){let e=null;for(const r of this.panels)r===t||!r.open||!t.trigger||!r.host.contains(t.trigger)||(e===null||e.host.contains(r.host))&&(e=r);if(s(this,Xr).set(t,e),!(t.manual||t.behavior.select))for(const r of this.panels)r.open&&r!==t&&!r.manual&&!r.behavior.select&&!this.isDescendant(t,r)&&r.close()}isDescendant(t,e){for(let r=s(this,Xr).get(t);r;r=s(this,Xr).get(r))if(r===e)return!0;return!1}contains(t,e){return e?t.host.contains(e)||[...this.panels].some(r=>this.isDescendant(r,t)&&r.host.contains(e)):!1}closeDescendants(t){for(const e of[...this.panels])this.isDescendant(e,t)&&e.close(!1)}closed(t){s(this,Xr).delete(t)}}Xr=new WeakMap,_u=new WeakMap,Au=new WeakMap,rl=new WeakMap,Ki=new WeakMap,Rs=new WeakSet,gg=function(){const t=e=>{let r=0;for(let i=s(this,Xr).get(e);i;i=s(this,Xr).get(i))r++;return r};return[...this.panels].filter(e=>e.open).reverse().sort((e,r)=>t(r)-t(e))},Fd=new WeakMap,qd=new WeakMap,Vd=new WeakMap,Bd=new WeakMap,Wd=new WeakMap,vg=function(t,e,r){if(!r&&e.some(o=>o.manual&&t.composedPath().includes(o.host)))return;const i=r??e.find(o=>!o.manual);i&&!i.manual&&(t.preventDefault(),t.stopImmediatePropagation(),i.close())};var We,Ji,_o,il,Xi,Qi,Pt,yg,BS,wg,Eu,WS,bg;class ev{constructor(t,e={}){m(this,Pt);I(this,"host");I(this,"behavior");I(this,"trigger",null);m(this,We);m(this,Ji,!1);m(this,_o,!1);m(this,il,!0);m(this,Xi,new Map);m(this,Qi,new Set);m(this,Eu,t=>{const e=t.target;e instanceof HTMLElement&&e!==this.host&&this.host.contains(e)&&s(this,Qi).add(e)});this.host=t,this.behavior=e}get open(){return this.host.hasAttribute("open")&&s(this,Ji)}get manual(){return this.host.hasAttribute("manual")}connect(){if(s(this,We))return;const t=this.host.ownerDocument;d(this,We,mg.get(t)),s(this,We)||(d(this,We,new ZO(t)),mg.set(t,s(this,We))),s(this,We).panels.add(this),this.refresh()}disconnect(){var e,r,i,o;if(!s(this,We))return;const t=s(this,We).contains(this,this.host.ownerDocument.activeElement);d(this,Ji,!1),s(this,We).closeDescendants(this),s(this,We).closed(this),this.host.removeAttribute("open"),(r=(e=this.behavior).closed)==null||r.call(e),h(this,Pt,wg).call(this),h(this,Pt,bg).call(this),t&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),h(this,Pt,yg).call(this),(o=s(this,We))==null||o.remove(this),d(this,We,void 0)}refresh(){var r,i,o,a,l,c,u;if(!s(this,We))return;const t=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),e=t instanceof HTMLButtonElement?t:null;if(e!==this.trigger&&(h(this,Pt,yg).call(this),this.trigger=e),this.trigger&&Aa(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==s(this,Ji))if(this.host.hasAttribute("open"))s(this,We).prepareOpen(this),d(this,Ji,!0),h(this,Pt,BS).call(this),h(this,Pt,WS).call(this),this.place(),(a=(o=this.behavior).opened)==null||a.call(o,s(this,_o)),d(this,_o,!1),s(this,We).animate();else{const p=s(this,We).contains(this,this.host.ownerDocument.activeElement);d(this,Ji,!1),s(this,We).closeDescendants(this),s(this,We).closed(this),(c=(l=this.behavior).closed)==null||c.call(l),h(this,Pt,wg).call(this),h(this,Pt,bg).call(this),p&&s(this,il)&&((u=this.trigger)!=null&&u.isConnected)&&this.trigger.focus({preventScroll:!0})}}toggle(t=!1){d(this,_o,t),this.host.toggleAttribute("open")}show(t=!1){d(this,_o,t),this.host.setAttribute("open","")}close(t=!0){d(this,il,t),this.host.removeAttribute("open"),this.refresh(),d(this,il,!0)}place(){var Ne,xe,tt;if(!this.open||!this.trigger)return;const t=this.host,e=t.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(e.getComputedStyle(t).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const o=t.scrollTop,a=t.scrollLeft,l=[];for(const le of s(this,Qi)){if(!le.isConnected||!t.contains(le)){s(this,Qi).delete(le);continue}l.push({element:le,scrollTop:le.scrollTop,scrollLeft:le.scrollLeft})}t.style.maxWidth="none";const c=s(this,Xi).get("max-height");c!=null&&c.value?t.style.setProperty("max-height",c.value,c.priority):t.style.removeProperty("max-height");const u=e.getComputedStyle(t).maxHeight;t.style.minWidth=this.behavior.select?`${Math.min(r.width,e.innerWidth-2*i)}px`:((Ne=s(this,Xi).get("min-width"))==null?void 0:Ne.value)??"";const p=t.getBoundingClientRect(),f=Math.max(0,e.innerWidth-i-r.left),y=Math.max(0,r.right-i),v=p.width>f&&y>f,S=Math.min(e.innerWidth-2*i,v?y:f),_=Number.parseFloat(e.getComputedStyle(t).minWidth)||0;t.style.minWidth=`${Math.max(0,Math.min(_,S))}px`,t.style.maxWidth=`${Math.max(0,S)}px`;const x=t.getBoundingClientRect(),Z=x.width,L=x.height,z=Math.max(i,Math.min(v?r.right-Z:r.left,e.innerWidth-i-Z));let P,B;if(this.behavior.select){const le=(tt=(xe=this.behavior).selectedRow)==null?void 0:tt.call(xe),je=le?le.getBoundingClientRect().top+le.offsetHeight/2-x.top:0,Dt=r.top+r.height/2-je;if(Dt>=i&&Dt+L<=e.innerHeight-i)P=Dt,B=e.innerHeight-i-Dt;else{const $n=e.innerHeight-i-r.top,ht=r.bottom-i,wt=L>$n&&ht>$n;B=wt?ht:$n,P=wt?r.bottom-Math.min(L,B):r.top}}else{const le=Math.max(0,e.innerHeight-i-r.bottom-i),je=Math.max(0,r.top-2*i),Dt=L>le&&je>le;B=Dt?je:le,P=Dt?r.top-i-Math.min(L,je):r.bottom+i}const F=`${Math.max(0,B)}px`;t.style.maxHeight=u==="none"?F:`min(${u}, ${F})`,t.style.left=`${z}px`,t.style.top=`${Math.max(i,Math.min(P,e.innerHeight-i-Math.min(L,B)))}px`;const q=e.getComputedStyle(t),Q=q.boxSizing==="border-box",V=parseFloat(q.width)+(Q?0:parseFloat(q.paddingLeft)+parseFloat(q.paddingRight)+parseFloat(q.borderLeftWidth)+parseFloat(q.borderRightWidth)),re=parseFloat(q.height)+(Q?0:parseFloat(q.paddingTop)+parseFloat(q.paddingBottom)+parseFloat(q.borderTopWidth)+parseFloat(q.borderBottomWidth));t.style.setProperty("--_panel-edge-inset",`${t.style.top} auto auto ${t.style.left}`),t.style.setProperty("--_panel-edge-width",`${V}px`),t.style.setProperty("--_panel-edge-height",`${re}px`),t.scrollTop=o,t.scrollLeft=a;for(const le of l)le.element.scrollTop=le.scrollTop,le.element.scrollLeft=le.scrollLeft}}We=new WeakMap,Ji=new WeakMap,_o=new WeakMap,il=new WeakMap,Xi=new WeakMap,Qi=new WeakMap,Pt=new WeakSet,yg=function(){var t,e;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(e=(t=this.behavior).unpair)==null||e.call(t,this.trigger),this.trigger=null)},BS=function(){s(this,Qi).clear(),this.host.addEventListener("scroll",s(this,Eu),!0)},wg=function(){this.host.removeEventListener("scroll",s(this,Eu),!0),s(this,Qi).clear()},Eu=new WeakMap,WS=function(){const t=this.host;for(const e of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])s(this,Xi).set(e,{value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)});t.style.position="fixed",t.style.zIndex="var(--layer-panel)",t.style.margin="0",t.style.overflow="auto",t.style.setProperty("--_panel-edge-position","fixed")},bg=function(){for(const[t,{value:e,priority:r}]of s(this,Xi))e?this.host.style.setProperty(t,e,r):this.host.style.removeProperty(t);s(this,Xi).clear()};class UO extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var es,xr,Sg,_g,GS;class jS extends HTMLElement{constructor(){super();m(this,xr);m(this,es,new ev(this,{opened:e=>{e&&Kc(h(this,xr,Sg).call(this)[0])},keydown:e=>h(this,xr,GS).call(this,e),pointermove:e=>Kc(h(this,xr,_g).call(this,e)??void 0),click:e=>{h(this,xr,_g).call(this,e)&&s(this,es).close()}}));this.attachInternals().role="menu"}connectedCallback(){s(this,es).connect()}disconnectedCallback(){s(this,es).disconnect()}attributeChangedCallback(){s(this,es).refresh()}}es=new WeakMap,xr=new WeakSet,Sg=function(){return[...this.querySelectorAll("tv-menu-item")]},_g=function(e){const r=e.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},GS=function(e){if(!s(this,es).open)return!1;const r=h(this,xr,Sg).call(this),i=r.indexOf(this.ownerDocument.activeElement);return VS(e,r)?!0:e.key==="Enter"&&i>=0?(e.preventDefault(),e.stopImmediatePropagation(),r[i].click(),!0):!1},I(jS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",UO);customElements.get("tv-menu")||customElements.define("tv-menu",jS);let FO=0;var ku;class qO extends an{constructor(){super(...arguments);m(this,ku,`menu-trigger-${++FO}`)}template(e,{trigger:r}){return j`${r(s(this,ku))}<tv-menu trigger=${s(this,ku)}>
|
|
68
|
-
${e.map(i=>"separator"in i?j`<hr>`:j`<tv-menu-item intent=${i.destructive?"danger":he} @click=${i.action}>${i.label}</tv-menu-item>`)}
|
|
69
|
-
</tv-menu>`}}ku=new WeakMap;const YS=ln(qO);/**
|
|
70
|
-
* @license
|
|
71
|
-
* Copyright 2020 Google LLC
|
|
72
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
73
|
-
*/const jn=()=>new VO;class VO{}const $m=new WeakMap,vt=Jl(class extends ZS{render(n){return he}update(n,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),he}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=$m.get(t);e===void 0&&(e=new WeakMap,$m.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,t;return typeof this.G=="function"?(n=$m.get(this.ht??globalThis))==null?void 0:n.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
|
|
74
|
-
* @license
|
|
75
|
-
* Copyright 2017 Google LLC
|
|
76
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
|
-
*/const K2=(n,t,e)=>{const r=new Map;for(let i=t;i<=e;i++)r.set(n[i],i);return r},Id=Jl(class extends fh{constructor(n){if(super(n),n.type!==Ir.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);const i=[],o=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,o[a]=e(l,a),a++;return{values:o,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,r]){const i=ZD(n),{values:o,keys:a}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=a,o;const l=this.ut??(this.ut=[]),c=[];let u,p,f=0,y=i.length-1,v=0,S=o.length-1;for(;f<=y&&v<=S;)if(i[f]===null)f++;else if(i[y]===null)y--;else if(l[f]===a[v])c[v]=Fs(i[f],o[v]),f++,v++;else if(l[y]===a[S])c[S]=Fs(i[y],o[S]),y--,S--;else if(l[f]===a[S])c[S]=Fs(i[f],o[S]),uc(n,c[S+1],i[f]),f++,S--;else if(l[y]===a[v])c[v]=Fs(i[y],o[v]),uc(n,i[f],i[y]),y--,v++;else if(u===void 0&&(u=K2(a,v,S),p=K2(l,f,y)),u.has(l[f]))if(u.has(l[y])){const _=p.get(a[v]),x=_!==void 0?i[_]:null;if(x===null){const Z=uc(n,i[f]);Fs(Z,o[v]),c[v]=Z}else c[v]=Fs(x,o[v]),uc(n,i[f],x),i[_]=null;v++}else Im(i[y]),y--;else Im(i[f]),f++;for(;v<=S;){const _=uc(n,c[S+1]);Fs(_,o[v]),c[v++]=_}for(;f<=y;){const _=i[f++];_!==null&&Im(_)}return this.ut=a,zS(n,c),$t}});/**
|
|
78
|
-
* @license
|
|
79
|
-
* Copyright 2018 Google LLC
|
|
80
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/const KS="important",BO=" !"+KS,$d=Jl(class extends fh{constructor(n){var t;if(super(n),n.type!==Ir.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const r=n[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const o=typeof i=="string"&&i.endsWith(BO);r.includes("-")||o?e.setProperty(r,o?i.slice(0,-11):i,o?KS:""):e[r]=i}}return $t}}),WO=24;function jO(n){return!J2(n.source)||!J2(n.current)||!eM(n.source,n.current)||!tM(n)||!QO(n.geometry)?{kind:"invalidated"}:KO(n.pointer,n.geometry)==="pinned"?GO(n):YO(n)}function GO(n){var c;const{source:t,current:e,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??JO(r.y,i.pinnedRows),l=e.pinnedChannelIds.filter(u=>u!==t.channelId);return l.splice(a,0,t.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function YO(n){const{source:t,current:e}=n,r=t.pinnedChannelIds.includes(t.channelId),i=r?XO(e.unpinnedChannelIds,t.channelId):t.unpinnedChannelIds.indexOf(t.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&e.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?e.pinnedChannelIds.filter(o=>o!==t.channelId):null}}function KO(n,t){const{sidebar:e}=t;if(n.x<e.left||n.x>e.right||n.y<e.top||n.y>e.bottom)return"unpinned";const i=t.unpinnedGroupTop??(t.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:t.pinnedContentBottom+WO);return n.y<i?"pinned":"unpinned"}function JO(n,t){const e=t.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return e===-1?t.length:e}function XO(n,t){const e=n.filter(i=>i!==t),r=e.findIndex(i=>i<t);return r===-1?e.length:r}function QO(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function J2(n){const t=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(t).size===t.length}function eM(n,t){return Ag(n.pinnedChannelIds,t.pinnedChannelIds)&&Ag(n.unpinnedChannelIds,t.unpinnedChannelIds)}function tM(n){const t=n.current.pinnedChannelIds.filter(o=>o!==n.source.channelId),e=n.geometry.pinnedRows.map(({channelId:o})=>o),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?t.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&Ag(t,e)&&i}function Ag(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}const JS=4,Pa=200,Tn=28,xd=800,Lh="ease",X2=.5,hc=.5,nM="New channel",qs=".channel-group:not(.channel-group-withdrawal) .channel-row",rM=24;var Lt,Qt,kt,mt,en,Ot,pr,Ao,Le,ye,gn,vn,yn,Mt,Nt,zt,wn,Ht,fr,Qr,sl,ol,ts,$,Eg,QS,e_,t_,n_,ed,r_,i_,s_,o_,Ec,Ea,a_,l_,kg,kc,jd,Gd,Yd,Kd,c_,Tg,Cg,u_,Tu,Cu,h_,Jd,Ru,d_,p_,Tc,Rg,f_,m_,Cc,Ig,$g,xg,g_,td,Iu,$u,xu,Pu,v_,Pg,nd,rd,Rc,Dg,Lg;class XS{constructor(t){m(this,$);m(this,Lt);m(this,Qt,null);m(this,kt,null);m(this,mt,{management:!0});m(this,en,!1);m(this,Ot,null);m(this,pr,"");m(this,Ao,!1);m(this,Le,null);m(this,ye,null);m(this,gn,!1);m(this,vn,null);m(this,yn,null);m(this,Mt,null);m(this,Nt,null);m(this,zt,null);m(this,wn,null);m(this,Ht,null);m(this,fr,null);m(this,Qr,jn());m(this,sl,jn());m(this,ol,jn());m(this,ts,null);I(this,"create",()=>{const t=s(this,Qt),e=s(this,kt);if(t===null||e===null||s(this,vn)!==null)return;const r={resultChannelId:null};d(this,vn,r),s(this,Lt).call(this),t.createChannel(nM).then(i=>{r.resultChannelId=i.id,t.focusChannel(i.id).catch(()=>{}),s(this,vn)===r&&s(this,Lt).call(this)},()=>{s(this,vn)!==r||s(this,yn)!==null||(d(this,vn,null),s(this,Lt).call(this))})});m(this,jd,t=>{d(this,pr,t.currentTarget.value)});m(this,Gd,t=>{t.key==="Enter"?(t.preventDefault(),h(this,$,kc).call(this,!0)):t.key==="Escape"&&(t.preventDefault(),h(this,$,kc).call(this,!1))});m(this,Yd,()=>{h(this,$,kc).call(this,!0)});m(this,Kd,t=>{t.preventDefault(),h(this,$,kc).call(this,!0)});m(this,Tu,()=>{d(this,gn,!1)});m(this,Cu,t=>{!s(this,gn)||t.detail===0||(d(this,gn,!1),t.preventDefault(),t.stopImmediatePropagation())});m(this,Jd,t=>{var e;!s(this,mt).highlightOnPointerMove||s(this,ye)!==null||s(this,Ot)!==null||(e=s(this,Qr).value)!=null&&e.querySelector("tv-menu[open]")||Kc(t.currentTarget)});m(this,Ru,t=>{if(s(this,en)){d(this,Le,null);return}const e=s(this,ye);if(e!==null){if(e.pointerId!==t.pointerId)return;t.preventDefault(),h(this,$,Tc).call(this,e,t);return}const r=s(this,Le);if(!(r===null||r.pointerId!==t.pointerId)){if(t.buttons===0){d(this,Le,null);return}Math.hypot(t.clientX-r.x,t.clientY-r.y)<=JS||h(this,$,d_).call(this,r,t)}});m(this,Iu,t=>{var r;const e=s(this,ye);if(e!==null&&e.pointerId===t.pointerId){if(e.completed)return;const i=e.captureTarget.hasPointerCapture(t.pointerId);h(this,$,Tc).call(this,e,t);const o=i&&e.placement.kind==="placement"?e.placement.operation:null,a=s(this,Qt);if(o===null||a===null){h(this,$,Rc).call(this,e,!1);return}e.completed=!0,h(this,$,Cc).call(this,e),e.operation=[...o],a.setPinnedChannelIds([...o]).then(()=>{s(this,ye)===e&&(e.operationResolved=!0,h(this,$,Pg).call(this,s(this,kt)))},()=>{s(this,ye)===e&&(e.operationResolved=!0,e.operationRejected=!0,h(this,$,nd).call(this,e))});return}((r=s(this,Le))==null?void 0:r.pointerId)===t.pointerId&&d(this,Le,null)});m(this,$u,t=>{var e,r;((e=s(this,ye))==null?void 0:e.pointerId)===t.pointerId&&!s(this,ye).completed?h(this,$,rd).call(this):((r=s(this,Le))==null?void 0:r.pointerId)===t.pointerId&&d(this,Le,null)});m(this,xu,t=>{const e=s(this,ye);e===null||e.pointerId!==t.pointerId||e.completed||h(this,$,Rc).call(this,e,!1)});m(this,Pu,t=>{t.key!=="Escape"||s(this,ye)===null||s(this,ye).completed||(t.preventDefault(),t.stopImmediatePropagation(),h(this,$,rd).call(this))});d(this,Lt,t)}get creating(){return s(this,vn)!==null}get dragging(){return s(this,ye)!==null}connect(){window.addEventListener("pointermove",s(this,Ru)),window.addEventListener("pointerup",s(this,Iu)),window.addEventListener("pointercancel",s(this,$u)),window.addEventListener("lostpointercapture",s(this,xu)),window.addEventListener("keydown",s(this,Pu),!0),window.addEventListener("click",s(this,Cu),!0),window.addEventListener("pointerdown",s(this,Tu),!0)}update(t,e,r){const i=s(this,kt),o=s(this,en);d(this,Qt,t),d(this,kt,e),d(this,mt,r),d(this,en,r.motionSuppressed??!1),!o&&s(this,en)&&h(this,$,a_).call(this),h(this,$,v_).call(this,e),h(this,$,t_).call(this,e),h(this,$,s_).call(this,i,e),s(this,Ot)!==null&&!e.channels.some(({id:l})=>l===s(this,Ot))&&(d(this,Ot,null),d(this,pr,"")),h(this,$,Pg).call(this,e);const a=s(this,ts);a!==null&&e.display.pinnedChannelIds.includes(a.channelId)===a.pinned&&(d(this,ts,null),queueMicrotask(()=>{const l=h(this,$,Tg).call(this,a.channelId);l==null||l.scrollIntoView({block:"nearest"}),a.focus&&(l==null||l.focus({preventScroll:!0}))})),o&&!s(this,en)&&h(this,$,l_).call(this)}template(){var r;const t=s(this,kt);if(t===null)return he;const e=h(this,$,o_).call(this,Q2(t,(r=s(this,ye))==null?void 0:r.source));return j`
|
|
82
|
-
<div
|
|
83
|
-
class="channel-list"
|
|
84
|
-
role="listbox"
|
|
85
|
-
aria-label="Channels"
|
|
86
|
-
${vt(s(this,Qr))}
|
|
87
|
-
>
|
|
88
|
-
${h(this,$,Eg).call(this,"Pinned",e.pinned)}
|
|
89
|
-
${h(this,$,Eg).call(this,"Recent",e.unpinned)}
|
|
90
|
-
</div>
|
|
91
|
-
`}overlayTemplate(){return s(this,mt).management?h(this,$,i_).call(this):he}disconnect(){var t,e,r;window.removeEventListener("pointermove",s(this,Ru)),window.removeEventListener("pointerup",s(this,Iu)),window.removeEventListener("pointercancel",s(this,$u)),window.removeEventListener("lostpointercapture",s(this,xu)),window.removeEventListener("keydown",s(this,Pu),!0),window.removeEventListener("click",s(this,Cu),!0),window.removeEventListener("pointerdown",s(this,Tu),!0),h(this,$,Dg).call(this),(t=s(this,fr))==null||t.withdraw(),d(this,fr,null),(e=s(this,wn))==null||e.cancel(),d(this,wn,null),(r=s(this,Ht))==null||r.cancel(),d(this,Ht,null),d(this,Qt,null),d(this,kt,null),d(this,Ot,null),d(this,pr,""),d(this,Ao,!1),d(this,Le,null),d(this,gn,!1),d(this,vn,null),d(this,yn,null),d(this,Mt,null),d(this,Nt,null),d(this,zt,null),d(this,ts,null)}}Lt=new WeakMap,Qt=new WeakMap,kt=new WeakMap,mt=new WeakMap,en=new WeakMap,Ot=new WeakMap,pr=new WeakMap,Ao=new WeakMap,Le=new WeakMap,ye=new WeakMap,gn=new WeakMap,vn=new WeakMap,yn=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,zt=new WeakMap,wn=new WeakMap,Ht=new WeakMap,fr=new WeakMap,Qr=new WeakMap,sl=new WeakMap,ol=new WeakMap,ts=new WeakMap,$=new WeakSet,Eg=function(t,e){var p;const r=t==="Pinned"?"pinned":"unpinned",i=s(this,ye);if(i===null&&e.length===0)return null;const o=i===null?void 0:e.find(({channel:f})=>f.id===i.channelId),a=i===null?e:e.filter(({channel:f})=>f.id!==i.channelId),l=(i==null?void 0:i.placement.kind)==="placement"&&((p=i.placement.placeholder)==null?void 0:p.side)===r?i.placement.placeholder:null,c=a.map(f=>({kind:"row",row:f}));l!==null&&c.splice(l.index,0,{kind:"placeholder",key:`channel-placeholder-${r}`}),o!==void 0&&c.push({kind:"row",row:o});const u=i!==null&&a.length===0&&l===null;return j`
|
|
92
|
-
<div
|
|
93
|
-
class="channel-group"
|
|
94
|
-
role="group"
|
|
95
|
-
aria-labelledby=${`channel-group-${r}`}
|
|
96
|
-
data-channel-side=${r}
|
|
97
|
-
?drag-collapsed=${u}
|
|
98
|
-
>
|
|
99
|
-
<div class="channel-group-label" id=${`channel-group-${r}`}>${t}</div>
|
|
100
|
-
${Id(c,f=>f.kind==="row"?f.row.channel.id:f.key,f=>f.kind==="row"?h(this,$,QS).call(this,f.row):j`
|
|
101
|
-
<span
|
|
102
|
-
class="channel-placeholder"
|
|
103
|
-
aria-hidden="true"
|
|
104
|
-
data-channel-side=${r}
|
|
105
|
-
data-channel-index=${(l==null?void 0:l.index)??0}
|
|
106
|
-
style=${$d({height:`${(i==null?void 0:i.rowHeight)??0}px`})}
|
|
107
|
-
></span>
|
|
108
|
-
`)}
|
|
109
|
-
</div>
|
|
110
|
-
`},QS=function(t){var c;const{channel:e,pinned:r,selected:i}=t,o=((c=s(this,ye))==null?void 0:c.channelId)===e.id?s(this,ye):null,a=o!==null&&r&&o.placement.kind==="placement"&&o.placement.side==="unpinned",l=e.id===s(this,Ot);return j`
|
|
111
|
-
<div
|
|
112
|
-
class=${`channel-row${o!==null?" dragged":""}${a?" unpinning":""}`}
|
|
113
|
-
data-channel-id=${e.id}
|
|
114
|
-
style=${$d(o===null?{}:{left:`${o.currentX-o.grip.previewOffsetX}px`,top:`${o.currentY-o.grip.offsetY}px`,width:`${o.rowWidth}px`,height:`${o.rowHeight}px`})}
|
|
115
|
-
>
|
|
116
|
-
${a?j`
|
|
117
|
-
<span class="channel-drag-action" aria-hidden="true">
|
|
118
|
-
<tv-icon name="unpin"></tv-icon>
|
|
119
|
-
Unpin
|
|
120
|
-
</span>
|
|
121
|
-
`:null}
|
|
122
|
-
${l?j`
|
|
123
|
-
<input
|
|
124
|
-
class="channel-rename"
|
|
125
|
-
aria-label="Channel name"
|
|
126
|
-
.value=${s(this,pr)}
|
|
127
|
-
@input=${s(this,jd)}
|
|
128
|
-
@keydown=${s(this,Gd)}
|
|
129
|
-
@blur=${s(this,Yd)}
|
|
130
|
-
${vt(s(this,sl))}
|
|
131
|
-
/>
|
|
132
|
-
<button
|
|
133
|
-
class="channel-rename-commit"
|
|
134
|
-
variant="ghost"
|
|
135
|
-
icon
|
|
136
|
-
size="sm"
|
|
137
|
-
type="button"
|
|
138
|
-
tabindex="-1"
|
|
139
|
-
aria-label="Rename"
|
|
140
|
-
@pointerdown=${s(this,Kd)}
|
|
141
|
-
>
|
|
142
|
-
<tv-icon name="check"></tv-icon>
|
|
143
|
-
</button>
|
|
144
|
-
`:j`
|
|
145
|
-
<div
|
|
146
|
-
class="channel"
|
|
147
|
-
role="option"
|
|
148
|
-
tabindex="-1"
|
|
149
|
-
@keydown=${u=>{u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),u.stopPropagation(),u.currentTarget.click())}}
|
|
150
|
-
@pointermove=${s(this,Jd)}
|
|
151
|
-
aria-selected=${i?"true":he}
|
|
152
|
-
@pointerdown=${u=>s(this,mt).dragging??s(this,mt).management?h(this,$,u_).call(this,e.id,u):void 0}
|
|
153
|
-
@click=${u=>h(this,$,h_).call(this,e.id,u)}
|
|
154
|
-
>
|
|
155
|
-
${e.name}
|
|
156
|
-
</div>
|
|
157
|
-
${s(this,mt).management?YS(h(this,$,e_).call(this,t),{trigger:u=>j`
|
|
158
|
-
<button
|
|
159
|
-
class="channel-menu-trigger"
|
|
160
|
-
variant="ghost"
|
|
161
|
-
icon
|
|
162
|
-
size="sm"
|
|
163
|
-
type="button"
|
|
164
|
-
tabindex="-1"
|
|
165
|
-
id=${u}
|
|
166
|
-
aria-haspopup="menu"
|
|
167
|
-
title=${`${e.name} menu`}
|
|
168
|
-
>
|
|
169
|
-
<tv-icon name="expand"></tv-icon>
|
|
170
|
-
</button>
|
|
171
|
-
`}):he}
|
|
172
|
-
`}
|
|
173
|
-
</div>
|
|
174
|
-
`},e_=function(t){const{channel:e,pinned:r}=t;return[{label:"Rename",action:()=>h(this,$,kg).call(this,e.id)},{label:r?"Unpin":"Pin",action:()=>h(this,$,c_).call(this,e.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,$,n_).call(this,e.id,e.name)}]},t_=function(t){const e=s(this,vn);if(e===null||s(this,yn)!==null||e.resultChannelId===null)return;const r=t.channels.find(({id:i})=>i===e.resultChannelId);r!==void 0&&(d(this,yn,r.id),queueMicrotask(()=>h(this,$,Ec).call(this,"create",r.id)))},n_=function(t,e){var i,o,a,l,c;if(s(this,Mt)!==null||s(this,Nt)!==null)return;h(this,$,Cg).call(this,t),d(this,Mt,{channelId:t,name:e}),(o=(i=s(this,mt)).onDeleteStart)==null||o.call(i,t),s(this,Lt).call(this);const r=(a=s(this,ol).value)==null?void 0:a.closest("dialog");r instanceof HTMLDialogElement&&(d(this,fr,Gp(r,()=>{h(this,$,ed).call(this)})),(c=(l=s(this,ol).value)==null?void 0:l.querySelector(".dialog-actions button"))==null||c.focus())},ed=function(t=!1){var i,o;const e=s(this,Mt),r=s(this,fr);d(this,fr,null),d(this,Mt,null),r==null||r.withdraw(),s(this,Lt).call(this),!t&&e!==null&&((o=(i=s(this,mt)).onDeleteEnd)==null||o.call(i,e.channelId,!1))},r_=function(){const t=s(this,Qt),e=s(this,Mt);if(t===null||e===null||s(this,Nt)!==null)return;d(this,Nt,e.channelId),h(this,$,ed).call(this,!0);const r=s(this,mt).onDeleteEnd;t.deleteChannel(e.channelId).then(()=>{r==null||r(e.channelId,!0)}).catch(()=>{s(this,Nt)===e.channelId&&s(this,zt)===null&&(d(this,Nt,null),s(this,Lt).call(this)),r==null||r(e.channelId,!1)})},i_=function(){const t=s(this,Mt);return t===null?null:jp(j`
|
|
175
|
-
<div
|
|
176
|
-
class="dialog-alert channel-delete-alert"
|
|
177
|
-
role="alertdialog"
|
|
178
|
-
aria-labelledby="channel-delete-title"
|
|
179
|
-
aria-describedby="channel-delete-body"
|
|
180
|
-
${vt(s(this,ol))}
|
|
181
|
-
>
|
|
182
|
-
<h2 id="channel-delete-title">Delete “${t.name}”?</h2>
|
|
183
|
-
<p id="channel-delete-body">
|
|
184
|
-
This will permanently delete this channel from Television.
|
|
185
|
-
</p>
|
|
186
|
-
<div class="dialog-actions">
|
|
187
|
-
<button type="button" autofocus @click=${()=>h(this,$,ed).call(this)}>
|
|
188
|
-
Cancel
|
|
189
|
-
</button>
|
|
190
|
-
<button type="button" intent="danger" @click=${()=>h(this,$,r_).call(this)}>
|
|
191
|
-
Delete
|
|
192
|
-
</button>
|
|
193
|
-
</div>
|
|
194
|
-
</div>
|
|
195
|
-
`)},s_=function(t,e){var u,p;if(s(this,Mt)!==null&&!e.channels.some(({id:f})=>{var y;return f===((y=s(this,Mt))==null?void 0:y.channelId)})){const f=s(this,Mt);(u=s(this,fr))==null||u.withdraw(),d(this,fr,null),d(this,Mt,null),queueMicrotask(()=>{var y,v;return(v=(y=s(this,mt)).onDeleteEnd)==null?void 0:v.call(y,f.channelId,!0)})}const r=s(this,zt);if(r!==null&&e.channels.some(({id:f})=>f===r.row.channel.id)){(p=s(this,Ht))==null||p.cancel(),d(this,Ht,null),d(this,zt,null),d(this,Nt,null);return}const i=s(this,Nt);if(i===null||r!==null||e.channels.some(({id:f})=>f===i))return;if(t===null){d(this,Nt,null);return}const o=Q2(t),a=o.pinned.findIndex(({channel:f})=>f.id===i),l=o.unpinned.findIndex(({channel:f})=>f.id===i),c=a>=0?o.pinned[a]:o.unpinned[l];if(c===void 0){d(this,Nt,null);return}d(this,zt,{row:{...c,selected:!1},side:a>=0?"pinned":"unpinned",index:a>=0?a:l}),queueMicrotask(()=>h(this,$,Ec).call(this,"delete",i))},o_=function(t){const e=s(this,zt);if(e===null)return t;const r=[...t[e.side]];return r.some(({channel:i})=>i.id===e.row.channel.id)||r.splice(e.index,0,e.row),{...t,[e.side]:r}},Ec=function(t,e){var l,c;if(t==="create"&&s(this,yn)!==e||t==="delete"&&((l=s(this,zt))==null?void 0:l.row.channel.id)!==e||s(this,en))return;const r=[...((c=s(this,Qr).value)==null?void 0:c.querySelectorAll(qs))??[]].find(u=>u.dataset.channelId===e);if(r===void 0){t==="delete"&&h(this,$,Ea).call(this,t,e);return}if(typeof r.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){h(this,$,Ea).call(this,t,e);return}const i=r.getBoundingClientRect().height,o=t==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${i}px`,opacity:1}]:[{maxHeight:`${i}px`,opacity:1},{maxHeight:"0px",opacity:0}],a=r.animate(o,{duration:Pa,easing:Lh});t==="create"?d(this,wn,a):d(this,Ht,a),a.finished.then(()=>{t==="create"&&s(this,wn)!==a||t==="delete"&&s(this,Ht)!==a||(t==="create"?d(this,wn,null):d(this,Ht,null),h(this,$,Ea).call(this,t,e))},()=>{})},Ea=function(t,e){var r;if(t==="create"){if(s(this,yn)!==e)return;d(this,yn,null),d(this,vn,null),h(this,$,kg).call(this,e);return}((r=s(this,zt))==null?void 0:r.row.channel.id)===e&&(d(this,zt,null),d(this,Nt,null),s(this,Lt).call(this))},a_=function(){var r;d(this,Le,null),h(this,$,Dg).call(this);const t=s(this,yn);s(this,wn)!==null&&(s(this,wn).cancel(),d(this,wn,null),t!==null&&queueMicrotask(()=>h(this,$,Ea).call(this,"create",t)));const e=((r=s(this,zt))==null?void 0:r.row.channel.id)??null;s(this,Ht)!==null&&(s(this,Ht).cancel(),d(this,Ht,null),e!==null&&queueMicrotask(()=>h(this,$,Ea).call(this,"delete",e)))},l_=function(){var r;const t=s(this,yn),e=((r=s(this,zt))==null?void 0:r.row.channel.id)??null;t!==null&&s(this,wn)===null&&queueMicrotask(()=>h(this,$,Ec).call(this,"create",t)),e!==null&&s(this,Ht)===null&&queueMicrotask(()=>h(this,$,Ec).call(this,"delete",e))},kg=function(t){var r;const e=(r=s(this,kt))==null?void 0:r.channels.find(({id:i})=>i===t);e!==void 0&&(d(this,Ot,t),d(this,pr,e.name),d(this,Le,null),s(this,Lt).call(this),queueMicrotask(()=>{var i,o;s(this,Ot)===t&&((i=s(this,sl).value)==null||i.focus(),(o=s(this,sl).value)==null||o.select())}))},kc=function(t){if(s(this,Ot)===null||s(this,Ao)||s(this,Qt)===null)return;d(this,Ao,!0);const e=s(this,Ot),r=s(this,pr).trim();d(this,Ot,null),d(this,pr,""),s(this,Lt).call(this),d(this,Ao,!1),t&&r.length>0&&s(this,Qt).renameChannel(e,r).catch(()=>{})},jd=new WeakMap,Gd=new WeakMap,Yd=new WeakMap,Kd=new WeakMap,c_=function(t,e){var o;if(s(this,Qt)===null||s(this,kt)===null)return;if(h(this,$,Cg).call(this,t),s(this,mt).revealMovedRow){const a=h(this,$,Tg).call(this,t);d(this,ts,{channelId:t,pinned:e,focus:((o=a==null?void 0:a.parentElement)==null?void 0:o.contains(document.activeElement))??!1})}const r=s(this,kt).display.pinnedChannelIds,i=e?[...r.filter(a=>a!==t),t]:r.filter(a=>a!==t);s(this,Qt).setPinnedChannelIds(i).catch(()=>{d(this,ts,null)})},Tg=function(t){var e,r;return((r=[...((e=s(this,Qr).value)==null?void 0:e.querySelectorAll(qs))??[]].find(i=>i.dataset.channelId===t))==null?void 0:r.querySelector(".channel"))??void 0},Cg=function(t){var i,o,a;const e=[...((i=s(this,Qr).value)==null?void 0:i.querySelectorAll(qs))??[]].find(l=>l.dataset.channelId===t),r=e==null?void 0:e.querySelector(".channel-menu-trigger");r&&((a=(o=s(this,Qr).value)==null?void 0:o.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||a.removeAttribute("open"))},u_=function(t,e){if(e.button!==0||s(this,Le)!==null||s(this,ye)!==null||s(this,kt)===null)return;d(this,gn,!1);const i=e.currentTarget.closest(".sidebar, .channel-switcher-pop");if(i===null)return;const o=Ic(s(this,kt));!o.pinnedChannelIds.includes(t)&&!o.unpinnedChannelIds.includes(t)||d(this,Le,{channelId:t,pointerId:e.pointerId,x:e.clientX,y:e.clientY,source:{channelId:t,...o},captureTarget:i})},Tu=new WeakMap,Cu=new WeakMap,h_=function(t,e){var r;if(e.detail!==0&&s(this,gn)){d(this,gn,!1);return}d(this,gn,!1),s(this,ye)===null&&(s(this,mt).selectChannel?s(this,mt).selectChannel(t):(r=s(this,Qt))==null||r.focusChannel(t).catch(()=>{}))},Jd=new WeakMap,Ru=new WeakMap,d_=function(t,e){if(s(this,en)){d(this,Le,null);return}const r=[...t.captureTarget.querySelectorAll(qs)].find(p=>p.dataset.channelId===t.channelId);if(r===void 0){d(this,Le,null);return}const i=r.getBoundingClientRect(),o=h(this,$,p_).call(this,r),a=iM({wideRow:i,compactPreviewWidth:o,pointer:{x:t.x,y:t.y}}),l=t.captureTarget.querySelector('[data-channel-side="pinned"]'),c=t.captureTarget.querySelector('[data-channel-side="unpinned"]');try{t.captureTarget.setPointerCapture(t.pointerId)}catch{d(this,Le,null);return}t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${a.previewOffsetX}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${a.offsetY}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${a.correctionX}px`),d(this,gn,!0);const u={...t,placement:{kind:"invalidated"},currentX:e.clientX,currentY:e.clientY,grip:a,rowWidth:o,rowHeight:i.height,originPinnedContentBottom:(l==null?void 0:l.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(c==null?void 0:c.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,Le,null),d(this,ye,u),h(this,$,Tc).call(this,u,e)},p_=function(t){const e=t.cloneNode(!0);for(const i of[e,...e.querySelectorAll("[id], [trigger]")])i.removeAttribute("id"),i.removeAttribute("trigger");e.classList.add("dragged"),e.style.position="fixed",e.style.left="-10000px",e.style.top="-10000px",e.style.visibility="hidden",e.style.pointerEvents="none",document.body.append(e);const r=e.getBoundingClientRect().width;return e.remove(),r},Tc=function(t,e,r=!0){if(t.completed)return;const i=s(this,kt);if(i===null){t.placement={kind:"invalidated"};return}t.currentX=e.clientX,t.currentY=e.clientY;const o=Ic(i),a=new Map([...t.captureTarget.querySelectorAll(qs)].map(L=>[L.dataset.channelId,L])),l=o.pinnedChannelIds.filter(L=>L!==t.channelId).flatMap(L=>{const z=a.get(L);if(z===void 0)return[];const P=z.getBoundingClientRect();return[{channelId:L,top:P.top,bottom:P.bottom}]}),c=t.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),u=t.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),p=t.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),f=p==null?void 0:p.getBoundingClientRect(),y=p==null?void 0:p.dataset.channelSide,v=Number(p==null?void 0:p.dataset.channelIndex),S=t.captureTarget.getBoundingClientRect(),_=jO({source:t.source,current:o,pointer:{x:e.clientX,y:e.clientY},geometry:{sidebar:{left:S.left,right:S.right,top:S.top,bottom:S.bottom},pinnedRows:l,unpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??t.originUnpinnedGroupTop,pinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??t.originPinnedContentBottom,placeholder:f!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(v)?{side:y,index:v,top:f.top,bottom:f.bottom}:null}}),x=!sM(t.placement,_),Z=x?h(this,$,$g).call(this,t):null;t.placement=_,(x||r)&&h(this,$,xg).call(this,t,Z,!1),h(this,$,Rg).call(this,t)},Rg=function(t){const e=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=e?h(this,$,Ig).call(this,e,t.currentY):0,i=e?Math.max(0,e.scrollHeight-e.clientHeight):0,o=r<0?((e==null?void 0:e.scrollTop)??0)<=X2:((e==null?void 0:e.scrollTop)??0)>=i-X2;if(s(this,en)||t.completed||r===0||i===0||o||typeof requestAnimationFrame!="function"){h(this,$,Cc).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(a=>{h(this,$,f_).call(this,t,a)}))},f_=function(t,e){if(t.edgeScrollFrame=0,s(this,en)||s(this,ye)!==t||t.completed){t.edgeScrollTimestamp=null;return}const r=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");if(r===null){t.edgeScrollTimestamp=null;return}const i=h(this,$,Ig).call(this,r,t.currentY),o=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=e,i!==0&&o!==null){const a=Math.max(0,e-o)/1e3,l=Math.max(0,r.scrollHeight-r.clientHeight),c=r.scrollTop,u=i*a+t.edgeScrollRemainder,p=Math.max(0,Math.min(l,c+u));r.scrollTop=p;const f=r.scrollTop-c;if(t.edgeScrollRemainder=p===0||p===l?0:u-f,f!==0){r.toggleAttribute("continues-start",r.scrollTop>0),h(this,$,m_).call(this,t);return}}h(this,$,Rg).call(this,t)},m_=function(t){h(this,$,Tc).call(this,t,{clientX:t.currentX,clientY:t.currentY},!1)},Cc=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},Ig=function(t,e){const r=t.getBoundingClientRect();return e>=r.top&&e<r.top+Tn?-xd*(r.top+Tn-e)/Tn:e>r.bottom-Tn&&e<=r.bottom?xd*(e-(r.bottom-Tn))/Tn:0},$g=function(t){var i;for(const o of t.displacementAnimations)o.cancel();t.displacementAnimations.clear();const e=new Map;for(const o of t.captureTarget.querySelectorAll(qs)){const a=o.dataset.channelId;if(a===void 0)continue;const l=o.getBoundingClientRect();e.set(a,{left:l.left,top:l.top})}const r=new Map;for(const o of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=o.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=o.getBoundingClientRect(),c=o.cloneNode(!0);for(const u of[c,...c.querySelectorAll("[id], [trigger]")])u.removeAttribute("id"),u.removeAttribute("trigger");(i=c.querySelector(".channel-row.dragged"))==null||i.remove(),c.classList.add("channel-group-withdrawal"),c.setAttribute("aria-hidden","true"),c.removeAttribute("drag-collapsed"),r.set(a,{left:l.left,top:l.top,width:l.width,height:o.hasAttribute("drag-collapsed")?0:l.height,withdrawal:c})}return{rows:e,groups:r}},xg=function(t,e,r){const i=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),o=(i==null?void 0:i.scrollTop)??0;s(this,Lt).call(this),queueMicrotask(()=>{const a=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");a!==null&&(a.scrollTop=o),e!==null&&h(this,$,g_).call(this,t,e,r)})},g_=function(t,e,r){if(!(s(this,en)||typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of t.captureTarget.querySelectorAll(qs)){const o=i.dataset.channelId;if(o===void 0||!r&&o===t.channelId)continue;const a=e.rows.get(o);if(a===void 0)continue;const l=i.getBoundingClientRect(),c=a.left-l.left,u=a.top-l.top;Math.hypot(c,u)<=hc||h(this,$,td).call(this,t,i.animate({translate:[`${c}px ${u}px`,"0px 0px"]},{duration:Pa,easing:Lh}))}for(const i of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=i.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const a=e.groups.get(o),l=i.getBoundingClientRect(),c=i.hasAttribute("drag-collapsed")?0:l.height;if(a!==void 0){if(a.height<=hc&&c>hc)h(this,$,td).call(this,t,i.animate([{opacity:0,translate:`0px -${c}px`},{opacity:1,translate:"0px 0px"}],{duration:Pa,easing:Lh}));else if(a.height>hc&&c<=hc&&a.withdrawal.childElementCount>0){const u=a.withdrawal;u.style.left=`${a.left}px`,u.style.top=`${a.top}px`,u.style.width=`${a.width}px`,u.style.height=`${a.height}px`,t.captureTarget.append(u);const p=u.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${a.height}px`}],{duration:Pa,easing:Lh});h(this,$,td).call(this,t,p),p.finished.finally(()=>u.remove()).catch(()=>{})}}}}},td=function(t,e){t.displacementAnimations.add(e),e.finished.finally(()=>{t.displacementAnimations.delete(e)}).catch(()=>{})},Iu=new WeakMap,$u=new WeakMap,xu=new WeakMap,Pu=new WeakMap,v_=function(t){const e=Ic(t);s(this,ye)!==null&&!s(this,ye).completed&&!eb(s(this,ye).source,e)&&h(this,$,rd).call(this),s(this,Le)!==null&&!eb(s(this,Le).source,e)&&d(this,Le,null)},Pg=function(t){const e=s(this,ye);if(t===null||e===null||!e.completed||!e.operationResolved||e.restorationQueued)return;if(e.operationRejected){h(this,$,nd).call(this,e);return}const r=e.operation;r!==null&&Pd(Ic(t).pinnedChannelIds,r)&&h(this,$,nd).call(this,e)},nd=function(t){s(this,ye)!==t||t.restorationQueued||(t.restorationQueued=!0,queueMicrotask(()=>{s(this,ye)===t&&h(this,$,Rc).call(this,t,!1)}))},rd=function(){d(this,Le,null);const t=s(this,ye);t!==null&&h(this,$,Rc).call(this,t,!0)},Rc=function(t,e){if(s(this,ye)!==t)return;h(this,$,Cc).call(this,t);const r=h(this,$,$g).call(this,t);d(this,ye,null),h(this,$,Lg).call(this,t),e&&t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId),h(this,$,xg).call(this,t,r,!0)},Dg=function(){d(this,Le,null);const t=s(this,ye);if(d(this,ye,null),t!==null){h(this,$,Cc).call(this,t);for(const e of t.displacementAnimations)e.cancel();t.displacementAnimations.clear(),h(this,$,Lg).call(this,t),t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId)}},Lg=function(t){t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")};function iM(n){const t=Math.max(0,n.wideRow.right-n.wideRow.left),e=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=tb(n.pointer.x-n.wideRow.left,0,t),i=Math.min(r,Math.max(0,n.compactPreviewWidth-rM));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:tb(n.pointer.y-n.wideRow.top,0,e)}}function Q2(n,t=Ic(n)){var l,c;const e=new Map(n.channels.map(u=>[u.id,u])),r=t.pinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),i=t.unpinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),o=n.display.focusedChannelId,a=o!==null&&e.has(o)?o:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===a})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===a}))}}function Ic(n){const t=new Set(n.channels.map(({id:o})=>o)),e=n.display.pinnedChannelIds.filter(o=>t.has(o)),r=new Set(e),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return{pinnedChannelIds:e,unpinnedChannelIds:i}}function eb(n,t){return Pd(n.pinnedChannelIds,t.pinnedChannelIds)&&Pd(n.unpinnedChannelIds,t.unpinnedChannelIds)}function Pd(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function sM(n,t){var e,r,i,o;return n.kind!==t.kind?!1:n.kind==="invalidated"||t.kind==="invalidated"?!0:n.side===t.side&&((e=n.placeholder)==null?void 0:e.side)===((r=t.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((o=t.placeholder)==null?void 0:o.index)&&n.operation===null==(t.operation===null)&&(n.operation===null||t.operation===null||Pd(n.operation,t.operation))}function tb(n,t,e){return Math.max(t,Math.min(e,n))}var Zn,Xd;class oM extends an{constructor(){super(...arguments);m(this,Zn,new XS(()=>this.render()));m(this,Xd,e=>{const r=e.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,Zn).connect()}template(e,r,i,o,a,l=!1){return s(this,Zn).update(e,r,{management:!0,motionSuppressed:l}),j`
|
|
196
|
-
<nav class="sidebar" ?dragging=${s(this,Zn).dragging}>
|
|
197
|
-
<header
|
|
198
|
-
class="sidebar-titlebar"
|
|
199
|
-
?electron-draggable=${i}
|
|
200
|
-
>
|
|
201
|
-
<button
|
|
202
|
-
class="channel-create"
|
|
203
|
-
variant="ghost"
|
|
204
|
-
icon
|
|
205
|
-
aria-label="New channel"
|
|
206
|
-
title="New channel"
|
|
207
|
-
type="button"
|
|
208
|
-
?disabled=${s(this,Zn).creating}
|
|
209
|
-
@click=${s(this,Zn).create}
|
|
210
|
-
>
|
|
211
|
-
<tv-icon name="add"></tv-icon>
|
|
212
|
-
</button>
|
|
213
|
-
<span
|
|
214
|
-
class="toolbar-separator"
|
|
215
|
-
role="separator"
|
|
216
|
-
aria-orientation="vertical"
|
|
217
|
-
></span>
|
|
218
|
-
${a===void 0?j`
|
|
219
|
-
<button
|
|
220
|
-
class="sidebar-collapse"
|
|
221
|
-
variant="ghost"
|
|
222
|
-
icon
|
|
223
|
-
aria-label="Collapse sidebar"
|
|
224
|
-
title="Collapse sidebar"
|
|
225
|
-
type="button"
|
|
226
|
-
@click=${o}
|
|
227
|
-
>
|
|
228
|
-
<tv-icon name="sidebar" size="sm"></tv-icon>
|
|
229
|
-
</button>
|
|
230
|
-
`:a??j`
|
|
231
|
-
<span class="sidebar-toggle-seat" aria-hidden="true"></span>
|
|
232
|
-
`}
|
|
233
|
-
</header>
|
|
234
|
-
|
|
235
|
-
<div class="sidebar-body" @scroll=${s(this,Xd)}>
|
|
236
|
-
${s(this,Zn).template()}
|
|
237
|
-
</div>
|
|
238
|
-
</nav>
|
|
239
|
-
${s(this,Zn).overlayTemplate()}
|
|
240
|
-
`}disconnected(){s(this,Zn).disconnect()}}Zn=new WeakMap,Xd=new WeakMap;const aM=ln(oM),lM=1280,cM=800,nb=.4,rb=.4,y_=280,ib=180,uM=14,hM=45,dM=16,sb=64,pM=90,fM=1,mM=24,gM=230,vM=230;function yM(n,t){const{expandedSidebarWidth:e,expandedToggleLeft:r,collapsedToggleLeft:i,toggleWidth:o,toggleSwitcherGap:a,collapsedLeadReservation:l,hasSwitcher:c}=t,u=e*(1-n),p=e-r,f=Math.max(u-p,i),y=i+p,v=Math.max(0,Math.min(o,u-f)),S=Og((u-y)/(e-y)),_=o+a,x=i+_,Z=c?Og((x-u)/_):0;let L=n*l;if(l>e){const z=1-x/e,P=Math.min(1,n/z);L=n*e+P*(l-e)}return{sidebarBoundary:u,toggleLeft:f,toggleWipe:v,titlebarOpacity:S,switcherOpacity:Z,leadReservation:L}}function wM(n,t,e,r){const i=r*Math.abs(t-n);if(i===0)return t;const a=1-(1-Og(e/i))**2;return n+(t-n)*a}function Og(n){return Math.max(0,Math.min(1,n))}var ei,ns,ti,al,ll,Eo,_i,id,Mg;class bM{constructor(t){m(this,_i);m(this,ei,null);m(this,ns,0);m(this,ti);m(this,al);m(this,ll);m(this,Eo,1);d(this,ti,t),d(this,al,t),d(this,ll,t)}get boundary(){return h(this,_i,id).call(this),s(this,ti)}move(t){const e=this.boundary;if(h(this,_i,Mg).call(this),d(this,al,e),d(this,ll,t.target),d(this,Eo,t.width),t.onFrame(e),matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(t.target-e)<Number.EPSILON){d(this,ti,t.target),t.onFrame(t.target),t.onFinish(t.target);return}const r=Math.abs(t.target-e)/t.width,i=t.root.animate([{},{}],{duration:ib*r,easing:"linear"});i.id="sidebar-collapse-boundary",d(this,ei,i);const o=()=>{if(s(this,ei)===i){if(h(this,_i,id).call(this),t.onFrame(s(this,ti)),i.playState==="finished"){d(this,ei,null),d(this,ns,0),d(this,ti,t.target),t.onFrame(t.target),t.onFinish(t.target);return}d(this,ns,requestAnimationFrame(o))}};d(this,ns,requestAnimationFrame(o))}cancel(){h(this,_i,id).call(this),h(this,_i,Mg).call(this)}}ei=new WeakMap,ns=new WeakMap,ti=new WeakMap,al=new WeakMap,ll=new WeakMap,Eo=new WeakMap,_i=new WeakSet,id=function(){const t=s(this,ei);if(t===null)return;const e=wM(1-s(this,al)/s(this,Eo),1-s(this,ll)/s(this,Eo),Number(t.currentTime??0),ib);d(this,ti,s(this,Eo)*(1-e))},Mg=function(){var t;cancelAnimationFrame(s(this,ns)),d(this,ns,0),(t=s(this,ei))==null||t.cancel(),d(this,ei,null)};const w_="television-active-theme",tv="tv-theme";let Fi=null,Si=null,_s=null,As=null,Ni=null,ob=0,Dd=0;function SM(n){const t=document.createElement("link"),e=new URL("/theme/theme.css",n);e.searchParams.set(tv,nv()),t.rel="stylesheet",t.href=e.toString(),t.dataset.televisionStyle=w_;const r=()=>{Fi===t&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",r,{once:!0}),Fi==null||Fi.remove(),document.head.append(t),Fi=t,t}function _M(){Fi&&(Fi.remove(),Fi=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function ab(n){const t=document.createElement("script"),e=new URL("/theme/main.js",n);return e.searchParams.set(tv,nv()),t.src=e.toString(),t.dataset.televisionScript=w_,Si==null||Si.remove(),document.head.append(t),Si=t,t}function AM(){Si==null||Si.remove(),Si=null}function EM(){return Si}async function kM(n,t,e){const r=b_();if(t===null)return;let i;try{i=await e()}catch{return}if(r!==Dd)return;const o=i.themes.find(p=>p.id===t);if(o===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=o.enableIframeBackgroundJS===!0?lb(n,"background"):null,u=o.enableIframeOverlayJS===!0?lb(n,"overlay"):null;r===Dd&&(c!==null&&(a.before(c),_s=c),u!==null&&(l.after(u),As=u))}function TM(){b_()}function b_(){return Dd+=1,_s==null||_s.remove(),As==null||As.remove(),_s=null,As=null,Dd}function lb(n,t){const e=t==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);e.searchParams.set(tv,nv());const r=document.createElement("iframe");return r.id=t==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=RM(e.toString(),CM()),r}function CM(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function RM(n,t){return`<!doctype html>
|
|
241
|
-
<html data-theme="${t}">
|
|
242
|
-
<head>
|
|
243
|
-
<meta charset="utf-8">
|
|
244
|
-
<style>
|
|
245
|
-
html, body {
|
|
246
|
-
width: 100%;
|
|
247
|
-
height: 100%;
|
|
248
|
-
margin: 0;
|
|
249
|
-
overflow: hidden;
|
|
250
|
-
background: transparent;
|
|
251
|
-
color-scheme: ${t};
|
|
252
|
-
}
|
|
253
|
-
</style>
|
|
254
|
-
</head>
|
|
255
|
-
<body>
|
|
256
|
-
<script src="${n}"><\/script>
|
|
257
|
-
</body>
|
|
258
|
-
</html>`}function S_(n){var o;let t,e=n.button,r=n.buttons;switch(n.eventType){case"pointermove":t="television-theme-pointer-move",e=-1;break;case"pointerdown":t="television-theme-pointer-down";break;case"pointerup":t="television-theme-pointer-up";break;case"pointercancel":t="television-theme-pointer-cancel",e=-1,r=0;break;case"click":t="television-theme-pointer-click",r=0;break}const i={type:t,clientX:n.clientX,clientY:n.clientY,button:e,buttons:r};for(const a of[_s,As])(a==null?void 0:a.isConnected)===!0&&((o=a.contentWindow)==null||o.postMessage(i,"*"))}function mh(n){n.isTrusted&&S_({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",mh,{capture:!0});document.addEventListener("pointerdown",mh,{capture:!0});document.addEventListener("pointerup",mh,{capture:!0});document.addEventListener("pointercancel",mh,{capture:!0});document.addEventListener("click",mh,{capture:!0});function __(n){if(n!==_s&&n!==As)return!1;const e=((Ni==null?void 0:Ni.isConnected)===!0&&Ni!==_s&&Ni!==As&&Ni.closest("#foreground-overlay")===null?Ni:null)??document.querySelector("#app");return e==null||e.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const t=n.target;t instanceof HTMLElement&&(__(t)||t.isConnected&&t.closest("#foreground-overlay")===null&&(Ni=t))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>__(document.activeElement))},{capture:!0});function nv(){return ob+=1,`${Date.now()}-${ob}`}const IM=404,$M="/views/url-unsupported/";function sd(n){const t=Td(n.artifact,{electron:n.electron,browserDemo:n.browserDemo??!1});let e;if(t.renderer==="url-direct")e=t;else if(n.currentURL===null){const r=n.viewURL??t.viewURL;t.renderer==="markdown"?e={renderer:"markdown",viewURL:r,contentURL:n.contentURL??t.contentURL}:t.renderer==="url-webview"&&t.contentURL!==null?e={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??t.contentURL}:e={...t,viewURL:r}}else cb(n.currentURL)&&!n.electron?e=qr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:$M,contentURL:null}:cb(n.currentURL)?e={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:e={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:DM(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...e,viewURL:n.frameSrcOverride}:e}var ut,bn,cl,ko,To,Un,Co,ul,Zt,hl,dl,mr,rs,is,Ro,se,od,A_,E_,Ng,k_,gr,ad,$c,zg,T_,Hg,Zg,Bs;class xM extends an{constructor(){super(...arguments);m(this,se);m(this,ut,null);m(this,bn,null);m(this,cl,"");m(this,ko,()=>{});m(this,To,()=>{});m(this,Un,null);m(this,Co,null);m(this,ul,null);m(this,Zt,null);m(this,hl,null);m(this,dl,null);m(this,mr,null);m(this,rs,null);m(this,is,null);m(this,Ro,null);m(this,gr,()=>{!s(this,bn)||s(this,bn)!==s(this,Un)||s(this,ko).call(this,!0)})}get currentFrame(){return s(this,bn)}connected(){h(this,se,ad).call(this),h(this,se,zg).call(this)}disconnected(){h(this,se,$c).call(this),h(this,se,Bs).call(this)}template(e,r,i=()=>{}){return d(this,ko,r),d(this,To,i),e(this),s(this,cl)}assignSource(e){const r=s(this,ut),i=r?!LM(r.artifact,e.artifact):!0;((r==null?void 0:r.artifact.id)!==e.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&e.artifact.kind==="path"&&r.artifact.path!==e.artifact.path)&&d(this,Ro,null),i&&(d(this,mr,null),s(this,Zt)&&(s(this,Zt).content=""),d(this,rs,null),d(this,is,null)),d(this,ut,e),h(this,se,od).call(this)}handleArtifactContentChanged(e){const r=s(this,ut);return e!==(r==null?void 0:r.artifact.id)||!s(this,Zt)&&!h(this,se,Zg).call(this)?!1:(h(this,se,Hg).call(this),!0)}handleThemeChanged(){var r;const e=(r=s(this,ut))==null?void 0:r.artifact;return(e==null?void 0:e.kind)!=="path"||!Gm(e.path)||s(this,Zt)===null?!1:(s(this,Zt).notifyStylesChanged(),!0)}refreshFrameLoadState(){h(this,se,ad).call(this)}}ut=new WeakMap,bn=new WeakMap,cl=new WeakMap,ko=new WeakMap,To=new WeakMap,Un=new WeakMap,Co=new WeakMap,ul=new WeakMap,Zt=new WeakMap,hl=new WeakMap,dl=new WeakMap,mr=new WeakMap,rs=new WeakMap,is=new WeakMap,Ro=new WeakMap,se=new WeakSet,od=function(){const e=s(this,ut);if(!e)return;if(e.artifact.kind==="path"&&h(this,se,Zg).call(this)){h(this,se,k_).call(this,e.artifact);return}const r=sd(e),i=h(this,se,A_).call(this,r.renderer);h(this,se,E_).call(this,i,r),h(this,se,Ng).call(this,i),h(this,se,ad).call(this),h(this,se,zg).call(this)},A_=function(e){var o;const r=e==="url-webview"?"webview":"iframe";if(((o=s(this,bn))==null?void 0:o.tagName.toLowerCase())===r)return s(this,bn);h(this,se,$c).call(this),h(this,se,Bs).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,bn,i),i},E_=function(e,r){e.getAttribute("src")!==r.viewURL&&(s(this,To).call(this,null),s(this,To).call(this,e),e.setAttribute("src",r.viewURL)),r.contentURL===null?delete e.dataset.contentUrl:e.dataset.contentUrl=r.contentURL},Ng=function(e){s(this,cl)!==e&&(d(this,cl,e),this.render(e))},k_=function(e){s(this,To).call(this,null),h(this,se,$c).call(this),h(this,se,Bs).call(this),d(this,bn,null),s(this,ko).call(this,!1),h(this,se,Ng).call(this,j`
|
|
259
|
-
<section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
|
|
260
|
-
<div class="artifact-missing-wrapper">
|
|
261
|
-
<h1>${dA()}</h1>
|
|
262
|
-
<p>${pA()}</p>
|
|
263
|
-
<section class="artifact-missing-path" aria-label="Missing artifact path">
|
|
264
|
-
<p class="artifact-missing-path-label">Registered path:</p>
|
|
265
|
-
<p><code>${e.path}</code></p>
|
|
266
|
-
</section>
|
|
267
|
-
<p>${fA()}</p>
|
|
268
|
-
</div>
|
|
269
|
-
</section>
|
|
270
|
-
`)},gr=new WeakMap,ad=function(){var o;const e=s(this,bn),r=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===s(this,Un)&&r===s(this,Co)||(h(this,se,$c).call(this),s(this,ko).call(this,!1),!e||!r||!this.isConnected))return;if(d(this,Un,e),d(this,Co,r),e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",s(this,gr)),e.addEventListener("did-fail-load",s(this,gr));return}e.addEventListener("load",s(this,gr));const i=e;try{i.isConnected&&((o=i.contentDocument)==null?void 0:o.readyState)==="complete"&&s(this,gr).call(this)}catch{}},$c=function(){if(!s(this,Un)){d(this,Co,null);return}s(this,Un).removeEventListener("load",s(this,gr)),s(this,Un).removeEventListener("did-finish-load",s(this,gr)),s(this,Un).removeEventListener("did-fail-load",s(this,gr)),d(this,Un,null),d(this,Co,null)},zg=function(){const e=s(this,ut),r=s(this,bn),i=(r==null?void 0:r.dataset.contentUrl)??null,o=(e==null?void 0:e.artifact.id)??null;if(!e||!r||!i||!o){h(this,se,Bs).call(this,{clearContent:!0});return}if(r!==s(this,ul)||o!==s(this,dl)){h(this,se,Bs).call(this),d(this,ul,r),d(this,hl,i),d(this,dl,o);const a=r.tagName.toLowerCase()==="webview"?new CD(r):new TD(r);d(this,Zt,a),a.handleUpdateContent(async l=>{const c=s(this,ut),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,mr,l),s(this,Zt)===a&&(a.content=l)}),s(this,mr)!==null&&(a.content=s(this,mr))}else d(this,hl,i);h(this,se,T_).call(this)},T_=function(){const e=s(this,ut),r=e==null?void 0:e.application;!e||!r||!s(this,Zt)||s(this,rs)===e.artifact.id&&s(this,is)===r||(d(this,rs,e.artifact.id),d(this,is,r),h(this,se,Hg).call(this))},Hg=async function(){var o,a;const e=s(this,ut),r=e==null?void 0:e.application;if(!e||!r)return;const i=e.artifact.id;try{const l=await r.readMarkdown(i);if(((o=s(this,ut))==null?void 0:o.artifact.id)!==i||s(this,ut).application!==r)return;d(this,Ro,null),d(this,mr,l);const c=s(this,Zt);if(!c){h(this,se,od).call(this);return}c.content=l}catch(l){if(((a=s(this,ut))==null?void 0:a.artifact.id)!==i||s(this,ut).application!==r)return;if(l instanceof jl&&l.status===IM){d(this,Ro,i),d(this,mr,null),h(this,se,Bs).call(this),h(this,se,od).call(this);return}d(this,rs,null),d(this,is,null)}},Zg=function(){var r;const e=(r=s(this,ut))==null?void 0:r.artifact;return s(this,Ro)===(e==null?void 0:e.id)&&e.kind==="path"&&Gm(e.path)},Bs=function(e={}){var r;(r=s(this,Zt))==null||r.dispose(),d(this,Zt,null),d(this,ul,null),d(this,hl,null),d(this,dl,null),d(this,rs,null),d(this,is,null),e.clearContent&&d(this,mr,null)};const PM=ln(xM);function cb(n){return n.startsWith("http://")||n.startsWith("https://")}function DM(n,t){if(!n.startsWith("/")||!t)return n;try{return new URL(n,t).toString()}catch{return n}}function LM(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?n.url===t.url:!0}var Du,pl,vr,ni,ss,os,as,Lu,Ou,Mu,Nu,on,Ug,ld,cd;class OM{constructor(t,e=()=>{}){m(this,on);m(this,Du);m(this,pl);m(this,vr,null);m(this,ni,null);m(this,ss,null);m(this,os,null);m(this,as,!1);m(this,Lu,t=>{const e=hb(t.data);if(!e)return;const r=s(this,ss);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,o=i.contentWindow;if(o===null)return;const a=e.type==="leaving",l=e.type==="navigation-request"&&e.native===!0&&e.sameDocument!==!0,c=o===t.source,u=(a||l)&&s(this,ni)!==null&&s(this,ni)===t.source,p=a&&NM(i)===t.origin;!c&&!u&&!p||h(this,on,Ug).call(this,e,i,{send:f=>{var y;return(y=i.contentWindow)==null?void 0:y.postMessage(f,"*")}})});m(this,Ou,t=>{var o;const e=t.detail??t;if(!e||e.channel!==ub)return;const r=hb((o=e.args)==null?void 0:o[0]),i=s(this,os);!r||!i||h(this,on,Ug).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,ub,a)}})});m(this,Mu,t=>{const e=db(t);e.isMainFrame===!0&&e.isInPlace!==!0&&this.reset()});m(this,Nu,t=>{db(t).isMainFrame!==!1&&this.reset()});d(this,Du,t),d(this,pl,e)}get currentGuid(){return s(this,vr)}get lifecycleWindow(){return s(this,ni)}get trustState(){return{currentGuid:s(this,vr),lifecycleWindow:s(this,ni)}}connect(){s(this,as)||(d(this,as,!0),window.addEventListener("message",s(this,Lu)),h(this,on,ld).call(this))}disconnect(){s(this,as)&&(window.removeEventListener("message",s(this,Lu)),d(this,as,!1),h(this,on,cd).call(this))}reset(){d(this,vr,null),d(this,ni,null),s(this,pl).call(this)}setCurrentFrame(t){if(t===s(this,ss)){h(this,on,ld).call(this);return}h(this,on,cd).call(this),s(this,ss)!==null&&this.reset(),d(this,ss,MM(t)?t:null),h(this,on,ld).call(this)}}Du=new WeakMap,pl=new WeakMap,vr=new WeakMap,ni=new WeakMap,ss=new WeakMap,os=new WeakMap,as=new WeakMap,Lu=new WeakMap,Ou=new WeakMap,Mu=new WeakMap,Nu=new WeakMap,on=new WeakSet,Ug=function(t,e,r){t.type==="bridge-ready"&&t.guid!==s(this,vr)?(s(this,vr)!==null&&s(this,pl).call(this),d(this,vr,t.guid),d(this,ni,e.tagName.toLowerCase()==="iframe"?e.contentWindow:null)):t.type==="leaving"&&t.guid===s(this,vr)&&this.reset(),s(this,Du).call(this,t,r)},ld=function(){if(!s(this,as))return;const t=s(this,ss),e=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;e!==s(this,os)&&(h(this,on,cd).call(this),e&&(e.addEventListener("ipc-message",s(this,Ou)),e.addEventListener("did-start-navigation",s(this,Mu)),e.addEventListener("did-fail-load",s(this,Nu)),d(this,os,e)))},cd=function(){const t=s(this,os);t&&(t.removeEventListener("ipc-message",s(this,Ou)),t.removeEventListener("did-start-navigation",s(this,Mu)),t.removeEventListener("did-fail-load",s(this,Nu)),d(this,os,null))};const ub="television-artifact-bridge";function hb(n){return tA(n)||nA(n)||rA(n)||iA(n)||sA(n)||oA(n)||aA(n)||lA(n)?n:null}function MM(n){if(!n)return!1;const t=n.tagName.toLowerCase();return t==="iframe"||t==="webview"}function NM(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function db(n){return n.detail??n}const zM="/views/url-unsupported/";class HM extends an{constructor(){super(...arguments);I(this,"_artifact",null);I(this,"_viewURL",null);I(this,"_contentURL",null);I(this,"_application",null);I(this,"_fullScreen",!1);I(this,"_inert",!1);I(this,"_onFullScreenChange",()=>{});I(this,"_connected",!1);I(this,"_deleteConfirmationOpen",!1);I(this,"_dialogPresentation",null);I(this,"_subscribedWebview",null);I(this,"_documentHost",null);I(this,"_pendingDocumentSource",null);I(this,"_rootRef",jn());I(this,"_trustedChannel",new OM((e,r)=>{this.handleTrustedFrameMessage(e,r)},()=>{this._missingArtifactReplyTransport=null}));I(this,"_activeReloadFrameSrc",null);I(this,"_applicationSubscriptionsAttached",!1);I(this,"_proxyReloadVersion",0);I(this,"_navigationState",null);I(this,"_navigationArtifactId",null);I(this,"_navigationCanonicalURL",null);I(this,"_preserveFrameSrcOnNavigationRender",!1);I(this,"_missingArtifactReplyTransport",null);I(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,r=!e;r&&!wi()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:e,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});I(this,"handleArtifactContentChanged",e=>{var o;const r=e.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((o=this._documentHost)!=null&&o.handleArtifactContentChanged(r))||this.reloadProxyFrame()});I(this,"handleThemeChanged",()=>{var e,r;((e=this._artifact)==null?void 0:e.kind)==="url"&&qr(this._artifact.url)||this.isDemoPage()||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});I(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});I(this,"handleWebviewDidNavigateInPage",e=>{if(e.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});I(this,"captureDocumentHost",e=>{this._documentHost=e,this._pendingDocumentSource&&(e.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});I(this,"handleEmbedLoadChange",e=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",e)});I(this,"handleDocumentFrameChange",e=>{e===null&&this.resetTrustedFrame(),this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(this.bridgeFrame(e)),this.syncWebviewSubscription(e)});I(this,"handleTitleBarDoubleClick",e=>{const r=e.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(e,r){var u;const[i,o,a]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==o){const p=c?!FM(c,o):!0;if(p&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:p}),l=!0,c&&qM(c,o)){const f=this.currentMissingArtifactMessage();f&&((u=this._missingArtifactReplyTransport)==null||u.send(f))}}else p&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(e,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var e;this._connected=!1,(e=this._dialogPresentation)==null||e.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(e,r){var i;switch(e.type){case"url-target-request":r.send({type:cA,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const o=this.currentMissingArtifactMessage();o&&(this._missingArtifactReplyTransport=r,r.send(o));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(e);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(e.key);return;case"artifact-pointer":this.handleArtifactPointer(e);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(e){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();S_({eventType:e.eventType,clientX:i.left+e.clientX*i.width/r.clientWidth,clientY:i.top+e.clientY*i.height/r.clientHeight,button:e.button,buttons:e.buttons})}currentExternalTargetURL(){var r,i;const e=((r=this._navigationState)==null?void 0:r.currentURL)??null;return e&&UM(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:uA,title:e.title,path:e.path}}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!qr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){if(!R2(e.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(e.url);if(i===zM||i===r.currentURL)return;const o=e.native===!0;(e.sameDocument||o)&&(this._preserveFrameSrcOnNavigationRender=!0),e.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact||this.isDemoPage()){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new rD(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const r=sd({artifact:e,application:this._application,electron:wi(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return e.kind==="url"&&qr(e.url)||r.renderer==="url-webview"?bi(i):pb(i,i)}convertIframeNavigationURL(e){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&qr(this._artifact.url)&&qr(e)?bi(e):pb(e,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(e){const r=e.url;if(typeof r!="string"||!R2(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const o=bi(r);return o===i.currentURL?!1:(i.navigate(o),!0)}syncWebviewSubscription(e=this.currentFrame){const r=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var e;return((e=this._documentHost)==null?void 0:e.currentFrame)??null}syncFrameSubscriptions(){const e=this.currentFrame;this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(this.bridgeFrame(e)),this.syncWebviewSubscription(e)}bridgeFrame(e){return this.isDemoPage()?null:e}get browserDemo(){var e;return((e=this._application)==null?void 0:e.browserDemoMode)===!0}isDemoPage(){const e=this._artifact;return e?Td(e,{electron:wi(),browserDemo:this.browserDemo}).renderer==="url-direct":!1}returnToOriginalPage(){var i,o;const e=this._artifact,r=this.currentFrame;(e==null?void 0:e.kind)!=="url"||(r==null?void 0:r.tagName.toLowerCase())!=="iframe"||((i=this._rootRef.value)==null||i.removeAttribute("data-embed-loaded"),r.setAttribute("src",e.url),(o=this._documentHost)==null||o.refreshFrameLoadState())}syncFrameTitle(e){e&&this._artifact&&e.getAttribute("title")!==this._artifact.title&&e.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(e={}){var p,f,y;const r=this._artifact;if(!r)return;e.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:wi(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((p=this._navigationState)==null?void 0:p.currentURL)??null},o=sd(i),a=(f=this.currentFrame)==null?void 0:f.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(C_(this._activeReloadFrameSrc,o.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=e.frameSrcOverride??l??(e.preserveFrameSrc&&a?a:o.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(y=this._documentHost)==null||y.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,u,p;const e=this.currentFrame;if(!e||e.hasAttribute("data-content-url")||e.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&qr(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&qr(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(zl,String(++this._proxyReloadVersion));const o=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=o,(p=this._rootRef.value)==null||p.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:o,resetTrust:!0})}forceCurrentFrameSrc(){var o,a,l;if(!this._artifact)return;const e=sd({artifact:this._artifact,application:this._application,electron:wi(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((o=this._navigationState)==null?void 0:o.currentURL)??null});if(e.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(a=this._rootRef.value)==null||a.removeAttribute("data-embed-loaded"),i.setAttribute("src",e.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var i;const e=this._rootRef.value,r=e==null?void 0:e.querySelector(".artifact-menu-trigger");r&&((i=e==null?void 0:e.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(e){this.closeMenu(),this._onFullScreenChange(e)}showDeleteConfirmation(){var r,i,o;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const e=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");e&&(this._dialogPresentation=Gp(e,()=>this.dismissDeleteConfirmation()),(o=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||o.focus())}dismissDeleteConfirmation(){const e=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,e==null||e.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const e=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!e||!r)&&r.deleteArtifact(e).catch(()=>{})}artifactIconTemplate(){return this.isDemoPage()?j`
|
|
271
|
-
<button
|
|
272
|
-
icon
|
|
273
|
-
size="sm"
|
|
274
|
-
variant="ghost"
|
|
275
|
-
class="artifact-return"
|
|
276
|
-
@click=${()=>this.returnToOriginalPage()}
|
|
277
|
-
aria-label="Return to the original page"
|
|
278
|
-
>
|
|
279
|
-
<tv-icon name="artifact"></tv-icon>
|
|
280
|
-
</button>
|
|
281
|
-
`:j`<tv-icon name="artifact"></tv-icon>`}navigationControlsTemplate(){const e=this._navigationState;return!e||!e.canGoBack&&!e.canGoForward?null:j`
|
|
282
|
-
<button
|
|
283
|
-
icon
|
|
284
|
-
size="sm"
|
|
285
|
-
variant="ghost"
|
|
286
|
-
class="artifact-back"
|
|
287
|
-
?disabled=${!e.canGoBack}
|
|
288
|
-
@click=${()=>e.back()}
|
|
289
|
-
aria-label="Back"
|
|
290
|
-
>
|
|
291
|
-
<tv-icon name="back" size="sm"></tv-icon>
|
|
292
|
-
</button>
|
|
293
|
-
<button
|
|
294
|
-
icon
|
|
295
|
-
size="sm"
|
|
296
|
-
variant="ghost"
|
|
297
|
-
class="artifact-forward"
|
|
298
|
-
?disabled=${!e.canGoForward}
|
|
299
|
-
@click=${()=>e.forward()}
|
|
300
|
-
aria-label="Forward"
|
|
301
|
-
>
|
|
302
|
-
<tv-icon name="forward" size="sm"></tv-icon>
|
|
303
|
-
</button>
|
|
304
|
-
<span class="artifact-bar-divider" aria-hidden="true"></span>
|
|
305
|
-
`}deleteConfirmationTemplate(){return!this._deleteConfirmationOpen||!this._artifact?null:jp(j`
|
|
306
|
-
<div class="dialog-alert" role="alertdialog">
|
|
307
|
-
<h2>Delete “${this._artifact.title}”?</h2>
|
|
308
|
-
<p>It’s removed from this channel; the file or web page it points to is not deleted.</p>
|
|
309
|
-
<div class="dialog-actions">
|
|
310
|
-
<button @click=${()=>this.dismissDeleteConfirmation()}>Cancel</button>
|
|
311
|
-
<button intent="danger" @click=${()=>this.confirmDelete()}>Delete</button>
|
|
312
|
-
</div>
|
|
313
|
-
</div>
|
|
314
|
-
`)}template(e,r,i){const o=this._artifact;return j`
|
|
315
|
-
<div
|
|
316
|
-
class="artifact-view artifact-frame"
|
|
317
|
-
kind=${o.kind}
|
|
318
|
-
?full-screen=${this._fullScreen}
|
|
319
|
-
?inert=${this._inert}
|
|
320
|
-
._trustedChannel=${this._trustedChannel}
|
|
321
|
-
${vt(this._rootRef)}
|
|
322
|
-
>
|
|
323
|
-
<div class="artifact-frame-clip">
|
|
324
|
-
${PM(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
|
|
325
|
-
<footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
|
|
326
|
-
${this.artifactIconTemplate()}
|
|
327
|
-
<span class="artifact-title">${o.title}</span>
|
|
328
|
-
${this.navigationControlsTemplate()}
|
|
329
|
-
${YS(this.menuEntries(),{trigger:a=>j`
|
|
330
|
-
<button
|
|
331
|
-
icon
|
|
332
|
-
size="sm"
|
|
333
|
-
variant="ghost"
|
|
334
|
-
class="artifact-menu-trigger"
|
|
335
|
-
id=${a}
|
|
336
|
-
aria-label=${`${o.title} menu`}
|
|
337
|
-
>
|
|
338
|
-
<tv-icon name="expand"></tv-icon>
|
|
339
|
-
</button>
|
|
340
|
-
`})}
|
|
341
|
-
</footer>
|
|
342
|
-
</div>
|
|
343
|
-
${this.deleteConfirmationTemplate()}
|
|
344
|
-
</div>
|
|
345
|
-
`}renderArtifact(e={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:e.preserveFrameSrc??!1,frameSrcOverride:e.frameSrcOverride,resetTrust:e.resetTrust}),this.render(),e.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const ZM=ln(HM);function UM(n){return n.startsWith("http://")||n.startsWith("https://")}function FM(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?C_(n.url,t.url):!0}function qM(n,t){return n.kind==="path"&&t.kind==="path"&&n.id===t.id&&(n.title!==t.title||n.path!==t.path)}function C_(n,t){try{const e=new URL(n,window.location.href),r=new URL(t,window.location.href);return e.searchParams.delete(zl),r.searchParams.delete(zl),e.origin===r.origin&&e.pathname===r.pathname&&e.search===r.search}catch{return!1}}function pb(n,t){try{const e=new URL(n,window.location.href);if(t){const r=new URL(t,window.location.href);if(e.origin!=="null"&&e.origin===r.origin)return e.searchParams.delete(zl),`${e.pathname}${e.search}${e.hash}`}}catch{return bi(n)}return bi(n)}function R_(n,t,e,r,i){const o=t.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===e?i:a.geometry.full_screen},size:a===e?{...r}:{...a.size}}));n.updateChannelPages(t.id,o).catch(()=>{})}function Fg(n,t,e,r){R_(n,t,e,e.size,r)}function rv(n){return{width:1-nb+nb*n.width/lM,height:1-rb+rb*n.height/cM}}function I_(n){return{width:Math.min(gM,n.width),height:Math.min(vM,n.height)}}function fb(n,t){const e=rv(t),r=I_(t);return{width:Math.min(t.width,Math.max(r.width,n.width*e.width)),height:Math.min(t.height,Math.max(r.height,n.height*e.height))}}function VM(n,t){const e=rv(t);return{width:n.width/e.width,height:n.height/e.height}}const mb=.5,Oh=2,BM=120,WM=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Io,yr,fl,ri,ml,$o,ls,cs,us,ii,xo,Po,wr,gl,si,br,Tt,oi,Sr,Y,$_,x_,xc,P_,Pc,qg,ud,D_,zu,Hu,Zu,Uu,Do,Fu,Vg,Ln,Bg,ka,L_,O_,Dc;class jM extends an{constructor(){super(...arguments);m(this,Y);m(this,Io,jn());m(this,yr,jn());m(this,fl);m(this,ri);m(this,ml);m(this,$o);m(this,ls);m(this,cs,0);m(this,us,0);m(this,ii,null);m(this,xo,null);m(this,Po,null);m(this,wr,null);m(this,gl,[]);m(this,si,null);m(this,br,null);m(this,Tt,null);m(this,oi,new Set);m(this,Sr,!1);m(this,zu,e=>{const r=s(this,Tt);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},r.option=e.altKey,h(this,Y,Vg).call(this,r))});m(this,Hu,e=>{var r;e.pointerId===((r=s(this,Tt))==null?void 0:r.pointerId)&&h(this,Y,Ln).call(this,!0)});m(this,Zu,e=>{var r;e.pointerId===((r=s(this,Tt))==null?void 0:r.pointerId)&&h(this,Y,Ln).call(this,!1)});m(this,Uu,e=>{var r;e.pointerId===((r=s(this,Tt))==null?void 0:r.pointerId)&&h(this,Y,Ln).call(this,!1)});m(this,Do,e=>{const r=s(this,Tt);if(r){if(e.type==="keydown"&&e.key==="Escape"){e.preventDefault(),h(this,Y,Ln).call(this,!1);return}r.option!==e.altKey&&(r.option=e.altKey,h(this,Y,Vg).call(this,r))}});m(this,Fu,()=>{const e=s(this,Tt);!e||gb(h(this,Y,xc).call(this,e.filmstrip),e.pageBox)||(h(this,Y,qg).call(this),h(this,Y,Ln).call(this,!1))})}connected(){d(this,fl,void 0),d(this,ri,void 0),d(this,ml,void 0),d(this,$o,void 0),d(this,ls,void 0)}template(e,r,i,o=!1){var Q;const a=!s(this,Sr)&&o;if(d(this,Sr,o),a){h(this,Y,Ln).call(this,!1),h(this,Y,Dc).call(this);for(const V of s(this,oi))V.cancel();s(this,oi).clear()}const l=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,c=YM(r,(l==null?void 0:l.pages)??(r==null?void 0:r.pages)),u=(r==null?void 0:r.selectedPage)??null,p=(r==null?void 0:r.id)??null,f=(u==null?void 0:u.artifactIds[0])??null,y=(u==null?void 0:u.geometry.full_screen)??null,v=s(this,$o)!==void 0,S=c.map(({key:V,page:re})=>`${V}:${re.geometry.full_screen}:${re.size.width}:${re.size.height}`).sort().join("|"),_=l===null?null:c.map(({key:V})=>V).join("|"),x=p!==s(this,fl),Z=f!==s(this,ri),L=y!==s(this,ml),z=S!==s(this,$o),P=_!==s(this,ls),F=!s(this,Sr)&&l!==null&&s(this,ls)!==void 0&&s(this,ls)!==null&&P?h(this,Y,L_).call(this):null,q=!s(this,Sr)&&Z&&!x&&s(this,ri)!==void 0&&s(this,ri)!==null&&f!==null;return s(this,Tt)&&(x||Z||L)&&h(this,Y,Ln).call(this,!1),d(this,fl,p),d(this,ri,f),d(this,ml,y),d(this,$o,S),d(this,ls,_),d(this,gl,c),z&&v&&h(this,Y,ud).call(this),x&&((Q=s(this,wr))==null||Q.disconnect(),d(this,xo,null),d(this,Po,null),d(this,si,null)),queueMicrotask(()=>h(this,Y,Pc).call(this)),x||Z||z||a?queueMicrotask(()=>h(this,Y,$_).call(this,f,q)):P&&queueMicrotask(()=>{const V=s(this,yr).value;V&&(h(this,Y,ka).call(this,V,f,!1),F&&h(this,Y,O_).call(this,F))}),j`
|
|
346
|
-
<section
|
|
347
|
-
class="stage"
|
|
348
|
-
${vt(s(this,Io))}
|
|
349
|
-
style=${`--handle-band: ${uM}px; --handle-reach: ${hM}px; --handle-thickness: ${dM}px;`}
|
|
350
|
-
>
|
|
351
|
-
${r!==null&&c.length===0?j`
|
|
352
|
-
<div class="stage-empty">
|
|
353
|
-
<tv-icon name="artifact" size="xl"></tv-icon>
|
|
354
|
-
<p>No artifacts yet — ask your agent to put something here.</p>
|
|
355
|
-
</div>
|
|
356
|
-
`:null}
|
|
357
|
-
${Id([p],V=>V,()=>j`
|
|
358
|
-
<div class="filmstrip" ${vt(s(this,yr))}>
|
|
359
|
-
<div class="filmstrip-inner">
|
|
360
|
-
${Id(c,({key:V})=>V,({page:V,artifact:re,key:Ne})=>{if(r===null)return null;const xe=Ne===f;return j`
|
|
361
|
-
<div
|
|
362
|
-
class="page"
|
|
363
|
-
data-page-key=${Ne}
|
|
364
|
-
?selected=${xe}
|
|
365
|
-
?full-screen=${V.geometry.full_screen}
|
|
366
|
-
style=${h(this,Y,P_).call(this,V)}
|
|
367
|
-
@click=${xe||re===null?null:()=>e.selectPage(r.id,re.id)}
|
|
368
|
-
>
|
|
369
|
-
${re?ZM(e,re,{viewURL:e.getArtifactViewURL(re),contentURL:e.getArtifactContentURL(re),fullScreen:V.geometry.full_screen,inert:!xe,onFullScreenChange:tt=>Fg(e,r,V,tt)}):null}
|
|
370
|
-
${xe?j`
|
|
371
|
-
<div class="page-handles" aria-hidden="true">
|
|
372
|
-
${WM.map(tt=>j`
|
|
373
|
-
<span
|
|
374
|
-
class="page-handle ${tt}"
|
|
375
|
-
@pointerdown=${le=>h(this,Y,D_).call(this,le,tt,e,r,V,Ne)}
|
|
376
|
-
></span>
|
|
377
|
-
`)}
|
|
378
|
-
</div>
|
|
379
|
-
`:null}
|
|
380
|
-
</div>
|
|
381
|
-
`})}
|
|
382
|
-
</div>
|
|
383
|
-
</div>
|
|
384
|
-
`)}
|
|
385
|
-
</section>
|
|
386
|
-
`}disconnected(){var e;h(this,Y,Ln).call(this,!1),h(this,Y,ud).call(this),h(this,Y,Dc).call(this),cancelAnimationFrame(s(this,cs)),d(this,cs,0),(e=s(this,wr))==null||e.disconnect(),d(this,wr,null),d(this,xo,null),d(this,Po,null),d(this,si,null),d(this,gl,[]);for(const r of s(this,oi))r.cancel();s(this,oi).clear()}}Io=new WeakMap,yr=new WeakMap,fl=new WeakMap,ri=new WeakMap,ml=new WeakMap,$o=new WeakMap,ls=new WeakMap,cs=new WeakMap,us=new WeakMap,ii=new WeakMap,xo=new WeakMap,Po=new WeakMap,wr=new WeakMap,gl=new WeakMap,si=new WeakMap,br=new WeakMap,Tt=new WeakMap,oi=new WeakMap,Sr=new WeakMap,Y=new WeakSet,$_=function(e,r){const i=s(this,yr).value;i&&(cancelAnimationFrame(s(this,cs)),d(this,cs,requestAnimationFrame(()=>{d(this,cs,0),h(this,Y,ka).call(this,i,e,r)})))},x_=function(e,r){var i;typeof ResizeObserver>"u"||e===s(this,xo)&&r===s(this,Po)||((i=s(this,wr))==null||i.disconnect(),d(this,xo,e),d(this,Po,r),d(this,wr,new ResizeObserver(()=>{const o=h(this,Y,xc).call(this,e);gb(o,s(this,si))||(h(this,Y,qg).call(this),s(this,Tt)&&h(this,Y,Ln).call(this,!1),h(this,Y,Pc).call(this,e)),s(this,ii)===null&&h(this,Y,ka).call(this,e,s(this,ri)??null,!1)})),s(this,wr).observe(e),s(this,wr).observe(r))},xc=function(e){const r=Number.parseFloat(getComputedStyle(e).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,e.clientWidth-2*r),height:Math.max(0,e.clientHeight-r)}},P_=function(e){if(e.geometry.full_screen||s(this,si)===null)return"";const r=fb(e.size,s(this,si));return`width: ${r.width}px; height: ${r.height}px;`},Pc=function(e=s(this,yr).value){var o;if(!e)return;const r=h(this,Y,xc).call(this,e);d(this,si,r);const i=new Map(s(this,gl).map(a=>[a.key,a.page]));for(const a of e.querySelectorAll(".page")){if(a===((o=s(this,Tt))==null?void 0:o.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=fb(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},qg=function(){const e=s(this,Io).value;e&&(e.setAttribute("window-tracking",""),s(this,br)!==null&&clearTimeout(s(this,br)),d(this,br,setTimeout(()=>{d(this,br,null),e.removeAttribute("window-tracking")},BM)))},ud=function(){var e;s(this,br)!==null&&(clearTimeout(s(this,br)),d(this,br,null)),(e=s(this,Io).value)==null||e.removeAttribute("window-tracking")},D_=function(e,r,i,o,a,l){if(s(this,Sr)||e.button!==0||!e.isPrimary)return;const c=e.currentTarget,u=c.closest(".page"),p=s(this,yr).value,f=s(this,Io).value;if(!u||!p||!f)return;h(this,Y,Ln).call(this,!1),h(this,Y,ud).call(this),e.preventDefault(),e.stopPropagation();const y=u.getBoundingClientRect(),v=h(this,Y,xc).call(this,p),S=rv(v),_=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),Z=r.includes("top")||r.includes("bottom");d(this,Tt,{application:i,channel:o,page:a,pageKey:l,pageElement:u,filmstrip:p,stage:f,handle:c,pointerId:e.pointerId,startPointer:{x:e.clientX,y:e.clientY},lastPointer:{x:e.clientX,y:e.clientY},startRendered:{width:y.width,height:y.height},rendered:{width:y.width,height:y.height},baselineSize:_?{width:v.width/S.width,height:v.height/S.height}:{...a.size},pageBox:v,wasFullScreen:_,horizontal:x,vertical:Z,leftish:r.includes("left"),topish:r.includes("top"),option:e.altKey,armed:!1,leftFullScreen:!1}),f.setAttribute("resizing",""),c.addEventListener("pointermove",s(this,zu)),c.addEventListener("pointerup",s(this,Hu)),c.addEventListener("pointercancel",s(this,Zu)),c.addEventListener("lostpointercapture",s(this,Uu)),window.addEventListener("keydown",s(this,Do)),window.addEventListener("keyup",s(this,Do)),window.addEventListener("resize",s(this,Fu)),c.setPointerCapture(e.pointerId)},zu=new WeakMap,Hu=new WeakMap,Zu=new WeakMap,Uu=new WeakMap,Do=new WeakMap,Fu=new WeakMap,Vg=function(e){const r=e.lastPointer.x!==e.startPointer.x||e.lastPointer.y!==e.startPointer.y;if(e.wasFullScreen&&!e.leftFullScreen){if(!r)return;e.leftFullScreen=!0,e.pageElement.removeAttribute("full-screen")}const i=I_(e.pageBox);let o=e.startRendered.width,a=e.startRendered.height;if(e.horizontal){const l=e.leftish?-Oh:Oh;o=Math.min(e.pageBox.width,Math.max(i.width,e.startRendered.width+(e.lastPointer.x-e.startPointer.x)*l))}if(e.vertical){const l=e.topish?-Oh:Oh;a=Math.min(e.pageBox.height,Math.max(i.height,e.startRendered.height+(e.lastPointer.y-e.startPointer.y)*l))}e.armed=!e.option&&e.horizontal&&e.vertical&&o>=e.pageBox.width-sb&&a>=e.pageBox.height-sb,e.rendered=e.armed?{...e.pageBox}:{width:o,height:a},e.pageElement.style.width=`${e.rendered.width}px`,e.pageElement.style.height=`${e.rendered.height}px`,h(this,Y,Bg).call(this,e.stage,e.armed),h(this,Y,ka).call(this,e.filmstrip,e.pageKey,!1)},Ln=function(e){const r=s(this,Tt);if(r){if(d(this,Tt,null),r.handle.removeEventListener("pointermove",s(this,zu)),r.handle.removeEventListener("pointerup",s(this,Hu)),r.handle.removeEventListener("pointercancel",s(this,Zu)),r.handle.removeEventListener("lostpointercapture",s(this,Uu)),window.removeEventListener("keydown",s(this,Do)),window.removeEventListener("keyup",s(this,Do)),window.removeEventListener("resize",s(this,Fu)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,Y,Bg).call(this,r.stage,!1),e&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),Fg(r.application,r.channel,r.page,!0);else if(e){const i={...r.baselineSize},o=VM(r.rendered,r.pageBox);let a=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=o.width,a=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=o.height,a=!0),a?R_(r.application,r.channel,r.page,i,!1):h(this,Y,Pc).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,Y,Pc).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,Y,ka).call(this,r.filmstrip,r.pageKey,!1)}},Bg=function(e,r){const i=e.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const o=document.createElement("div");o.className="snap-outline",o.setAttribute("aria-hidden","true"),e.append(o)},ka=function(e,r,i){const o=[...e.querySelectorAll(".page")].find(y=>y.dataset.pageKey===r);if(!o){h(this,Y,Dc).call(this);return}h(this,Y,x_).call(this,e,o);const a=o.getBoundingClientRect(),l=e.getBoundingClientRect(),c=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(l.left+l.width/2),e.scrollWidth-e.clientWidth));if(h(this,Y,Dc).call(this),s(this,Sr)||!i||Math.abs(c-e.scrollLeft)<mb||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,p=e.animate([{},{}],{duration:y_,easing:"ease"});d(this,ii,p);const f=()=>{var v;if(p!==s(this,ii))return;const y=p.playState==="finished"?1:((v=p.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*y,p.playState==="finished"?(e.scrollLeft=c,d(this,ii,null),d(this,us,0)):d(this,us,requestAnimationFrame(f))};d(this,us,requestAnimationFrame(f))},L_=function(){const e=s(this,yr).value;return e?new Map([...e.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},O_=function(e){if(s(this,Sr))return;const r=s(this,yr).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const o=e.get(i.dataset.pageKey??"");if(o===void 0)continue;const a=o-i.getBoundingClientRect().left;if(Math.abs(a)<=mb)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:Pa,easing:"ease"});s(this,oi).add(l),l.finished.finally(()=>{s(this,oi).delete(l)}).catch(()=>{})}},Dc=function(){var e;cancelAnimationFrame(s(this,us)),d(this,us,0),(e=s(this,ii))==null||e.cancel(),d(this,ii,null)};const GM=ln(jM);function YM(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{const o=r.artifactIds[0];return{page:r,artifact:o===void 0?null:e.get(o)??null,key:o??`empty-page-${i}`}})}function gb(n,t){return t!==null&&n.width===t.width&&n.height===t.height}/**
|
|
387
|
-
* @license
|
|
388
|
-
* Copyright 2017 Google LLC
|
|
389
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
390
|
-
*/class Wg extends fh{constructor(t){if(super(t),this.it=he,t.type!==Ir.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===he||t==null)return this._t=void 0,this.it=t;if(t===$t)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Wg.directiveName="unsafeHTML",Wg.resultType=1;const M_=Jl(Wg);/*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */function vb(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function KM(n){if(Array.isArray(n))return n}function JM(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var r,i,o,a,l=[],c=!0,u=!1;try{if(o=(e=e.call(n)).next,t!==0)for(;!(c=(r=o.call(e)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function XM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
391
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function QM(n,t){return KM(n)||JM(n,t)||e9(n,t)||XM()}function e9(n,t){if(n){if(typeof n=="string")return vb(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?vb(n,t):void 0}}const N_=Object.entries,yb=Object.setPrototypeOf,t9=Object.isFrozen,n9=Object.getPrototypeOf,r9=Object.getOwnPropertyDescriptor;let ot=Object.freeze,ct=Object.seal,Ta=Object.create,z_=typeof Reflect<"u"&&Reflect,jg=z_.apply,Gg=z_.construct;ot||(ot=function(t){return t});ct||(ct=function(t){return t});jg||(jg=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(e,i)});Gg||(Gg=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Ws=et(Array.prototype.forEach),i9=et(Array.prototype.lastIndexOf),wb=et(Array.prototype.pop),dc=et(Array.prototype.push),s9=et(Array.prototype.splice),Oa=Array.isArray,Lc=et(String.prototype.toLowerCase),xm=et(String.prototype.toString),bb=et(String.prototype.match),pc=et(String.prototype.replace),Sb=et(String.prototype.indexOf),o9=et(String.prototype.trim),a9=et(Number.prototype.toString),l9=et(Boolean.prototype.toString),_b=typeof BigInt>"u"?null:et(BigInt.prototype.toString),Ab=typeof Symbol>"u"?null:et(Symbol.prototype.toString),Vt=et(Object.prototype.hasOwnProperty),fc=et(Object.prototype.toString),ft=et(RegExp.prototype.test),Li=c9(TypeError);function et(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return jg(n,t,r)}}function c9(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Gg(n,e)}}function ve(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Lc;if(yb&&yb(n,null),!Oa(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=e(i);o!==i&&(t9(t)||(t[r]=o),i=o)}n[i]=!0}return n}function u9(n){for(let t=0;t<n.length;t++)Vt(n,t)||(n[t]=null);return n}function Kt(n){const t=Ta(null);for(const r of N_(n)){var e=QM(r,2);const i=e[0],o=e[1];Vt(n,i)&&(Oa(o)?t[i]=u9(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=Kt(o):t[i]=o)}return t}function h9(n){switch(typeof n){case"string":return n;case"number":return a9(n);case"boolean":return l9(n);case"bigint":return _b?_b(n):"0";case"symbol":return Ab?Ab(n):"Symbol()";case"undefined":return fc(n);case"function":case"object":{if(n===null)return fc(n);const t=n,e=dn(t,"toString");if(typeof e=="function"){const r=e(t);return typeof r=="string"?r:fc(r)}return fc(n)}default:return fc(n)}}function dn(n,t){for(;n!==null;){const r=r9(n,t);if(r){if(r.get)return et(r.get);if(typeof r.value=="function")return et(r.value)}n=n9(n)}function e(){return null}return e}function d9(n){try{return ft(n,""),!0}catch{return!1}}const Eb=ot(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pm=ot(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Dm=ot(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),p9=ot(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Lm=ot(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),f9=ot(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kb=ot(["#text"]),Tb=ot(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Om=ot(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Cb=ot(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Mh=ot(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),m9=ct(/{{[\w\W]*|^[\w\W]*}}/g),g9=ct(/<%[\w\W]*|^[\w\W]*%>/g),v9=ct(/\${[\w\W]*/g),y9=ct(/^data-[\-\w.\u00B7-\uFFFF]+$/),w9=ct(/^aria-[\-\w]+$/),Rb=ct(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),b9=ct(/^(?:\w+script|data):/i),S9=ct(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_9=ct(/^html$/i),A9=ct(/^[a-z][.\w]*(-[.\w]+)+$/i),Ib=ct(/<[/\w!]/g),$b=ct(/<[/\w]/g),E9=ct(/<\/no(script|embed|frames)/i),k9=ct(/\/>/i),Yt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},H_=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],T9=ot(ve({},H_)),C9=(function(){const n={};return Ws(H_,t=>{n[t]=ct(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ot(n)})(),R9=function(){return typeof window>"u"?null:window},I9=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},xb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Oi=function(t,e,r,i){return Vt(t,e)&&Oa(t[e])?ve(i.base?Kt(i.base):{},t[e],i.transform):r},Mm=function(t,e,r){const i=Vt(t,e)?t[e]:void 0;return i&&typeof i=="object"?Kt(i):r()};function Z_(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:R9();const t=N=>Z_(N);if(t.version="3.4.16",t.removed=[],!n||!n.document||n.document.nodeType!==Yt.document||!n.Element)return t.isSupported=!1,t;let e=n.document;const r=e,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,a=n.Node,l=n.Element,c=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const u=n.DOMParser,p=n.trustedTypes,f=l.prototype,y=dn(f,"cloneNode"),v=dn(f,"remove"),S=dn(f,"removeAttributeNode"),_=dn(f,"nextSibling"),x=dn(f,"childNodes"),Z=dn(f,"parentNode"),L=dn(f,"shadowRoot"),z=dn(f,"attributes"),P=a&&a.prototype?dn(a.prototype,"nodeType"):null,B=a&&a.prototype?dn(a.prototype,"nodeName"):null,F=a&&a.prototype?dn(a.prototype,"ownerDocument"):null,q=function(w){return P?P(w):w.nodeType},Q=function(w){return B?B(w):w.nodeName};if(typeof o=="function"){const N=e.createElement("template");N.content&&N.content.ownerDocument&&(e=N.content.ownerDocument)}let V,re="",Ne,xe=!1,tt=0;const le=function(){if(tt>0)throw Li('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},je=function(w){le(),tt++;try{return V.createHTML(w)}finally{tt--}},Dt=function(w){le(),tt++;try{return V.createScriptURL(w)}finally{tt--}},$n=function(){return xe||(Ne=I9(p,i),xe=!0),Ne},ht=e,wt=ht.implementation,Ps=ht.createNodeIterator,sa=ht.createDocumentFragment,Ds=ht.getElementsByTagName,Ci=r.importNode;let Ee=xb();t.isSupported=typeof N_=="function"&&typeof Z=="function"&&wt&&wt.createHTMLDocument!==void 0;const Ql=m9,xn=g9,Ls=v9,ec=y9,bt=w9,Re=b9,Be=S9,Pe=A9;let Ge=Rb,ce=null;const cn=ve({},[...Eb,...Pm,...Dm,...Lm,...kb]);let oe=null;const at=ve({},[...Tb,...Om,...Cb,...Mh]);let ze=Object.seal(Ta(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),un=null,Pn=null;const Ye=Object.seal(Ta(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Pr=!0,Xn=!0,Dr=!1,vh=!0,Qn=!1,er=!0,Lr=!1,Or=!1,Ri=null,Os=null,tc=!1,Ii=!1,$i=!1,Mr=!1,k=!0,C=!1;const fe="user-content-";let Se=!0,ke=!1,te={},St=null;const tr=ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let dt=null;const Dn=ve({},["audio","video","img","source","image","track"]);let oa=null;const Nr=ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",Ms="http://www.w3.org/2000/svg",jt="http://www.w3.org/1999/xhtml";let zr=jt,Hr=!1,Ns=null;const aa=ve({},[pt,Ms,jt],xm),la=ot(["mi","mo","mn","ms","mtext"]);let zs=ve({},la);const nc=ot(["annotation-xml"]);let ca=ve({},nc);const rc=ve({},["title","style","font","a","script"]);let xi=null;const ic=["application/xhtml+xml","text/html"],yh="text/html";let He=null,nr=null;const Pi=e.createElement("form"),Hs=function(w){return w instanceof RegExp||w instanceof Function},sc=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(nr&&nr===w)return;(!w||typeof w!="object")&&(w={}),w=Kt(w),xi=ic.indexOf(w.PARSER_MEDIA_TYPE)===-1?yh:w.PARSER_MEDIA_TYPE,He=xi==="application/xhtml+xml"?xm:Lc,ce=Oi(w,"ALLOWED_TAGS",cn,{transform:He}),oe=Oi(w,"ALLOWED_ATTR",at,{transform:He}),Ns=Oi(w,"ALLOWED_NAMESPACES",aa,{transform:xm}),oa=Oi(w,"ADD_URI_SAFE_ATTR",Nr,{transform:He,base:Nr}),dt=Oi(w,"ADD_DATA_URI_TAGS",Dn,{transform:He,base:Dn}),St=Oi(w,"FORBID_CONTENTS",tr,{transform:He}),un=Oi(w,"FORBID_TAGS",Kt({}),{transform:He}),Pn=Oi(w,"FORBID_ATTR",Kt({}),{transform:He}),te=Vt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Kt(w.USE_PROFILES):w.USE_PROFILES:!1,Pr=w.ALLOW_ARIA_ATTR!==!1,Xn=w.ALLOW_DATA_ATTR!==!1,Dr=w.ALLOW_UNKNOWN_PROTOCOLS||!1,vh=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qn=w.SAFE_FOR_TEMPLATES||!1,er=w.SAFE_FOR_XML!==!1,Lr=w.WHOLE_DOCUMENT||!1,Ii=w.RETURN_DOM||!1,$i=w.RETURN_DOM_FRAGMENT||!1,Mr=w.RETURN_TRUSTED_TYPE||!1,tc=w.FORCE_BODY||!1,k=w.SANITIZE_DOM!==!1,C=w.SANITIZE_NAMED_PROPS||!1,Se=w.KEEP_CONTENT!==!1,ke=w.IN_PLACE||!1,Ge=d9(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:Rb,zr=typeof w.NAMESPACE=="string"?w.NAMESPACE:jt,zs=Mm(w,"MATHML_TEXT_INTEGRATION_POINTS",()=>ve({},la)),ca=Mm(w,"HTML_INTEGRATION_POINTS",()=>ve({},nc));const A=Mm(w,"CUSTOM_ELEMENT_HANDLING",()=>Ta(null));if(ze=Ta(null),Vt(A,"tagNameCheck")&&Hs(A.tagNameCheck)&&(ze.tagNameCheck=A.tagNameCheck),Vt(A,"attributeNameCheck")&&Hs(A.attributeNameCheck)&&(ze.attributeNameCheck=A.attributeNameCheck),Vt(A,"allowCustomizedBuiltInElements")&&typeof A.allowCustomizedBuiltInElements=="boolean"&&(ze.allowCustomizedBuiltInElements=A.allowCustomizedBuiltInElements),ct(ze),Qn&&(Xn=!1),$i&&(Ii=!0),te&&(ce=ve({},kb),oe=Ta(null),te.html===!0&&(ve(ce,Eb),ve(oe,Tb)),te.svg===!0&&(ve(ce,Pm),ve(oe,Om),ve(oe,Mh)),te.svgFilters===!0&&(ve(ce,Dm),ve(oe,Om),ve(oe,Mh)),te.mathMl===!0&&(ve(ce,Lm),ve(oe,Cb),ve(oe,Mh))),Ye.tagCheck=null,Ye.attributeCheck=null,Vt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Ye.tagCheck=w.ADD_TAGS:Oa(w.ADD_TAGS)&&(ce===cn&&(ce=Kt(ce)),ve(ce,w.ADD_TAGS,He))),Vt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Ye.attributeCheck=w.ADD_ATTR:Oa(w.ADD_ATTR)&&(oe===at&&(oe=Kt(oe)),ve(oe,w.ADD_ATTR,He))),Vt(w,"ADD_FORBID_CONTENTS")&&Oa(w.ADD_FORBID_CONTENTS)&&(St===tr&&(St=Kt(St)),ve(St,w.ADD_FORBID_CONTENTS,He)),Se&&(ce["#text"]=!0),Lr&&ve(ce,["html","head","body"]),ce.table&&(ve(ce,["tbody"]),delete un.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Li('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const M=V;V=w.TRUSTED_TYPES_POLICY;try{re=je("")}catch(H){throw V=M,H}}else w.TRUSTED_TYPES_POLICY===null?(V=void 0,re=""):(V===void 0&&(V=$n()),V&&typeof re=="string"&&(re=je("")));ot&&ot(w),nr=w},oc=ve({},[...Pm,...Dm,...p9]),yv=ve({},[...Lm,...f9]),F4=function(w,A,M){return A.namespaceURI===jt?w==="svg":A.namespaceURI===pt?w==="svg"&&(M==="annotation-xml"||zs[M]):!!oc[w]},q4=function(w,A,M){return A.namespaceURI===jt?w==="math":A.namespaceURI===Ms?w==="math"&&ca[M]:!!yv[w]},V4=function(w,A,M){return A.namespaceURI===Ms&&!ca[M]||A.namespaceURI===pt&&!zs[M]?!1:!yv[w]&&(rc[w]||!oc[w])},B4=function(w){let A=Z(w);(!A||!A.tagName)&&(A={namespaceURI:zr,tagName:"template"});const M=Lc(w.tagName),H=Lc(A.tagName);return Ns[w.namespaceURI]?w.namespaceURI===Ms?F4(M,A,H):w.namespaceURI===pt?q4(M,A,H):w.namespaceURI===jt?V4(M,A,H):!!(xi==="application/xhtml+xml"&&Ns[w.namespaceURI]):!1},Di=function(w){dc(t.removed,{element:w});try{Z(w).removeChild(w)}catch{if(v(w),!Z(w))throw Li("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},wv=function(w,A,M){try{S(w,A)}catch{try{w.removeAttribute(M)}catch{}}},wh=function(w){bh(w);const A=x(w);if(A){const H=[];Ws(A,X=>{dc(H,X)}),Ws(H,X=>{try{v(X)}catch{}})}const M=z(w);if(M)for(let H=M.length-1;H>=0;--H){const X=M[H],de=X&&X.name;typeof de=="string"&&wv(w,X,de)}},Zs=function(w,A,M){if(!M)try{M=A.getAttributeNode(w)}catch{M=null}dc(t.removed,{attribute:M||null,from:A});try{M?S(A,M):A.removeAttribute(w)}catch{try{A.removeAttribute(w)}catch{}}if(w==="is")if(Ii||$i)try{Di(A)}catch{}else try{A.setAttribute(w,"")}catch{}},W4=function(w){const A=z(w);if(A)for(let M=A.length-1;M>=0;--M){const H=A[M],X=H&&H.name;typeof X!="string"||oe[He(X)]||wv(w,H,X)}},bh=function(w){const A=[w];for(;A.length>0;){const M=A.pop();q(M)===Yt.element&&W4(M);const H=x(M);if(H)for(let X=H.length-1;X>=0;--X)A.push(H[X])}},bv=function(w,A){return er?w==="patchsrc"?!0:w==="for"&&A!=="label"&&A!=="output":!1},j4=function(w){if(!er)return;const A=[w];for(;A.length>0;){const M=A.pop(),H=q(M);if(H===Yt.processingInstruction||H===Yt.comment&&ft($b,M.data)){try{v(M)}catch{}continue}if(H===Yt.element){const de=M,me=He(Q(M));try{de.hasAttribute&&de.hasAttribute("patchsrc")&&de.removeAttribute("patchsrc"),de.hasAttribute&&de.hasAttribute("for")&&bv("for",me)&&de.removeAttribute("for")}catch{}}const X=x(M);if(X)for(let de=X.length-1;de>=0;--de)A.push(X[de])}},Sv=function(w){let A=null,M=null;if(tc)w="<remove></remove>"+w;else{const de=bb(w,/^[\r\n\t ]+/);M=de&&de[0]}xi==="application/xhtml+xml"&&zr===jt&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const H=V?je(w):w;if(zr===jt)try{A=new u().parseFromString(H,xi)}catch{}if(!A||!A.documentElement){A=wt.createDocument(zr,"template",null);try{A.documentElement.innerHTML=Hr?re:H}catch{}}const X=A.body||A.documentElement;return w&&M&&X.insertBefore(e.createTextNode(M),X.childNodes[0]||null),zr===jt?Ds.call(A,Lr?"html":"body")[0]:Lr?A.documentElement:X},_v=function(w){const A=F?F(w):w.ownerDocument;return Ps.call(A||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Sh=function(w){return w=pc(w,Ql," "),w=pc(w,xn," "),w=pc(w,Ls," "),w},Xp=function(w){var A;w.normalize();const M=F?F(w):w.ownerDocument,H=Ps.call(M||w,w,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let X=H.nextNode();for(;X;)X.data=Sh(X.data),X=H.nextNode();const de=(A=w.querySelectorAll)===null||A===void 0?void 0:A.call(w,"template");de&&Ws(de,me=>{ua(me.content)&&Xp(me.content)})},_h=function(w){const A=B?B(w):null;return typeof A!="string"||He(A)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==z(w)||typeof w.removeAttribute!="function"||typeof w.removeAttributeNode!="function"||typeof w.getAttributeNode!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==P(w)||w.childNodes!==x(w)},ua=function(w){if(!P||typeof w!="object"||w===null)return!1;try{return P(w)===Yt.documentFragment}catch{return!1}},ac=function(w){if(!P||typeof w!="object"||w===null)return!1;try{return typeof P(w)=="number"}catch{return!1}};function rr(N,w,A){N.length!==0&&Ws(N,M=>{M.call(t,w,A,nr)})}const G4=function(w,A){return!!(er&&w.hasChildNodes()&&!ac(w.firstElementChild)&&ft(Ib,w.textContent)&&ft(Ib,w.innerHTML)||er&&w.namespaceURI===jt&&T9[A]&&(ac(w.firstElementChild)||typeof w.textContent=="string"&&ft(C9[A],w.textContent))||w.nodeType===Yt.processingInstruction||er&&w.nodeType===Yt.comment&&ft($b,w.data))},Ah=function(w,A){if(w instanceof RegExp)return ft(w,A);if(w instanceof Function){for(var M=arguments.length,H=new Array(M>2?M-2:0),X=2;X<M;X++)H[X-2]=arguments[X];return!!w(A,...H)}return!1},Y4=function(w,A,M){if(!un[A]&&Tv(A)&&Ah(ze.tagNameCheck,A))return!1;if(Se&&!St[A]){const H=Z(w),X=x(w);if(X&&H){const de=X.length;for(let me=de-1;me>=0;--me){const Ve=w===M?y(X[me],!0):X[me];H.insertBefore(Ve,_(w))}}}return Di(w),!0},Av=function(w,A,M,H){return w.length===0?A:A===M||A===H?Kt(A):A},ha=function(w,A){return w===A||Z(w)!==null?!1:(ke&&bh(w),!0)},Ev=function(w,A){if(rr(Ee.beforeSanitizeElements,w,null),ha(w,A))return!0;if(_h(w))return Di(w),!0;const M=He(Q(w));if(ce=Av(Ee.uponSanitizeElement,ce,cn,Ri),rr(Ee.uponSanitizeElement,w,{tagName:M,allowedTags:ce}),ha(w,A))return!0;if(G4(w,M))return Di(w),!0;if(un[M]||!(Ye.tagCheck instanceof Function&&Ye.tagCheck(M))&&!ce[M]){const H=Y4(w,M,A);return H===!1&&(rr(Ee.afterSanitizeElements,w,null),ha(w,A))?!0:H}if(q(w)===Yt.element&&!B4(w)||(M==="noscript"||M==="noembed"||M==="noframes")&&ft(E9,w.innerHTML))return Di(w),!0;if(Qn&&w.nodeType===Yt.text){const H=Sh(w.textContent);w.textContent!==H&&(dc(t.removed,{element:w.cloneNode()}),w.textContent=H)}return rr(Ee.afterSanitizeElements,w,null),ha(w,A)},kv=function(w,A,M){if(Pn[A]||bv(A,w)||k&&(A==="id"||A==="name")&&(M in e||M in Pi))return!1;const H=oe[A]||Ye.attributeCheck instanceof Function&&Ye.attributeCheck(A,w);return Xn&&ft(ec,A)||Pr&&ft(bt,A)?!0:H?oa[A]||ft(Ge,pc(M,Be,""))||(A==="src"||A==="xlink:href"||A==="href")&&w!=="script"&&Sb(M,"data:")===0&&dt[w]||Dr&&!ft(Re,pc(M,Be,""))?!0:!M:Tv(w)&&Ah(ze.tagNameCheck,w)&&Ah(ze.attributeNameCheck,A,w)||A==="is"&&ze.allowCustomizedBuiltInElements&&Ah(ze.tagNameCheck,M)},K4=ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Tv=function(w){return!K4[Lc(w)]&&ft(Pe,w)},J4=function(w,A,M,H){if(V&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!M)switch(p.getAttributeType(w,A)){case"TrustedHTML":return je(H);case"TrustedScriptURL":return Dt(H)}return H},X4=function(w,A,M,H){try{return M?w.setAttributeNS(M,A,H):w.setAttribute(A,H),_h(w)?(Di(w),!1):!0}catch{return Zs(A,w),!1}},Cv=function(w,A){if(rr(Ee.beforeSanitizeAttributes,w,null),ha(w,A))return;const M=w.attributes;if(!M||_h(w))return;oe=Av(Ee.uponSanitizeAttribute,oe,at,Os);const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let X=M.length;const de=He(w.nodeName);for(;X--;){const me=M[X],Ve=me.name,hn=me.namespaceURI,Gt=me.value,da=He(Ve),ef=Gt;let _t=Ve==="value"?ef:o9(ef),Rv=!1;if(H.attrName=da,H.attrValue=_t,H.keepAttr=!0,H.forceKeepAttr=void 0,rr(Ee.uponSanitizeAttribute,w,H),_t=H.attrValue,C&&(da==="id"||da==="name")&&Sb(_t,fe)!==0&&(Zs(Ve,w,me),_t=fe+_t,Rv=!0),er&&ft(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_t)){Zs(Ve,w,me);continue}if(da==="attributename"&&bb(_t,"href")){Zs(Ve,w,me);continue}if(!H.forceKeepAttr){if(!H.keepAttr){Zs(Ve,w,me);continue}if(!vh&&ft(k9,_t)){Zs(Ve,w,me);continue}if(Qn&&(_t=Sh(_t)),!kv(de,da,_t)){Zs(Ve,w,me);continue}_t=J4(de,da,hn,_t),_t!==ef&&X4(w,Ve,hn,_t)&&Rv&&wb(t.removed)}}rr(Ee.afterSanitizeAttributes,w,null),ha(w,A)},Eh=function(w){let A=null;const M=_v(w);for(rr(Ee.beforeSanitizeShadowDOM,w,null);A=M.nextNode();)if(rr(Ee.uponSanitizeShadowNode,A,null),Ev(A,w),Cv(A,w),ua(A.content)&&Eh(A.content),q(A)===Yt.element){const H=L(A);ua(H)&&(Qp(H),Eh(H))}rr(Ee.afterSanitizeShadowDOM,w,null)},Qp=function(w){const A=[{node:w,shadow:null}];for(;A.length>0;){const M=A.pop();if(M.shadow){Eh(M.shadow);continue}const H=M.node,X=q(H)===Yt.element,de=x(H);if(de)for(let me=de.length-1;me>=0;--me)A.push({node:de[me],shadow:null});if(X){const me=B?B(H):null;if(typeof me=="string"&&He(me)==="template"){const Ve=H.content;ua(Ve)&&A.push({node:Ve,shadow:null})}}if(X){const me=L(H);ua(me)&&A.push({node:null,shadow:me},{node:me,shadow:null})}}};return t.sanitize=function(N){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,M=null,H=null,X=null;if(Hr=!N,Hr&&(N="<!-->"),typeof N!="string"&&!ac(N)&&(N=h9(N),typeof N!="string"))throw Li("dirty is not a string, aborting");if(!t.isSupported)return N;Or?(ce=Ri,oe=Os):sc(w),(Ee.uponSanitizeElement.length>0||Ee.uponSanitizeAttribute.length>0)&&(ce=Kt(ce)),Ee.uponSanitizeAttribute.length>0&&(oe=Kt(oe)),t.removed=[];const de=ke&&typeof N!="string"&&ac(N);if(de){j4(N);const hn=Q(N);if(typeof hn=="string"){const Gt=He(hn);if(!ce[Gt]||un[Gt])throw wh(N),Li("root node is forbidden and cannot be sanitized in-place")}if(_h(N))throw wh(N),Li("root node is clobbered and cannot be sanitized in-place");try{Qp(N)}catch(Gt){throw wh(N),Gt}}else if(ac(N))A=Sv("<!---->"),M=A.ownerDocument.importNode(N,!0),M.nodeType===Yt.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?A=M:A.appendChild(M),Qp(A);else{if(!Ii&&!Qn&&!Lr&&N.indexOf("<")===-1)return V&&Mr?je(N):N;if(A=Sv(N),!A)return Ii?null:Mr?re:""}A&&tc&&Di(A.firstChild);const me=de?N:A;try{const hn=_v(me);for(;H=hn.nextNode();)Ev(H,me),Cv(H,me),ua(H.content)&&Eh(H.content)}catch(hn){throw de&&(wh(N),Ws(t.removed,Gt=>{Gt.element&&bh(Gt.element)})),hn}if(de){let hn=!1;if(Ws(t.removed,Gt=>{Gt.element&&(Gt.element===N&&(hn=!0),bh(Gt.element))}),hn)throw Li("a node selected for removal could not be safely returned; refusing to sanitize in place");return Qn&&Xp(N),N}if(Ii){if(Qn&&Xp(A),$i)for(X=sa.call(A.ownerDocument);A.firstChild;)X.appendChild(A.firstChild);else X=A;return(oe.shadowroot||oe.shadowrootmode)&&(X=Ci.call(r,X,!0)),X}let Ve=Lr?A.outerHTML:A.innerHTML;return Lr&&ce["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&ft(_9,A.ownerDocument.doctype.name)&&(Ve="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
392
|
-
`+Ve),Qn&&(Ve=Sh(Ve)),V&&Mr?je(Ve):Ve},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sc(N),Or=!0,Ri=ce,Os=oe},t.clearConfig=function(){nr=null,Or=!1,Ri=null,Os=null,V=Ne,re=""},t.isValidAttribute=function(N,w,A){nr||sc({});const M=He(N),H=He(w);return kv(M,H,A)},t.addHook=function(N,w){typeof w=="function"&&Vt(Ee,N)&&dc(Ee[N],w)},t.removeHook=function(N,w){if(Vt(Ee,N)){if(w!==void 0){const A=i9(Ee[N],w);return A===-1?void 0:s9(Ee[N],A,1)[0]}return wb(Ee[N])}},t.removeHooks=function(N){Vt(Ee,N)&&(Ee[N]=[])},t.removeAllHooks=function(){Ee=xb()},t}var U_=Z_();function iv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ia=iv();function F_(n){ia=n}var Js={exec:()=>null};function ge(n,t=""){let e=typeof n=="string"?n:n.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(xt.caret,"$1"),e=e.replace(i,a),r},getRegex:()=>new RegExp(e,t)};return r}var $9=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),xt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},x9=/^(?:[ \t]*(?:\n|$))+/,P9=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,D9=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,L9=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,q_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,V_=ge(q_).replace(/bull/g,sv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),O9=ge(q_).replace(/bull/g,sv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ov=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,M9=/^[^\n]+/,av=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,N9=ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",av).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),z9=ge(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,sv).getRegex(),Yp="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",lv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,H9=ge("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",lv).replace("tag",Yp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B_=ge(ov).replace("hr",gh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yp).getRegex(),Z9=ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B_).getRegex(),cv={blockquote:Z9,code:P9,def:N9,fences:D9,heading:L9,hr:gh,html:H9,lheading:V_,list:z9,newline:x9,paragraph:B_,table:Js,text:M9},Pb=ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yp).getRegex(),U9={...cv,lheading:O9,table:Pb,paragraph:ge(ov).replace("hr",gh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pb).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yp).getRegex()},F9={...cv,html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Js,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ge(ov).replace("hr",gh).replace("heading",` *#{1,6} *[^
|
|
393
|
-
]`).replace("lheading",V_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q9=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,V9=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,W_=/^( {2,}|\\)\n(?!\s*$)/,B9=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xl=/[\p{P}\p{S}]/u,Kp=/[\s\p{P}\p{S}]/u,uv=/[^\s\p{P}\p{S}]/u,W9=ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),j_=/(?!~)[\p{P}\p{S}]/u,j9=/(?!~)[\s\p{P}\p{S}]/u,G9=/(?:[^\s\p{P}\p{S}]|~)/u,Y9=ge(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$9?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),G_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,K9=ge(G_,"u").replace(/punct/g,Xl).getRegex(),J9=ge(G_,"u").replace(/punct/g,j_).getRegex(),Y_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X9=ge(Y_,"gu").replace(/notPunctSpace/g,uv).replace(/punctSpace/g,Kp).replace(/punct/g,Xl).getRegex(),Q9=ge(Y_,"gu").replace(/notPunctSpace/g,G9).replace(/punctSpace/g,j9).replace(/punct/g,j_).getRegex(),eN=ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,uv).replace(/punctSpace/g,Kp).replace(/punct/g,Xl).getRegex(),tN=ge(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xl).getRegex(),nN="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",rN=ge(nN,"gu").replace(/notPunctSpace/g,uv).replace(/punctSpace/g,Kp).replace(/punct/g,Xl).getRegex(),iN=ge(/\\(punct)/,"gu").replace(/punct/g,Xl).getRegex(),sN=ge(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),oN=ge(lv).replace("(?:-->|$)","-->").getRegex(),aN=ge("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",oN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ld=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,lN=ge(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ld).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),K_=ge(/^!?\[(label)\]\[(ref)\]/).replace("label",Ld).replace("ref",av).getRegex(),J_=ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",av).getRegex(),cN=ge("reflink|nolink(?!\\()","g").replace("reflink",K_).replace("nolink",J_).getRegex(),Db=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,hv={_backpedal:Js,anyPunctuation:iN,autolink:sN,blockSkip:Y9,br:W_,code:V9,del:Js,delLDelim:Js,delRDelim:Js,emStrongLDelim:K9,emStrongRDelimAst:X9,emStrongRDelimUnd:eN,escape:q9,link:lN,nolink:J_,punctuation:W9,reflink:K_,reflinkSearch:cN,tag:aN,text:B9,url:Js},uN={...hv,link:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",Ld).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ld).getRegex()},Yg={...hv,emStrongRDelimAst:Q9,emStrongLDelim:J9,delLDelim:tN,delRDelim:rN,url:ge(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Db).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ge(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Db).getRegex()},hN={...Yg,br:ge(W_).replace("{2,}","*").getRegex(),text:ge(Yg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Nh={normal:cv,gfm:U9,pedantic:F9},mc={normal:hv,gfm:Yg,breaks:hN,pedantic:uN},dN={"&":"&","<":"<",">":">",'"':""","'":"'"},Lb=n=>dN[n];function sr(n,t){if(t){if(xt.escapeTest.test(n))return n.replace(xt.escapeReplace,Lb)}else if(xt.escapeTestNoEncode.test(n))return n.replace(xt.escapeReplaceNoEncode,Lb);return n}function Ob(n){try{n=encodeURI(n).replace(xt.percentDecode,"%")}catch{return null}return n}function Mb(n,t){var o;let e=n.replace(xt.findPipe,(a,l,c)=>{let u=!1,p=l;for(;--p>=0&&c[p]==="\\";)u=!u;return u?"|":" |"}),r=e.split(xt.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(xt.slashPipe,"|");return r}function gc(n,t,e){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===t;)i++;return n.slice(0,r-i)}function pN(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===t[0])e++;else if(n[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function fN(n,t=0){let e=t,r="";for(let i of n)if(i===" "){let o=4-e%4;r+=" ".repeat(o),e+=o}else r+=i,e++;return r}function Nb(n,t,e,r,i){let o=t.href,a=t.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:o,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function mN(n,t,e){let r=n.match(e.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
394
|
-
`).map(o=>{let a=o.match(e.other.beginningSpace);if(a===null)return o;let[l]=a;return l.length>=i.length?o.slice(i.length):o}).join(`
|
|
395
|
-
`)}var Od=class{constructor(n){I(this,"options");I(this,"rules");I(this,"lexer");this.options=n||ia}space(n){let t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){let t=this.rules.block.code.exec(n);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:gc(e,`
|
|
396
|
-
`)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],r=mN(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=gc(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:gc(t[0],`
|
|
397
|
-
`)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=gc(t[0],`
|
|
398
|
-
`).split(`
|
|
399
|
-
`),r="",i="",o=[];for(;e.length>0;){let a=!1,l=[],c;for(c=0;c<e.length;c++)if(this.rules.other.blockquoteStart.test(e[c]))l.push(e[c]),a=!0;else if(!a)l.push(e[c]);else break;e=e.slice(c);let u=l.join(`
|
|
400
|
-
`),p=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
401
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
402
|
-
${u}`:u,i=i?`${i}
|
|
403
|
-
${p}`:p;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=f,e.length===0)break;let y=o.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let v=y,S=v.raw+`
|
|
404
|
-
`+e.join(`
|
|
405
|
-
`),_=this.blockquote(S);o[o.length-1]=_,r=r.substring(0,r.length-v.raw.length)+_.raw,i=i.substring(0,i.length-v.text.length)+_.text;break}else if((y==null?void 0:y.type)==="list"){let v=y,S=v.raw+`
|
|
406
|
-
`+e.join(`
|
|
407
|
-
`),_=this.list(S);o[o.length-1]=_,r=r.substring(0,r.length-y.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,e=S.substring(o.at(-1).raw.length).split(`
|
|
408
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(n){var e,r;let t=this.rules.block.list.exec(n);if(t){let i=t[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let p=!1,f="",y="";if(!(t=l.exec(n))||this.rules.block.hr.test(n))break;f=t[0],n=n.substring(f.length);let v=fN(t[2].split(`
|
|
409
|
-
`,1)[0],t[1].length),S=n.split(`
|
|
410
|
-
`,1)[0],_=!v.trim(),x=0;if(this.options.pedantic?(x=2,y=v.trimStart()):_?x=t[1].length+1:(x=v.search(this.rules.other.nonSpaceChar),x=x>4?1:x,y=v.slice(x),x+=t[1].length),_&&this.rules.other.blankLine.test(S)&&(f+=S+`
|
|
411
|
-
`,n=n.substring(S.length+1),p=!0),!p){let Z=this.rules.other.nextBulletRegex(x),L=this.rules.other.hrRegex(x),z=this.rules.other.fencesBeginRegex(x),P=this.rules.other.headingBeginRegex(x),B=this.rules.other.htmlBeginRegex(x),F=this.rules.other.blockquoteBeginRegex(x);for(;n;){let q=n.split(`
|
|
412
|
-
`,1)[0],Q;if(S=q,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),Q=S):Q=S.replace(this.rules.other.tabCharGlobal," "),z.test(S)||P.test(S)||B.test(S)||F.test(S)||Z.test(S)||L.test(S))break;if(Q.search(this.rules.other.nonSpaceChar)>=x||!S.trim())y+=`
|
|
413
|
-
`+Q.slice(x);else{if(_||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(v)||P.test(v)||L.test(v))break;y+=`
|
|
414
|
-
`+S}_=!S.trim(),f+=q+`
|
|
415
|
-
`,n=n.substring(q.length+1),v=Q.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),a.raw+=f}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p of a.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((e=p.tokens[0])==null?void 0:e.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let f=this.rules.other.listTaskCheckbox.exec(p.raw);if(f){let y={type:"checkbox",raw:f[0]+" ",checked:f[0]!=="[ ]"};p.checked=y.checked,a.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=y.raw+p.tokens[0].raw,p.tokens[0].text=y.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(y)):p.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):p.tokens.unshift(y)}}if(!a.loose){let f=p.tokens.filter(v=>v.type==="space"),y=f.length>0&&f.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=y}}if(a.loose)for(let p of a.items){p.loose=!0;for(let f of p.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:i}}}table(n){var a;let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=Mb(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
416
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<e.length;l++)o.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(Mb(l,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
417
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let o=gc(e.slice(0,-1),"\\");if((e.length-o.length)%2===0)return}else{let o=pN(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),Nb(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let o=e[0].charAt(0);return{type:"text",raw:o,text:o}}return Nb(e,i,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,o,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+i);(r=u.exec(t))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let p=[...r[0]][0].length,f=n.slice(0,i+r.index+p+a);if(Math.min(i,a)%2){let v=f.slice(1,-1);return{type:"em",raw:f,text:v,tokens:this.lexer.inlineTokens(v)}}let y=f.slice(2,-2);return{type:"strong",raw:f,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n,t,e=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,o,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*n.length+i);(r=c.exec(t))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(a=[...o].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let u=[...r[0]][0].length,p=n.slice(0,i+r.index+u+a),f=p.slice(i,-i);return{type:"del",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(n){var e;let t;if(t=this.rules.inline.url.exec(n)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Bn=class Kg{constructor(t){I(this,"tokens");I(this,"options");I(this,"state");I(this,"inlineQueue");I(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ia,this.options.tokenizer=this.options.tokenizer||new Od,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:xt,block:Nh.normal,inline:mc.normal};this.options.pedantic?(e.block=Nh.pedantic,e.inline=mc.pedantic):this.options.gfm&&(e.block=Nh.gfm,this.options.breaks?e.inline=mc.breaks:e.inline=mc.gfm),this.tokenizer.rules=e}static get rules(){return{block:Nh,inline:mc}}static lex(t,e){return new Kg(e).lex(t)}static lexInline(t,e){return new Kg(e).inlineTokens(t)}lex(t){t=t.replace(xt.carriageReturn,`
|
|
418
|
-
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let r=this.inlineQueue[e];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){var i,o,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(xt.tabCharGlobal," ").replace(xt.spaceLine,""));t;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(u=>(l=u.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let u=e.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
419
|
-
`:e.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
420
|
-
`)?"":`
|
|
421
|
-
`)+l.raw,u.text+=`
|
|
422
|
-
`+l.text,this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
423
|
-
`)?"":`
|
|
424
|
-
`)+l.raw,u.text+=`
|
|
425
|
-
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},e.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0,p=t.slice(1),f;this.options.extensions.startBlock.forEach(y=>{f=y.call({lexer:this},p),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let u=e.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
426
|
-
`)?"":`
|
|
427
|
-
`)+l.raw,u.text+=`
|
|
428
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
429
|
-
`)?"":`
|
|
430
|
-
`)+l.raw,u.text+=`
|
|
431
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){var c,u,p,f,y;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let v=Object.keys(this.tokens.links);if(v.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)v.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let a=!1,l="";for(;t;){a||(l=""),a=!1;let v;if((f=(p=this.options.extensions)==null?void 0:p.inline)!=null&&f.some(_=>(v=_.call({lexer:this},t,e))?(t=t.substring(v.raw.length),e.push(v),!0):!1))continue;if(v=this.tokenizer.escape(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.tag(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.link(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(v.raw.length);let _=e.at(-1);v.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=v.raw,_.text+=v.text):e.push(v);continue}if(v=this.tokenizer.emStrong(t,r,l)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.codespan(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.br(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.del(t,r,l)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.autolink(t)){t=t.substring(v.raw.length),e.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(t))){t=t.substring(v.raw.length),e.push(v);continue}let S=t;if((y=this.options.extensions)!=null&&y.startInline){let _=1/0,x=t.slice(1),Z;this.options.extensions.startInline.forEach(L=>{Z=L.call({lexer:this},x),typeof Z=="number"&&Z>=0&&(_=Math.min(_,Z))}),_<1/0&&_>=0&&(S=t.substring(0,_+1))}if(v=this.tokenizer.inlineText(S)){t=t.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(l=v.raw.slice(-1)),a=!0;let _=e.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=v.raw,_.text+=v.text):e.push(v);continue}if(t){let _="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return e}},Md=class{constructor(n){I(this,"options");I(this,"parser");this.options=n||ia}space(n){return""}code({text:n,lang:t,escaped:e}){var o;let r=(o=(t||"").match(xt.notSpaceStart))==null?void 0:o[0],i=n.replace(xt.endingNewline,"")+`
|
|
432
|
-
`;return r?'<pre><code class="language-'+sr(r)+'">'+(e?i:sr(i,!0))+`</code></pre>
|
|
433
|
-
`:"<pre><code>"+(e?i:sr(i,!0))+`</code></pre>
|
|
434
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
435
|
-
${this.parser.parse(n)}</blockquote>
|
|
436
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:t}){return`<h${t}>${this.parser.parseInline(n)}</h${t}>
|
|
437
|
-
`}hr(n){return`<hr>
|
|
438
|
-
`}list(n){let t=n.ordered,e=n.start,r="";for(let a=0;a<n.items.length;a++){let l=n.items[a];r+=this.listitem(l)}let i=t?"ol":"ul",o=t&&e!==1?' start="'+e+'"':"";return"<"+i+o+`>
|
|
439
|
-
`+r+"</"+i+`>
|
|
440
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
441
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
442
|
-
`}table(n){let t="",e="";for(let i=0;i<n.header.length;i++)e+=this.tablecell(n.header[i]);t+=this.tablerow({text:e});let r="";for(let i=0;i<n.rows.length;i++){let o=n.rows[i];e="";for(let a=0;a<o.length;a++)e+=this.tablecell(o[a]);r+=this.tablerow({text:e})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
443
|
-
<thead>
|
|
444
|
-
`+t+`</thead>
|
|
445
|
-
`+r+`</table>
|
|
446
|
-
`}tablerow({text:n}){return`<tr>
|
|
447
|
-
${n}</tr>
|
|
448
|
-
`}tablecell(n){let t=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
|
|
449
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${sr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let r=this.parser.parseInline(e),i=Ob(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return t&&(o+=' title="'+sr(t)+'"'),o+=">"+r+"</a>",o}image({href:n,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let i=Ob(n);if(i===null)return sr(e);n=i;let o=`<img src="${n}" alt="${sr(e)}"`;return t&&(o+=` title="${sr(t)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:sr(n.text)}},dv=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Wn=class Jg{constructor(t){I(this,"options");I(this,"renderer");I(this,"textRenderer");this.options=t||ia,this.options.renderer=this.options.renderer||new Md,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dv}static parse(t,e){return new Jg(e).parse(t)}static parseInline(t,e){return new Jg(e).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let e="";for(let o=0;o<t.length;o++){let a=t[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){e+=u||"";continue}}let l=a;switch(l.type){case"space":{e+=this.renderer.space(l);break}case"hr":{e+=this.renderer.hr(l);break}case"heading":{e+=this.renderer.heading(l);break}case"code":{e+=this.renderer.code(l);break}case"table":{e+=this.renderer.table(l);break}case"blockquote":{e+=this.renderer.blockquote(l);break}case"list":{e+=this.renderer.list(l);break}case"checkbox":{e+=this.renderer.checkbox(l);break}case"html":{e+=this.renderer.html(l);break}case"def":{e+=this.renderer.def(l);break}case"paragraph":{e+=this.renderer.paragraph(l);break}case"text":{e+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return e}parseInline(t,e=this.renderer){var i,o;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let l=t[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=e.text(c);break}case"html":{r+=e.html(c);break}case"link":{r+=e.link(c);break}case"image":{r+=e.image(c);break}case"checkbox":{r+=e.checkbox(c);break}case"strong":{r+=e.strong(c);break}case"em":{r+=e.em(c);break}case"codespan":{r+=e.codespan(c);break}case"br":{r+=e.br(c);break}case"del":{r+=e.del(c);break}case"text":{r+=e.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Uh,Oc=(Uh=class{constructor(n){I(this,"options");I(this,"block");this.options=n||ia}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Bn.lex:Bn.lexInline}provideParser(){return this.block?Wn.parse:Wn.parseInline}},I(Uh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),I(Uh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Uh),gN=class{constructor(...n){I(this,"defaults",iv());I(this,"options",this.setOptions);I(this,"parse",this.parseMarkdown(!0));I(this,"parseInline",this.parseMarkdown(!1));I(this,"Parser",Wn);I(this,"Renderer",Md);I(this,"TextRenderer",dv);I(this,"Lexer",Bn);I(this,"Tokenizer",Od);I(this,"Hooks",Oc);this.use(...n)}walkTokens(n,t){var r,i;let e=[];for(let o of n)switch(e=e.concat(t.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)e=e.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)e=e.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=o;e=e.concat(this.walkTokens(a.items,t));break}default:{let a=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);e=e.concat(this.walkTokens(c,t))}):a.tokens&&(e=e.concat(this.walkTokens(a.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),e.renderer){let i=this.defaults.renderer||new Md(this.defaults);for(let o in e.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=e.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}r.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new Od(this.defaults);for(let o in e.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=e.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new Oc;for(let o in e.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=e.hooks[a],c=i[a];Oc.passThroughHooks.has(o)?i[a]=u=>{if(this.defaults.async&&Oc.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await l.call(i,u);return c.call(i,f)})();let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(i,u);return f===!1&&(f=await c.apply(i,u)),f})();let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,o=e.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,t){return Bn.lex(n,t??this.defaults)}parser(n,t){return Wn.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let r={...e},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer():n?Bn.lex:Bn.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?Wn.parse:Wn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():n?Bn.lex:Bn.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?Wn.parse:Wn.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(n,t){return e=>{if(e.message+=`
|
|
450
|
-
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+sr(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},ta=new gN;function Te(n,t){return ta.parse(n,t)}Te.options=Te.setOptions=function(n){return ta.setOptions(n),Te.defaults=ta.defaults,F_(Te.defaults),Te};Te.getDefaults=iv;Te.defaults=ia;Te.use=function(...n){return ta.use(...n),Te.defaults=ta.defaults,F_(Te.defaults),Te};Te.walkTokens=function(n,t){return ta.walkTokens(n,t)};Te.parseInline=ta.parseInline;Te.Parser=Wn;Te.parser=Wn.parse;Te.Renderer=Md;Te.TextRenderer=dv;Te.Lexer=Bn;Te.lexer=Bn.lex;Te.Tokenizer=Od;Te.Hooks=Oc;Te.parse=Te;Te.options;Te.setOptions;Te.use;Te.walkTokens;Te.parseInline;Wn.parse;Bn.lex;U_.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function X_(n){const t=Te.parse(n,{async:!1});return U_.sanitize(t,{USE_PROFILES:{html:!0}})}const zb={restart_to_update:"Restart to update",restarting:"Restarting…"};var Lo,qu,Fn,Qd,Q_,vl,ep;class vN extends an{constructor(){super(...arguments);m(this,Qd);m(this,Lo,null);m(this,qu,jn());m(this,Fn,null);m(this,vl,()=>{this.render()});m(this,ep,()=>{var e;(e=s(this,Fn))==null||e.restart()})}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||s(this,Lo)!==null)return;const e=((r=s(this,qu).value)==null?void 0:r.querySelector("dialog"))??null;if(e===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,Lo,Gp(e,()=>{}))})}disconnected(){var e,r;(e=s(this,Lo))==null||e.withdraw(),d(this,Lo,null),(r=s(this,Fn))==null||r.removeEventListener("change",s(this,vl)),d(this,Fn,null)}template(e,r){var a,l;h(this,Qd,Q_).call(this,r??null);const i=((a=s(this,Fn))==null?void 0:a.version)??null,o=((l=s(this,Fn))==null?void 0:l.restarting)??!1;return j`
|
|
451
|
-
<div class="desktop-upgrade-gate" ${vt(s(this,qu))}>
|
|
452
|
-
${jp(j`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${M_(X_(wS(e,i!==null)))}</div>${i===null?he:j`<div class="upgrade-gate-actions"><button
|
|
453
|
-
intent="primary"
|
|
454
|
-
class="upgrade-gate-restart"
|
|
455
|
-
?disabled=${o}
|
|
456
|
-
@click=${s(this,ep)}
|
|
457
|
-
>${o?zb.restarting:zb.restart_to_update}</button></div>`}`)}
|
|
458
|
-
</div>
|
|
459
|
-
`}}Lo=new WeakMap,qu=new WeakMap,Fn=new WeakMap,Qd=new WeakSet,Q_=function(e){var r;e!==s(this,Fn)&&((r=s(this,Fn))==null||r.removeEventListener("change",s(this,vl)),d(this,Fn,e),e==null||e.addEventListener("change",s(this,vl)),e==null||e.subscribe())},vl=new WeakMap,ep=new WeakMap;const yN=ln(vN),wN=250,bN=1e3;var _r,Ar,Oo,hs,Mo,yl,Jn,e4,tp,np,t4,Xg,n4;class SN extends an{constructor(){super(...arguments);m(this,Jn);m(this,_r,AN());m(this,Ar,null);m(this,Oo,!1);m(this,hs,null);m(this,Mo,"");m(this,yl,null);m(this,tp,e=>{d(this,Mo,e.currentTarget.value)});m(this,np,e=>{e.preventDefault();const r=s(this,Mo).trim();r.length===0||s(this,yl)===null||s(this,yl).authenticate(r)})}disconnected(){var e;h(this,Jn,Xg).call(this),(e=s(this,Ar))==null||e.withdraw(),d(this,Ar,null),d(this,Oo,!1),Qh(null,s(this,_r))}template(e,r,i){var o;return d(this,yl,r),h(this,Jn,t4).call(this,e),e.kind==="needs-upgrade"?((o=s(this,Ar))==null||o.withdraw(),d(this,Ar,null),Qh(yN(e.instructions,i),s(this,_r)),s(this,_r)):(Qh(jp(h(this,Jn,e4).call(this,e)),s(this,_r)),h(this,Jn,n4).call(this),s(this,_r))}}_r=new WeakMap,Ar=new WeakMap,Oo=new WeakMap,hs=new WeakMap,Mo=new WeakMap,yl=new WeakMap,Jn=new WeakSet,e4=function(e){switch(e.kind){case"connecting":return j`
|
|
460
|
-
<div class="system-modal" role="status" aria-live="polite">
|
|
461
|
-
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
462
|
-
<h2>Connecting</h2>
|
|
463
|
-
</div>
|
|
464
|
-
`;case"disconnected":return j`
|
|
465
|
-
<div class="system-modal" role="status" aria-live="polite">
|
|
466
|
-
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
467
|
-
<h2>Disconnected</h2>
|
|
468
|
-
<p>${EN(e.nextRetryAt)}</p>
|
|
469
|
-
</div>
|
|
470
|
-
`;case"unauthorized":{const r=!!e.invalid;return r&&d(this,Mo,""),j`
|
|
471
|
-
<form class="system-modal auth-form" @submit=${s(this,np)}>
|
|
472
|
-
<tv-icon name="locked" size="xl"></tv-icon>
|
|
473
|
-
<h2>Enter access token</h2>
|
|
474
|
-
<p>This server requires an access token to connect.</p>
|
|
475
|
-
<input
|
|
476
|
-
class="auth-token"
|
|
477
|
-
type="password"
|
|
478
|
-
name="token"
|
|
479
|
-
placeholder="paste token here"
|
|
480
|
-
aria-label="Access token"
|
|
481
|
-
aria-invalid=${r?"true":he}
|
|
482
|
-
aria-describedby=${r?"auth-token-error":he}
|
|
483
|
-
.value=${s(this,Mo)}
|
|
484
|
-
@input=${s(this,tp)}
|
|
485
|
-
autofocus
|
|
486
|
-
required
|
|
487
|
-
/>
|
|
488
|
-
${r?j`<p id="auth-token-error" class="tv-error" role="alert">
|
|
489
|
-
The previous token was rejected. Try again.
|
|
490
|
-
</p>`:null}
|
|
491
|
-
<button type="submit" intent="primary" class="auth-submit">
|
|
492
|
-
Connect
|
|
493
|
-
</button>
|
|
494
|
-
</form>
|
|
495
|
-
`}case"error":return j`
|
|
496
|
-
<div class="system-modal">
|
|
497
|
-
<h2>Can’t connect with server</h2>
|
|
498
|
-
<p class="server-url">${e.serverURL}</p>
|
|
499
|
-
<p>${e.message}</p>
|
|
500
|
-
</div>
|
|
501
|
-
`}},tp=new WeakMap,np=new WeakMap,t4=function(e){const r=e.kind==="disconnected"&&e.nextRetryAt!==null;r&&s(this,hs)===null?d(this,hs,setInterval(()=>this.render(),wN)):r||h(this,Jn,Xg).call(this)},Xg=function(){s(this,hs)!==null&&(clearInterval(s(this,hs)),d(this,hs,null))},n4=function(){s(this,Ar)!==null||s(this,Oo)||(d(this,Oo,!0),queueMicrotask(()=>{if(d(this,Oo,!1),!this.isConnected||!s(this,_r).isConnected||s(this,Ar)!==null)return;const e=s(this,_r).querySelector("dialog");e!==null&&d(this,Ar,Gp(e,()=>{}))}))};const _N=ln(SN);function AN(){const n=document.createElement("section");return n.className="system-modal-host",n}function EN(n){if(n===null)return"Reattempting now…";const t=n-Date.now();return t<=0?"Reattempting now…":`Reattempting in ${Math.ceil(t/bN)}s…`}const kN=1400,zh=new WeakMap;function TN(n,t){var o;const e=t.ownerDocument,r=(o=e.defaultView)==null?void 0:o.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=e.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",e.body.append(i),i.select();try{e.execCommand("copy")}catch{}i.remove()}const CN={writeClipboard:TN,scheduler:{setTimeout(n,t){return globalThis.setTimeout(n,t)},clearTimeout(n){globalThis.clearTimeout(n)}}};function RN(n,t,e){const r=n.currentTarget;if(!r)return;t.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,o=i!=null&&i.classList.contains("copy-button-status")?i:null;o&&(o.textContent="",o.textContent="Copied");const a=zh.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:t.scheduler};l.handle=t.scheduler.setTimeout(()=>{zh.get(r)===l&&(zh.delete(r),r.toggleAttribute("copied",!1),o&&(o.textContent=""))},kN),zh.set(r,l),e()}function r4({label:n,prompt:t="",intent:e,copied:r=!1,onActivate:i=()=>{}},o=CN){return j`
|
|
502
|
-
<button
|
|
503
|
-
class="copy-button"
|
|
504
|
-
size="sm"
|
|
505
|
-
aria-label=${n}
|
|
506
|
-
intent=${e??he}
|
|
507
|
-
?copied=${r}
|
|
508
|
-
prompt=${t}
|
|
509
|
-
@click=${a=>RN(a,o,i)}
|
|
510
|
-
>
|
|
511
|
-
<span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
|
|
512
|
-
<span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
|
|
513
|
-
</button>
|
|
514
|
-
<span
|
|
515
|
-
class="copy-button-status"
|
|
516
|
-
role="status"
|
|
517
|
-
aria-live="polite"
|
|
518
|
-
>${r?"Copied":he}</span
|
|
519
|
-
>
|
|
520
|
-
`}const i4="1.4.0",IN="tv-desktop-upgrade-recommendation-dismissed",$N=`### Recommended desktop upgrade available
|
|
521
|
-
|
|
522
|
-
The Television desktop app is now a downloaded Mac app that updates itself. This copy was installed with npm and receives no more updates.
|
|
523
|
-
|
|
524
|
-
To move to the downloaded app on an Apple Silicon Mac:
|
|
525
|
-
|
|
526
|
-
1. [Download Television for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64).
|
|
527
|
-
2. Open the downloaded disk image and drag Television to Applications.
|
|
528
|
-
3. Quit this app, then open Television from Applications. It keeps your saved server connection.
|
|
529
|
-
|
|
530
|
-
From then on, open Television from Applications, not with \`tv-desktop\`.`;function xN(n){var t;return!n.electron||n.noticesSuppressed||((t=n.updateState)==null?void 0:t.toast)!=null||n.shellVersion===null||!Op(n.shellVersion)||n.shellVersion===bd?!1:Z1(i4,n.shellVersion)}var wl;class s4 extends HTMLElement{constructor(){super(...arguments);m(this,wl,new ev(this))}connectedCallback(){s(this,wl).connect()}disconnectedCallback(){s(this,wl).disconnect()}attributeChangedCallback(){s(this,wl).refresh()}}wl=new WeakMap,I(s4,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",s4);const PN="tv-update-dismissed",fa={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},DN="update-popover";function LN(n,t){const e=n.target;if(!(e instanceof Element))return!1;const r=e.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&t.contains(r)}var bl,ai,Sl,Vu,Bu,rp;class ON extends an{constructor(){super(...arguments);m(this,bl);m(this,ai);m(this,Sl,!1);m(this,Vu,()=>{});m(this,Bu,()=>{});m(this,rp,e=>{var r;(r=s(this,ai))==null||r.disconnect(),d(this,ai,void 0),d(this,bl,e),d(this,Sl,(e==null?void 0:e.hasAttribute("open"))??!1),e&&(d(this,ai,new MutationObserver(()=>{const i=e.hasAttribute("open");i!==s(this,Sl)&&(d(this,Sl,i),i?s(this,Vu).call(this):s(this,Bu).call(this))})),s(this,ai).observe(e,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var e;(e=s(this,ai))==null||e.disconnect(),d(this,ai,void 0),d(this,bl,void 0)}template({body:e,prompt:r,copied:i=!1,restart:o,panelRef:a,bellRef:l,onPresent:c=()=>{},onDismiss:u=()=>{},onCopy:p=()=>{},onRestart:f=()=>{}}){d(this,Vu,c),d(this,Bu,u);const y=()=>{var S;(S=s(this,bl))==null||S.removeAttribute("open")},v=S=>{const _=S.currentTarget;S.key!=="Escape"||!LN(S,_)||(S.preventDefault(),S.stopPropagation(),_.removeAttribute("open"))};return j`
|
|
531
|
-
<button
|
|
532
|
-
class="update-bell"
|
|
533
|
-
id="update-bell"
|
|
534
|
-
icon
|
|
535
|
-
intent="alert"
|
|
536
|
-
aria-label=${fa.update_available}
|
|
537
|
-
title=${fa.update_available}
|
|
538
|
-
${l===void 0?he:vt(l)}
|
|
539
|
-
>
|
|
540
|
-
<tv-icon name="notification" size="sm"></tv-icon>
|
|
541
|
-
</button>
|
|
542
|
-
|
|
543
|
-
<tv-popover
|
|
544
|
-
id=${DN}
|
|
545
|
-
manual
|
|
546
|
-
trigger="update-bell"
|
|
547
|
-
role="status"
|
|
548
|
-
class="update-popover"
|
|
549
|
-
${vt(s(this,rp))}
|
|
550
|
-
${a===void 0?he:vt(a)}
|
|
551
|
-
@keydown=${v}
|
|
552
|
-
>
|
|
553
|
-
${e}
|
|
554
|
-
<div class="update-actions">
|
|
555
|
-
<button size="sm" class="update-later" @click=${y}
|
|
556
|
-
>${fa.later}</button
|
|
557
|
-
>
|
|
558
|
-
${r===void 0?he:r4({label:fa.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:p})}
|
|
559
|
-
${o===void 0?he:j`<button
|
|
560
|
-
size="sm"
|
|
561
|
-
intent="primary"
|
|
562
|
-
class="update-restart"
|
|
563
|
-
?disabled=${o==="restarting"}
|
|
564
|
-
@click=${f}
|
|
565
|
-
>${o==="restarting"?fa.restarting:fa.restart_to_update}</button>`}
|
|
566
|
-
</div>
|
|
567
|
-
</tv-popover>
|
|
568
|
-
`}}bl=new WeakMap,ai=new WeakMap,Sl=new WeakMap,Vu=new WeakMap,Bu=new WeakMap,rp=new WeakMap;const MN=ln(ON);function NN(n,t){return t===null?!0:Z1(n,t)}const Hb=new Set;var Sn,tn,Wu,nn,ju,_l,Er,No,zo,Ho,Al,gt,li,Zo,El,kl,Uo,ds,ee,Qg,e1,t1,n1,r1,i1,s1,Fo,qo,hd,Mc,o1,o4,a1,l1,c1,ip,sp,op,ap,lp,cp,Nc,a4;class zN{constructor(t=()=>{}){m(this,ee);m(this,Sn,null);m(this,tn,null);m(this,Wu,null);m(this,nn,null);m(this,ju,"");m(this,_l);m(this,Er,!1);m(this,No,!1);m(this,zo,!1);m(this,Ho,!1);m(this,Al,null);m(this,gt,!1);m(this,li,!1);m(this,Zo,null);m(this,El,null);m(this,kl,!1);m(this,Uo,[]);m(this,ds);m(this,Fo,()=>{s(this,ds).call(this)});m(this,qo,()=>{h(this,ee,c1).call(this),s(this,ds).call(this)});m(this,ip,()=>{var e;const t=h(this,ee,Mc).call(this,((e=s(this,tn))==null?void 0:e.toastsSuppressed)??!1);t===null||s(this,gt)||(d(this,gt,!0),t.kind==="server"&&h(this,ee,a1).call(this,t.toast),s(this,ds).call(this))});m(this,sp,()=>{var e,r;if(!s(this,gt))return;const t=h(this,ee,Mc).call(this,((e=s(this,tn))==null?void 0:e.toastsSuppressed)??!1);t!==null&&((r=h(this,ee,Qg).call(this))==null||r.setItem(h(this,ee,o1).call(this,t),t.version)),d(this,gt,!1),d(this,li,!0),s(this,ds).call(this)});m(this,op,()=>{var t;(t=s(this,nn))==null||t.restart()});m(this,ap,()=>{var e;const t=h(this,ee,Mc).call(this,((e=s(this,tn))==null?void 0:e.toastsSuppressed)??!1);(t==null?void 0:t.kind)!=="server"||t.prompt===void 0||h(this,ee,l1).call(this,"update_prompt_copy_clicked",t.toast)});m(this,lp,t=>{d(this,Zo,t instanceof HTMLElement?t:null),h(this,ee,Nc).call(this)});m(this,cp,t=>{d(this,El,t instanceof HTMLElement?t:null),h(this,ee,Nc).call(this)});d(this,ds,t)}get presented(){return s(this,gt)}configure({connectionOwner:t=null,primaryServerURL:e="",presentation:r=null,dismissalStorage:i,desktopRecommendation:o=null,desktopUpdate:a=null}){t!==s(this,Sn)&&(h(this,ee,t1).call(this),d(this,Sn,t),h(this,ee,e1).call(this)),r!==s(this,tn)&&(h(this,ee,r1).call(this),d(this,tn,r),h(this,ee,n1).call(this)),a!==s(this,nn)&&(h(this,ee,s1).call(this),d(this,nn,a),h(this,ee,i1).call(this)),d(this,ju,e),d(this,_l,i),d(this,Wu,o)}connect(){s(this,Er)||(d(this,Er,!0),h(this,ee,e1).call(this),h(this,ee,n1).call(this),h(this,ee,i1).call(this))}disconnect(){s(this,Er)&&(h(this,ee,t1).call(this),h(this,ee,r1).call(this),h(this,ee,s1).call(this),d(this,Er,!1),d(this,Zo,null),d(this,El,null))}template(){var l,c,u;const t=((l=s(this,tn))==null?void 0:l.toastsSuppressed)??!1,e=h(this,ee,Mc).call(this,t),r=e===null?null:`${e.kind}:${e.version}`;if(e===null?(d(this,Al,null),d(this,gt,!1),d(this,li,!0)):r!==s(this,Al)&&(d(this,Al,r),d(this,gt,h(this,ee,o4).call(this,e)),d(this,li,!0),s(this,gt)&&e.kind==="server"&&!t&&h(this,ee,a1).call(this,e.toast)),e===null||t)return d(this,gt,!1),d(this,li,!0),h(this,ee,Nc).call(this),he;const i=(c=s(this,Zo))==null?void 0:c.querySelector(".copy-button"),o=s(this,gt)&&!s(this,li)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=MN({body:M_(X_(e.markdown)),prompt:e.kind==="server"?e.prompt:void 0,copied:o,restart:e.kind!=="desktop-self-update"?void 0:(u=s(this,nn))!=null&&u.restarting?"restarting":"ready",presented:s(this,gt),panelRef:s(this,lp),bellRef:s(this,cp),onPresent:s(this,ip),onDismiss:s(this,sp),onCopy:s(this,ap),onRestart:s(this,op)});return d(this,li,!1),h(this,ee,Nc).call(this),a}}Sn=new WeakMap,tn=new WeakMap,Wu=new WeakMap,nn=new WeakMap,ju=new WeakMap,_l=new WeakMap,Er=new WeakMap,No=new WeakMap,zo=new WeakMap,Ho=new WeakMap,Al=new WeakMap,gt=new WeakMap,li=new WeakMap,Zo=new WeakMap,El=new WeakMap,kl=new WeakMap,Uo=new WeakMap,ds=new WeakMap,ee=new WeakSet,Qg=function(){return s(this,_l)!==void 0?s(this,_l):typeof localStorage>"u"?null:localStorage},e1=function(){!s(this,Er)||s(this,No)||s(this,Sn)===null||(s(this,Sn).addEventListener("server-status",s(this,qo)),s(this,Sn).addEventListener("change",s(this,qo)),d(this,No,!0))},t1=function(){!s(this,No)||s(this,Sn)===null||(s(this,Sn).removeEventListener("server-status",s(this,qo)),s(this,Sn).removeEventListener("change",s(this,qo)),d(this,No,!1))},n1=function(){!s(this,Er)||s(this,zo)||s(this,tn)===null||(s(this,tn).addEventListener("change",s(this,Fo)),d(this,zo,!0))},r1=function(){!s(this,zo)||s(this,tn)===null||(s(this,tn).removeEventListener("change",s(this,Fo)),d(this,zo,!1))},i1=function(){!s(this,Er)||s(this,Ho)||s(this,nn)===null||(s(this,nn).addEventListener("change",s(this,Fo)),s(this,nn).subscribe(),d(this,Ho,!0))},s1=function(){!s(this,Ho)||s(this,nn)===null||(s(this,nn).removeEventListener("change",s(this,Fo)),d(this,Ho,!1))},Fo=new WeakMap,qo=new WeakMap,hd=function(){var e;const t=((e=s(this,Sn))==null?void 0:e.connection)??null;return(t==null?void 0:t.url)===s(this,ju)?t:null},Mc=function(t){var a,l;const e=((a=h(this,ee,hd).call(this))==null?void 0:a.updateState)??null,r=(e==null?void 0:e.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=t?null:((l=s(this,nn))==null?void 0:l.version)??null;if(i!==null)return{kind:"desktop-self-update",version:i,markdown:AD(i)};const o=s(this,Wu);return o!==null&&xN({...o,noticesSuppressed:t,updateState:e})?{kind:"recommendation",version:i4,markdown:$N}:null},o1=function(t){switch(t.kind){case"server":return PN;case"desktop-self-update":return _D;case"recommendation":return IN}},o4=function(t){var r;const e=((r=h(this,ee,Qg).call(this))==null?void 0:r.getItem(h(this,ee,o1).call(this,t)))??null;return t.kind==="desktop-self-update"?e!==t.version:NN(t.version,e!==null&&Op(e)?e:null)},a1=function(t){Hb.has(t.version)||(Hb.add(t.version),h(this,ee,l1).call(this,"update_toast_shown",t))},l1=function(t,e){var r;s(this,Uo).push({event:t,properties:{server_version:((r=h(this,ee,hd).call(this))==null?void 0:r.serverVersion)??"",channel_version:e.version}}),h(this,ee,c1).call(this)},c1=function(){if(s(this,Uo).length===0)return;const t=h(this,ee,hd).call(this);if(!t||t.status!=="connected")return;const e=s(this,Uo);d(this,Uo,[]);for(const r of e)t.sendTelemetrySignal(r.event,r.properties)},ip=new WeakMap,sp=new WeakMap,op=new WeakMap,ap=new WeakMap,lp=new WeakMap,cp=new WeakMap,Nc=function(){s(this,kl)||(d(this,kl,!0),queueMicrotask(()=>{d(this,kl,!1),h(this,ee,a4).call(this)}))},a4=function(){const t=s(this,Zo);t!==null&&(s(this,gt)&&s(this,El)===null||t.toggleAttribute("open",s(this,gt)))};const HN=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,ZN=""+new URL("table-oeG9uAN1.png",import.meta.url).href,UN=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,FN=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,Zb="Artifact skills",qN="Artifact skills",VN="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",BN="Copy prompt";function Hh({artifactSkill:n,name:t,description:e,prompt:r,thumbnail:i},o){return j`
|
|
569
|
-
<article class="skill-card">
|
|
570
|
-
<div class="skill-thumb"><img src=${i} alt="" /></div>
|
|
571
|
-
<div class="skill-name">${t}</div>
|
|
572
|
-
<p class="skill-desc">${e}</p>
|
|
573
|
-
${r4({label:BN,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
|
|
574
|
-
</article>
|
|
575
|
-
`}class WN extends an{template(t=null){return j`
|
|
576
|
-
<button
|
|
577
|
-
class="skill-trigger"
|
|
578
|
-
variant="ghost"
|
|
579
|
-
icon
|
|
580
|
-
id="skills-trigger"
|
|
581
|
-
aria-label=${Zb}
|
|
582
|
-
title=${Zb}
|
|
583
|
-
>
|
|
584
|
-
<tv-icon name="skills" size="sm"></tv-icon>
|
|
585
|
-
</button>
|
|
586
|
-
|
|
587
|
-
<tv-popover
|
|
588
|
-
id="skills-popover"
|
|
589
|
-
trigger="skills-trigger"
|
|
590
|
-
class="skill-popover"
|
|
591
|
-
>
|
|
592
|
-
<div class="skill-heading">${qN}</div>
|
|
593
|
-
<p class="skill-intro">${VN}</p>
|
|
594
|
-
<div class="skill-grid">
|
|
595
|
-
${Hh({artifactSkill:"calendar",name:"Calendar",description:"Visualize your calendar events across day and week views.",prompt:"Use the tv-calendar skill to make a calendar artifact for the following request, and put it on TV: ",thumbnail:HN},t)}
|
|
596
|
-
${Hh({artifactSkill:"table",name:"Table",description:"Beautiful tables with headers, grouping, and chips for displaying data.",prompt:"Use the tv-table skill to make a table artifact for the following request, and put it on TV: ",thumbnail:ZN},t)}
|
|
597
|
-
${Hh({artifactSkill:"tasks",name:"Tasks",description:"Track tasks and plans in a checklist, with due dates, projects, and labels.",prompt:"Use the tv-tasks skill to make a task list artifact for the following request, and put it on TV: ",thumbnail:UN},t)}
|
|
598
|
-
${Hh({artifactSkill:"markdown",name:"Markdown",description:"An interactive markdown editor for Obsidian notes and other formatted docs.",prompt:"Make a markdown artifact for the following request, and put it on TV: ",thumbnail:FN},t)}
|
|
599
|
-
</div>
|
|
600
|
-
</tv-popover>
|
|
601
|
-
`}}const jN=ln(WN),GN=600;let YN=0;const Ub=new WeakMap,Nm=n=>{if(n.id)return n.id;let t=Ub.get(n);if(!t){do t=`tv-select-${++YN}`;while(n.ownerDocument.getElementById(t));Ub.set(n,t)}return n.id=t,t},Zh=n=>{var t;return((t=n.textContent)==null?void 0:t.trim())??""};var Gu;class l4 extends HTMLElement{constructor(){super();m(this,Gu,this.attachInternals());s(this,Gu).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){s(this,Gu).ariaSelected=String(this.hasAttribute("selected"))}}Gu=new WeakMap,I(l4,"observedAttributes",["selected"]);var Ct,ci,Tl,ps,fs,Yu,ne,zi,Ca,u1,dd,Hi,pd,h1,u4,fd,h4;class c4 extends HTMLElement{constructor(){super();m(this,ne);m(this,Ct,new ev(this,{select:!0,refresh:()=>h(this,ne,pd).call(this),opened:()=>{d(this,fs,""),h(this,ne,Hi).call(this,h(this,ne,Ca).call(this))},closed:()=>{h(this,ne,Hi).call(this,void 0),d(this,fs,"")},keydown:e=>h(this,ne,h4).call(this,e),pointermove:e=>{const r=h(this,ne,u1).call(this,e);r&&h(this,ne,Hi).call(this,r)},click:e=>{const r=h(this,ne,u1).call(this,e);r&&h(this,ne,fd).call(this,r)},selectedRow:()=>h(this,ne,Ca).call(this),unpair:e=>h(this,ne,u4).call(this,e)}));m(this,ci);m(this,Tl,"");m(this,ps);m(this,fs,"");m(this,Yu,0);this.attachInternals().role="listbox"}connectedCallback(){s(this,Ct).connect()}disconnectedCallback(){s(this,Ct).disconnect()}attributeChangedCallback(){s(this,Ct).refresh()}get value(){var e;return((e=h(this,ne,Ca).call(this))==null?void 0:e.getAttribute("value"))??""}set value(e){const r=h(this,ne,zi).call(this).find(i=>i.getAttribute("value")===e);r&&(h(this,ne,dd).call(this,r),h(this,ne,pd).call(this))}}Ct=new WeakMap,ci=new WeakMap,Tl=new WeakMap,ps=new WeakMap,fs=new WeakMap,Yu=new WeakMap,ne=new WeakSet,zi=function(){return[...this.querySelectorAll("tv-option")].filter(e=>e.closest("tv-select")===this)},Ca=function(){return h(this,ne,zi).call(this).find(e=>e.hasAttribute("selected"))},u1=function(e){const r=e.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},dd=function(e){for(const r of h(this,ne,zi).call(this))r.toggleAttribute("selected",r===e)},Hi=function(e){for(const r of h(this,ne,zi).call(this))r.toggleAttribute("highlighted",r===e);if(s(this,Ct).trigger&&Aa(s(this,Ct).trigger,"aria-activedescendant",e?Nm(e):null),e){const r=e.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},pd=function(){var l;const e=h(this,ne,zi).call(this),r=h(this,ne,Ca).call(this)??e[0];r&&h(this,ne,dd).call(this,r);const i=s(this,Ct).trigger;if(!i)return;Aa(i,"role","combobox"),Aa(i,"aria-haspopup","listbox"),Aa(i,"aria-controls",Nm(this));for(const c of e)Nm(c);const o=e.find(c=>c.hasAttribute("highlighted"));Aa(i,"aria-activedescendant",this.hasAttribute("open")&&o?o.id:null);const a=r?Zh(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}h(this,ne,h1).call(this,i,e)},h1=function(e,r){if(s(this,ps)||(d(this,ps,new ResizeObserver(()=>{const c=s(this,Ct).trigger;c&&h(this,ne,h1).call(this,c,h(this,ne,zi).call(this))})),s(this,ps).observe(e)),!e.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(e),o=JSON.stringify([e.id,r.map(Zh),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(o===s(this,Tl))return;d(this,Tl,o);const a=e.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,e.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${Zh(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),s(this,ci)??d(this,ci,this.ownerDocument.createElement("style")),s(this,ci).textContent=`:where(button[id="${CSS.escape(e.id)}"]) { width: ${l}px; }`,s(this,ci).isConnected||this.ownerDocument.head.append(s(this,ci))},u4=function(e){var r,i;for(const o of["role","aria-haspopup","aria-controls","aria-activedescendant"])e.removeAttribute(o);(r=s(this,ps))==null||r.disconnect(),d(this,ps,void 0),(i=s(this,ci))==null||i.remove(),d(this,ci,void 0),d(this,Tl,"")},fd=function(e){const r=h(this,ne,Ca).call(this)!==e;h(this,ne,dd).call(this,e),h(this,ne,pd).call(this),s(this,Ct).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},h4=function(e){if(!s(this,Ct).open)return this.ownerDocument.activeElement!==s(this,Ct).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)?!1:(e.preventDefault(),e.stopImmediatePropagation(),s(this,Ct).show(!0),!0);const r=h(this,ne,zi).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(e.key==="Tab")return e.stopImmediatePropagation(),this.ownerDocument.activeElement!==s(this,Ct).trigger?(e.preventDefault(),!0):(r[i]&&h(this,ne,fd).call(this,r[i]),!0);if(e.key==="Escape")return!1;const o=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(e.key)&&!o)return!1;if(e.preventDefault(),e.stopImmediatePropagation(),e.key==="Enter"||e.key===" ")r[i]&&h(this,ne,fd).call(this,r[i]);else if(e.key==="Home")h(this,ne,Hi).call(this,r[0]);else if(e.key==="End")h(this,ne,Hi).call(this,r.at(-1));else if(e.key==="ArrowDown"||e.key==="ArrowUp")h(this,ne,Hi).call(this,r[Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();d(this,fs,a-s(this,Yu)>GN?e.key.toLowerCase():s(this,fs)+e.key.toLowerCase()),d(this,Yu,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(u=>Zh(u).toLowerCase().startsWith(s(this,fs)));c&&h(this,ne,Hi).call(this,c)}return!0},I(c4,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",l4);customElements.get("tv-select")||customElements.define("tv-select",c4);/**
|
|
602
|
-
* @license
|
|
603
|
-
* Copyright 2020 Google LLC
|
|
604
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
605
|
-
*/const KN=Jl(class extends fh{constructor(n){if(super(n),n.type!==Ir.PROPERTY&&n.type!==Ir.ATTRIBUTE&&n.type!==Ir.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!NS(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[t]){if(t===$t||t===he)return t;const e=n.element,r=n.name;if(n.type===Ir.PROPERTY){if(t===e[r])return $t}else if(n.type===Ir.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(r))return $t}else if(n.type===Ir.ATTRIBUTE&&e.getAttribute(r)===t+"")return $t;return zS(n),t}}),Fb="Settings",qb="Refresh themes",JN="Themes directory",XN="None";function Vb(n){return n instanceof Error?n.message:String(n)}var Ut,Vo,ui,kr,Ku,hi,di,Bo,Cl,Rl,Gn,d4,up,hp,d1,dp,pp,fp,md;class QN extends an{constructor(){super(...arguments);m(this,Gn);m(this,Ut,null);m(this,Vo,null);m(this,ui,!1);m(this,kr,null);m(this,Ku,!1);m(this,hi,0);m(this,di,null);m(this,Bo,!1);m(this,Cl,jn());m(this,Rl,jn());m(this,up,e=>{var i;if((i=s(this,di))==null||i.disconnect(),d(this,di,null),d(this,Bo,!1),!e)return;const r=()=>{const o=e.hasAttribute("open");o!==s(this,Bo)&&(d(this,Bo,o),o&&h(this,Gn,d1).call(this,!1))};d(this,di,new MutationObserver(r)),s(this,di).observe(e,{attributes:!0,attributeFilter:["open"]}),r()});m(this,hp,()=>{h(this,Gn,d1).call(this,!0)});m(this,dp,e=>{var o;const r=e.currentTarget,i=r.value;r.value=((o=s(this,Ut))==null?void 0:o.snapshot.display.appearanceMode)??"system",this.render(),h(this,Gn,md).call(this,()=>{var a;return(a=s(this,Ut))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});m(this,pp,e=>{var o;const r=e.currentTarget,i=r.value||null;r.value=((o=s(this,Ut))==null?void 0:o.snapshot.display.activeThemeName)??"",this.render(),h(this,Gn,md).call(this,()=>{var a;return(a=s(this,Ut))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});m(this,fp,e=>{var a;const r=e.currentTarget,i=r.value,o=r.checked;r.checked=((a=s(this,Ut))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),h(this,Gn,md).call(this,()=>{var l;return(l=s(this,Ut))==null?void 0:l.setThemeJavaScriptConsent(i,o)},"Unable to change theme JavaScript consent")})}template(e){var f,y;d(this,Ut,e);const r=e.snapshot.connection.status==="connected";s(this,Ku)&&!r&&h(this,Gn,d4).call(this),d(this,Ku,r);const{activeThemeName:i,appearanceMode:o,themeJavaScriptConsentIds:a}=e.snapshot.display,l=((f=s(this,Vo))==null?void 0:f.themes)??[],c=((y=s(this,Vo))==null?void 0:y.errors)??[],u=i===null?void 0:l.find(v=>v.id===i&&v.enableMainJS===!0),p=i!==null&&a.includes(i);return queueMicrotask(()=>{var v,S;this.isConnected&&(s(this,Cl).value&&(s(this,Cl).value.value=((v=s(this,Ut))==null?void 0:v.snapshot.display.appearanceMode)??"system"),s(this,Rl).value&&(s(this,Rl).value.value=((S=s(this,Ut))==null?void 0:S.snapshot.display.activeThemeName)??""))}),j`
|
|
606
|
-
<button
|
|
607
|
-
class="settings-trigger"
|
|
608
|
-
variant="ghost"
|
|
609
|
-
icon
|
|
610
|
-
id="settings-trigger"
|
|
611
|
-
aria-label=${Fb}
|
|
612
|
-
title=${Fb}
|
|
613
|
-
>
|
|
614
|
-
<tv-icon name="settings" size="sm"></tv-icon>
|
|
615
|
-
</button>
|
|
616
|
-
|
|
617
|
-
<tv-popover
|
|
618
|
-
id="settings-popover"
|
|
619
|
-
trigger="settings-trigger"
|
|
620
|
-
class="settings-popover"
|
|
621
|
-
${vt(s(this,up))}
|
|
622
|
-
>
|
|
623
|
-
<div class="settings-heading">Settings</div>
|
|
624
|
-
|
|
625
|
-
<div class="settings-field">
|
|
626
|
-
<label id="settings-appearance-label">Light/dark mode</label>
|
|
627
|
-
<button id="settings-appearance" aria-labelledby="settings-appearance-label"></button>
|
|
628
|
-
<tv-select
|
|
629
|
-
trigger="settings-appearance"
|
|
630
|
-
name="appearance-mode"
|
|
631
|
-
${vt(s(this,Cl))}
|
|
632
|
-
@change=${s(this,dp)}
|
|
633
|
-
>
|
|
634
|
-
<tv-option value="system" ?selected=${o==="system"}>Adapt to system</tv-option>
|
|
635
|
-
<tv-option value="light" ?selected=${o==="light"}>Light</tv-option>
|
|
636
|
-
<tv-option value="dark" ?selected=${o==="dark"}>Dark</tv-option>
|
|
637
|
-
</tv-select>
|
|
638
|
-
</div>
|
|
639
|
-
|
|
640
|
-
<div class="settings-field">
|
|
641
|
-
<label id="settings-theme-label">Theme</label>
|
|
642
|
-
<div class="settings-theme-control">
|
|
643
|
-
<button id="settings-theme" aria-labelledby="settings-theme-label"></button>
|
|
644
|
-
<tv-select
|
|
645
|
-
trigger="settings-theme"
|
|
646
|
-
name="theme"
|
|
647
|
-
${vt(s(this,Rl))}
|
|
648
|
-
@change=${s(this,pp)}
|
|
649
|
-
>
|
|
650
|
-
<tv-option value="" ?selected=${i===null}>${XN}</tv-option>
|
|
651
|
-
${l.map(v=>j`
|
|
652
|
-
<tv-option
|
|
653
|
-
value=${v.id}
|
|
654
|
-
?selected=${v.id===i}
|
|
655
|
-
>${v.name}</tv-option>
|
|
656
|
-
`)}
|
|
657
|
-
</tv-select>
|
|
658
|
-
<button
|
|
659
|
-
type="button"
|
|
660
|
-
variant="ghost"
|
|
661
|
-
icon
|
|
662
|
-
aria-label=${qb}
|
|
663
|
-
title=${qb}
|
|
664
|
-
?disabled=${s(this,ui)||!r}
|
|
665
|
-
@click=${s(this,hp)}
|
|
666
|
-
>
|
|
667
|
-
<tv-icon name="reload" size="sm"></tv-icon>
|
|
668
|
-
</button>
|
|
669
|
-
</div>
|
|
670
|
-
</div>
|
|
671
|
-
|
|
672
|
-
${u?j`
|
|
673
|
-
<section
|
|
674
|
-
class="settings-javascript-consent"
|
|
675
|
-
aria-label="Experimental main-page JavaScript"
|
|
676
|
-
>
|
|
677
|
-
<p class="settings-javascript-disclosure">This theme uses experimental JavaScript. JavaScript can access your Television content, so only enable for themes you trust or have had your agent inspect.</p>
|
|
678
|
-
<label class="settings-javascript-toggle">
|
|
679
|
-
<input
|
|
680
|
-
type="checkbox"
|
|
681
|
-
role="switch"
|
|
682
|
-
name="theme-javascript-consent"
|
|
683
|
-
value=${u.id}
|
|
684
|
-
.checked=${KN(p)}
|
|
685
|
-
@change=${s(this,fp)}
|
|
686
|
-
>
|
|
687
|
-
<span>Enable experimental javascript for this theme</span>
|
|
688
|
-
</label>
|
|
689
|
-
</section>
|
|
690
|
-
`:null}
|
|
691
|
-
|
|
692
|
-
${s(this,ui)?j`<p class="settings-status" role="status">Loading themes…</p>`:null}
|
|
693
|
-
${s(this,kr)?j`<p class="settings-failure" role="alert">${s(this,kr)}</p>`:null}
|
|
694
|
-
${c.length>0?j`
|
|
695
|
-
<div class="settings-errors" aria-label="Theme validation errors">
|
|
696
|
-
${c.map(v=>j`
|
|
697
|
-
<p><strong>${v.folder??JN}</strong>: ${v.error}</p>
|
|
698
|
-
`)}
|
|
699
|
-
</div>
|
|
700
|
-
`:null}
|
|
701
|
-
</tv-popover>
|
|
702
|
-
`}disconnected(){var e;(e=s(this,di))==null||e.disconnect(),d(this,di,null),d(this,Bo,!1),d(this,Ut,null),d(this,hi,s(this,hi)+1)}}Ut=new WeakMap,Vo=new WeakMap,ui=new WeakMap,kr=new WeakMap,Ku=new WeakMap,hi=new WeakMap,di=new WeakMap,Bo=new WeakMap,Cl=new WeakMap,Rl=new WeakMap,Gn=new WeakSet,d4=function(){d(this,Vo,null),d(this,kr,null),d(this,ui,!1),d(this,hi,s(this,hi)+1)},up=new WeakMap,hp=new WeakMap,d1=async function(e){const r=s(this,Ut);if(r===null||r.snapshot.connection.status!=="connected"||s(this,ui))return;const i=++kh(this,hi)._;d(this,ui,!0),d(this,kr,null),this.render();try{const o=await(e?r.refreshThemes():r.listThemes());if(i!==s(this,hi))return;d(this,Vo,o)}catch(o){if(i!==s(this,hi))return;d(this,kr,`${e?"Unable to refresh themes":"Unable to load themes"}: ${Vb(o)}`)}finally{i===s(this,hi)&&(d(this,ui,!1),this.render())}},dp=new WeakMap,pp=new WeakMap,fp=new WeakMap,md=async function(e,r){d(this,kr,null),this.render();try{await e()}catch(i){d(this,kr,`${r}: ${Vb(i)}`),this.render()}};const ez=ln(QN),vc={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},tz=(n,{items:t,distance:e,edges:r})=>{const i=new Set;let o=0,a=!1;const l=v=>{v.removeAttribute("data-item-edge-fade");for(const S of Object.values(vc))v.style.removeProperty(S)},c=()=>{o=0;const v=new Set(n.querySelectorAll(t)),S=[];for(const F of i)v.has(F)||(p.unobserve(F),i.delete(F),S.push(F));for(const F of v)i.has(F)||(i.add(F),p.observe(F));const x=n.getBoundingClientRect().left+n.clientLeft,Z=x+n.clientWidth,L=Math.max(0,Math.min(e,n.clientWidth/2)),z=n.scrollLeft>1?L:0,P=n.scrollLeft<n.scrollWidth-n.clientWidth-1?L:0,B=[...v].map(F=>({item:F,bounds:F.getBoundingClientRect()}));for(const F of S)l(F);for(const{item:F,bounds:q}of B){const Q=z>0&&q.left<x+z&&q.right>x,V=P>0&&q.right>Z-P&&q.left<Z;if(!Q&&!V){l(F);continue}F.style.setProperty(vc.start,`${x-q.left}px`),F.style.setProperty(vc.end,`${Z-q.left}px`),F.style.setProperty(vc.left,`${z}px`),F.style.setProperty(vc.right,`${P}px`),F.setAttribute("data-item-edge-fade","")}},u=()=>{!a&&!o&&(o=requestAnimationFrame(c))},p=new ResizeObserver(u);p.observe(n);const f=new MutationObserver(u);return f.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",u,{passive:!0}),u(),{refresh:u,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(o),p.disconnect(),f.disconnect(),n.removeEventListener("scroll",u);for(const v of i)l(v);i.clear()}}}},yc=.5;var Ft,Il,$l,Wo,ms,Tr,pi,fi,gs,vs,qn,ys,xl,ws,jo,Ju,nt,mi,gi,_n,mp,W,p4,f4,Xu,Qu,eh,gp,th,Ra,p1,m4,gd,f1,m1,g1,g4,v4,Pl,nh,y4,js,vd,w4,b4,S4,_4,Ia,A4,zc;class nz extends an{constructor(){super(...arguments);m(this,W);m(this,Ft,jn());m(this,Il);m(this,$l);m(this,Wo,!1);m(this,ms,0);m(this,Tr,!1);m(this,pi,!1);m(this,fi,!1);m(this,gs,0);m(this,vs,null);m(this,qn,!1);m(this,ys,null);m(this,xl,null);m(this,ws,null);m(this,jo,null);m(this,Ju,!1);m(this,nt,null);m(this,mi,!1);m(this,gi,!1);m(this,_n,!1);m(this,mp,()=>{h(this,W,zc).call(this)});m(this,Xu,e=>{var o;const r=s(this,nt);if(r===null||r.pointerId!==e.pointerId||!r.dragging&&Math.hypot(e.clientX-r.originX,e.clientY-r.originY)<=JS)return;const i=s(this,Ft).value;if(i){if(r.currentX=e.clientX,r.currentY=e.clientY,r.dragging)this.render();else{h(this,W,Ia).call(this);const a=r.tab.getBoundingClientRect();d(this,mi,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(e.pointerId),this.render(),(o=r.onReorderChange)==null||o.call(r,h(this,W,g1).call(this,r))}h(this,W,m1).call(this,r),h(this,W,p1).call(this,r)}});m(this,Qu,e=>{const r=s(this,nt);r===null||r.pointerId!==e.pointerId||h(this,W,Ra).call(this,!0,!0)});m(this,eh,e=>{var r;((r=s(this,nt))==null?void 0:r.pointerId)===e.pointerId&&h(this,W,Ra).call(this,!1,!0)});m(this,gp,e=>{var r;((r=s(this,nt))==null?void 0:r.pointerId)===e.pointerId&&h(this,W,Ra).call(this,!1,!0)});m(this,th,e=>{var r;e.key!=="Escape"||!((r=s(this,nt))!=null&&r.dragging)||(e.preventDefault(),h(this,W,Ra).call(this,!1,!0))});m(this,Pl,()=>{d(this,qn,!0),h(this,W,js).call(this,!1)});m(this,nh,()=>{d(this,qn,!0),h(this,W,js).call(this,!0)})}connected(){var e;d(this,Il,void 0),d(this,$l,void 0),d(this,qn,!1),h(this,W,y4).call(this),typeof document<"u"&&((e=document.fonts)==null||e.addEventListener("loadingdone",s(this,nh))),document.addEventListener("television-theme-styles-changed",s(this,Pl)),d(this,jo,new MutationObserver(s(this,Pl))),s(this,jo).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",s(this,Xu)),window.addEventListener("pointerup",s(this,Qu)),window.addEventListener("pointercancel",s(this,eh)),window.addEventListener("keydown",s(this,th))}template(e,r,i=null,o,a=!1){var x,Z;h(this,W,A4).call(this,a);const l=(x=s(this,nt))!=null&&x.dragging?s(this,nt):null,c=(l==null?void 0:l.provisionalPages)??(r==null?void 0:r.pages),u=iz(r,c),p=(l==null?void 0:l.artifactId)??i,f=((Z=r==null?void 0:r.selectedPage)==null?void 0:Z.artifactIds[0])??null,y=`${(r==null?void 0:r.id)??""}:${u.map(({key:L,label:z})=>`${L}:${z}`).join("|")}`,v=f!==s(this,Il),S=y!==s(this,$l);v&&d(this,gi,!1);const _=v||l===null&&S;return S&&d(this,qn,!0),d(this,Il,f),d(this,$l,y),h(this,W,js).call(this,_,v,v&&!S),j`
|
|
703
|
-
<div
|
|
704
|
-
class="tab-strip"
|
|
705
|
-
role="tablist"
|
|
706
|
-
${vt(s(this,Ft))}
|
|
707
|
-
?tab-held=${l!==null}
|
|
708
|
-
@scroll=${s(this,mp)}
|
|
709
|
-
@lostpointercapture=${s(this,gp)}
|
|
710
|
-
>
|
|
711
|
-
${Id(u,({key:L})=>L,(L,z)=>{const P=L.artifactId!==null&&L.artifactId===f,B=L.artifactId!==null&&L.artifactId===p,F=B&&l!==null;return j`
|
|
712
|
-
${B?j`
|
|
713
|
-
<span
|
|
714
|
-
class="tab-placeholder"
|
|
715
|
-
aria-hidden="true"
|
|
716
|
-
style=${$d(F?{width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
|
|
717
|
-
></span>
|
|
718
|
-
`:null}
|
|
719
|
-
<div
|
|
720
|
-
class=${B?"tab dragged":"tab"}
|
|
721
|
-
?dragging=${F}
|
|
722
|
-
style=${$d(F?{left:`${l.tabLeft+l.currentX-l.originX}px`,top:`${l.tabTop+l.currentY-l.originY}px`,width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
|
|
723
|
-
@keydown=${q=>{q.key!=="Enter"&&q.key!==" "||(q.preventDefault(),q.currentTarget.click())}}
|
|
724
|
-
role="tab"
|
|
725
|
-
aria-selected=${P?"true":"false"}
|
|
726
|
-
tabindex=${P?"0":"-1"}
|
|
727
|
-
data-artifact-id=${L.artifactId??""}
|
|
728
|
-
@pointerdown=${p===null?q=>h(this,W,p4).call(this,q,e,r,L,o):null}
|
|
729
|
-
@click=${q=>h(this,W,f4).call(this,q,e,r,L)}
|
|
730
|
-
@dblclick=${P&&r!==null&&!F?()=>Fg(e,r,L.page,!L.page.geometry.full_screen):null}
|
|
731
|
-
>
|
|
732
|
-
<span class="tab-label">${L.label}</span>
|
|
733
|
-
</div>
|
|
734
|
-
`})}
|
|
735
|
-
</div>
|
|
736
|
-
`}disconnected(){var e,r,i,o;d(this,Wo,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,ms)),d(this,ms,0),d(this,Tr,!1),d(this,pi,!1),d(this,fi,!1),h(this,W,Ia).call(this),d(this,gi,!1),d(this,qn,!1),(e=s(this,ys))==null||e.disconnect(),d(this,ys,null),d(this,xl,null),(r=s(this,ws))==null||r.dispose(),d(this,ws,null),(i=s(this,jo))==null||i.disconnect(),d(this,jo,null),document.removeEventListener("television-theme-styles-changed",s(this,Pl)),typeof document<"u"&&((o=document.fonts)==null||o.removeEventListener("loadingdone",s(this,nh))),window.removeEventListener("pointermove",s(this,Xu)),window.removeEventListener("pointerup",s(this,Qu)),window.removeEventListener("pointercancel",s(this,eh)),window.removeEventListener("keydown",s(this,th)),h(this,W,Ra).call(this,!1,!1),d(this,mi,!1)}}Ft=new WeakMap,Il=new WeakMap,$l=new WeakMap,Wo=new WeakMap,ms=new WeakMap,Tr=new WeakMap,pi=new WeakMap,fi=new WeakMap,gs=new WeakMap,vs=new WeakMap,qn=new WeakMap,ys=new WeakMap,xl=new WeakMap,ws=new WeakMap,jo=new WeakMap,Ju=new WeakMap,nt=new WeakMap,mi=new WeakMap,gi=new WeakMap,_n=new WeakMap,mp=new WeakMap,W=new WeakSet,p4=function(e,r,i,o,a){s(this,_n)||s(this,nt)!==null||i===null||o.artifactId===null||e.button!==0||!e.isPrimary||(d(this,mi,!1),d(this,nt,{pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,tab:e.currentTarget,application:r,channelId:i.id,artifactId:o.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(o.page),currentX:e.clientX,currentY:e.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},f4=function(e,r,i,o){var a;if(e.detail!==0&&s(this,mi)){d(this,mi,!1);return}d(this,mi,!1),!((a=s(this,nt))!=null&&a.dragging||i===null||o.artifactId===null)&&r.selectPage(i.id,o.artifactId)},Xu=new WeakMap,Qu=new WeakMap,eh=new WeakMap,gp=new WeakMap,th=new WeakMap,Ra=function(e,r){var a;const i=s(this,nt);if(i===null)return;if(h(this,W,gd).call(this,i),i.edgeScrollMoved&&d(this,gi,!0),i.dragging&&(d(this,Tr,s(this,pi)),s(this,pi)||d(this,fi,!1)),i.dragging&&e&&!sz(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!e)for(const l of i.displacementAnimations)l.cancel();d(this,nt,null),(a=i.onReorderChange)==null||a.call(i,null);const o=s(this,Ft).value;i.dragging&&(o!=null&&o.hasPointerCapture(i.pointerId))&&o.releasePointerCapture(i.pointerId),r&&this.render()},p1=function(e){const r=s(this,Ft).value,i=r?h(this,W,f1).call(this,r,e.currentX):0,o=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=yc:((r==null?void 0:r.scrollLeft)??0)>=o-yc;if(s(this,_n)||!e.dragging||i===0||o===0||a||typeof requestAnimationFrame!="function"){h(this,W,gd).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,W,m4).call(this,e,l)}))},m4=function(e,r){if(e.edgeScrollFrame=0,s(this,_n)||s(this,nt)!==e||!e.dragging){e.edgeScrollTimestamp=null;return}const i=s(this,Ft).value;if(!i){e.edgeScrollTimestamp=null;return}const o=h(this,W,f1).call(this,i,e.currentX),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,o!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,p=o*l+e.edgeScrollRemainder,f=Math.max(0,Math.min(c,u+p));i.scrollLeft=f;const y=i.scrollLeft-u;y!==0&&(e.edgeScrollMoved=!0),e.edgeScrollRemainder=f===0||f===c?0:p-y,y!==0&&(h(this,W,zc).call(this,i),h(this,W,m1).call(this,e))}h(this,W,p1).call(this,e)},gd=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},f1=function(e,r){const i=e.getBoundingClientRect();return r>=i.left&&r<i.left+Tn?-xd*(i.left+Tn-r)/Tn:r>i.right-Tn&&r<=i.right?xd*(r-(i.right-Tn))/Tn:0},m1=function(e){var S;const r=s(this,Ft).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const o=i.nextElementSibling,a=e.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=e.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const _=u.getBoundingClientRect();if(l>=_.left+_.width/2)break;c-=1,u=u.previousElementSibling}let p=o==null?void 0:o.nextElementSibling;for(;p!=null&&p.classList.contains("tab");){const _=p.getBoundingClientRect();if(l<=_.left+_.width/2)break;c+=1,p=p.nextElementSibling}if(c===e.slot)return;const f=h(this,W,g4).call(this,r),y=[...e.provisionalPages],[v]=y.splice(e.slot,1);v&&(y.splice(c,0,v),e.provisionalPages=y,e.slot=c,this.render(),(S=e.onReorderChange)==null||S.call(e,h(this,W,g1).call(this,e)),queueMicrotask(()=>h(this,W,v4).call(this,e,f)))},g1=function(e){return{channelId:e.channelId,pages:e.provisionalPages,carriedArtifactId:e.artifactId}},g4=function(e){return new Map([...e.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},v4=function(e,r){if(s(this,_n))return;const i=s(this,Ft).value;if(i)for(const o of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(o.dataset.artifactId??"");if(a===void 0)continue;const l=a-o.getBoundingClientRect().left;if(Math.abs(l)<=yc)continue;const c=o.animate({translate:[`${l}px 0`,"0px 0"]},{duration:Pa,easing:"ease"});e.displacementAnimations.add(c),c.finished.finally(()=>{e.displacementAnimations.delete(c)}).catch(()=>{})}},Pl=new WeakMap,nh=new WeakMap,y4=function(){s(this,Ju)||typeof document>"u"||!document.fonts||(d(this,Ju,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,qn,!0),h(this,W,js).call(this,!0))}))},js=function(e,r=!1,i=!1){s(this,Tr)||d(this,Tr,e),e&&r&&(d(this,pi,!0),d(this,fi,i&&!s(this,_n))),!(s(this,Wo)||s(this,ms)!==0)&&(d(this,Wo,!0),queueMicrotask(()=>{if(d(this,Wo,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,W,vd).call(this);return}d(this,ms,requestAnimationFrame(()=>{d(this,ms,0),h(this,W,vd).call(this)}))}}))},vd=function(){var l,c;const e=s(this,Ft).value;if(!e)return;s(this,qn)&&(d(this,qn,!1),h(this,W,b4).call(this,e)),h(this,W,S4).call(this,e),h(this,W,w4).call(this,e);const r=((l=s(this,nt))==null?void 0:l.dragging)===!0,i=s(this,pi),o=i&&s(this,fi),a=!r&&(i||s(this,Tr)&&!s(this,gi));r?d(this,Tr,i):(d(this,Tr,!1),d(this,pi,!1),d(this,fi,!1),i&&d(this,gi,!1)),a&&h(this,W,_4).call(this,e,o),h(this,W,zc).call(this,e),(c=s(this,ws))==null||c.refresh()},w4=function(e){for(const r of e.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},b4=function(e){var r;for(const i of e.querySelectorAll(".tab")){const o=i.querySelector(".tab-label");if(!o)continue;const a=document.createRange();a.selectNodeContents(o);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=wc(c.paddingLeft)+wc(c.paddingRight)+wc(c.borderLeftWidth)+wc(c.borderRightWidth),f=Math.ceil(l.width)+u>pM+fM?"capped":"hugging";i.dataset.compression!==f&&(i.dataset.compression=f)}},S4=function(e){var r,i;typeof ResizeObserver>"u"||s(this,xl)===e||((r=s(this,ys))==null||r.disconnect(),s(this,ys)??d(this,ys,new ResizeObserver(()=>{s(this,_n)?(d(this,Tr,!0),h(this,W,vd).call(this)):h(this,W,js).call(this,!0)})),s(this,ys).observe(e),d(this,xl,e),(i=s(this,ws))==null||i.dispose(),d(this,ws,tz(e,{items:".tab:not(.dragged)",distance:mM,edges:"both"})))},_4=function(e,r){const i=e.querySelector('.tab[aria-selected="true"]');if(!i){h(this,W,Ia).call(this);return}const o=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=wc(getComputedStyle(i).translate),c=Math.max(0,Math.min(e.scrollLeft+a.left-l+a.width/2-(o.left+o.width/2),e.scrollWidth-e.clientWidth));if(h(this,W,Ia).call(this),s(this,_n)||!r||Math.abs(e.scrollLeft-c)<=yc||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,p=e.animate([{},{}],{duration:y_,easing:"ease"});d(this,vs,p);const f=()=>{var v;if(p!==s(this,vs))return;const y=p.playState==="finished"?1:((v=p.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*y,p.playState==="finished"?(e.scrollLeft=c,d(this,vs,null),d(this,gs,0),h(this,W,zc).call(this,e)):d(this,gs,requestAnimationFrame(f))};d(this,gs,requestAnimationFrame(f))},Ia=function(){var e;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,gs)),d(this,gs,0),(e=s(this,vs))==null||e.cancel(),d(this,vs,null)},A4=function(e){var i;if(s(this,_n)===e||(d(this,_n,e),!e))return;h(this,W,Ia).call(this),d(this,fi,!1),d(this,gi,!1);const r=s(this,nt);if(r!==null){h(this,W,gd).call(this,r);for(const o of r.displacementAnimations)o.cancel();r.displacementAnimations.clear(),d(this,nt,null),r.dragging&&((i=s(this,Ft).value)!=null&&i.hasPointerCapture(r.pointerId))&&s(this,Ft).value.releasePointerCapture(r.pointerId),queueMicrotask(()=>{var o;return(o=r.onReorderChange)==null?void 0:o.call(r,null)})}h(this,W,js).call(this,!0,!0,!1)},zc=function(e=s(this,Ft).value){if(!e)return;const r=Math.max(0,e.scrollWidth-e.clientWidth);e.toggleAttribute("data-overflow",r>yc)};const rz=ln(nz);function iz(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{var a;const o=r.artifactIds[0]??null;return{page:r,artifactId:o,label:o===null?"":((a=e.get(o))==null?void 0:a.title)??"",key:o??`empty-page-${i}`}})}function sz(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function wc(n){const t=Number.parseFloat(n);return Number.isFinite(t)?t:0}let oz=0;var Go,qt,rh,Rt,vi,Cr,Dl,yi,ih,An,vp,yp,sh,Zl,E4,wp,bp,k4,Sp,_p;class az extends an{constructor(){super(...arguments);m(this,Zl);m(this,Go,new zN(()=>this.render()));m(this,qt,new XS(()=>this.render()));m(this,rh,`channel-switcher-trigger-${++oz}`);m(this,Rt,null);m(this,vi,null);m(this,Cr,!1);m(this,Dl,null);m(this,yi,null);m(this,ih,jn());m(this,An,null);m(this,vp,e=>{var r,i,o;(r=s(this,Rt))==null||r.removeAttribute("open"),((i=s(this,yi))==null?void 0:i.display.focusedChannelId)!==e&&((o=s(this,Dl))==null||o.focusChannel(e).catch(()=>{}))});m(this,yp,e=>{s(this,Cr)||(d(this,Cr,!0),this.render(),e.detail===0&&requestAnimationFrame(()=>{var r;(r=s(this,Rt))!=null&&r.hasAttribute("open")&&h(this,Zl,E4).call(this,0)}))});m(this,sh,e=>{const r=s(this,Rt);r===null||!r.hasAttribute("open")||s(this,qt).dragging||r.querySelector("input, tv-menu[open]")||VS(e,[...r.querySelectorAll('.channel[role="option"]')])});m(this,wp,e=>{var r,i;d(this,An,{channelId:e,scrollTop:((i=(r=s(this,Rt))==null?void 0:r.querySelector(".channel-switcher-pop-body"))==null?void 0:i.scrollTop)??0,result:null})});m(this,bp,(e,r)=>{var i;((i=s(this,An))==null?void 0:i.channelId)===e&&(s(this,An).result=r?"deleted":"cancelled",this.render())});m(this,Sp,e=>{var r;(r=s(this,vi))==null||r.disconnect(),d(this,vi,null),s(this,Rt)!==null&&s(this,An)===null&&s(this,qt).disconnect(),d(this,Rt,e instanceof HTMLElement?e:null),s(this,Rt)!==null&&(s(this,qt).connect(),d(this,vi,new MutationObserver(s(this,_p))),s(this,vi).observe(s(this,Rt),{attributes:!0,attributeFilter:["open"]}))});m(this,_p,()=>{var e;(((e=s(this,Rt))==null?void 0:e.hasAttribute("open"))??!0)||s(this,An)===null&&(d(this,Cr,!1),this.render())})}connected(){s(this,Go).connect(),document.addEventListener("keydown",s(this,sh))}template(e,r,i={}){var l;d(this,Dl,e),d(this,yi,r);const o=i.collapsed||i.sidebarTransitioning;(i.sidebarTransitioning||!o||r.focusedChannel===null)&&d(this,Cr,!1),s(this,qt).update(e,r,{management:!0,dragging:!0,revealMovedRow:!0,onDeleteStart:s(this,wp),onDeleteEnd:s(this,bp),selectChannel:s(this,vp),highlightOnPointerMove:!0,motionSuppressed:i.sidebarTransitioning});const a=s(this,An);return a!=null&&a.result&&(r.channels.length===0||r.focusedChannel!==null)&&(a.result==="cancelled"||!r.channels.some(({id:c})=>c===a.channelId))&&queueMicrotask(()=>h(this,Zl,k4).call(this,a)),s(this,Go).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),j`
|
|
737
|
-
<header class="top-bar" ${vt(s(this,ih))}>
|
|
738
|
-
${o?j`
|
|
739
|
-
<div class="top-bar-lead">
|
|
740
|
-
${i.sidebarToggle===void 0?j`
|
|
741
|
-
<button
|
|
742
|
-
class="sidebar-expand"
|
|
743
|
-
variant="ghost"
|
|
744
|
-
icon
|
|
745
|
-
aria-label="Show sidebar"
|
|
746
|
-
title="Show sidebar"
|
|
747
|
-
type="button"
|
|
748
|
-
@click=${i.onExpandSidebar}
|
|
749
|
-
>
|
|
750
|
-
<tv-icon name="sidebar" size="sm"></tv-icon>
|
|
751
|
-
</button>
|
|
752
|
-
`:i.sidebarToggle??j`
|
|
753
|
-
<span class="sidebar-toggle-seat" aria-hidden="true"></span>
|
|
754
|
-
`}
|
|
755
|
-
${r.focusedChannel===null?null:j`
|
|
756
|
-
<button
|
|
757
|
-
class="channel-switcher"
|
|
758
|
-
variant="ghost"
|
|
759
|
-
target
|
|
760
|
-
aria-haspopup="listbox"
|
|
761
|
-
id=${s(this,rh)}
|
|
762
|
-
type="button"
|
|
763
|
-
@click=${s(this,yp)}
|
|
764
|
-
>
|
|
765
|
-
<span class="channel-switcher-name">
|
|
766
|
-
${r.focusedChannel.name}
|
|
767
|
-
</span>
|
|
768
|
-
<tv-icon name="select" size="sm"></tv-icon>
|
|
769
|
-
</button>
|
|
770
|
-
${s(this,Cr)?j`
|
|
771
|
-
<tv-popover
|
|
772
|
-
class="channel-switcher-pop"
|
|
773
|
-
?dragging=${s(this,qt).dragging}
|
|
774
|
-
trigger=${s(this,rh)}
|
|
775
|
-
${vt(s(this,Sp))}
|
|
776
|
-
>
|
|
777
|
-
<div class="channel-switcher-pop-body">
|
|
778
|
-
${s(this,qt).template()}
|
|
779
|
-
</div>
|
|
780
|
-
<footer class="channel-switcher-pop-footer">
|
|
781
|
-
<button
|
|
782
|
-
class="channel-create"
|
|
783
|
-
variant="ghost"
|
|
784
|
-
icon
|
|
785
|
-
aria-label="New channel"
|
|
786
|
-
title="New channel"
|
|
787
|
-
type="button"
|
|
788
|
-
?disabled=${s(this,qt).creating}
|
|
789
|
-
@click=${s(this,qt).create}
|
|
790
|
-
>
|
|
791
|
-
<tv-icon name="add"></tv-icon>
|
|
792
|
-
</button>
|
|
793
|
-
</footer>
|
|
794
|
-
</tv-popover>
|
|
795
|
-
`:null}
|
|
796
|
-
`}
|
|
797
|
-
</div>
|
|
798
|
-
`:null}
|
|
799
|
-
${rz(e,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
|
|
800
|
-
<div class="top-bar-controls">
|
|
801
|
-
${jN((l=i.connectionOwner)==null?void 0:l.connection)}
|
|
802
|
-
${ez(e)}
|
|
803
|
-
${s(this,Go).template()}
|
|
804
|
-
</div>
|
|
805
|
-
</header>
|
|
806
|
-
${s(this,qt).overlayTemplate()}
|
|
807
|
-
`}disconnected(){var e;s(this,Go).disconnect(),document.removeEventListener("keydown",s(this,sh)),s(this,qt).disconnect(),(e=s(this,vi))==null||e.disconnect(),d(this,vi,null),d(this,Rt,null),d(this,Cr,!1),d(this,Dl,null),d(this,yi,null),d(this,An,null)}}Go=new WeakMap,qt=new WeakMap,rh=new WeakMap,Rt=new WeakMap,vi=new WeakMap,Cr=new WeakMap,Dl=new WeakMap,yi=new WeakMap,ih=new WeakMap,An=new WeakMap,vp=new WeakMap,yp=new WeakMap,sh=new WeakMap,Zl=new WeakSet,E4=function(e){var r;Kc((r=s(this,Rt))==null?void 0:r.querySelectorAll('.channel[role="option"]')[e])},wp=new WeakMap,bp=new WeakMap,k4=function(e){var u,p;if(s(this,An)!==e||s(this,yi)===null)return;d(this,An,null);const r=s(this,yi).focusedChannel;d(this,Cr,r!==null),this.render();const i=s(this,Rt);if(i===null){s(this,qt).disconnect(),(p=(u=s(this,ih).value)==null?void 0:u.querySelector(".sidebar-expand"))==null||p.focus();return}i.setAttribute("open","");const o=i.querySelector(".channel-switcher-pop-body");o&&(o.scrollTop=e.scrollTop);const a=e.result==="cancelled"&&s(this,yi).channels.some(({id:f})=>f===e.channelId)?e.channelId:r==null?void 0:r.id,l=[...i.querySelectorAll(".channel-row")].find(f=>f.dataset.channelId===a),c=l==null?void 0:l.querySelector(".channel");c==null||c.focus({preventScroll:!0}),e.result==="deleted"&&(c==null||c.scrollIntoView({block:"nearest"}))},Sp=new WeakMap,_p=new WeakMap;const lz=ln(az);var Rr,oh,Yo,Ll,It,rn,En,kn,Ko,Ie,Vn,bs,Ol,Ss,ah,Ap,Jo,Ep,kp,Tp,J,yd,v1,T4,lh,Cp,Zi,Gs,Hc,wd,y1,C4,R4,Rp,Ip,$p,ch,xp,Ys,Zc,I4;class cz extends an{constructor(){super(...arguments);m(this,J);m(this,Rr,null);m(this,oh);m(this,Yo,null);m(this,Ll,null);m(this,It,Dh);m(this,rn,!1);m(this,En,null);m(this,kn,null);m(this,Ko,null);m(this,Ie,!1);m(this,Vn,!1);m(this,bs,Dh);m(this,Ol,0);m(this,Ss,null);m(this,ah,e=>{var r;if(e.key==="Escape"&&s(this,En)!==null){e.preventDefault(),e.stopPropagation(),h(this,J,Ys).call(this);return}hA(e,navigator.platform)&&(e.preventDefault(),e.stopPropagation(),(r=s(this,Rr))==null||r.handleNavigationKey(e.key))});m(this,Ap,e=>{d(this,oh,e??void 0),this.render()});m(this,Jo,()=>{this.render()});m(this,Ep,()=>h(this,J,yd).call(this,!0));m(this,kp,()=>h(this,J,yd).call(this,!1));m(this,Tp,()=>{const e=s(this,Ie)?!s(this,Vn):!s(this,rn);h(this,J,yd).call(this,e)});m(this,lh,e=>{const r=s(this,Ss),i=h(this,J,Gs).call(this).closest("#app");if(!r||!i)return;d(this,bs,e);const o=yM(1-e/r.expandedSidebarWidth,r),a=(c,u)=>{i.style.setProperty(`--motion-${c}`,`${u}px`)};a("boundary",o.sidebarBoundary),a("toggle-left",o.toggleLeft),a("toggle-top",r.toggleTop),a("toggle-width",r.toggleWidth),a("toggle-height",r.toggleHeight),a("toggle-wipe",o.toggleWipe),a("lead-reservation",o.leadReservation),a("switcher-left",r.collapsedToggleLeft+r.toggleWidth+r.toggleSwitcherGap-o.sidebarBoundary-r.barInset),i.style.setProperty("--motion-titlebar-opacity",String(o.titlebarOpacity)),i.style.setProperty("--motion-switcher-opacity",String(o.switcherOpacity));const l=h(this,J,Gs).call(this);l.style.removeProperty("left"),l.style.removeProperty("top")});m(this,Cp,e=>{var o;if(!s(this,Ie))return;const r=e===0;if(r!==s(this,Vn))return;const i=document.activeElement===s(this,kn);h(this,J,Zi).call(this,r),this.render(),i&&((o=s(this,kn))==null||o.focus({preventScroll:!0}))});m(this,Rp,e=>{if(e.button!==0||s(this,En)!==null)return;const r=e.currentTarget,i=r.closest("#app");i!==null&&(r.setPointerCapture(e.pointerId),d(this,En,{pointerId:e.pointerId,startX:e.clientX,startWidth:s(this,It),root:i}),e.preventDefault())});m(this,Ip,e=>{const r=s(this,En);r===null||e.pointerId!==r.pointerId||h(this,J,Zc).call(this,r.root,r.startWidth+e.clientX-r.startX)});m(this,$p,e=>{var o;const r=s(this,En);if(r===null||e.pointerId!==r.pointerId)return;d(this,En,null);const i=((o=s(this,Yo))==null?void 0:o.commit(s(this,It)))??s(this,It);h(this,J,Zc).call(this,r.root,i)});m(this,ch,e=>{const r=s(this,En);r===null||e.pointerId!==r.pointerId||h(this,J,Ys).call(this)});m(this,xp,e=>{var i;const r=e.currentTarget.closest("#app");r!==null&&((i=s(this,Yo))==null||i.clear(),h(this,J,Zc).call(this,r,Dh))})}update(e,r){const i=r[0],o=r[1].sidebarWidthPreference,a=r[1].sidebarCollapsedPreference;s(this,Rr)!==i&&(s(this,Rr)!==null&&this.isConnected&&(s(this,Rr).removeEventListener("change",s(this,Jo)),i.addEventListener("change",s(this,Jo))),d(this,Rr,i));const l=s(this,Yo)!==o,c=s(this,Ll)!==a;return l&&(h(this,J,Ys).call(this),d(this,Yo,o),d(this,It,o.read()??Dh)),c&&(h(this,J,Ys).call(this),d(this,Ll,a),d(this,rn,a.read())),(l||c)&&h(this,J,Zi).call(this,s(this,rn)),super.update(e,r)}connected(){var e;(e=s(this,Rr))==null||e.addEventListener("change",s(this,Jo)),document.addEventListener("keydown",s(this,ah),{capture:!0})}disconnected(){var e,r;h(this,J,Ys).call(this),s(this,Ie)?h(this,J,Zi).call(this,s(this,Vn)):(e=s(this,Ko))==null||e.cancel(),(r=s(this,Rr))==null||r.removeEventListener("change",s(this,Jo)),document.removeEventListener("keydown",s(this,ah),{capture:!0})}template(e,r){const i=VD(e.snapshot,r.runtimeServerURL),o=e.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),j`
|
|
808
|
-
<div
|
|
809
|
-
id="app"
|
|
810
|
-
tabindex="-1"
|
|
811
|
-
data-app-state=${i.kind}
|
|
812
|
-
?data-sidebar-transition=${s(this,Ie)}
|
|
813
|
-
?data-sidebar-motion=${s(this,Ie)}
|
|
814
|
-
style=${h(this,J,R4).call(this)}
|
|
815
|
-
>
|
|
816
|
-
${hz(i)?h(this,J,I4).call(this,e,o,r):null}
|
|
817
|
-
${dz(i)?_N(i,e,r.desktopUpdate):null}
|
|
818
|
-
</div>
|
|
819
|
-
<div id="foreground-overlay" inert aria-hidden="true"></div>
|
|
820
|
-
`}}Rr=new WeakMap,oh=new WeakMap,Yo=new WeakMap,Ll=new WeakMap,It=new WeakMap,rn=new WeakMap,En=new WeakMap,kn=new WeakMap,Ko=new WeakMap,Ie=new WeakMap,Vn=new WeakMap,bs=new WeakMap,Ol=new WeakMap,Ss=new WeakMap,ah=new WeakMap,Ap=new WeakMap,Jo=new WeakMap,Ep=new WeakMap,kp=new WeakMap,Tp=new WeakMap,J=new WeakSet,yd=function(e){var c,u;if(!s(this,Ie)&&s(this,rn)===e||s(this,Ie)&&s(this,Vn)===e)return;h(this,J,Ys).call(this);const r=document.activeElement===s(this,kn);if((c=s(this,Ll))==null||c.setCollapsed(e),matchMedia("(prefers-reduced-motion: reduce)").matches){h(this,J,Zi).call(this,e),this.render(),r&&((u=s(this,kn))==null||u.focus({preventScroll:!0}));return}if(d(this,Vn,e),s(this,Ie)){h(this,J,Hc).call(this),h(this,J,v1).call(this);return}const i=h(this,J,Gs).call(this),o=i.closest("#app"),a=i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();if(!o||!l||a.width===0){h(this,J,Zi).call(this,e),this.render();return}for(const p of o.getAnimations({subtree:!0}))p.cancel();d(this,Ie,!0),d(this,Ol,a.top-l.top),d(this,Ss,null),i.style.left=`${a.left-l.left}px`,i.style.top=`${s(this,Ol)}px`,h(this,J,Hc).call(this),this.render(),queueMicrotask(()=>{s(this,Ie)&&(h(this,J,T4).call(this),r&&i.focus({preventScroll:!0}),h(this,J,v1).call(this))})},v1=function(){const e=h(this,J,Gs).call(this).closest("#app"),r=s(this,Ko);if(!e||!r||!s(this,Ss))return;const i=s(this,Vn)?0:s(this,It);r.move({root:e,width:s(this,It),target:i,onFrame:s(this,lh),onFinish:s(this,Cp)})},T4=function(){const r=h(this,J,Gs).call(this).closest("#app"),i=r==null?void 0:r.querySelector(".sidebar-titlebar > .sidebar-toggle-seat"),o=r==null?void 0:r.querySelector(".top-bar > .top-bar-lead"),a=o==null?void 0:o.querySelector(":scope > .sidebar-toggle-seat"),l=o==null?void 0:o.querySelector(":scope > .channel-switcher"),c=o==null?void 0:o.closest(".top-bar");if(!r||!i||!o||!a||!c){h(this,J,Zi).call(this,s(this,Vn)),this.render();return}const u=i.closest(".app-sidebar");r.removeAttribute("data-sidebar-motion");const p=r.getBoundingClientRect(),f=o.style.display;o.style.display="none";const y=i.getBoundingClientRect();u.style.marginLeft=`${-s(this,It)}px`,o.style.display=f;const v=a.getBoundingClientRect(),S=l==null?void 0:l.getBoundingClientRect();d(this,Ss,{expandedSidebarWidth:s(this,It),expandedToggleLeft:y.left-p.left,collapsedToggleLeft:v.left-p.left,toggleTop:s(this,Ol),toggleWidth:v.width,toggleHeight:v.height,toggleSwitcherGap:S?S.left-v.right:0,collapsedLeadReservation:o.getBoundingClientRect().width,hasSwitcher:!!l,barInset:c.getBoundingClientRect().left-p.left}),u.style.removeProperty("margin-left"),r.setAttribute("data-sidebar-motion",""),s(this,lh).call(this,s(this,bs))},lh=new WeakMap,Cp=new WeakMap,Zi=function(e){var r;(r=s(this,Ko))==null||r.cancel(),d(this,rn,e),d(this,Ie,!1),d(this,bs,e?0:s(this,It)),d(this,Ko,new bM(s(this,bs))),d(this,Ss,null),h(this,J,C4).call(this),h(this,J,Hc).call(this)},Gs=function(){if(s(this,kn)!==null)return s(this,kn);const e=document.createElement("button");return e.type="button",e.setAttribute("variant","ghost"),e.setAttribute("icon",""),e.append(h(this,J,wd).call(this)),e.addEventListener("pointerdown",r=>{r.button===0&&e.setPointerCapture(r.pointerId)}),e.addEventListener("click",s(this,Tp)),d(this,kn,e),h(this,J,Hc).call(this),e},Hc=function(){var o;const e=s(this,kn);if(e===null)return;const r=s(this,Ie)?s(this,Vn):s(this,rn);e.className=s(this,Ie)?"sidebar-motion-toggle sidebar-toggle":r?"sidebar-expand":"sidebar-collapse",s(this,Ie)?e.querySelectorAll(":scope > .sidebar-toggle-paint").length!==2&&e.replaceChildren(h(this,J,y1).call(this,"expanded-paint"),h(this,J,y1).call(this,"collapsed-paint")):(e.children.length!==1||!((o=e.firstElementChild)!=null&&o.matches("tv-icon[name='sidebar']")))&&e.replaceChildren(h(this,J,wd).call(this));const i=r?"Show sidebar":"Collapse sidebar";e.setAttribute("aria-label",i),e.title=i},wd=function(){const e=document.createElement("tv-icon");return e.setAttribute("name","sidebar"),e.setAttribute("size","sm"),e},y1=function(e){const r=document.createElement("span");return r.className=`sidebar-toggle-paint ${e}`,r.setAttribute("aria-hidden","true"),r.append(h(this,J,wd).call(this)),r},C4=function(){const e=s(this,kn);e!==null&&(e.style.removeProperty("left"),e.style.removeProperty("top"))},R4=function(){const e=[`--sidebar-width: ${s(this,It)}px`];return s(this,Ie)&&e.push(`--motion-boundary: ${s(this,bs)}px`),e.join("; ")},Rp=new WeakMap,Ip=new WeakMap,$p=new WeakMap,ch=new WeakMap,xp=new WeakMap,Ys=function(){const e=s(this,En);if(e===null)return;d(this,En,null),h(this,J,Zc).call(this,e.root,e.startWidth);const r=e.root.querySelector(".app-sidebar-resize");r!=null&&r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId)},Zc=function(e,r){d(this,It,yS(r)),h(this,J,Zi).call(this,s(this,rn)),e.style.setProperty("--sidebar-width",`${s(this,It)}px`)},I4=function(e,r,i){const o=!s(this,rn)||s(this,Ie),a=h(this,J,Gs).call(this);return j`
|
|
821
|
-
${o?j`
|
|
822
|
-
<aside class="app-sidebar">
|
|
823
|
-
${aM(e,r,i.electronMode,s(this,Ep),s(this,Ie)?null:a,s(this,Ie))}
|
|
824
|
-
</aside>
|
|
825
|
-
${s(this,Ie)?null:j`
|
|
826
|
-
<div
|
|
827
|
-
class="app-sidebar-resize"
|
|
828
|
-
aria-hidden="true"
|
|
829
|
-
@pointerdown=${s(this,Rp)}
|
|
830
|
-
@pointermove=${s(this,Ip)}
|
|
831
|
-
@pointerup=${s(this,$p)}
|
|
832
|
-
@pointercancel=${s(this,ch)}
|
|
833
|
-
@lostpointercapture=${s(this,ch)}
|
|
834
|
-
@dblclick=${s(this,xp)}
|
|
835
|
-
></div>
|
|
836
|
-
`}
|
|
837
|
-
`:null}
|
|
838
|
-
<main class="app-main">
|
|
839
|
-
${lz(e,r,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,onTabReorderChange:s(this,Ap),collapsed:s(this,rn),onExpandSidebar:s(this,kp),sidebarToggle:s(this,Ie)?null:s(this,rn)?a:void 0,sidebarTransitioning:s(this,Ie)})}
|
|
840
|
-
${GM(e,r.focusedChannel,s(this,oh),s(this,Ie))}
|
|
841
|
-
</main>
|
|
842
|
-
${s(this,Ie)?a:null}
|
|
843
|
-
`};const uz=ln(cz);function hz(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function dz(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const $4="television-appearance-mode";function pz(n){return n==="system"||n==="light"||n==="dark"}function fz(){try{const n=window.localStorage.getItem($4);return pz(n)?n:"system"}catch{return"system"}}function x4(){return window.__televisionAppearanceResolver??kD(fz())}function mz(n,t){return t==="light"||t==="dark"?t:n}function gz(n){x4().setPreference(n);try{window.localStorage.setItem($4,n)}catch{}}document.documentElement.dataset.tvBundleVersion=J1();Object.defineProperty(window,"__tvVersion",{value:J1(),writable:!1,configurable:!1});x4();const vz=Pz(),Yn=wi();Yn?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const pv=MI(),P4=NI(),yz=new Ok(Yn?"television-electron":"television-browser",Lk()),wz=new cD(window.localStorage),bz=new aD(window.localStorage),Bb=pS(),Sz=Bb?VI({storage:Bb,clientApp:Yn?"desktop":"browser",desktopAppVersion:Yn?m6():null}):null,fv=Es(Yn?pv:window.location.origin),mv=fD({search:window.location.search}),Kn=X1(),D4=new bD,gv=wD({detection:mv,primaryServerURL:fv,navigationLatch:Kn,presentation:D4}),Oe=new K5({localStore:yz,serverURL:pv,launchToken:P4,telemetryMeta:Sz,navigationPending:()=>Kn.pending,...mv.electron?{decideBoot:n=>gv.decideBoot(n)}:{}}),_z=n=>{Ak(yt,n)},yt=new pk({connectionOwner:Oe,navigationKeyHandler:_z,retainedGateHalted:()=>gv.gated}),to=globalThis.__televisionNativeBridge;Yn&&to&&to.onNavigationKey(n=>yt.handleNavigationKey(n));const Az=new ED({electron:Yn,bridge:to});if(P4){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}pD({owner:Oe,primaryServerURL:fv,navigationLatch:Kn});gv.attach(Oe);const Ez=()=>{const n=Oe.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:t})=>{const e=new Set(t.map(r=>r.id));sD(e)}).catch(()=>{})},L4=()=>{Oe.connection.status==="connected"&&SM(Oe.connection.url)};let Nd=null,w1=null,O4=Oe.connection.status;const kz=()=>{Kn.pending||Kn.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const t=new URL(window.location.href);t.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`)}window.location.reload()})},M4=(n,t,e)=>{if(Kn.pending||Oe.connection.status!=="connected"||yt.snapshot.connection.status!=="connected"||!yt.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(t)},i=Nd,o=EM(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),u=i!==null&&!a&&l&&!c,p=i!==null&&U4(i.consentIds,r.consentIds);if(Nd=r,o!==null&&(a||u)){kz();return}if(o===null&&c){ab(Oe.connection.url);return}o!==null&&c&&e&&!a&&p&&ab(Oe.connection.url)},Tz=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},N4=(n,t)=>{if(Kn.pending||Oe.connection.status!=="connected"||yt.snapshot.connection.status!=="connected"||!yt.snapshot.ready)return;const e={activeThemeName:n,serverURL:Oe.connection.url,appearance:Tz()},r=w1;w1=e,!(!t&&(r==null?void 0:r.activeThemeName)===e.activeThemeName&&r.serverURL===e.serverURL&&r.appearance===e.appearance)&&kM(e.serverURL,e.activeThemeName,()=>yt.listThemes())},z4=()=>{if(!Kn.pending){if(O4=Oe.connection.status,Oe.connection.status!=="connected"){_M(),AM(),TM(),Nd=null,w1=null;return}L4(),Ez()}};let b1,S1;const vv=(n,t)=>{const e=mz(n,t);e!==b1&&(gz(e),b1=e),e!==S1&&Yn&&typeof(to==null?void 0:to.setAppearanceMode)=="function"&&(to.setAppearanceMode(e),S1=e)},Jp=()=>{const n=yt.snapshot;if(n.connection.status!=="connected"){b1=void 0,S1=void 0;return}n.ready&&(vv(n.display.appearanceMode,n.display.activeThemeColorScheme),O4===Oe.connection.status&&(M4(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),N4(n.display.activeThemeName,!1)))},Cz=n=>{if(Kn.pending)return;vv(yt.snapshot.display.appearanceMode,n.activeThemeColorScheme);const t=Nd,e=t!==null&&t.activeThemeName===n.themeName&&!U4(t.consentIds,new Set(n.themeJavaScriptConsentIds));M4(n.themeName,n.themeJavaScriptConsentIds,!0),!(Kn.pending||e)&&(L4(),N4(n.themeName,!0))},Rz=n=>{Kn.pending||vv(n.appearanceMode,yt.snapshot.display.activeThemeColorScheme)};z4();Jp();Oe.addEventListener("change",z4);yt.addEventListener("change",Jp);yt.addEventListener("theme-changed",Cz);yt.addEventListener("appearance-changed",Rz);const Iz=new MutationObserver(()=>{Jp()});Iz.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});m8.register("ServerConnectionOwner",()=>Oe);m8.register("ApplicationService",()=>yt);const qc=globalThis.__telepath??(globalThis.__telepath={});qc.applicationService=yt;qc.connectionOwner=Oe;const $z=qc.renderCompleteCallbacks??(qc.renderCompleteCallbacks=new Set);Yn&&document.body.classList.add("electron");let Wb=!1,jb=!1;const xz=n=>{if(!vz||jb||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const t=document.querySelector("#settings-popover");t!==null&&(jb=!0,t.setAttribute("open",""))},H4=()=>{Wb||(Qh(uz(yt,{runtimeServerURL:pv,electronMode:Yn,connectionOwner:Oe,primaryServerURL:fv,updatePresentation:D4,desktopRecommendation:mv,desktopUpdate:Az,sidebarWidthPreference:wz,sidebarCollapsedPreference:bz,onRenderComplete(n){xz(n);for(const t of $z)t(n)}}),document.body),Wb=!0,Jp())},Z4=()=>{const n=Oe.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Oe.connectError===null||(Oe.removeEventListener("change",Z4),H4())};Yn?Oe.addEventListener("change",Z4):H4();Oe.connect();function Pz(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function U4(n,t){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}
|