@telepath-computer/television 1.4.11 → 1.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,842 +0,0 @@
1
- var E_=Object.defineProperty;var $1=n=>{throw TypeError(n)};var k_=(n,e,t)=>e in n?E_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var C=(n,e,t)=>k_(n,typeof e!="symbol"?e+"":e,t),hf=(n,e,t)=>e.has(n)||$1("Cannot "+t);var s=(n,e,t)=>(hf(n,e,"read from private field"),t?t.call(n):e.get(n)),p=(n,e,t)=>e.has(n)?$1("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),h=(n,e,t,r)=>(hf(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),u=(n,e,t)=>(hf(n,e,"access private method"),t);var nh=(n,e,t,r)=>({set _(i){h(n,e,i,t)},get _(){return s(n,e,r)}});import{i as C_,a as T_,b as $_,c as R_,d as I_,e as x_,f as P_,g as L_,U as D_,A as M_,h as O_}from"./artifact-bridge-BEUWXKq7.js";import{m as N_,a as z_,b as Z_}from"./missing-artifact-page-DVzJ41AE.js";var ls=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function H_(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var R1=Object.prototype.toString,qw=function(e){var t=R1.call(e),r=t==="[object Arguments]";return r||(r=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&R1.call(e.callee)==="[object Function]"),r},df,I1;function U_(){if(I1)return df;I1=1;var n;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=qw,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},d={$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},f=function(){if(typeof window>"u")return!1;for(var y in window)try{if(!d["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{c(window[y])}catch{return!0}}catch{return!0}return!1}(),g=function(y){if(typeof window>"u"||!f)return c(y);try{return c(y)}catch{return!1}};n=function(v){var _=v!==null&&typeof v=="object",E=t.call(v)==="[object Function]",x=r(v),B=_&&t.call(v)==="[object String]",P=[];if(!_&&!E&&!x)throw new TypeError("Object.keys called on a non-object");var J=a&&E;if(B&&v.length>0&&!e.call(v,0))for(var O=0;O<v.length;++O)P.push(String(O));if(x&&v.length>0)for(var Y=0;Y<v.length;++Y)P.push(String(Y));else for(var U in v)!(J&&U==="prototype")&&e.call(v,U)&&P.push(String(U));if(o)for(var j=g(v),fe=0;fe<l.length;++fe)!(j&&l[fe]==="constructor")&&e.call(v,l[fe])&&P.push(l[fe]);return P}}return df=n,df}var F_=Array.prototype.slice,V_=qw,x1=Object.keys,kh=x1?function(e){return x1(e)}:U_(),P1=Object.keys;kh.shim=function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=function(r){return V_(r)?P1(F_.call(r)):P1(r)})}else Object.keys=kh;return Object.keys||kh};var B_=kh,Ch=Object.defineProperty||!1;if(Ch)try{Ch({},"a",{value:1})}catch{Ch=!1}var Lu=Ch,Gr=SyntaxError,re=TypeError,q_=Object.getOwnPropertyDescriptor,Th=q_;if(Th)try{Th([],"length")}catch{Th=null}var sl=Th,L1=Lu,W_=Gr,ko=re,D1=sl,Ww=function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new ko("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new ko("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ko("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ko("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ko("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ko("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!D1&&D1(e,t);if(L1)L1(e,t,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:o===null&&c?c.writable:!o});else if(l||!i&&!o&&!a)e[t]=r;else throw new W_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},o0=Lu,jw=function(){return!!o0};jw.hasArrayLengthDefineBug=function(){if(!o0)return null;try{return o0([],"length",{value:1}).length!==1}catch{return!0}};var Rp=jw,j_=B_,G_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Y_=Object.prototype.toString,J_=Array.prototype.concat,M1=Ww,K_=function(n){return typeof n=="function"&&Y_.call(n)==="[object Function]"},Gw=Rp(),X_=function(n,e,t,r){if(e in n){if(r===!0){if(n[e]===t)return}else if(!K_(r)||!r())return}Gw?M1(n,e,t,!0):M1(n,e,t)},Yw=function(n,e){var t=arguments.length>2?arguments[2]:{},r=j_(e);G_&&(r=J_.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)X_(n,r[i],e[r[i]],t[r[i]])};Yw.supportsDescriptors=!!Gw;var mo=Yw,$h={exports:{}};typeof self<"u"?$h.exports=self:typeof window<"u"?$h.exports=window:$h.exports=Function("return this")();var Jw=$h.exports,Q_=Jw,Kw=function(){return typeof ls!="object"||!ls||ls.Math!==Math||ls.Array!==Array?Q_:ls},e4=mo,t4=sl,n4=Kw,r4=function(){var e=n4();if(e4.supportsDescriptors){var t=t4(e,"globalThis");(!t||t.configurable&&(t.enumerable||!t.writable||globalThis!==e))&&Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!0})}else(typeof globalThis!="object"||globalThis!==e)&&(e.globalThis=e);return e},i4=mo,s4=Jw,Xw=Kw,o4=r4,a4=Xw(),Qw=function(){return a4};i4(Qw,{getPolyfill:Xw,implementation:s4,shim:o4});var eg=Qw,Yr=function(e){return!!e&&(typeof e=="function"||typeof e=="object")},tg=Object,e2=Error,l4=EvalError,c4=RangeError,ng=ReferenceError,u4=URIError,h4=Math.abs,d4=Math.floor,p4=Math.max,f4=Math.min,m4=Math.pow,g4=Math.round,rg=Number.isNaN||function(e){return e!==e},v4=rg,y4=function(e){return v4(e)||e===0?e:e<0?-1:1},ol=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==i||l.enumerable!==!0)return!1}return!0},O1=typeof Symbol<"u"&&Symbol,w4=ol,ig=function(){return typeof O1!="function"||typeof Symbol!="function"||typeof O1("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:w4()},t2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,b4=tg,n2=b4.getPrototypeOf||null,S4="Function.prototype.bind called on incompatible ",_4=Object.prototype.toString,A4=Math.max,E4="[object Function]",N1=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r},k4=function(e,t){for(var r=[],i=t,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},C4=function(n,e){for(var t="",r=0;r<n.length;r+=1)t+=n[r],r+1<n.length&&(t+=e);return t},T4=function(e){var t=this;if(typeof t!="function"||_4.apply(t)!==E4)throw new TypeError(S4+t);for(var r=k4(arguments,1),i,o=function(){if(this instanceof i){var f=t.apply(this,N1(r,arguments));return Object(f)===f?f:this}return t.apply(e,N1(r,arguments))},a=A4(0,t.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+C4(l,",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var d=function(){};d.prototype=t.prototype,i.prototype=new d,d.prototype=null}return i},$4=T4,Du=Function.prototype.bind||$4,sg=Function.prototype.call,pf,z1;function og(){return z1||(z1=1,pf=Function.prototype.apply),pf}var R4=typeof Reflect<"u"&&Reflect&&Reflect.apply,I4=Du,x4=og(),P4=sg,L4=R4,r2=L4||I4.call(P4,x4),D4=Du,M4=re,O4=sg,N4=r2,Ip=function(e){if(e.length<1||typeof e[0]!="function")throw new M4("a function is required");return N4(D4,O4,e)},z4=Ip,Z1=sl,i2;try{i2=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var ff=!!i2&&Z1&&Z1(Object.prototype,"__proto__"),s2=Object,H1=s2.getPrototypeOf,Z4=ff&&typeof ff.get=="function"?z4([ff.get]):typeof H1=="function"?function(e){return H1(e==null?e:s2(e))}:!1,U1=t2,F1=n2,V1=Z4,o2=U1?function(e){return U1(e)}:F1?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return F1(e)}:V1?function(e){return V1(e)}:null,H4=Function.prototype.call,U4=Object.prototype.hasOwnProperty,F4=Du,Jr=F4.call(H4,U4),ne,V4=tg,B4=e2,q4=l4,W4=c4,j4=ng,Xa=Gr,Yo=re,G4=u4,Y4=h4,J4=d4,K4=p4,X4=f4,Q4=m4,eA=g4,tA=y4,a2=Function,mf=function(n){try{return a2('"use strict"; return ('+n+").constructor;")()}catch{}},dc=sl,nA=Lu,gf=function(){throw new Yo},rA=dc?function(){try{return arguments.callee,gf}catch{try{return dc(arguments,"callee").get}catch{return gf}}}():gf,Co=ig(),Ue=o2,iA=n2,sA=t2,l2=og(),Mu=sg,Io={},oA=typeof Uint8Array>"u"||!Ue?ne:Ue(Uint8Array),co={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&Ue?Ue([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":Io,"%AsyncGenerator%":Io,"%AsyncGeneratorFunction%":Io,"%AsyncIteratorPrototype%":Io,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":B4,"%eval%":eval,"%EvalError%":q4,"%Float16Array%":typeof Float16Array>"u"?ne:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":a2,"%GeneratorFunction%":Io,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&Ue?Ue(Ue([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Co||!Ue?ne:Ue(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":V4,"%Object.getOwnPropertyDescriptor%":dc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":W4,"%ReferenceError%":j4,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Co||!Ue?ne:Ue(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&Ue?Ue(""[Symbol.iterator]()):ne,"%Symbol%":Co?Symbol:ne,"%SyntaxError%":Xa,"%ThrowTypeError%":rA,"%TypedArray%":oA,"%TypeError%":Yo,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":G4,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet,"%Function.prototype.call%":Mu,"%Function.prototype.apply%":l2,"%Object.defineProperty%":nA,"%Object.getPrototypeOf%":iA,"%Math.abs%":Y4,"%Math.floor%":J4,"%Math.max%":K4,"%Math.min%":X4,"%Math.pow%":Q4,"%Math.round%":eA,"%Math.sign%":tA,"%Reflect.getPrototypeOf%":sA};if(Ue)try{null.error}catch(n){var aA=Ue(Ue(n));co["%Error.prototype%"]=aA}var lA=function n(e){var t;if(e==="%AsyncFunction%")t=mf("async function () {}");else if(e==="%GeneratorFunction%")t=mf("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=mf("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Ue&&(t=Ue(i.prototype))}return co[e]=t,t},B1={__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"]},Ou=Du,dd=Jr,cA=Ou.call(Mu,Array.prototype.concat),uA=Ou.call(l2,Array.prototype.splice),q1=Ou.call(Mu,String.prototype.replace),pd=Ou.call(Mu,String.prototype.slice),hA=Ou.call(Mu,RegExp.prototype.exec),dA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pA=/\\(\\)?/g,fA=function(e){var t=pd(e,0,1),r=pd(e,-1);if(t==="%"&&r!=="%")throw new Xa("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new Xa("invalid intrinsic syntax, expected opening `%`");var i=[];return q1(e,dA,function(o,a,l,c){i[i.length]=l?q1(c,pA,"$1"):a||o}),i},mA=function(e,t){var r=e,i;if(dd(B1,r)&&(i=B1[r],r="%"+i[0]+"%"),dd(co,r)){var o=co[r];if(o===Io&&(o=lA(r)),typeof o>"u"&&!t)throw new Yo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Xa("intrinsic "+e+" does not exist!")},rn=function(e,t){if(typeof e!="string"||e.length===0)throw new Yo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Yo('"allowMissing" argument must be a boolean');if(hA(/^%?[^%]*%?$/,e)===null)throw new Xa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=fA(e),i=r.length>0?r[0]:"",o=mA("%"+i+"%",t),a=o.name,l=o.value,c=!1,d=o.alias;d&&(i=d[0],uA(r,cA([0,1],d)));for(var f=1,g=!0;f<r.length;f+=1){var y=r[f],v=pd(y,0,1),_=pd(y,-1);if((v==='"'||v==="'"||v==="`"||_==='"'||_==="'"||_==="`")&&v!==_)throw new Xa("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(c=!0),i+="."+y,a="%"+i+"%",dd(co,a))l=co[a];else if(l!=null){if(!(y in l)){if(!t)throw new Yo("base intrinsic for "+e+" exists, but the property is not available.");return}if(dc&&f+1>=r.length){var E=dc(l,y);g=!!E,g&&"get"in E&&!("originalValue"in E.get)?l=E.get:l=l[y]}else g=dd(l,y),l=l[y];g&&!c&&(co[a]=l)}}return l},vf,W1;function Gi(){if(W1)return vf;W1=1;var n=rn,e=Ip,t=e([n("%String.prototype.indexOf%")]);return vf=function(i,o){var a=n(i,!!o);return typeof a=="function"&&t(i,".prototype.")>-1?e([a]):a},vf}var yf,j1;function ag(){if(j1)return yf;j1=1;var n=rn,e=n("%Array%"),t=!e.isArray&&Gi()("Object.prototype.toString");return yf=e.isArray||function(i){return t(i)==="[object Array]"},yf}var gA=Rp,G1=Lu,c2=gA.hasArrayLengthDefineBug(),vA=c2&&ag(),yA=Gi(),wA=yA("Object.prototype.propertyIsEnumerable"),lg=function(e,t,r,i,o,a){if(!G1){if(!e(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||o in i&&wA(i,o)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[o]=l,t(i[o],l)}return c2&&o==="length"&&"[[Value]]"in a&&vA(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(G1(i,o,r(a)),!0)},bA=re,El=Jr,SA={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},al=function(e){if(!e||typeof e!="object")return!1;for(var t in e)if(El(e,t)&&!SA[t])return!1;var r=El(e,"[[Value]]")||El(e,"[[Writable]]"),i=El(e,"[[Get]]")||El(e,"[[Set]]");if(r&&i)throw new bA("Property Descriptors may not be both accessor and data descriptors");return!0},u2=function(e){if(typeof e>"u")return e;var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=!!e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=!!e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=!!e["[[Configurable]]"]),t},_A=re,AA=al,EA=u2,h2=function(e){if(typeof e<"u"&&!AA(e))throw new _A("Assertion failed: `Desc` must be a Property Descriptor");return EA(e)},kA=re,Y1=Jr,CA=al,d2=function(e){if(typeof e>"u")return!1;if(!CA(e))throw new kA("Assertion failed: `Desc` must be a Property Descriptor");return!(!Y1(e,"[[Value]]")&&!Y1(e,"[[Writable]]"))},ll=function(e){return typeof e=="string"||typeof e=="symbol"},J1=rg,p2=function(e,t){return e===t?e===0?1/e===1/t:!0:J1(e)&&J1(t)},K1=re,TA=Yr,$A=lg,RA=h2,IA=d2,xA=ll,PA=p2,cg=function(e,t,r){if(!TA(e))throw new K1("Assertion failed: Type(O) is not Object");if(!xA(t))throw new K1("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return $A(IA,PA,RA,e,t,i)},f2=Function.prototype.toString,qo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a0,Rh;if(typeof qo=="function"&&typeof Object.defineProperty=="function")try{a0=Object.defineProperty({},"length",{get:function(){throw Rh}}),Rh={},qo(function(){throw 42},null,a0)}catch(n){n!==Rh&&(qo=null)}else qo=null;var LA=/^\s*class\b/,l0=function(e){try{var t=f2.call(e);return LA.test(t)}catch{return!1}},wf=function(e){try{return l0(e)?!1:(f2.call(e),!0)}catch{return!1}},Ih=Object.prototype.toString,DA="[object Object]",MA="[object Function]",OA="[object GeneratorFunction]",NA="[object HTMLAllCollection]",zA="[object HTML document.all class]",ZA="[object HTMLCollection]",HA=typeof Symbol=="function"&&!!Symbol.toStringTag,UA=!(0 in[,]),c0=function(){return!1};if(typeof document=="object"){var FA=document.all;Ih.call(FA)===Ih.call(document.all)&&(c0=function(e){if((UA||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=Ih.call(e);return(t===NA||t===zA||t===ZA||t===DA)&&e("")==null}catch{}return!1})}var m2=qo?function(e){if(c0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{qo(e,null,a0)}catch(t){if(t!==Rh)return!1}return!l0(e)&&wf(e)}:function(e){if(c0(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(HA)return wf(e);if(l0(e))return!1;var t=Ih.call(e);return t!==MA&&t!==OA&&!/^\[object HTML/.test(t)?!1:wf(e)},VA=m2,BA=function(e){return!!e},Tn=Jr,rh=re,qA=Yr,X1=VA,bf=BA,WA=function(e){if(!qA(e))throw new rh("ToPropertyDescriptor requires an object");var t={};if(Tn(e,"enumerable")&&(t["[[Enumerable]]"]=bf(e.enumerable)),Tn(e,"configurable")&&(t["[[Configurable]]"]=bf(e.configurable)),Tn(e,"value")&&(t["[[Value]]"]=e.value),Tn(e,"writable")&&(t["[[Writable]]"]=bf(e.writable)),Tn(e,"get")){var r=e.get;if(typeof r<"u"&&!X1(r))throw new rh("getter must be a function");t["[[Get]]"]=r}if(Tn(e,"set")){var i=e.set;if(typeof i<"u"&&!X1(i))throw new rh("setter must be a function");t["[[Set]]"]=i}if((Tn(t,"[[Get]]")||Tn(t,"[[Set]]"))&&(Tn(t,"[[Value]]")||Tn(t,"[[Writable]]")))throw new rh("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},Sf=re,jA=Yr,Q1=al,GA=lg,YA=h2,JA=d2,KA=ll,XA=p2,QA=WA,eE=function(e,t,r){if(!jA(e))throw new Sf("Assertion failed: Type(O) is not Object");if(!KA(t))throw new Sf("Assertion failed: P is not a Property Key");var i=Q1(r)?r:QA(r);if(!Q1(i))throw new Sf("Assertion failed: Desc is not a valid Property Descriptor");return GA(JA,XA,YA,e,t,i)},ev=re,tE=Yr,nE=eE,rE=ll,iE=function(e,t,r){if(!tE(e))throw new ev("Assertion failed: Type(O) is not Object");if(!rE(t))throw new ev("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return nE(e,t,i)},sE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,oE=tg,aE=oE.setPrototypeOf||null,lE=Ip,tv=sl,cE=re,g2={};try{g2.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var uE=!("toString"in g2),_f=tv&&tv(Object.prototype,"__proto__"),hE=uE&&(!!_f&&typeof _f.set=="function"&&lE([_f.set])||function(e,t){if(e==null)throw new cE("set Object.prototype.__proto__ called on null or undefined");return e.__proto__=t,t}),nv=sE,dE=aE,rv=hE,pE=re,fE=nv?function(e,t){if(nv(e,t))return e;throw new pE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:dE||(rv?function(e,t){return rv(e,t),e}:null),iv=re,mE=Yr,sv=o2,gE=function(e){if(!mE(e))throw new iv("Assertion failed: O must be an Object");if(!sv)throw new iv("This environment does not support fetching prototypes.");return sv(e)},vE=re,yE=fE,wE=Yr,bE=gE,SE=function(e,t){if(t!==null&&!wE(t))throw new vE("Assertion failed: V must be Object or Null");try{yE(e,t)}catch{return!1}return bE(e)===t},Af=cg,ov=iE,v2=SE,_E=Rp(),ug=e2;function Nu(n,e,t){var r=new ug(t);return v2(r,xh),delete r.constructor,ov(r,"error",n),ov(r,"suppressed",e),r}_E&&Object.defineProperty(Nu,"prototype",{writable:!1});var xh=Nu.prototype;if(!Af(xh,"constructor",Nu)||!Af(xh,"message","")||!Af(xh,"name","SuppressedError"))throw new ug("unable to install SuppressedError.prototype properties; please report this!");v2(Nu.prototype,ug.prototype);var AE=Nu,EE=AE,y2=function(){return typeof SuppressedError=="function"?SuppressedError:EE},kE=mo,av=eg(),CE=y2,TE=function(){var e=CE();return kE(av,{SuppressedError:e},{SuppressedError:function(){return av.SuppressedError!==e}}),e};TE();var $E=re,RE=al,IE=u2,xE=function(e){if(typeof e<"u"&&!RE(e))throw new $E("Assertion failed: `Desc` must be a Property Descriptor");return IE(e)},PE=re,lv=Jr,LE=al,DE=function(e){if(typeof e>"u")return!1;if(!LE(e))throw new PE("Assertion failed: `Desc` must be a Property Descriptor");return!(!lv(e,"[[Value]]")&&!lv(e,"[[Writable]]"))},cv=rg,ME=function(e,t){return e===t?e===0?1/e===1/t:!0:cv(e)&&cv(t)},cl=m2,OE=function(e){return!!e},$n=Jr,ih=re,NE=Yr,uv=cl,Ef=OE,zE=function(e){if(!NE(e))throw new ih("ToPropertyDescriptor requires an object");var t={};if($n(e,"enumerable")&&(t["[[Enumerable]]"]=Ef(e.enumerable)),$n(e,"configurable")&&(t["[[Configurable]]"]=Ef(e.configurable)),$n(e,"value")&&(t["[[Value]]"]=e.value),$n(e,"writable")&&(t["[[Writable]]"]=Ef(e.writable)),$n(e,"get")){var r=e.get;if(typeof r<"u"&&!uv(r))throw new ih("getter must be a function");t["[[Get]]"]=r}if($n(e,"set")){var i=e.set;if(typeof i<"u"&&!uv(i))throw new ih("setter must be a function");t["[[Set]]"]=i}if(($n(t,"[[Get]]")||$n(t,"[[Set]]"))&&($n(t,"[[Value]]")||$n(t,"[[Writable]]")))throw new ih("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t},kf=re,ZE=Yr,hv=al,HE=lg,UE=xE,FE=DE,VE=ll,BE=ME,qE=zE,zu=function(e,t,r){if(!ZE(e))throw new kf("Assertion failed: Type(O) is not Object");if(!VE(t))throw new kf("Assertion failed: P is not a Property Key");var i=hv(r)?r:qE(r);if(!hv(i))throw new kf("Assertion failed: Desc is not a valid Property Descriptor");return HE(FE,BE,UE,e,t,i)},WE=ol(),jE=WE?Symbol.dispose||Symbol("Symbol.dispose"):null,GE=ol,YE=jE,hg=function(){return GE()&&Symbol.dispose||YE},JE=ig,KE=zu,XE=hg,QE=function(){var e=XE();return JE()&&KE(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},ek=ol(),tk=ek?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,nk=ol,rk=tk,dg=function(){return nk()&&Symbol.asyncDispose||rk},ik=ig,sk=zu,ok=dg,ak=function(){var e=ok();return ik()&&sk(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":e}),e},lk=ag(),ck=rn,uk=Gi(),hk=re,dk=lk,pk=ck("%Reflect.apply%",!0)||uk("Function.prototype.apply"),xp=function(e,t){var r=arguments.length>2?arguments[2]:[];if(!dk(r))throw new hk("Assertion failed: optional `argumentsList`, if provided, must be a List");return pk(e,t,r)};const fk={},mk=Object.freeze(Object.defineProperty({__proto__:null,default:fk},Symbol.toStringTag,{value:"Module"})),gk=H_(mk);var pg=typeof Map=="function"&&Map.prototype,Cf=Object.getOwnPropertyDescriptor&&pg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fd=pg&&Cf&&typeof Cf.get=="function"?Cf.get:null,dv=pg&&Map.prototype.forEach,fg=typeof Set=="function"&&Set.prototype,Tf=Object.getOwnPropertyDescriptor&&fg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,md=fg&&Tf&&typeof Tf.get=="function"?Tf.get:null,pv=fg&&Set.prototype.forEach,vk=typeof WeakMap=="function"&&WeakMap.prototype,oc=vk?WeakMap.prototype.has:null,yk=typeof WeakSet=="function"&&WeakSet.prototype,ac=yk?WeakSet.prototype.has:null,wk=typeof WeakRef=="function"&&WeakRef.prototype,fv=wk?WeakRef.prototype.deref:null,bk=Boolean.prototype.valueOf,Sk=Object.prototype.toString,_k=Function.prototype.toString,Ak=String.prototype.match,mg=String.prototype.slice,Zi=String.prototype.replace,Ek=String.prototype.toUpperCase,mv=String.prototype.toLowerCase,w2=RegExp.prototype.test,gv=Array.prototype.concat,tr=Array.prototype.join,kk=Array.prototype.slice,vv=Math.floor,u0=typeof BigInt=="function"?BigInt.prototype.valueOf:null,$f=Object.getOwnPropertySymbols,h0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qa=typeof Symbol=="function"&&typeof Symbol.iterator=="object",lc=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qa||!0)?Symbol.toStringTag:null,b2=Object.prototype.propertyIsEnumerable,yv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function wv(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||w2.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-vv(-n):vv(n);if(r!==n){var i=String(r),o=mg.call(e,i.length+1);return Zi.call(i,t,"$&_")+"."+Zi.call(Zi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zi.call(e,t,"$&_")}var d0=gk,bv=d0.custom,Sv=A2(bv)?bv:null,S2={__proto__:null,double:'"',single:"'"},Ck={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ul=function n(e,t,r,i){var o=t||{};if(pr(o,"quoteStyle")&&!pr(S2,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=pr(o,"customInspect")?o.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return k2(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?wv(e,c):c}if(typeof e=="bigint"){var d=String(e)+"n";return l?wv(e,d):d}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof e=="object")return p0(e)?"[Array]":"[Object]";var g=Bk(o,r);if(typeof i>"u")i=[];else if(E2(i,e)>=0)return"[Circular]";function y(Ze,le,sr){if(le&&(i=kk.call(i),i.push(le)),sr){var Zt={depth:o.depth};return pr(o,"quoteStyle")&&(Zt.quoteStyle=o.quoteStyle),n(Ze,Zt,r+1,i)}return n(Ze,o,r+1,i)}if(typeof e=="function"&&!_v(e)){var v=Mk(e),_=sh(e,y);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(_.length>0?" { "+tr.call(_,", ")+" }":"")}if(A2(e)){var E=Qa?Zi.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):h0.call(e);return typeof e=="object"&&!Qa?kl(E):E}if(Uk(e)){for(var x="<"+mv.call(String(e.nodeName)),B=e.attributes||[],P=0;P<B.length;P++)x+=" "+B[P].name+"="+_2(Tk(B[P].value),"double",o);return x+=">",e.childNodes&&e.childNodes.length&&(x+="..."),x+="</"+mv.call(String(e.nodeName))+">",x}if(p0(e)){if(e.length===0)return"[]";var J=sh(e,y);return g&&!Vk(J)?"["+f0(J,g)+"]":"[ "+tr.call(J,", ")+" ]"}if(Rk(e)){var O=sh(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!b2.call(e,"cause")?"{ ["+String(e)+"] "+tr.call(gv.call("[cause]: "+y(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+tr.call(O,", ")+" }"}if(typeof e=="object"&&a){if(Sv&&typeof e[Sv]=="function"&&d0)return d0(e,{depth:f-r});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ok(e)){var Y=[];return dv&&dv.call(e,function(Ze,le){Y.push(y(le,e,!0)+" => "+y(Ze,e))}),Av("Map",fd.call(e),Y,g)}if(Zk(e)){var U=[];return pv&&pv.call(e,function(Ze){U.push(y(Ze,e))}),Av("Set",md.call(e),U,g)}if(Nk(e))return Rf("WeakMap");if(Hk(e))return Rf("WeakSet");if(zk(e))return Rf("WeakRef");if(xk(e))return kl(y(Number(e)));if(Lk(e))return kl(y(u0.call(e)));if(Pk(e))return kl(bk.call(e));if(Ik(e))return kl(y(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof ls<"u"&&e===ls)return"{ [object globalThis] }";if(!$k(e)&&!_v(e)){var j=sh(e,y),fe=yv?yv(e)===Object.prototype:e instanceof Object||e.constructor===Object,de=e instanceof Object?"":"null prototype",Ve=!fe&&lc&&Object(e)===e&&lc in e?mg.call(Yi(e),8,-1):de?"Object":"",ve=fe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Xe=ve+(Ve||de?"["+tr.call(gv.call([],Ve||[],de||[]),": ")+"] ":"");return j.length===0?Xe+"{}":g?Xe+"{"+f0(j,g)+"}":Xe+"{ "+tr.call(j,", ")+" }"}return String(e)};function _2(n,e,t){var r=t.quoteStyle||e,i=S2[r];return i+n+i}function Tk(n){return Zi.call(String(n),/"/g,"&quot;")}function go(n){return!lc||!(typeof n=="object"&&(lc in n||typeof n[lc]<"u"))}function p0(n){return Yi(n)==="[object Array]"&&go(n)}function $k(n){return Yi(n)==="[object Date]"&&go(n)}function _v(n){return Yi(n)==="[object RegExp]"&&go(n)}function Rk(n){return Yi(n)==="[object Error]"&&go(n)}function Ik(n){return Yi(n)==="[object String]"&&go(n)}function xk(n){return Yi(n)==="[object Number]"&&go(n)}function Pk(n){return Yi(n)==="[object Boolean]"&&go(n)}function A2(n){if(Qa)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!h0)return!1;try{return h0.call(n),!0}catch{}return!1}function Lk(n){if(!n||typeof n!="object"||!u0)return!1;try{return u0.call(n),!0}catch{}return!1}var Dk=Object.prototype.hasOwnProperty||function(n){return n in this};function pr(n,e){return Dk.call(n,e)}function Yi(n){return Sk.call(n)}function Mk(n){if(n.name)return n.name;var e=Ak.call(_k.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function E2(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function Ok(n){if(!fd||!n||typeof n!="object")return!1;try{fd.call(n);try{md.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Nk(n){if(!oc||!n||typeof n!="object")return!1;try{oc.call(n,oc);try{ac.call(n,ac)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function zk(n){if(!fv||!n||typeof n!="object")return!1;try{return fv.call(n),!0}catch{}return!1}function Zk(n){if(!md||!n||typeof n!="object")return!1;try{md.call(n);try{fd.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Hk(n){if(!ac||!n||typeof n!="object")return!1;try{ac.call(n,ac);try{oc.call(n,oc)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Uk(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function k2(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return k2(mg.call(n,0,e.maxStringLength),e)+r}var i=Ck[e.quoteStyle||"single"];i.lastIndex=0;var o=Zi.call(Zi.call(n,i,"\\$1"),/[\x00-\x1f]/g,Fk);return _2(o,"single",e)}function Fk(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Ek.call(e.toString(16))}function kl(n){return"Object("+n+")"}function Rf(n){return n+" { ? }"}function Av(n,e,t,r){var i=r?f0(t,r):tr.call(t,", ");return n+" ("+e+") {"+i+"}"}function Vk(n){for(var e=0;e<n.length;e++)if(E2(n[e],`
2
- `)>=0)return!1;return!0}function Bk(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=tr.call(Array(n.indent+1)," ");else return null;return{base:t,prev:tr.call(Array(e+1),t)}}function f0(n,e){if(n.length===0)return"";var t=`
3
- `+e.prev+e.base;return t+tr.call(n,","+t)+`
4
- `+e.prev}function sh(n,e){var t=p0(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=pr(n,i)?e(n[i],n):""}var o=typeof $f=="function"?$f(n):[],a;if(Qa){a={};for(var l=0;l<o.length;l++)a["$"+o[l]]=o[l]}for(var c in n)pr(n,c)&&(t&&String(Number(c))===c&&c<n.length||Qa&&a["$"+c]instanceof Symbol||(w2.call(/[^\w$]/,c)?r.push(e(c,n)+": "+e(n[c],n)):r.push(c+": "+e(n[c],n))));if(typeof $f=="function")for(var d=0;d<o.length;d++)b2.call(n,o[d])&&r.push("["+e(o[d])+"]: "+e(n[o[d]],n));return r}var qk=ul,Wk=re,Pp=function(n,e,t){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===e)return r.next=i.next,t||(i.next=n.next,n.next=i),i},jk=function(n,e){if(n){var t=Pp(n,e);return t&&t.value}},Gk=function(n,e,t){var r=Pp(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},Yk=function(n,e){return n?!!Pp(n,e):!1},Jk=function(n,e){if(n)return Pp(n,e,!0)},Kk=function(){var e,t={assert:function(r){if(!t.has(r))throw new Wk("Side channel does not contain "+qk(r))},delete:function(r){var i=Jk(e,r);return i&&e&&!e.next&&(e=void 0),!!i},get:function(r){return jk(e,r)},has:function(r){return Yk(e,r)},set:function(r,i){e||(e={next:void 0}),Gk(e,r,i)}};return t},Xk=rn,Zu=Gi(),Qk=ul,e3=re,Ev=Xk("%Map%",!0),t3=Zu("Map.prototype.get",!0),n3=Zu("Map.prototype.set",!0),r3=Zu("Map.prototype.has",!0),i3=Zu("Map.prototype.delete",!0),s3=Zu("Map.prototype.size",!0),C2=!!Ev&&function(){var e,t={assert:function(r){if(!t.has(r))throw new e3("Side channel does not contain "+Qk(r))},delete:function(r){if(e){var i=i3(e,r);return s3(e)===0&&(e=void 0),i}return!1},get:function(r){if(e)return t3(e,r)},has:function(r){return e?r3(e,r):!1},set:function(r,i){e||(e=new Ev),n3(e,r,i)}};return t},o3=rn,Lp=Gi(),a3=ul,oh=C2,l3=re,To=o3("%WeakMap%",!0),c3=Lp("WeakMap.prototype.get",!0),u3=Lp("WeakMap.prototype.set",!0),h3=Lp("WeakMap.prototype.has",!0),d3=Lp("WeakMap.prototype.delete",!0),p3=To?function(){var e,t,r={assert:function(i){if(!r.has(i))throw new l3("Side channel does not contain "+a3(i))},delete:function(i){if(To&&i&&(typeof i=="object"||typeof i=="function")){if(e)return d3(e,i)}else if(oh&&t)return t.delete(i);return!1},get:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?c3(e,i):t&&t.get(i)},has:function(i){return To&&i&&(typeof i=="object"||typeof i=="function")&&e?h3(e,i):!!t&&t.has(i)},set:function(i,o){To&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new To),u3(e,i,o)):oh&&(t||(t=oh()),t.set(i,o))}};return r}:oh,f3=re,m3=ul,g3=Kk,v3=C2,y3=p3,w3=y3||v3||g3,b3=function(){var e,t={assert:function(r){if(!t.has(r)){var i=r&&Object(r)===r?"the given object key":m3(r);throw new f3("Side channel does not contain "+i)}},delete:function(r){return!!e&&e.delete(r)},get:function(r){return e&&e.get(r)},has:function(r){return!!e&&e.has(r)},set:function(r,i){e||(e=w3()),e.set(r,i)}};return t},S3=Jr,Cl=b3(),cr=re,gg={assert:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");if(Cl.assert(n),!gg.has(n,e))throw new cr("`"+e+"` is not present on `O`")},get:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return t&&t["$"+e]},has:function(n,e){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var t=Cl.get(n);return!!t&&S3(t,"$"+e)},set:function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new cr("`O` is not an object");if(typeof e!="string")throw new cr("`slot` must be a string");var r=Cl.get(n);r||(r={},Cl.set(n,r)),r["$"+e]=t}};Object.freeze&&Object.freeze(gg);var vg=gg,T2=Gr,Fi=vg,Hu=function n(e,t){if(!(this instanceof n))return new n(e,t);if(e!=="normal"&&e!=="break"&&e!=="continue"&&e!=="return"&&e!=="throw")throw new T2('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Fi.set(this,"[[Type]]",e),Fi.set(this,"[[Value]]",t)};Hu.prototype.type=function(){return Fi.get(this,"[[Type]]")};Hu.prototype.value=function(){return Fi.get(this,"[[Value]]")};Hu.prototype["?"]=function(){var e=Fi.get(this,"[[Type]]"),t=Fi.get(this,"[[Value]]");if(e==="throw")throw t;return t};Hu.prototype["!"]=function(){var e=Fi.get(this,"[[Type]]");if(e!=="normal")throw new T2('Assertion failed: Completion Record is not of type "normal"');return Fi.get(this,"[[Value]]")};var yg=Hu,_3=yg,wg=function(e){return new _3("normal",e)},If,kv;function A3(){if(kv)return If;kv=1;var n=ol;return If=function(){return n()&&!!Symbol.toStringTag},If}var E3=rn,Cv=E3("%Object.defineProperty%",!0),k3=A3()(),C3=Jr,T3=re,ah=k3?Symbol.toStringTag:null,$2=function(e,t){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new T3("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ah&&(r||!C3(e,ah))&&(Cv?Cv(e,ah,{configurable:!i,enumerable:!1,value:t,writable:!1}):e[ah]=t)},R2={exports:{}},$3=rn,Tv=Ww,R3=Rp(),$v=sl,Rv=re,I3=$3("%Math.floor%"),x3=function(e,t){if(typeof e!="function")throw new Rv("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||I3(t)!==t)throw new Rv("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&$v){var a=$v(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!r)&&(R3?Tv(e,"length",t,!0,!0):Tv(e,"length",t)),e},P3=Du,L3=og(),D3=r2,M3=function(){return D3(P3,L3,arguments)};(function(n){var e=x3,t=Lu,r=Ip,i=M3;n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return e(l,c>0?c:0,!0)},t?t(n.exports,"apply",{value:i}):n.exports.apply=i})(R2);var bg=R2.exports,O3=function(e,t){for(var r=0;r<e.length;r+=1)if(!t(e[r],r,e))return!1;return!0},N3=Object,z3=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||N3(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},Z3=Jr,H3=ag(),U3=O3,F3=z3,V3=function(e){return e&&typeof e=="object"&&Z3(e,"[[DisposableResourceStack]]")&&H3(e["[[DisposableResourceStack]]"])&&(e["[[DisposableResourceStack]]"].length===0||U3(e["[[DisposableResourceStack]]"],F3))},B3=Yr,q3=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(B3(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},W3=q3,Sg=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":W3(e)},j3=re,G3=ul,Y3=ll,J3=function(e,t){if(!Y3(t))throw new j3("Assertion failed: P is not a Property Key, got "+G3(t));return e[t]},Iv=re,K3=J3,X3=cl,Q3=ll,xv=ul,eC=function(e,t){if(!Q3(t))throw new Iv("Assertion failed: P is not a Property Key");var r=K3(e,t);if(r!=null){if(!X3(r))throw new Iv(xv(t)+" is not a function: "+xv(r));return r}},m0={exports:{}},tC=rn,nC=tC,Pv=nC("%Reflect.construct%",!0),gd=zu;try{gd({},"",{"[[Get]]":function(){}})}catch{gd=null}if(gd&&Pv){var Lv={},Dv={};gd(Dv,"length",{"[[Get]]":function(){throw Lv},"[[Enumerable]]":!0}),m0.exports=function(e){try{Pv(e,Dv)}catch(t){return t===Lv}}}else m0.exports=function(e){return typeof e=="function"&&!!e.prototype};var rC=m0.exports,xf=re,Mv=cl,iC=rC,sC=function(e){if(!iC(e))throw new xf("C must be a constructor");var t={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new e(function(i,o){if(typeof t["[[Resolve]]"]<"u"||typeof t["[[Reject]]"]<"u")throw new xf("executor has already been called");t["[[Resolve]]"]=i,t["[[Reject]]"]=o});if(!Mv(t["[[Resolve]]"])||!Mv(t["[[Reject]]"]))throw new xf("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":t["[[Resolve]]"],"[[Reject]]":t["[[Reject]]"]}},Ov=Gr,oC=re,Pf=xp,Nv=eC,aC=sC,lC=Sg,zv=hg(),Zv=dg(),cC=function(e,t){if(lC(e)!=="Object")throw new oC("`V` must be an Object");if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new Ov("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(t==="ASYNC-DISPOSE"&&Zv&&(r=Nv(e,Zv)),!r){if(!zv)throw new Ov("`Symbol.dispose` is not supported");if(r=Nv(e,zv),typeof r<"u")return function(){var i=this;if(t==="ASYNC-DISPOSE"){var o=aC(Promise);try{Pf(r,i),Pf(o["[[Resolve]]"],void 0,[void 0])}catch(a){o["[[Reject]]"](a)}return o["[[Promise]]"]}Pf(r,i)}}return r},uC=Gr,Lf=re,hC=cl,dC=Sg,pC=cC,fC=function(e,t){if(t!=="SYNC-DISPOSE"&&t!=="ASYNC-DISPOSE")throw new uC("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(e==null)e=void 0,r=void 0;else{if(typeof e<"u"&&dC(e)!=="Object")throw new Lf("`V` must be an Object, or `null` or `undefined`");if(r=pC(e,t),typeof r>"u")throw new Lf("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!hC(r))throw new Lf("`method`, when provided, must be a function");return{"[[ResourceValue]]":e,"[[Hint]]":t,"[[DisposeMethod]]":r}},mC=Gr,lh=re,gC=V3,Hv=fC,vC=Gi(),yC=vC("Array.prototype.push"),I2=function(e,t,r){if(!gC(e))throw new lh("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new mC("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var i=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof i!="function")throw new lh("Assertion failed: `method`, when present, must be a function");if(!e["[[DisposableResourceStack]]"])throw new lh("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var o;if(arguments.length<4){if(t==null&&r==="SYNC_DISPOSE")return"UNUSED";o=Hv(t,r)}else{if(typeof t<"u")throw new lh("Assertion failed: `V` must be undefined when `method` is present");o=Hv(void 0,r,i)}return yC(e["[[DisposableResourceStack]]"],o),"UNUSED"},Df,Uv;function _g(){if(Uv)return Df;Uv=1;var n=rn,e=bg,t=Gr,r=n("%Promise.resolve%",!0),i=r&&e(r);return Df=function(a,l){if(!i)throw new t("This environment does not support Promises.");return i(a,l)},Df}var Mf,Fv;function wC(){if(Fv)return Mf;Fv=1;var n=rn,e=Gr,t=n("%Promise%",!0),r=xp,i=_g(),o=Sg;return Mf=function(l,c,d){if(typeof l<"u"&&o(l)!=="Object")throw new e("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new e("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof d<"u"&&typeof d!="function")throw new e("Assertion failed: `method` must be `undefined` or a function");var f=typeof d>"u"?d:r(d,l);if(c==="ASYNC-DISPOSE")return i(t,f)},Mf}var Of,Vv;function bC(){if(Vv)return Of;Vv=1;var n=yg;return Of=function(t){return new n("throw",t)},Of}var SC=rn,Nf=Gr,Bv=re,_C=SC("%Promise%",!0),AC=Gi(),qv=AC("Promise.prototype.then",!0),EC=yg,Wv=wC(),kC=wg,CC=_g(),jv=bC(),TC=y2(),x2=function(e,t){if(!(t instanceof EC))throw new Bv("`completion` must be a Completion Record");var r=e["[[DisposableResourceStack]]"];if(!r)throw new Bv("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,o=r.length-1;o>=0;o-=1)if(!i)i=r[o]["[[Hint]]"];else if(i!==r[o]["[[Hint]]"])throw new Nf("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&CC(_C,t),l=function(y){if(t.type()==="throw"){var v=t.value(),_=new TC(y,v);t=jv(_)}else t=jv(y)},c=i==="ASYNC-DISPOSE"&&function(v){return qv(a,function(){var _=Wv(v["[[ResourceValue]]"],v["[[Hint]]"],v["[[DisposeMethod]]"]);if(!_)throw new Nf("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return qv(_,kC)},l)},d=r.length-1;d>=0;d-=1)if(i==="ASYNC-DISPOSE")a=c(r[d]);else{var f=r[d];try{var g=Wv(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(g)throw new Nf("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(y){l(y)}}return e["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:t},P2=function(){var e=[];return{"[[DisposableResourceStack]]":e}},Dp=ng,Ag=re,$C=xp,hl=cg,RC=zu,L2=cl,IC=wg,Et=vg,xC=$2,D2=mo.supportsDescriptors,PC=bg,Eg=I2,LC=x2,M2=P2,Gv=hg(),en=function n(){if(!(this instanceof n)||Et.has(this,"[[DisposableState]]")||Et.has(this,"[[DisposeCapability]]"))throw new Ag("can only be used with new");Et.set(this,"[[DisposableState]]","PENDING"),Et.set(this,"[[DisposeCapability]]",M2())},O2=function(){var e=this;return Et.assert(e,"[[DisposableState]]"),Et.get(e,"[[DisposableState]]")==="DISPOSED"},Uu=PC(O2);D2?RC(en.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":O2}):en.prototype.disposed=!1;var N2=function(e){Et.set(e,"[[DisposableState]]","DISPOSED"),D2||(e.disposed=!0)};hl(en.prototype,"dispose",function(){var e=this;if(!Uu(e))return N2(e),LC(Et.get(e,"[[DisposeCapability]]"),IC())["?"]()});hl(en.prototype,"use",function(e){var t=this;if(Uu(t))throw new Dp("a disposed stack can not use anything new");return Eg(Et.get(t,"[[DisposeCapability]]"),e,"SYNC-DISPOSE"),e});hl(en.prototype,"adopt",function(e,t){var r=this;if(Uu(r))throw new Dp("a disposed stack can not use anything new");if(!L2(t))throw new Ag("`onDispose` must be a function");var i=function(){return $C(t,void 0,[e])};return Eg(Et.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),e});hl(en.prototype,"defer",function(e){var t=this;if(Uu(t))throw new Dp("a disposed stack can not defer anything new");if(!L2(e))throw new Ag("`onDispose` must be a function");Eg(Et.get(t,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",e)});hl(en.prototype,"move",function(){var e=this;if(Uu(e))throw new Dp("a disposed stack can not use anything new");var t=new en;return Et.set(t,"[[DisposeCapability]]",Et.get(e,"[[DisposeCapability]]")),Et.set(e,"[[DisposeCapability]]",M2()),N2(e),t});Gv&&hl(en.prototype,Gv,en.prototype.dispose);xC(en.prototype,"DisposableStack");var DC=en,MC=DC,OC=function(){return typeof DisposableStack=="function"?DisposableStack:MC},NC=mo,zC=eg(),ZC=OC,HC=function(){var e=ZC();return NC(zC,{DisposableStack:e},{DisposableStack:!0}),e},UC=rn,Mp=ng,kg=re,Yv=UC("%Promise%",!0),Cg=I2,FC=xp,dl=cg,VC=zu,BC=x2,z2=cl,Z2=P2,qC=wg,Jv=_g(),kt=vg,WC=$2,H2=mo.supportsDescriptors,jC=bg,GC=Gi(),YC=GC("Promise.prototype.then",!0),Kv=dg(),tn=function n(){if(!(this instanceof n)||kt.has(this,"[[AsyncDisposableState]]")||kt.has(this,"[[DisposeCapability]]"))throw new kg("can only be used with new");kt.set(this,"[[AsyncDisposableState]]","pending"),kt.set(this,"[[DisposeCapability]]",Z2())},U2=function(){var e=this;return kt.assert(e,"[[AsyncDisposableState]]"),kt.get(e,"[[AsyncDisposableState]]")==="disposed"},Fu=jC(U2);H2?VC(tn.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":U2}):tn.prototype.disposed=!1;var F2=function(e){kt.set(e,"[[AsyncDisposableState]]","disposed"),H2||(e.disposed=!0)};dl(tn.prototype,"disposeAsync",function(){var e=this;return Fu(e)?Jv(Yv):(F2(e),YC(Jv(Yv,BC(kt.get(e,"[[DisposeCapability]]"),qC())),function(t){return t["?"]()}))});dl(tn.prototype,"use",function(e){var t=this;if(Fu(t))throw new Mp("a disposed stack can not use anything new");return Cg(kt.get(t,"[[DisposeCapability]]"),e,"ASYNC-DISPOSE"),e});dl(tn.prototype,"adopt",function(e,t){var r=this;if(Fu(r))throw new Mp("a disposed stack can not use anything new");if(!z2(t))throw new kg("`onDisposeAsync` must be a function");var i=function(){return FC(t,void 0,[e])};return i.value=e,Cg(kt.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),e});dl(tn.prototype,"defer",function(e){var t=this;if(Fu(t))throw new Mp("a disposed stack can not defer anything new");if(!z2(e))throw new kg("`onDispose` must be a function");Cg(kt.get(t,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",e)});dl(tn.prototype,"move",function(){var e=this;if(Fu(e))throw new Mp("a disposed stack can not use anything new");var t=new tn;return kt.set(t,"[[DisposeCapability]]",kt.get(e,"[[DisposeCapability]]")),kt.set(e,"[[DisposeCapability]]",Z2()),F2(e),t});Kv&&dl(tn.prototype,Kv,tn.prototype.disposeAsync);WC(tn.prototype,"AsyncDisposableStack");var JC=tn,KC=JC,XC=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:KC},QC=mo,eT=eg(),tT=XC,nT=function(){var e=tT();return QC(eT,{AsyncDisposableStack:e},{AsyncDisposableStack:!0}),e},rT=QE,iT=ak,sT=HC,oT=nT,aT=function(){rT(),iT(),sT(),oT()};aT();const Xv=new WeakMap;function lT(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function $o(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function Qv(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function cT(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class uT{constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(e,t){if(t===void 0){if(typeof e!="function")throw Qv();this.validateClassRegistration(e),this.storeFactory(e,()=>this.instantiateClass(e));return}if(typeof t!="function")throw Qv();if(t.constructor.name==="AsyncFunction")throw cT();this.storeFactory(e,t)}has(e){var t;return((t=this.entries.get(e))==null?void 0:t.factory)!==void 0}resolve(e){return this.resolveAny(e)}storeFactory(e,t){const r=this.getOrCreateEntry(e);r.factory=t,r.instance=void 0,r.error=void 0}validateClassRegistration(e){const t=Xv.get(e);if(t){if(e.length!==t.length)throw new Error(`${$o(e)} cannot be registered with register(Class). @injectable(...) declared ${t.length} dependencies but constructor arity is ${e.length}. Use register(Key, () => value) instead.`);return}if(e.length!==0)throw new Error(`${$o(e)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(e){const t=Xv.get(e);if(!t)return new e;const r=t.map(i=>this.resolveAny(i));return new e(...r)}resolveAny(e){return this.getOrCreateEntry(e).proxy}getOrCreateEntry(e){let t=this.entries.get(e);return t||(t={key:e},t.proxy=this.createProxy(t),this.entries.set(e,t),t)}createProxy(e){return new Proxy({},{get:(t,r)=>{if(r==="then")return;const i=this.getInstance(e),o=Reflect.get(i,r,i);return typeof o=="function"?o.bind(i):o},set:(t,r,i)=>{const o=this.getInstance(e);return Reflect.set(o,r,i,o)},has:(t,r)=>{const i=this.getInstance(e);return r in i}})}getInstance(e){if(e.instance)return e.instance;if(e.error)throw e.error;if(!e.factory)throw new Error(`${$o(e.key)} was resolved but never registered`);const t=this.constructionStack.indexOf(e.key);if(t!==-1){const r=[...this.constructionStack.slice(t),e.key].map(i=>$o(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(e.key);try{const r=e.factory();if(lT(r))throw new Error(`Factory for ${$o(e.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${$o(e.key)} returned a non-object value. Wrap primitives in an object.`);return e.instance=r,r}catch(r){throw e.error=r,r}finally{this.constructionStack.pop()}}}const V2=new uT,hT=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function dT(n){for(const e of Object.keys(n))if(hT.has(e))throw new Error(`Event payload key "${e}" is reserved; choose a different property name`)}function pT(n,e){dT(e);for(const t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0})}function sn(){class n extends Event{constructor(t,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(t,{bubbles:o,cancelable:a,composed:l}),pT(this,c)}}return n}class Kr extends globalThis.EventTarget{}const fT="X-Television-Client-Meta",mT="telemetry-activity",gT="telemetry-signal",B2={kind:"single",full_screen:!1},q2={width:560,height:740};function vT(n){return n.layout.flatMap(e=>e.artifactIds)}function yT(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const e=[];for(const[t,r]of n.entries())wT(r,t,e);return{valid:e.length===0,errors:e}}function pc(n){return n.flatMap(e=>e.artifactIds)}function g0(n,e){return n.flatMap(t=>{if(!t.artifactIds.includes(e))return[t];const r=t.artifactIds.filter(i=>i!==e);return r.length===0?[]:[{...t,artifactIds:r}]})}function wT(n,e,t){if(!zf(n)){t.push(`Page ${e} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&t.push(`Page ${e} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?t.push(`Page ${e} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&t.push(`Page ${e} artifact ids must be non-empty strings`),!zf(n.geometry)){t.push(`Page ${e} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&t.push(`Page ${e} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){t.push(`Page ${e} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&t.push(`Page ${e} single geometry must include a boolean full_screen`),!zf(n.size)){t.push(`Page ${e} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&t.push(`Page ${e} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&t.push(`Page ${e} size ${r} must be a finite positive number`)}}function zf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const At=sn(),Ph=sn(),ey=sn(),bT=sn(),ST=sn(),_T=sn();function W2(n){class e extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return e}const pl=W2("RequestError"),ty=W2("ValidationError"),AT=200,ET=300,ch=401;class kT{constructor(e,t){C(this,"serverURL");C(this,"token");C(this,"onUnauthorized");C(this,"telemetryMeta");this.serverURL=e.replace(/\/$/,""),this.token=t.token,this.onUnauthorized=t.onUnauthorized,this.telemetryMeta=t.telemetryMeta}async requestJSON(e,t,r){var a;const i=await this.request(e,t,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),o=await CT(i);if(!i.ok||i.status<AT||i.status>=ET)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(e,t,r){var o;const i=await this.request(e,t,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 Zf(i,i.statusText),i.status)}async requestText(e,t){var i;const r=await this.request(e,t);if(!r.ok)throw r.status===ch&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Zf(r,r.statusText),r.status);return r.text()}async requestRawVoid(e,t,r){var o;const i=await this.request(e,t,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 Zf(i,i.statusText),i.status)}createError(e,t){const r={serverURL:this.serverURL};return t!==void 0&&(r.status=t),new pl(e,r)}async request(e,t,r,i){const o=`${this.serverURL}${t}`;try{return await fetch(o,{method:e,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(e){const t={...e??{}};return this.token&&(t.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(t[fT]=JSON.stringify(this.telemetryMeta)),Object.keys(t).length>0?t:void 0}}async function CT(n){try{return await n.json()}catch{const e=await n.text().catch(()=>"");return e?{message:e}:{}}}async function Zf(n,e){try{const t=await n.json();if(typeof t.error=="string")return t.error;if(typeof t.message=="string")return t.message}catch{}return e}function TT(n){return n.map(e=>`${e.name} (${e.id})`).join(", ")}var mr,Md,j2;class $T{constructor(e){p(this,Md);p(this,mr);h(this,mr,e)}list(){return s(this,mr).requestJSON("GET","/channels")}async get(e={}){const t=await u(this,Md,j2).call(this,e.channelID);return s(this,mr).requestJSON("GET",`/channels/${encodeURIComponent(t)}`)}create(e){const t={name:e.name};return e.id!==void 0&&(t.id=e.id),s(this,mr).requestJSON("POST","/channels",t)}update(e){const{channelID:t,...r}=e;return s(this,mr).requestJSON("PATCH",`/channels/${encodeURIComponent(t)}`,r)}remove(e){return s(this,mr).requestJSON("DELETE",`/channels/${encodeURIComponent(e.channelID)}`)}}mr=new WeakMap,Md=new WeakSet,j2=async function(e){if(e!==void 0)return e;const{channels:t}=await this.list();if(t.length===1)return t[0].id;throw t.length===0?new ty("channelID is required, but no channels exist."):new ty(`channelID is required when multiple channels exist. Available channels: ${TT(t)}`)};var gr;class RT{constructor(e){p(this,gr);h(this,gr,e)}create(e){const t={kind:e.kind,title:e.title};switch(e.kind){case"path":t.path=e.path;break;case"url":t.url=e.url;break}return t.channelID=e.channelID,s(this,gr).requestJSON("POST","/artifacts",t)}list(e={}){const t=new URLSearchParams;e.channelID!==void 0&&t.set("channelID",e.channelID);const r=t.toString();return s(this,gr).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(e){return s(this,gr).requestJSON("GET",`/artifacts/${encodeURIComponent(e.artifactID)}`)}update(e){const t={};return e.title!==void 0&&(t.title=e.title),e.path!==void 0&&(t.path=e.path),e.url!==void 0&&(t.url=e.url),s(this,gr).requestJSON("PATCH",`/artifacts/${encodeURIComponent(e.artifactID)}`,t)}delete(e){return s(this,gr).requestJSON("DELETE",`/artifacts/${encodeURIComponent(e.artifactID)}`)}}gr=new WeakMap;var Xo;class IT{constructor(e){p(this,Xo);h(this,Xo,e)}list(){return s(this,Xo).requestJSON("GET","/themes")}refresh(){return s(this,Xo).requestJSON("POST","/themes/refresh")}}Xo=new WeakMap;var Qo;class xT{constructor(e){p(this,Qo);h(this,Qo,e)}get(e){return s(this,Qo).requestText("GET",`/markdown/${encodeURIComponent(e.artifactID)}`)}update(e){return s(this,Qo).requestRawVoid("PUT",`/markdown/${encodeURIComponent(e.artifactID)}`,e.content)}}Qo=new WeakMap;var fs;class PT{constructor(e){p(this,fs);h(this,fs,e)}status(){return s(this,fs).requestJSON("GET","/telemetry")}enable(){return s(this,fs).requestJSON("POST","/telemetry/enable")}disable(){return s(this,fs).requestJSON("POST","/telemetry/disable")}}fs=new WeakMap;var ms;class LT{constructor(e){p(this,ms);h(this,ms,e)}get(){return s(this,ms).requestJSON("GET","/display")}patch(e){const t={};return e.focusedChannelId!==void 0&&(t.focusedChannelId=e.focusedChannelId),e.pinnedChannelIds!==void 0&&(t.pinnedChannelIds=e.pinnedChannelIds),e.activeThemeName!==void 0&&(t.activeThemeName=e.activeThemeName),e.appearanceMode!==void 0&&(t.appearanceMode=e.appearanceMode),e.themeJavaScriptConsentIds!==void 0&&(t.themeJavaScriptConsentIds=e.themeJavaScriptConsentIds),s(this,ms).requestVoid("PATCH","/display",t)}focus(e){return s(this,ms).requestJSON("POST","/display/focus",{artifactID:e.artifactID})}}ms=new WeakMap;var Ht;class DT{constructor(e,t={}){C(this,"channels");C(this,"artifacts");C(this,"display");C(this,"themes");C(this,"markdown");C(this,"telemetry");p(this,Ht);h(this,Ht,new kT(e,t)),this.channels=new $T(s(this,Ht)),this.artifacts=new RT(s(this,Ht)),this.display=new LT(s(this,Ht)),this.themes=new IT(s(this,Ht)),this.markdown=new xT(s(this,Ht)),this.telemetry=new PT(s(this,Ht))}health(){return s(this,Ht).requestJSON("GET","/health")}demoMode(){return s(this,Ht).requestJSON("GET","/demo-mode")}}Ht=new WeakMap;const vd="0.0.0",MT=/^\d+\.\d+\.\d+$/,OT=3;function Op(n){return MT.test(n)}function Tg(n,e){const t=n.split(".").map(Number),r=e.split(".").map(Number);for(let i=0;i<OT;i++)if(t[i]!==r[i])return t[i]>r[i];return!1}function NT(n,e){return n===vd||e===vd?!1:n!==e}const zT=400,ZT=404,G2=500,HT=600,UT={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ee,bc,Sc,vr,xe,ce,gs,oi,vs,yr,$t,ea,_c,L,Rn,v0,xo,Y2,y0,J2,Lh,w0,K2,Po,X2,hr,b0,Q2,Ie;class FT extends Kr{constructor(t){super();p(this,L);p(this,ee);p(this,bc);p(this,Sc);p(this,vr,new Set);C(this,"pendingPageWrites",new Map);p(this,xe,new Map);p(this,ce,qT());p(this,gs);p(this,oi,!1);p(this,vs,!1);p(this,yr,0);p(this,$t,!1);p(this,ea,()=>{if(s(this,$t))return;const t=s(this,ee).connection.status==="connected";t&&!s(this,vs)?(h(this,vs,!0),u(this,L,X2).call(this)):!t&&s(this,vs)&&(h(this,vs,!1),h(this,yr,s(this,yr)+1)),u(this,L,hr).call(this)});p(this,_c,t=>{if(s(this,$t)||t.serverURL!==s(this,ee).connection.url)return;for(const i of s(this,vr))i.push(t.event);const r=t.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new ey("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){s(this,oi)&&yd(s(this,ce),s(this,xe),r.channelID,r.artifactID)&&u(this,L,hr).call(this),this.dispatchEvent(new bT("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new ST("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new _T("appearance-changed",{appearanceMode:r.appearanceMode})),s(this,oi)&&(uh(s(this,ce),r,this.pendingPageWrites,s(this,xe)),Hf(s(this,ce),s(this,xe)),u(this,L,hr).call(this))});h(this,ee,t.connectionOwner),h(this,bc,t.navigationKeyHandler),h(this,Sc,t.retainedGateHalted??(()=>!1)),h(this,gs,u(this,L,b0).call(this)),s(this,ee).addEventListener("change",s(this,ea)),s(this,ee).addEventListener("server-event",s(this,_c)),s(this,ea).call(this)}get snapshot(){return s(this,gs)}handleNavigationKey(t){var r;u(this,L,Ie).call(this),(r=s(this,bc))==null||r.call(this,t)}authenticate(t){return u(this,L,Ie).call(this),s(this,ee).authenticate(t)}async createChannel(t){u(this,L,Ie).call(this);const{channel:r}=await u(this,L,Rn).call(this,s(this,ee).connection.client.channels.create({name:t}),()=>u(this,L,Y2).call(this));return r}focusChannel(t){return u(this,L,Ie).call(this),u(this,L,Rn).call(this,s(this,ee).connection.client.display.patch({focusedChannelId:t}),()=>u(this,L,xo).call(this))}setPinnedChannelIds(t){return u(this,L,Ie).call(this),u(this,L,Rn).call(this,s(this,ee).connection.client.display.patch({pinnedChannelIds:[...t]}),()=>u(this,L,xo).call(this))}listThemes(){return u(this,L,Ie).call(this),s(this,ee).connection.client.themes.list()}refreshThemes(){return u(this,L,Ie).call(this),s(this,ee).connection.client.themes.refresh()}setActiveTheme(t){return u(this,L,Ie).call(this),u(this,L,Rn).call(this,s(this,ee).connection.client.display.patch({activeThemeName:t}),()=>u(this,L,xo).call(this))}setAppearanceMode(t){return u(this,L,Ie).call(this),u(this,L,Rn).call(this,s(this,ee).connection.client.display.patch({appearanceMode:t}),()=>u(this,L,xo).call(this))}setThemeJavaScriptConsent(t,r){u(this,L,Ie).call(this);const i=s(this,ce).display.themeJavaScriptConsentIds,o=r?i.includes(t)?[...i]:[...i,t]:i.filter(a=>a!==t);return u(this,L,Rn).call(this,s(this,ee).connection.client.display.patch({themeJavaScriptConsentIds:o}),()=>u(this,L,xo).call(this))}selectPage(t,r){u(this,L,Ie).call(this),yd(s(this,ce),s(this,xe),t,r)&&u(this,L,hr).call(this)}async renameChannel(t,r){u(this,L,Ie).call(this),await u(this,L,Rn).call(this,s(this,ee).connection.client.channels.update({channelID:t,name:r}),()=>u(this,L,y0).call(this,t))}async deleteChannel(t){u(this,L,Ie).call(this),await u(this,L,Rn).call(this,s(this,ee).connection.client.channels.remove({channelID:t}),()=>u(this,L,J2).call(this,t))}updateChannelPages(t,r){u(this,L,Ie).call(this);const i=yT(r),o=s(this,ce).channels.get(t);if(!i.valid||!o)return Promise.resolve();const a=us(r),l=us(o.channel.layout),c={previousPages:l};return uo(s(this,xe),t,l,a),o.channel={...o.channel,layout:a},this.pendingPageWrites.set(t,c),u(this,L,hr).call(this),s(this,ee).connection.client.channels.update({channelID:t,layout:us(a)}).then(()=>{this.pendingPageWrites.get(t)===c&&this.pendingPageWrites.delete(t)},async d=>{if(s(this,$t))throw d;const f=this.pendingPageWrites.get(t)===c;if(f&&this.pendingPageWrites.delete(t),ry(d))throw await u(this,L,v0).call(this,()=>u(this,L,y0).call(this,t)),d;if(!f||!JT(d))throw d;const g=s(this,ce).channels.get(t);if(!g)throw d;const y=us(c.previousPages);throw uo(s(this,xe),t,g.channel.layout,y),g.channel={...g.channel,layout:y},u(this,L,hr).call(this),d})}async deleteArtifact(t){u(this,L,Ie).call(this);const r=iy(s(this,ce),t);await u(this,L,Rn).call(this,s(this,ee).connection.client.artifacts.delete({artifactID:t}),()=>u(this,L,K2).call(this,t,r))}readMarkdown(t){return u(this,L,Ie).call(this),s(this,ee).connection.client.markdown.get({artifactID:t})}writeMarkdown(t,r){return u(this,L,Ie).call(this),s(this,ee).connection.client.markdown.update({artifactID:t,content:r})}get browserDemoMode(){return s(this,ee).connection.browserDemoMode}getArtifactViewURL(t){return u(this,L,Ie).call(this),s(this,ee).connection.getViewURL(t)}getArtifactContentURL(t){return u(this,L,Ie).call(this),s(this,ee).connection.getContentURL(t)}dispose(){s(this,$t)||(h(this,$t,!0),h(this,yr,s(this,yr)+1),s(this,vr).clear(),this.pendingPageWrites.clear(),s(this,xe).clear(),s(this,ee).removeEventListener("change",s(this,ea)),s(this,ee).removeEventListener("server-event",s(this,_c)))}}ee=new WeakMap,bc=new WeakMap,Sc=new WeakMap,vr=new WeakMap,xe=new WeakMap,ce=new WeakMap,gs=new WeakMap,oi=new WeakMap,vs=new WeakMap,yr=new WeakMap,$t=new WeakMap,ea=new WeakMap,_c=new WeakMap,L=new WeakSet,Rn=async function(t,r){try{return await t}catch(i){throw!s(this,$t)&&ry(i)&&await u(this,L,v0).call(this,r),i}},v0=async function(t){try{await t()}catch{}},xo=function(){const t=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>t.display.get(),r=>u(this,L,Lh).call(this,r))},Y2=function(){const t=s(this,ee).connection.client;return u(this,L,Po).call(this,async()=>{const[{channels:r},i]=await Promise.all([t.channels.list(),t.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,ce).channels.keys())o.has(a)||(this.pendingPageWrites.delete(a),s(this,xe).delete(a),s(this,ce).channels.delete(a));for(const a of r)s(this,ce).channels.has(a.id)||s(this,ce).channels.set(a.id,{channel:Jo(a),artifacts:new Map});u(this,L,Lh).call(this,i)})},y0=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Uf(()=>r.channels.get({channelID:t})),i=>u(this,L,w0).call(this,t,i))},J2=function(t){const r=s(this,ee).connection.client;return u(this,L,Po).call(this,async()=>{const[i,o]=await Promise.all([Uf(()=>r.channels.get({channelID:t})),r.display.get()]);return{detail:i,display:o}},({detail:i,display:o})=>{u(this,L,w0).call(this,t,i),u(this,L,Lh).call(this,o)})},Lh=function(t){s(this,ce).display=_0(t),s(this,ee).connection.acpClient.setEnabled(t.acpEnabled)},w0=function(t,r){this.pendingPageWrites.delete(t);const i=s(this,ce).channels.get(t);if(r===null){s(this,xe).delete(t),s(this,ce).channels.delete(t);return}uo(s(this,xe),t,(i==null?void 0:i.channel.layout)??[],r.channel.layout),s(this,ce).channels.set(t,{channel:Jo(r.channel),artifacts:new Map(r.artifacts.map(o=>[o.id,structuredClone(o)]))})},K2=function(t,r){const i=s(this,ee).connection.client;return u(this,L,Po).call(this,()=>Uf(()=>i.artifacts.get({artifactID:t})),o=>{const a=iy(s(this,ce),t)??r;if(o===null){a!==null&&uh(s(this,ce),{type:"artifact-removed",channelID:a,artifactID:t},this.pendingPageWrites,s(this,xe));return}const l=a===null?void 0:s(this,ce).channels.get(a);l==null||l.artifacts.set(t,structuredClone(o.artifact))})},Po=async function(t,r){const i=s(this,yr),o=[];s(this,vr).add(o);try{const a=await t();if(s(this,$t)||i!==s(this,yr))return;r(a);for(const l of o)uh(s(this,ce),l,this.pendingPageWrites,s(this,xe));Hf(s(this,ce),s(this,xe)),u(this,L,hr).call(this)}finally{s(this,vr).delete(o)}},X2=async function(){const t=++nh(this,yr)._,r=s(this,ee).connection,i=r.client,o=[];s(this,vr).add(o);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:g})=>i.channels.get({channelID:g})));if(s(this,$t)||t!==s(this,yr))return;const d={channels:new Map,display:_0(l)};for(const g of c)d.channels.set(g.channel.id,{channel:Jo(g.channel),artifacts:new Map(g.artifacts.map(y=>[y.id,structuredClone(y)]))});WT(s(this,xe),s(this,ce),d);for(const g of o)uh(d,g,this.pendingPageWrites,s(this,xe));Hf(d,s(this,xe));const f=s(this,oi)?VT(s(this,ce),d):[];this.pendingPageWrites.clear(),h(this,ce,d),h(this,oi,!0),r.acpClient.setEnabled(l.acpEnabled),u(this,L,hr).call(this);for(const g of f)this.dispatchEvent(new ey("artifact-content-changed",{artifactID:g}))}catch{}finally{s(this,vr).delete(o)}},hr=function(){s(this,$t)||(h(this,gs,u(this,L,b0).call(this)),u(this,L,Q2).call(this),this.dispatchEvent(new At("change")))},b0=function(){var o;const t=[...s(this,ce).channels.values()].map(a=>GT(a,s(this,xe).get(a.channel.id))),r=t.find(({id:a})=>a===s(this,ce).display.focusedChannelId)??null,i=s(this,ee).connection;return Object.freeze({ready:s(this,oi),channels:Object.freeze(t),display:YT(s(this,ce).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||s(this,Sc).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:s(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:BT(((o=i.updateState)==null?void 0:o.desktop)??null)})})},Q2=function(){const t=s(this,gs).focusedChannel;s(this,ee).connection.acpClient.setChannelContext(t?{channelID:t.id,channelName:t.name}:null)},Ie=function(){if(s(this,$t))throw new Error("ApplicationService is disposed")};function VT(n,e){const t=e.display.focusedChannelId;if(t===null||n.display.focusedChannelId!==t)return[];const r=n.channels.get(t),i=e.channels.get(t);if(!r||!i)return[];const o=new Set(pc(r.channel.layout));return pc(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 BT(n){return n===null?null:Object.freeze({...n})}function qT(){return{channels:new Map,display:_0(UT)}}function uh(n,e,t,r){switch(e.type){case"channel-created":r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:Jo(e.channel),artifacts:new Map});return;case"channel-updated":{t.delete(e.channel.id);const i=n.channels.get(e.channel.id);if(!i){r.delete(e.channel.id),n.channels.set(e.channel.id,{channel:Jo(e.channel),artifacts:new Map});return}uo(r,e.channel.id,i.channel.layout,e.channel.layout);const o=new Set(pc(e.channel.layout));i.channel=Jo(e.channel);for(const a of i.artifacts.keys())o.has(a)||i.artifacts.delete(a);return}case"channel-removed":t.delete(e.channelID),r.delete(e.channelID),n.channels.delete(e.channelID);return;case"channel-changed":n.display.focusedChannelId=e.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...e.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=e.themeName,n.display.activeThemeColorScheme=e.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...e.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=e.appearanceMode;return;case"artifact-created":{const i=n.channels.get(e.channelID);if(!i)return;const o=t.get(e.channelID);if(o&&(o.previousPages=ny(o.previousPages,e.artifact.id)),!pc(i.channel.layout).includes(e.artifact.id)){const a=i.channel.layout,l=ny(a,e.artifact.id);uo(r,e.channelID,a,l),i.channel={...i.channel,layout:l}}i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(e.artifact.id)){i.artifacts.set(e.artifact.id,structuredClone(e.artifact));return}return;case"artifact-removed":{const i=n.channels.get(e.channelID);if(!i)return;const o=t.get(e.channelID);o&&(o.previousPages=g0(o.previousPages,e.artifactID)),i.artifacts.delete(e.artifactID);const a=i.channel.layout,l=g0(a,e.artifactID);uo(r,e.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":yd(n,r,e.channelID,e.artifactID);return;case"artifact-content-changed":return;default:return KT(e)}}function WT(n,e,t){var r;for(const i of n.keys())t.channels.has(i)||n.delete(i);for(const[i,o]of t.channels)uo(n,i,((r=e.channels.get(i))==null?void 0:r.channel.layout)??[],o.channel.layout)}function uo(n,e,t,r){const i=n.get(e);if(i===void 0)return;if(r.length===0){n.delete(e);return}const o=S0(r,i);if(o!==-1){n.set(e,[...r[o].artifactIds]);return}const a=S0(t,i),l=a===-1?0:Math.min(a,r.length-1);n.set(e,[...r[l].artifactIds])}function yd(n,e,t,r){const i=n.channels.get(t),o=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!o)return!1;const a=e.get(t);return a&&jT(a,o.artifactIds)?!1:(e.set(t,[...o.artifactIds]),!0)}function Hf(n,e){var i,o;const t=n.display.focusedChannelId;if(t===null||e.has(t))return;const r=(o=(i=n.channels.get(t))==null?void 0:i.channel.layout[0])==null?void 0:o.artifactIds[0];r!==void 0&&yd(n,e,t,r)}function S0(n,e){const t=new Set(e);return n.findIndex(r=>r.artifactIds.some(i=>t.has(i)))}function jT(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function GT(n,e){const t=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=e===void 0?0:S0(n.channel.layout,e),i=t[r]??t[0]??null,o=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:t,selectedPage:i,artifacts:o};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function YT(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 ny(n,e){return pc(n).includes(e)?us(n):[...us(n),{artifactIds:[e],geometry:{...B2},size:{...q2}}]}function JT(n){return n instanceof pl&&n.status!==void 0&&n.status>=zT&&n.status<G2}function ry(n){return n instanceof pl&&(n.status===void 0||n.status>=G2&&n.status<HT)}async function Uf(n){try{return await n()}catch(e){if(e instanceof pl&&e.status===ZT)return null;throw e}}function iy(n,e){for(const[t,r]of n.channels)if(r.artifacts.has(e))return t;return null}function us(n){return n.map(e=>({artifactIds:[...e.artifactIds],geometry:{...e.geometry},size:{...e.size}}))}function Jo(n){return{id:n.id,name:n.name,layout:us(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function _0(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function KT(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function XT(n,e){var c;const t=n.snapshot,r=t.focusedChannel;if(e==="ArrowLeft"||e==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const d=r.pages.indexOf(r.selectedPage),f=d+(e==="ArrowLeft"?-1:1),g=(c=r.pages[f])==null?void 0:c.artifactIds[0];return d===-1||g===void 0?!1:(sy(),n.selectPage(r.id,g),!0)}const i=QT(t),o=r===null?-1:i.indexOf(r.id),a=o+(e==="ArrowUp"?-1:1),l=i[a];return o===-1||l===void 0?!1:(sy(),n.focusChannel(l).catch(()=>{}),!0)}function QT(n){const e=new Map(n.channels.map(o=>[o.id,o])),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return[...t,...i]}function sy(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const e8="0123456789ABCDEFGHJKMNPQRSTVWXYZ",wd=32,e$=16,t8=10,oy=0xffffffffffff;var hs;(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"})(hs||(hs={}));class Hl extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function t$(n){const e=Math.floor(n()*wd)%wd;return e8.charAt(e)}function n$(n){const e=r$(),t=e&&(e.crypto||e.msCrypto)||null;if(typeof(t==null?void 0:t.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]/256};if(typeof(t==null?void 0:t.randomBytes)=="function")return()=>t.randomBytes(1).readUInt8()/256;throw new Hl(hs.PRNGDetectFailure,"Failed to find a reliable PRNG")}function r$(){return o$()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function i$(n,e){let t="";for(;n>0;n--)t=t$(e)+t;return t}function s$(n,e=t8){if(isNaN(n))throw new Hl(hs.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>oy)throw new Hl(hs.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${oy}: ${n}`);if(n<0)throw new Hl(hs.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Hl(hs.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let t,r="";for(let i=e;i>0;i--)t=n%wd,r=e8.charAt(t)+r,n=(n-t)/wd;return r}function o$(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function $g(n,e){const t=n$(),r=Date.now();return s$(r,t8)+i$(e$,t)}const Ul=sn(),n8=sn(),r8=sn(),a$=sn(),Ff=sn(),l$="store-";function Vi(n){return new URL(n).origin}function c$(){return{authTokens:{}}}var ys,ws,bs;class u$ extends Kr{constructor(t,r,i={}){super();p(this,ys);p(this,ws);p(this,bs);h(this,ys,`${l$}${t}`),h(this,ws,i.storage??d$());const o=s(this,ws).getItem(s(this,ys));o===null?(h(this,bs,r),s(this,ws).setItem(s(this,ys),JSON.stringify(r))):h(this,bs,p$(JSON.parse(o),r))}get(){return s(this,bs)}set(t){h(this,bs,t),s(this,ws).setItem(s(this,ys),JSON.stringify(t)),this.dispatchEvent(new At("change"))}}ys=new WeakMap,ws=new WeakMap,bs=new WeakMap;function ay(n,e){return n.authTokens[Vi(e)]??null}function ly(n,e,t){return{authTokens:{...n.authTokens,[Vi(e)]:t}}}function h$(n,e){const t=Vi(e);if(!(t in n.authTokens))return n;const r={...n.authTokens};return delete r[t],{authTokens:r}}function d$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function p$(n,e){if(typeof n!="object"||n===null||Array.isArray(n))return e;const t=n.authTokens;if(typeof t!="object"||t===null||Array.isArray(t))return e;const r={};for(const[i,o]of Object.entries(t))if(typeof o=="string")try{r[Vi(i)]=o}catch{}return{authTokens:r}}function k(n,e,t){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),e(l,c);const d=a.prototype,f=Object.keys(d);for(let g=0;g<f.length;g++){const y=f[g];y in l||(l[y]=d[y].bind(l))}}const i=(t==null?void 0:t.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:n});function a(l){var c;const d=t!=null&&t.Parent?new o:this;r(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,d;return t!=null&&t.Parent&&l instanceof t.Parent?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class Ko extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i8 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const s8={};function Bi(n){return s8}function o8(n){const e=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>e.indexOf(+r)===-1).map(([r,i])=>i)}function A0(n,e){return typeof e=="bigint"?e.toString():e}function Np(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function Rg(n){return n==null}function Ig(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function f$(n,e){const t=(n.toString().split(".")[1]||"").length,r=e.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=t>i?t:i,a=Number.parseInt(n.toFixed(o).replace(".","")),l=Number.parseInt(e.toFixed(o).replace(".",""));return a%l/10**o}const cy=Symbol("evaluating");function ue(n,e,t){let r;Object.defineProperty(n,e,{get(){if(r!==cy)return r===void 0&&(r=cy,r=t()),r},set(i){Object.defineProperty(n,e,{value:i})},configurable:!0})}function vo(n,e,t){Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Ji(...n){const e={};for(const t of n){const r=Object.getOwnPropertyDescriptors(t);Object.assign(e,r)}return Object.defineProperties({},e)}function uy(n){return JSON.stringify(n)}function m$(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const a8="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function fc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const g$=Np(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function el(n){if(fc(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(fc(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function l8(n){return el(n)?{...n}:Array.isArray(n)?[...n]:n}const v$=new Set(["string","number","symbol"]);function tl(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(n,e,t){const r=new n._zod.constr(e??n._zod.def);return(!e||t!=null&&t.parent)&&(r._zod.parent=n),r}function H(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function y$(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const w$={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 b$(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ji(n._zod.def,{get shape(){const a={};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&(a[l]=t.shape[l])}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function S$(n,e){const t=n._zod.def,r=t.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ji(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in e){if(!(l in t.shape))throw new Error(`Unrecognized key: "${l}"`);e[l]&&delete a[l]}return vo(this,"shape",a),a},checks:[]});return Ki(n,o)}function _$(n,e){if(!el(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const o=n._zod.def.shape;for(const a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ji(n._zod.def,{get shape(){const o={...n._zod.def.shape,...e};return vo(this,"shape",o),o}});return Ki(n,i)}function A$(n,e){if(!el(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return vo(this,"shape",r),r}});return Ki(n,t)}function E$(n,e){const t=Ji(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e._zod.def.shape};return vo(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Ki(n,t)}function k$(n,e,t){const i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=Ji(e._zod.def,{get shape(){const l=e._zod.def.shape,c={...l};if(t)for(const d in t){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(c[d]=n?new n({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)c[d]=n?new n({type:"optional",innerType:l[d]}):l[d];return vo(this,"shape",c),c},checks:[]});return Ki(e,a)}function C$(n,e,t){const r=Ji(e._zod.def,{get shape(){const i=e._zod.def.shape,o={...i};if(t)for(const a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[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 vo(this,"shape",o),o}});return Ki(e,r)}function Wo(n,e=0){var t;if(n.aborted===!0)return!0;for(let r=e;r<n.issues.length;r++)if(((t=n.issues[r])==null?void 0:t.continue)!==!0)return!0;return!1}function jo(n,e){return e.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(n),t})}function hh(n){return typeof n=="string"?n:n==null?void 0:n.message}function qi(n,e,t){var i,o,a,l,c,d;const r={...n,path:n.path??[]};if(!n.message){const f=hh((a=(o=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,n))??hh((l=e==null?void 0:e.error)==null?void 0:l.call(e,n))??hh((c=t.customError)==null?void 0:c.call(t,n))??hh((d=t.localeError)==null?void 0:d.call(t,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function xg(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function mc(...n){const[e,t,r]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:r}:{...e}}const c8=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,A0,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},u8=k("$ZodError",c8),h8=k("$ZodError",c8,{Parent:Error});function T$(n,e=t=>t.message){const t={},r=[];for(const i of n.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}function $$(n,e=t=>t.message){const t={_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)t._errors.push(e(o));else{let a=t,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(e(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),t}const Pg=n=>(e,t,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new Ko;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qi(c,o,Bi())));throw a8(l,i==null?void 0:i.callee),l}return a.value},Lg=n=>async(e,t,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=e._zod.run({value:t,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=>qi(c,o,Bi())));throw a8(l,i==null?void 0:i.callee),l}return a.value},zp=n=>(e,t,r)=>{const i=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new Ko;return o.issues.length?{success:!1,error:new(n??u8)(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},R$=zp(h8),Zp=n=>async(e,t,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(a=>qi(a,i,Bi())))}:{success:!0,data:o.value}},I$=Zp(h8),x$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Pg(n)(e,t,i)},P$=n=>(e,t,r)=>Pg(n)(e,t,r),L$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Lg(n)(e,t,i)},D$=n=>async(e,t,r)=>Lg(n)(e,t,r),M$=n=>(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zp(n)(e,t,i)},O$=n=>(e,t,r)=>zp(n)(e,t,r),N$=n=>async(e,t,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Zp(n)(e,t,i)},z$=n=>async(e,t,r)=>Zp(n)(e,t,r),Z$=/^[cC][^\s-]{8,}$/,H$=/^[0-9a-z]+$/,U$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,F$=/^[0-9a-vA-V]{20}$/,V$=/^[A-Za-z0-9]{27}$/,B$=/^[a-zA-Z0-9_-]{21}$/,q$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,W$=/^([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})$/,hy=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)$/,j$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Y$(){return new RegExp(G$,"u")}const J$=/^(?:(?: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])$/,K$=/^(([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}|:))$/,X$=/^((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])$/,Q$=/^(([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])$/,eR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d8=/^[A-Za-z0-9_-]*$/,tR=/^\+[1-9]\d{6,14}$/,p8="(?:(?:\\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])))",nR=new RegExp(`^${p8}$`);function f8(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function rR(n){return new RegExp(`^${f8(n)}$`)}function iR(n){const e=f8({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${t.join("|")})`;return new RegExp(`^${p8}T(?:${r})$`)}const sR=n=>{const e=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},oR=/^-?\d+$/,m8=/^-?\d+(?:\.\d+)?$/,aR=/^(?:true|false)$/i,lR=/^[^A-Z]*$/,cR=/^[^a-z]*$/,Ct=k("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),g8={number:"number",bigint:"bigint",object:"date"},v8=k("$ZodCheckLessThan",(n,e)=>{Ct.init(n,e);const t=g8[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),y8=k("$ZodCheckGreaterThan",(n,e)=>{Ct.init(n,e);const t=g8[typeof e.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),n._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),uR=k("$ZodCheckMultipleOf",(n,e)=>{Ct.init(n,e),n._zod.onattach.push(t=>{var r;(r=t._zod.bag).multipleOf??(r.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):f$(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),hR=k("$ZodCheckNumberFormat",(n,e)=>{var a;Ct.init(n,e),e.format=e.format||"float64";const t=(a=e.format)==null?void 0:a.includes("int"),r=t?"int":"number",[i,o]=w$[e.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=e.format,c.minimum=i,c.maximum=o,t&&(c.pattern=oR)}),n._zod.check=l=>{const c=l.value;if(t){if(!Number.isInteger(c)){l.issues.push({expected:r,format:e.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:!e.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:!e.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!e.abort}),c>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!e.abort})}}),dR=k("$ZodCheckMaxLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Rg(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const a=xg(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),pR=k("$ZodCheckMinLength",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Rg(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const a=xg(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:n,continue:!e.abort})}}),fR=k("$ZodCheckLengthEquals",(n,e)=>{var t;Ct.init(n,e),(t=n._zod.def).when??(t.when=r=>{const i=r.value;return!Rg(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),n._zod.check=r=>{const i=r.value,o=i.length;if(o===e.length)return;const a=xg(i),l=o>e.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!e.abort})}}),Hp=k("$ZodCheckStringFormat",(n,e)=>{var t,r;Ct.init(n,e),n._zod.onattach.push(i=>{const o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(r=n._zod).check??(r.check=()=>{})}),mR=k("$ZodCheckRegex",(n,e)=>{Hp.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),gR=k("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=lR),Hp.init(n,e)}),vR=k("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=cR),Hp.init(n,e)}),yR=k("$ZodCheckIncludes",(n,e)=>{Ct.init(n,e);const t=tl(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.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(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:n,continue:!e.abort})}}),wR=k("$ZodCheckStartsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`^${tl(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:n,continue:!e.abort})}}),bR=k("$ZodCheckEndsWith",(n,e)=>{Ct.init(n,e);const t=new RegExp(`.*${tl(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),n._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:n,continue:!e.abort})}}),SR=k("$ZodCheckOverwrite",(n,e)=>{Ct.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class _R{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.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 e=Function,t=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new e(...t,i.join(`
6
- `))}}const AR={major:4,minor:3,patch:6},Ee=k("$ZodType",(n,e)=>{var i;var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=AR;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)(t=n._zod).deferred??(t.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const o=(l,c,d)=>{let f=Wo(l),g;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(f)continue;const v=l.issues.length,_=y._zod.check(l);if(_ instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Ko;if(g||_ instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await _,l.issues.length!==v&&(f||(f=Wo(l,v)))});else{if(l.issues.length===v)continue;f||(f=Wo(l,v))}}return g?g.then(()=>l):l},a=(l,c,d)=>{if(Wo(l))return l.aborted=!0,l;const f=o(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ko;return f.then(g=>n._zod.parse(g,d))}return n._zod.parse(f,d)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const f=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(g=>a(g,l,c)):a(f,l,c)}const d=n._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Ko;return d.then(f=>o(f,r,c))}return o(d,r,c)}}ue(n,"~standard",()=>({validate:o=>{var a;try{const l=R$(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return I$(n,o).then(c=>{var d;return c.success?{value:c.data}:{issues:(d=c.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),Dg=k("$ZodString",(n,e)=>{var t;Ee.init(n,e),n._zod.pattern=[...((t=n==null?void 0:n._zod.bag)==null?void 0:t.patterns)??[]].pop()??sR(n._zod.bag),n._zod.parse=(r,i)=>{if(e.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}}),_e=k("$ZodStringFormat",(n,e)=>{Hp.init(n,e),Dg.init(n,e)}),ER=k("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=W$),_e.init(n,e)}),kR=k("$ZodUUID",(n,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=hy(r))}else e.pattern??(e.pattern=hy());_e.init(n,e)}),CR=k("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=j$),_e.init(n,e)}),TR=k("$ZodURL",(n,e)=>{_e.init(n,e),n._zod.check=t=>{try{const r=t.value.trim(),i=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=i.href:t.value=r;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),$R=k("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=Y$()),_e.init(n,e)}),RR=k("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=B$),_e.init(n,e)}),IR=k("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=Z$),_e.init(n,e)}),xR=k("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=H$),_e.init(n,e)}),PR=k("$ZodULID",(n,e)=>{e.pattern??(e.pattern=U$),_e.init(n,e)}),LR=k("$ZodXID",(n,e)=>{e.pattern??(e.pattern=F$),_e.init(n,e)}),DR=k("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=V$),_e.init(n,e)}),MR=k("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=iR(e)),_e.init(n,e)}),OR=k("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=nR),_e.init(n,e)}),NR=k("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=rR(e)),_e.init(n,e)}),zR=k("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=q$),_e.init(n,e)}),ZR=k("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=J$),_e.init(n,e),n._zod.bag.format="ipv4"}),HR=k("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=K$),_e.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),UR=k("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=X$),_e.init(n,e)}),FR=k("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=Q$),_e.init(n,e),n._zod.check=t=>{const r=t.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{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function w8(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const VR=k("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=eR),_e.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{w8(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function BR(n){if(!d8.test(n))return!1;const e=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return w8(t)}const qR=k("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=d8),_e.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{BR(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),WR=k("$ZodE164",(n,e)=>{e.pattern??(e.pattern=tR),_e.init(n,e)});function jR(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[r]=t;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const GR=k("$ZodJWT",(n,e)=>{_e.init(n,e),n._zod.check=t=>{jR(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),b8=k("$ZodNumber",(n,e)=>{Ee.init(n,e),n._zod.pattern=n._zod.bag.pattern??m8,n._zod.parse=(t,r)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...o?{received:o}:{}}),t}}),YR=k("$ZodNumberFormat",(n,e)=>{hR.init(n,e),b8.init(n,e)}),JR=k("$ZodBoolean",(n,e)=>{Ee.init(n,e),n._zod.pattern=aR,n._zod.parse=(t,r)=>{if(e.coerce)try{t.value=!!t.value}catch{}const i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),t}}),KR=k("$ZodUnknown",(n,e)=>{Ee.init(n,e),n._zod.parse=t=>t}),XR=k("$ZodNever",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function dy(n,e,t){n.issues.length&&e.issues.push(...jo(t,n.issues)),e.value[t]=n.value}const QR=k("$ZodArray",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),t;t.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const l=i[a],c=e.element._zod.run({value:l,issues:[]},r);c instanceof Promise?o.push(c.then(d=>dy(d,t,a))):dy(c,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function bd(n,e,t,r,i){if(n.issues.length){if(i&&!(t in r))return;e.issues.push(...jo(t,n.issues))}n.value===void 0?t in r&&(e.value[t]=void 0):e.value[t]=n.value}function S8(n){var r,i,o,a;const e=Object.keys(n.shape);for(const l of e)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 t=y$(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function _8(n,e,t,r,i,o){const a=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,f=c.optout==="optional";for(const g in e){if(l.has(g))continue;if(d==="never"){a.push(g);continue}const y=c.run({value:e[g],issues:[]},r);y instanceof Promise?n.push(y.then(v=>bd(v,t,g,e,f))):bd(y,t,g,e,f)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),n.length?Promise.all(n).then(()=>t):t}const eI=k("$ZodObject",(n,e)=>{Ee.init(n,e);const t=Object.getOwnPropertyDescriptor(e,"shape");if(!(t!=null&&t.get)){const l=e.shape;Object.defineProperty(e,"shape",{get:()=>{const c={...l};return Object.defineProperty(e,"shape",{value:c}),c}})}const r=Np(()=>S8(e));ue(n._zod,"propValues",()=>{const l=e.shape,c={};for(const d in l){const f=l[d]._zod;if(f.values){c[d]??(c[d]=new Set);for(const g of f.values)c[d].add(g)}}return c});const i=fc,o=e.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:n}),l;l.value={};const f=[],g=a.shape;for(const y of a.keys){const v=g[y],_=v._zod.optout==="optional",E=v._zod.run({value:d[y],issues:[]},c);E instanceof Promise?f.push(E.then(x=>bd(x,l,y,d,_))):bd(E,l,y,d,_)}return o?_8(f,d,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),tI=k("$ZodObjectJIT",(n,e)=>{eI.init(n,e);const t=n._zod.parse,r=Np(()=>S8(e)),i=y=>{var J;const v=new _R(["shape","payload","ctx"]),_=r.value,E=O=>{const Y=uy(O);return`shape[${Y}]._zod.run({ value: input[${Y}], issues: [] }, ctx)`};v.write("const input = payload.value;");const x=Object.create(null);let B=0;for(const O of _.keys)x[O]=`key_${B++}`;v.write("const newResult = {};");for(const O of _.keys){const Y=x[O],U=uy(O),j=y[O],fe=((J=j==null?void 0:j._zod)==null?void 0:J.optout)==="optional";v.write(`const ${Y} = ${E(O)};`),fe?v.write(`
7
- if (${Y}.issues.length) {
8
- if (${U} in input) {
9
- payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({
10
- ...iss,
11
- path: iss.path ? [${U}, ...iss.path] : [${U}]
12
- })));
13
- }
14
- }
15
-
16
- if (${Y}.value === undefined) {
17
- if (${U} in input) {
18
- newResult[${U}] = undefined;
19
- }
20
- } else {
21
- newResult[${U}] = ${Y}.value;
22
- }
23
-
24
- `):v.write(`
25
- if (${Y}.issues.length) {
26
- payload.issues = payload.issues.concat(${Y}.issues.map(iss => ({
27
- ...iss,
28
- path: iss.path ? [${U}, ...iss.path] : [${U}]
29
- })));
30
- }
31
-
32
- if (${Y}.value === undefined) {
33
- if (${U} in input) {
34
- newResult[${U}] = undefined;
35
- }
36
- } else {
37
- newResult[${U}] = ${Y}.value;
38
- }
39
-
40
- `)}v.write("payload.value = newResult;"),v.write("return payload;");const P=v.compile();return(O,Y)=>P(y,O,Y)};let o;const a=fc,l=!s8.jitless,d=l&&g$.value,f=e.catchall;let g;n._zod.parse=(y,v)=>{g??(g=r.value);const _=y.value;return a(_)?l&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(o||(o=i(e.shape)),y=o(y,v),f?_8([],_,y,v,g,n):y):t(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:_,inst:n}),y)}});function py(n,e,t,r){for(const o of n)if(o.issues.length===0)return e.value=o.value,e;const i=n.filter(o=>!Wo(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(o=>o.issues.map(a=>qi(a,r,Bi())))}),e)}const A8=k("$ZodUnion",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ue(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ue(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ue(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Ig(o.source)).join("|")})$`)}});const t=e.options.length===1,r=e.options[0]._zod.run;n._zod.parse=(i,o)=>{if(t)return r(i,o);let a=!1;const l=[];for(const c of e.options){const d=c._zod.run({value:i.value,issues:[]},o);if(d instanceof Promise)l.push(d),a=!0;else{if(d.issues.length===0)return d;l.push(d)}}return a?Promise.all(l).then(c=>py(c,i,n,o)):py(l,i,n,o)}}),nI=k("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,A8.init(n,e);const t=n._zod.parse;ue(n._zod,"propValues",()=>{const i={};for(const o of e.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const d of c)i[l].add(d)}}return i});const r=Np(()=>{var a;const i=e.options,o=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(l)}"`);for(const d of c){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,l)}}return o});n._zod.parse=(i,o)=>{const a=i.value;if(!fc(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[e.discriminator]);return l?l._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:n}),i)}}),rI=k("$ZodIntersection",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value,o=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,d])=>fy(t,c,d)):fy(t,o,a)}});function E0(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(el(n)&&el(e)){const t=Object.keys(e),r=Object.keys(n).filter(o=>t.indexOf(o)!==-1),i={...n,...e};for(const o of r){const a=E0(n[o],e[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(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let r=0;r<n.length;r++){const i=n[r],o=e[r],a=E0(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function fy(n,e,t){const r=new Map;let i;for(const l of e.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 t.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}),Wo(n))return n;const a=E0(e.value,t.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const iI=k("$ZodRecord",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{const i=t.value;if(!el(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),t;const o=[],a=e.keyType._zod.values;if(a){t.value={};const l=new Set;for(const d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);const f=e.valueType._zod.run({value:i[d],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(d,g.issues)),t.value[d]=g.value})):(f.issues.length&&t.issues.push(...jo(d,f.issues)),t.value[d]=f.value)}let c;for(const d in i)l.has(d)||(c=c??[],c.push(d));c&&c.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{t.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=e.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"&&m8.test(l)&&c.issues.length){const g=e.keyType._zod.run({value:Number(l),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(c=g)}if(c.issues.length){e.mode==="loose"?t.value[l]=i[l]:t.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(g=>qi(g,r,Bi())),input:l,path:[l],inst:n});continue}const f=e.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?o.push(f.then(g=>{g.issues.length&&t.issues.push(...jo(l,g.issues)),t.value[c.value]=g.value})):(f.issues.length&&t.issues.push(...jo(l,f.issues)),t.value[c.value]=f.value)}}return o.length?Promise.all(o).then(()=>t):t}}),sI=k("$ZodEnum",(n,e)=>{Ee.init(n,e);const t=o8(e.entries),r=new Set(t);n._zod.values=r,n._zod.pattern=new RegExp(`^(${t.filter(i=>v$.has(typeof i)).map(i=>typeof i=="string"?tl(i):i.toString()).join("|")})$`),n._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:t,input:a,inst:n}),i}}),oI=k("$ZodLiteral",(n,e)=>{if(Ee.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?tl(r):r?tl(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const o=r.value;return t.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:n}),r}}),aI=k("$ZodTransform",(n,e)=>{Ee.init(n,e),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new i8(n.constructor.name);const i=e.transform(t.value,t);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(t.value=a,t));if(i instanceof Promise)throw new Ko;return t.value=i,t}});function my(n,e){return n.issues.length&&e===void 0?{issues:[],value:void 0}:n}const E8=k("$ZodOptional",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",n._zod.optout="optional",ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Ig(t.source)})?$`):void 0}),n._zod.parse=(t,r)=>{if(e.innerType._zod.optin==="optional"){const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(o=>my(o,t.value)):my(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,r)}}),lI=k("$ZodExactOptional",(n,e)=>{E8.init(n,e),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,r)=>e.innerType._zod.run(t,r)}),cI=k("$ZodNullable",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Ig(t.source)}|null)$`):void 0}),ue(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,r)=>t.value===null?t:e.innerType._zod.run(t,r)}),uI=k("$ZodDefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);if(t.value===void 0)return t.value=e.defaultValue,t;const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(o=>gy(o,e)):gy(i,e)}});function gy(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const hI=k("$ZodPrefault",(n,e)=>{Ee.init(n,e),n._zod.optin="optional",ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>(r.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,r))}),dI=k("$ZodNonOptional",(n,e)=>{Ee.init(n,e),ue(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(r=>r!==void 0)):void 0}),n._zod.parse=(t,r)=>{const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(o=>vy(o,n)):vy(i,n)}});function vy(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const pI=k("$ZodCatch",(n,e)=>{Ee.init(n,e),ue(n._zod,"optin",()=>e.innerType._zod.optin),ue(n._zod,"optout",()=>e.innerType._zod.optout),ue(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>qi(a,r,Bi()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>qi(o,r,Bi()))},input:t.value}),t.issues=[]),t)}}),fI=k("$ZodPipe",(n,e)=>{Ee.init(n,e),ue(n._zod,"values",()=>e.in._zod.values),ue(n._zod,"optin",()=>e.in._zod.optin),ue(n._zod,"optout",()=>e.out._zod.optout),ue(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,r)=>{if(r.direction==="backward"){const o=e.out._zod.run(t,r);return o instanceof Promise?o.then(a=>dh(a,e.in,r)):dh(o,e.in,r)}const i=e.in._zod.run(t,r);return i instanceof Promise?i.then(o=>dh(o,e.out,r)):dh(i,e.out,r)}});function dh(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues},t)}const mI=k("$ZodReadonly",(n,e)=>{Ee.init(n,e),ue(n._zod,"propValues",()=>e.innerType._zod.propValues),ue(n._zod,"values",()=>e.innerType._zod.values),ue(n._zod,"optin",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optin}),ue(n._zod,"optout",()=>{var t,r;return(r=(t=e.innerType)==null?void 0:t._zod)==null?void 0:r.optout}),n._zod.parse=(t,r)=>{if(r.direction==="backward")return e.innerType._zod.run(t,r);const i=e.innerType._zod.run(t,r);return i instanceof Promise?i.then(yy):yy(i)}});function yy(n){return n.value=Object.freeze(n.value),n}const gI=k("$ZodCustom",(n,e)=>{Ct.init(n,e),Ee.init(n,e),n._zod.parse=(t,r)=>t,n._zod.check=t=>{const r=t.value,i=e.fn(r);if(i instanceof Promise)return i.then(o=>wy(o,t,r,n));wy(i,t,r,n)}});function wy(n,e,t,r){if(!n){const i={code:"custom",input:t,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(mc(i))}}var by;class vI{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const i={...r,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function yI(){return new vI}(by=globalThis).__zod_globalRegistry??(by.__zod_globalRegistry=yI());const Fl=globalThis.__zod_globalRegistry;function wI(n,e){return new n({type:"string",...H(e)})}function bI(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...H(e)})}function Sy(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)})}function SI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)})}function _I(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)})}function AI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)})}function EI(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)})}function kI(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...H(e)})}function CI(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)})}function TI(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)})}function $I(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)})}function RI(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)})}function II(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)})}function xI(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)})}function PI(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)})}function LI(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)})}function DI(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)})}function MI(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)})}function OI(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)})}function NI(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)})}function zI(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)})}function ZI(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)})}function HI(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)})}function UI(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)})}function FI(n,e){return new n({type:"string",format:"date",check:"string_format",...H(e)})}function VI(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...H(e)})}function BI(n,e){return new n({type:"string",format:"duration",check:"string_format",...H(e)})}function qI(n,e){return new n({type:"number",checks:[],...H(e)})}function WI(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}function jI(n,e){return new n({type:"boolean",...H(e)})}function GI(n){return new n({type:"unknown"})}function YI(n,e){return new n({type:"never",...H(e)})}function _y(n,e){return new v8({check:"less_than",...H(e),value:n,inclusive:!1})}function Vf(n,e){return new v8({check:"less_than",...H(e),value:n,inclusive:!0})}function Ay(n,e){return new y8({check:"greater_than",...H(e),value:n,inclusive:!1})}function Bf(n,e){return new y8({check:"greater_than",...H(e),value:n,inclusive:!0})}function Ey(n,e){return new uR({check:"multiple_of",...H(e),value:n})}function k8(n,e){return new dR({check:"max_length",...H(e),maximum:n})}function Sd(n,e){return new pR({check:"min_length",...H(e),minimum:n})}function C8(n,e){return new fR({check:"length_equals",...H(e),length:n})}function JI(n,e){return new mR({check:"string_format",format:"regex",...H(e),pattern:n})}function KI(n){return new gR({check:"string_format",format:"lowercase",...H(n)})}function XI(n){return new vR({check:"string_format",format:"uppercase",...H(n)})}function QI(n,e){return new yR({check:"string_format",format:"includes",...H(e),includes:n})}function ex(n,e){return new wR({check:"string_format",format:"starts_with",...H(e),prefix:n})}function tx(n,e){return new bR({check:"string_format",format:"ends_with",...H(e),suffix:n})}function fl(n){return new SR({check:"overwrite",tx:n})}function nx(n){return fl(e=>e.normalize(n))}function rx(){return fl(n=>n.trim())}function ix(){return fl(n=>n.toLowerCase())}function sx(){return fl(n=>n.toUpperCase())}function ox(){return fl(n=>m$(n))}function ax(n,e,t){return new n({type:"array",element:e,...H(t)})}function lx(n,e,t){return new n({type:"custom",check:"custom",fn:e,...H(t)})}function cx(n){const e=ux(t=>(t.addIssue=r=>{if(typeof r=="string")t.issues.push(mc(r,t.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(mc(i))}},n(t.value,t)));return e}function ux(n,e){const t=new Ct({check:"custom",...H(e)});return t._zod.check=n,t}function T8(n){let e=(n==null?void 0:n.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??Fl,target:e,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 Le(n,e,t={path:[],schemaPath:[]}){var f,g;var r;const i=n._zod.def,o=e.seen.get(n);if(o)return o.count++,t.schemaPath.includes(n)&&(o.cycle=t.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,a);const l=(g=(f=n._zod).toJSONSchema)==null?void 0:g.call(f);if(l)a.schema=l;else{const y={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,a.schema,y);else{const _=a.schema,E=e.processors[i.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);E(n,e,_,y)}const v=n._zod.parent;v&&(a.ref||(a.ref=v),Le(v,e,y),e.seen.get(v).isParent=!0)}const c=e.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),e.io==="input"&&et(n)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(n).schema}function $8(n,e){var a,l,c,d;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const f of n.seen.entries()){const g=(a=n.metadataRegistry.get(f[0]))==null?void 0:a.id;if(g){const y=r.get(g);if(y&&y!==f[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(g,f[0])}}const i=f=>{var E;const g=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(E=n.external.registry.get(f[0]))==null?void 0:E.id,B=n.external.uri??(J=>J);if(x)return{ref:B(x)};const P=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=P,{defId:P,ref:`${B("__shared")}#/${g}/${P}`}}if(f[1]===t)return{ref:"#"};const v=`#/${g}/`,_=f[1].schema.id??`__schema${n.counter++}`;return{defId:_,ref:v+_}},o=f=>{if(f[1].schema.$ref)return;const g=f[1],{ref:y,defId:v}=i(f);g.def={...g.schema},v&&(g.defId=v);const _=g.schema;for(const E in _)delete _[E];_.$ref=y};if(n.cycles==="throw")for(const f of n.seen.entries()){const g=f[1];if(g.cycle)throw new Error(`Cycle detected: #/${(l=g.cycle)==null?void 0:l.join("/")}/<root>
41
-
42
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const g=f[1];if(e===f[0]){o(f);continue}if(n.external){const v=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(e!==f[0]&&v){o(f);continue}}if((d=n.metadataRegistry.get(f[0]))==null?void 0:d.id){o(f);continue}if(g.cycle){o(f);continue}if(g.count>1&&n.reused==="ref"){o(f);continue}}}function R8(n,e){var a,l,c;const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const f=n.seen.get(d);if(f.ref===null)return;const g=f.def??f.schema,y={...g},v=f.ref;if(f.ref=null,v){r(v);const E=n.seen.get(v),x=E.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(x)):Object.assign(g,x),Object.assign(g,y),d._zod.parent===v)for(const P in g)P==="$ref"||P==="allOf"||P in y||delete g[P];if(x.$ref&&E.def)for(const P in g)P==="$ref"||P==="allOf"||P in E.def&&JSON.stringify(g[P])===JSON.stringify(E.def[P])&&delete g[P]}const _=d._zod.parent;if(_&&_!==v){r(_);const E=n.seen.get(_);if(E!=null&&E.schema.$ref&&(g.$ref=E.schema.$ref,E.def))for(const x in g)x==="$ref"||x==="allOf"||x in E.def&&JSON.stringify(g[x])===JSON.stringify(E.def[x])&&delete g[x]}n.override({zodSchema:d,jsonSchema:g,path:f.path??[]})};for(const d of[...n.seen.entries()].reverse())r(d[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 d=(l=n.external.registry.get(e))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(d)}Object.assign(i,t.def??t.schema);const o=((c=n.external)==null?void 0:c.defs)??{};for(const d of n.seen.entries()){const f=d[1];f.def&&f.defId&&(o[f.defId]=f.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...e["~standard"],jsonSchema:{input:_d(e,"input",n.processors),output:_d(e,"output",n.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function et(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return et(r.element,t);if(r.type==="set")return et(r.valueType,t);if(r.type==="lazy")return et(r.getter(),t);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return et(r.innerType,t);if(r.type==="intersection")return et(r.left,t)||et(r.right,t);if(r.type==="record"||r.type==="map")return et(r.keyType,t)||et(r.valueType,t);if(r.type==="pipe")return et(r.in,t)||et(r.out,t);if(r.type==="object"){for(const i in r.shape)if(et(r.shape[i],t))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(et(i,t))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(et(i,t))return!0;return!!(r.rest&&et(r.rest,t))}return!1}const hx=(n,e={})=>t=>{const r=T8({...t,processors:e});return Le(n,r),$8(r,n),R8(r,n)},_d=(n,e,t={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=T8({...i??{},target:o,io:e,processors:t});return Le(n,a),$8(a,n),R8(a,n)},dx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},px=(n,e,t,r)=>{const i=t;i.type="string";const{minimum:o,maximum:a,format:l,patterns:c,contentEncoding:d}=n._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=dx[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),d&&(i.contentEncoding=d),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(g=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},fx=(n,e,t,r)=>{const i=t,{minimum:o,maximum:a,format:l,multipleOf:c,exclusiveMaximum:d,exclusiveMinimum:f}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof f=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f),typeof o=="number"&&(i.minimum=o,typeof f=="number"&&e.target!=="draft-04"&&(f>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d),typeof a=="number"&&(i.maximum=a,typeof d=="number"&&e.target!=="draft-04"&&(d<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},mx=(n,e,t,r)=>{t.type="boolean"},gx=(n,e,t,r)=>{t.not={}},vx=(n,e,t,r)=>{},yx=(n,e,t,r)=>{const i=n._zod.def,o=o8(i.entries);o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),t.enum=o},wx=(n,e,t,r)=>{const i=n._zod.def,o=[];for(const a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.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];t.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[a]:t.const=a}else o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),o.every(a=>typeof a=="boolean")&&(t.type="boolean"),o.every(a=>a===null)&&(t.type="null"),t.enum=o},bx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sx=(n,e,t,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_x=(n,e,t,r)=>{const i=t,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=Le(o.element,e,{...r,path:[...r.path,"items"]})},Ax=(n,e,t,r)=>{var d;const i=t,o=n._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=Le(a[f],e,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(f=>{const g=o.shape[f]._zod;return e.io==="input"?g.optin===void 0:g.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((d=o.catchall)==null?void 0:d._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Le(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Ex=(n,e,t,r)=>{const i=n._zod.def,o=i.inclusive===!1,a=i.options.map((l,c)=>Le(l,e,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?t.oneOf=a:t.anyOf=a},kx=(n,e,t,r)=>{const i=n._zod.def,o=Le(i.left,e,{...r,path:[...r.path,"allOf",0]}),a=Le(i.right,e,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];t.allOf=c},Cx=(n,e,t,r)=>{const i=t,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 f=Le(o.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of c)i.patternProperties[g.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Le(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Le(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const d=a._zod.values;if(d){const f=[...d].filter(g=>typeof g=="string"||typeof g=="number");f.length>0&&(i.required=f)}},Tx=(n,e,t,r)=>{const i=n._zod.def,o=Le(i.innerType,e,r),a=e.seen.get(n);e.target==="openapi-3.0"?(a.ref=i.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},$x=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Rx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},Ix=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},xx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.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")}t.default=a},Px=(n,e,t,r)=>{const i=n._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Le(o,e,r);const a=e.seen.get(n);a.ref=o},Lx=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType,t.readOnly=!0},I8=(n,e,t,r)=>{const i=n._zod.def;Le(i.innerType,e,r);const o=e.seen.get(n);o.ref=i.innerType},Dx=k("ZodISODateTime",(n,e)=>{MR.init(n,e),Ce.init(n,e)});function Mx(n){return UI(Dx,n)}const Ox=k("ZodISODate",(n,e)=>{OR.init(n,e),Ce.init(n,e)});function Nx(n){return FI(Ox,n)}const zx=k("ZodISOTime",(n,e)=>{NR.init(n,e),Ce.init(n,e)});function Zx(n){return VI(zx,n)}const Hx=k("ZodISODuration",(n,e)=>{zR.init(n,e),Ce.init(n,e)});function Ux(n){return BI(Hx,n)}const x8=(n,e)=>{u8.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>$$(n,t)},flatten:{value:t=>T$(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,A0,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,A0,2)}},isEmpty:{get(){return n.issues.length===0}}})},ky=k("ZodError",x8),on=k("ZodError",x8,{Parent:Error}),Fx=Pg(on),Vx=Lg(on),Bx=zp(on),qx=Zp(on),Wx=x$(on),jx=P$(on),Gx=L$(on),Yx=D$(on),Jx=M$(on),Kx=O$(on),Xx=N$(on),Qx=z$(on),ke=k("ZodType",(n,e)=>(Ee.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:_d(n,"input"),output:_d(n,"output")}}),n.toJSONSchema=hx(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.check=(...t)=>n.clone(Ji(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(t,r)=>Ki(n,t,r),n.brand=()=>n,n.register=(t,r)=>(t.add(n,r),n),n.parse=(t,r)=>Fx(n,t,r,{callee:n.parse}),n.safeParse=(t,r)=>Bx(n,t,r),n.parseAsync=async(t,r)=>Vx(n,t,r,{callee:n.parseAsync}),n.safeParseAsync=async(t,r)=>qx(n,t,r),n.spa=n.safeParseAsync,n.encode=(t,r)=>Wx(n,t,r),n.decode=(t,r)=>jx(n,t,r),n.encodeAsync=async(t,r)=>Gx(n,t,r),n.decodeAsync=async(t,r)=>Yx(n,t,r),n.safeEncode=(t,r)=>Jx(n,t,r),n.safeDecode=(t,r)=>Kx(n,t,r),n.safeEncodeAsync=async(t,r)=>Xx(n,t,r),n.safeDecodeAsync=async(t,r)=>Qx(n,t,r),n.refine=(t,r)=>n.check(q5(t,r)),n.superRefine=t=>n.check(W5(t)),n.overwrite=t=>n.check(fl(t)),n.optional=()=>$y(n),n.exactOptional=()=>P5(n),n.nullable=()=>Ry(n),n.nullish=()=>$y(Ry(n)),n.nonoptional=t=>z5(n,t),n.array=()=>z(n),n.or=t=>X([n,t]),n.and=t=>Up(n,t),n.transform=t=>Iy(n,I5(t)),n.default=t=>M5(n,t),n.prefault=t=>N5(n,t),n.catch=t=>H5(n,t),n.pipe=t=>Iy(n,t),n.readonly=()=>V5(n),n.describe=t=>{const r=n.clone();return Fl.add(r,{description:t}),r},Object.defineProperty(n,"description",{get(){var t;return(t=Fl.get(n))==null?void 0:t.description},configurable:!0}),n.meta=(...t)=>{if(t.length===0)return Fl.get(n);const r=n.clone();return Fl.add(r,t[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=t=>t(n),n)),P8=k("_ZodString",(n,e)=>{Dg.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>px(n,r,i);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,n.regex=(...r)=>n.check(JI(...r)),n.includes=(...r)=>n.check(QI(...r)),n.startsWith=(...r)=>n.check(ex(...r)),n.endsWith=(...r)=>n.check(tx(...r)),n.min=(...r)=>n.check(Sd(...r)),n.max=(...r)=>n.check(k8(...r)),n.length=(...r)=>n.check(C8(...r)),n.nonempty=(...r)=>n.check(Sd(1,...r)),n.lowercase=r=>n.check(KI(r)),n.uppercase=r=>n.check(XI(r)),n.trim=()=>n.check(rx()),n.normalize=(...r)=>n.check(nx(...r)),n.toLowerCase=()=>n.check(ix()),n.toUpperCase=()=>n.check(sx()),n.slugify=()=>n.check(ox())}),e5=k("ZodString",(n,e)=>{Dg.init(n,e),P8.init(n,e),n.email=t=>n.check(bI(t5,t)),n.url=t=>n.check(kI(n5,t)),n.jwt=t=>n.check(HI(v5,t)),n.emoji=t=>n.check(CI(r5,t)),n.guid=t=>n.check(Sy(Cy,t)),n.uuid=t=>n.check(SI(ph,t)),n.uuidv4=t=>n.check(_I(ph,t)),n.uuidv6=t=>n.check(AI(ph,t)),n.uuidv7=t=>n.check(EI(ph,t)),n.nanoid=t=>n.check(TI(i5,t)),n.guid=t=>n.check(Sy(Cy,t)),n.cuid=t=>n.check($I(s5,t)),n.cuid2=t=>n.check(RI(o5,t)),n.ulid=t=>n.check(II(a5,t)),n.base64=t=>n.check(NI(f5,t)),n.base64url=t=>n.check(zI(m5,t)),n.xid=t=>n.check(xI(l5,t)),n.ksuid=t=>n.check(PI(c5,t)),n.ipv4=t=>n.check(LI(u5,t)),n.ipv6=t=>n.check(DI(h5,t)),n.cidrv4=t=>n.check(MI(d5,t)),n.cidrv6=t=>n.check(OI(p5,t)),n.e164=t=>n.check(ZI(g5,t)),n.datetime=t=>n.check(Mx(t)),n.date=t=>n.check(Nx(t)),n.time=t=>n.check(Zx(t)),n.duration=t=>n.check(Ux(t))});function m(n){return wI(e5,n)}const Ce=k("ZodStringFormat",(n,e)=>{_e.init(n,e),P8.init(n,e)}),t5=k("ZodEmail",(n,e)=>{CR.init(n,e),Ce.init(n,e)}),Cy=k("ZodGUID",(n,e)=>{ER.init(n,e),Ce.init(n,e)}),ph=k("ZodUUID",(n,e)=>{kR.init(n,e),Ce.init(n,e)}),n5=k("ZodURL",(n,e)=>{TR.init(n,e),Ce.init(n,e)}),r5=k("ZodEmoji",(n,e)=>{$R.init(n,e),Ce.init(n,e)}),i5=k("ZodNanoID",(n,e)=>{RR.init(n,e),Ce.init(n,e)}),s5=k("ZodCUID",(n,e)=>{IR.init(n,e),Ce.init(n,e)}),o5=k("ZodCUID2",(n,e)=>{xR.init(n,e),Ce.init(n,e)}),a5=k("ZodULID",(n,e)=>{PR.init(n,e),Ce.init(n,e)}),l5=k("ZodXID",(n,e)=>{LR.init(n,e),Ce.init(n,e)}),c5=k("ZodKSUID",(n,e)=>{DR.init(n,e),Ce.init(n,e)}),u5=k("ZodIPv4",(n,e)=>{ZR.init(n,e),Ce.init(n,e)}),h5=k("ZodIPv6",(n,e)=>{HR.init(n,e),Ce.init(n,e)}),d5=k("ZodCIDRv4",(n,e)=>{UR.init(n,e),Ce.init(n,e)}),p5=k("ZodCIDRv6",(n,e)=>{FR.init(n,e),Ce.init(n,e)}),f5=k("ZodBase64",(n,e)=>{VR.init(n,e),Ce.init(n,e)}),m5=k("ZodBase64URL",(n,e)=>{qR.init(n,e),Ce.init(n,e)}),g5=k("ZodE164",(n,e)=>{WR.init(n,e),Ce.init(n,e)}),v5=k("ZodJWT",(n,e)=>{GR.init(n,e),Ce.init(n,e)}),L8=k("ZodNumber",(n,e)=>{b8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>fx(n,r,i),n.gt=(r,i)=>n.check(Ay(r,i)),n.gte=(r,i)=>n.check(Bf(r,i)),n.min=(r,i)=>n.check(Bf(r,i)),n.lt=(r,i)=>n.check(_y(r,i)),n.lte=(r,i)=>n.check(Vf(r,i)),n.max=(r,i)=>n.check(Vf(r,i)),n.int=r=>n.check(Ty(r)),n.safe=r=>n.check(Ty(r)),n.positive=r=>n.check(Ay(0,r)),n.nonnegative=r=>n.check(Bf(0,r)),n.negative=r=>n.check(_y(0,r)),n.nonpositive=r=>n.check(Vf(0,r)),n.multipleOf=(r,i)=>n.check(Ey(r,i)),n.step=(r,i)=>n.check(Ey(r,i)),n.finite=()=>n;const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function G(n){return qI(L8,n)}const y5=k("ZodNumberFormat",(n,e)=>{YR.init(n,e),L8.init(n,e)});function Ty(n){return WI(y5,n)}const w5=k("ZodBoolean",(n,e)=>{JR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>mx(n,t,r)});function Fe(n){return jI(w5,n)}const b5=k("ZodUnknown",(n,e)=>{KR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>vx()});function S(){return GI(b5)}const S5=k("ZodNever",(n,e)=>{XR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>gx(n,t,r)});function _5(n){return YI(S5,n)}const A5=k("ZodArray",(n,e)=>{QR.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>_x(n,t,r,i),n.element=e.element,n.min=(t,r)=>n.check(Sd(t,r)),n.nonempty=t=>n.check(Sd(1,t)),n.max=(t,r)=>n.check(k8(t,r)),n.length=(t,r)=>n.check(C8(t,r)),n.unwrap=()=>n.element});function z(n,e){return ax(A5,n,e)}const D8=k("ZodObject",(n,e)=>{tI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ax(n,t,r,i),ue(n,"shape",()=>e.shape),n.keyof=()=>N8(Object.keys(n._zod.def.shape)),n.catchall=t=>n.clone({...n._zod.def,catchall:t}),n.passthrough=()=>n.clone({...n._zod.def,catchall:S()}),n.loose=()=>n.clone({...n._zod.def,catchall:S()}),n.strict=()=>n.clone({...n._zod.def,catchall:_5()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=t=>_$(n,t),n.safeExtend=t=>A$(n,t),n.merge=t=>E$(n,t),n.pick=t=>b$(n,t),n.omit=t=>S$(n,t),n.partial=(...t)=>k$(z8,n,t[0]),n.required=(...t)=>C$(Z8,n,t[0])});function M8(n,e){const t={type:"object",shape:n??{},...H(e)};return new D8(t)}function w(n,e){return new D8({type:"object",shape:n,catchall:S(),...H(e)})}const O8=k("ZodUnion",(n,e)=>{A8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ex(n,t,r,i),n.options=e.options});function X(n,e){return new O8({type:"union",options:n,...H(e)})}const E5=k("ZodDiscriminatedUnion",(n,e)=>{O8.init(n,e),nI.init(n,e)});function k5(n,e,t){return new E5({type:"union",options:e,discriminator:n,...H(t)})}const C5=k("ZodIntersection",(n,e)=>{rI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>kx(n,t,r,i)});function Up(n,e){return new C5({type:"intersection",left:n,right:e})}const T5=k("ZodRecord",(n,e)=>{iI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Cx(n,t,r,i),n.keyType=e.keyType,n.valueType=e.valueType});function A(n,e,t){return new T5({type:"record",keyType:n,valueType:e,...H(t)})}const k0=k("ZodEnum",(n,e)=>{sI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(r,i,o)=>yx(n,r,i),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(r,i)=>{const o={};for(const a of r)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new k0({...e,checks:[],...H(i),entries:o})},n.exclude=(r,i)=>{const o={...e.entries};for(const a of r)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new k0({...e,checks:[],...H(i),entries:o})}});function N8(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new k0({type:"enum",entries:t,...H(e)})}const $5=k("ZodLiteral",(n,e)=>{oI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>wx(n,t,r),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function $(n,e){return new $5({type:"literal",values:Array.isArray(n)?n:[n],...H(e)})}const R5=k("ZodTransform",(n,e)=>{aI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Sx(n,t),n._zod.parse=(t,r)=>{if(r.direction==="backward")throw new i8(n.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(mc(o,t.value,e));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=n),t.issues.push(mc(a))}};const i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>(t.value=o,t)):(t.value=i,t)}});function I5(n){return new R5({type:"transform",transform:n})}const z8=k("ZodOptional",(n,e)=>{E8.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>I8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function $y(n){return new z8({type:"optional",innerType:n})}const x5=k("ZodExactOptional",(n,e)=>{lI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>I8(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function P5(n){return new x5({type:"optional",innerType:n})}const L5=k("ZodNullable",(n,e)=>{cI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Tx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function Ry(n){return new L5({type:"nullable",innerType:n})}const D5=k("ZodDefault",(n,e)=>{uI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Rx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function M5(n,e){return new D5({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():l8(e)}})}const O5=k("ZodPrefault",(n,e)=>{hI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Ix(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function N5(n,e){return new O5({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():l8(e)}})}const Z8=k("ZodNonOptional",(n,e)=>{dI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>$x(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function z5(n,e){return new Z8({type:"nonoptional",innerType:n,...H(e)})}const Z5=k("ZodCatch",(n,e)=>{pI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>xx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function H5(n,e){return new Z5({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const U5=k("ZodPipe",(n,e)=>{fI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Px(n,t,r,i),n.in=e.in,n.out=e.out});function Iy(n,e){return new U5({type:"pipe",in:n,out:e})}const F5=k("ZodReadonly",(n,e)=>{mI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>Lx(n,t,r,i),n.unwrap=()=>n._zod.def.innerType});function V5(n){return new F5({type:"readonly",innerType:n})}const B5=k("ZodCustom",(n,e)=>{gI.init(n,e),ke.init(n,e),n._zod.processJSONSchema=(t,r,i)=>bx(n,t)});function q5(n,e={}){return lx(B5,n,e)}function W5(n){return cx(n)}const j5=[".md",".markdown"];function H8(n){if(n.length===0)return!1;const e=n.at(-1);return e==="/"||e==="\\"}function U8(n){const e=n.lastIndexOf("/"),t=n.lastIndexOf("\\");return n.slice(Math.max(e,t)+1)}function G5(n){return U8(n).toLowerCase()}function Y5(n,e){const t=G5(n);return e.some(r=>t.endsWith(r))}function C0(n){return!H8(n)&&Y5(n,j5)}function J5(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function fr(n){try{const{pathname:e}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e)}catch{return!1}}const K5=M8({id:m().min(1),kind:$("path"),title:m(),path:m()}).strict(),X5=M8({id:m().min(1),kind:$("url"),title:m(),url:m().refine(J5,{message:"url must be an http(s) URL"})}).strict();k5("kind",[K5,X5]);const Q5=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function eP(n,e){try{const t=new URL(e),r=new URL(n,t);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:Q5.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function xy(n,e){return eP(n,e).kind==="web"}const tP="/views/markdown/",nP="/views/url-unsupported/";function rP(n){try{const{protocol:e}=new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function F8(n){return`/artifact/${encodeURIComponent(n)}`}function iP(n,e){return`${F8(n)}/${encodeURIComponent(e)}`}function sP(n){return`/markdown/${encodeURIComponent(n)}`}function Ad(n,e={electron:!1}){if(n.kind==="url")return e.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:fr(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:e.browserDemo&&rP(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:nP,contentURL:null};if(C0(n.path)){const r={viewURL:tP,contentURL:sP(n.id)};return e.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const t=H8(n.path)?`${F8(n.id)}/`:iP(n.id,U8(n.path));return e.electron?{renderer:"url-webview",viewURL:t,contentURL:null}:{renderer:"proxy-iframe",viewURL:t,contentURL:null}}const oP="serverURL",aP="token",lP="mode",cP="desktopAppVersion",uP="electron";function hP(n=window.location.search,e=window.location.origin){const r=new URLSearchParams(n).get(oP);return r?new URL(r).origin:new URL(e).origin}function dP(n=window.location.search){return new URLSearchParams(n).get(aP)}function Br(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(lP)===uP}function V8(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(cP)}const Py="tv.telemetry.clientId",pP=5,fP=60,mP=1e3,gP=pP*fP*mP,Ly=["pointerdown","scroll","keydown"],Dy=["focus"],My=["visibilitychange"],vP="hidden";function yP(n,e=AP){const t=n.getItem(Py);if(t)return t;const r=e();return n.setItem(Py,r),r}function wP(n){return{clientId:yP(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function bP(n){const e=new URLSearchParams;return e.set("clientId",n.clientId),e.set("userAgent",n.userAgent),e.set("clientApp",n.clientApp),n.desktopAppVersion&&e.set("desktopAppVersion",n.desktopAppVersion),e}function SP(n){return new _P(n)}var Ac,wr,ai,Ec,kc,Ut,Ss,Cc,Od,B8;class _P{constructor(e){p(this,Od);p(this,Ac);p(this,wr);p(this,ai);p(this,Ec);p(this,kc);p(this,Ut);p(this,Ss,!1);p(this,Cc,Number.NEGATIVE_INFINITY);h(this,Ac,e.meta),h(this,wr,e.documentTarget),h(this,ai,e.windowTarget),h(this,Ec,e.send),h(this,kc,e.nowMs??Date.now),h(this,Ut,()=>u(this,Od,B8).call(this))}start(){if(!s(this,Ss)){h(this,Ss,!0);for(const e of Ly)s(this,ai).addEventListener(e,s(this,Ut)),s(this,wr).addEventListener(e,s(this,Ut));for(const e of Dy)s(this,ai).addEventListener(e,s(this,Ut));for(const e of My)s(this,wr).addEventListener(e,s(this,Ut))}}stop(){if(s(this,Ss)){h(this,Ss,!1);for(const e of Ly)s(this,ai).removeEventListener(e,s(this,Ut)),s(this,wr).removeEventListener(e,s(this,Ut));for(const e of Dy)s(this,ai).removeEventListener(e,s(this,Ut));for(const e of My)s(this,wr).removeEventListener(e,s(this,Ut))}}}Ac=new WeakMap,wr=new WeakMap,ai=new WeakMap,Ec=new WeakMap,kc=new WeakMap,Ut=new WeakMap,Ss=new WeakMap,Cc=new WeakMap,Od=new WeakSet,B8=function(){if(s(this,wr).visibilityState===vP)return;const e=s(this,kc).call(this);e-s(this,Cc)<gP||(h(this,Cc,e),s(this,Ec).call(this,{type:mT,clientId:s(this,Ac).clientId}))};function AP(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():$g().toLowerCase()}const we={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"},ur={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"},EP=1,kP=w({_meta:A(m(),S()).nullish(),terminal:Fe().optional().default(!1)}),CP=w({_meta:A(m(),S()).nullish(),label:m().nullish(),name:m(),optional:Fe().optional().default(!1),secret:Fe().optional().default(!0)}),TP=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),name:m()}),$P=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:m(),link:m().nullish(),name:m(),vars:z(CP)}),RP=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),description:m().nullish(),env:A(m(),m()).optional(),id:m(),name:m()}),IP=X([$P.and(w({type:$("env_var")})),RP.and(w({type:$("terminal")})),TP]),xP=w({_meta:A(m(),S()).nullish(),methodId:m()}),PP=w({_meta:A(m(),S()).nullish()}),LP=w({_meta:A(m(),S()).nullish(),blob:m(),mimeType:m().nullish(),uri:m()}),DP=w({default:Fe().nullish(),description:m().nullish(),title:m().nullish()}),MP=w({_meta:A(m(),S()).nullish()}),OP=w({_meta:A(m(),S()).nullish()}),NP=w({amount:G(),currency:m()}),zP=w({_meta:A(m(),S()).nullish(),terminalId:m()}),ZP=w({_meta:A(m(),S()).nullish(),newText:m(),oldText:m().nullish(),path:m()}),HP=X([m(),G(),G(),Fe(),z(m())]),UP=w({content:A(m(),HP).nullish()}),FP=X([UP.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),VP=w({_meta:A(m(),S()).nullish()}),q8=m(),BP=w({_meta:A(m(),S()).nullish(),elicitationId:q8}),qP=w({_meta:A(m(),S()).nullish(),action:FP}),WP=$("object"),jP=$("string"),GP=w({_meta:A(m(),S()).nullish()}),YP=w({_meta:A(m(),S()).nullish(),form:VP.nullish(),url:GP.nullish()}),JP=w({elicitationId:q8,url:m().url()}),W8=w({const:m(),title:m()}),j8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),KP=X([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),G().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),G8=w({code:KP,data:S().optional(),message:m()}),Y8=S(),J8=S(),K8=S(),XP=w({_meta:A(m(),S()).nullish(),readTextFile:Fe().optional().default(!1),writeTextFile:Fe().optional().default(!1)}),X8=w({_meta:A(m(),S()).nullish(),name:m(),value:m()}),Q8=w({_meta:A(m(),S()).nullish(),name:m(),title:m().nullish(),version:m()}),QP=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),eL=w({_meta:A(m(),S()).nullish()}),tL=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cursor:m().nullish(),cwd:m().nullish()}),nL=w({_meta:A(m(),S()).nullish()}),rL=w({_meta:A(m(),S()).nullish(),logout:nL.nullish()}),iL=w({_meta:A(m(),S()).nullish()}),sL=w({_meta:A(m(),S()).nullish()}),oL=w({_meta:A(m(),S()).nullish(),http:Fe().optional().default(!1),sse:Fe().optional().default(!1)}),aL=w({_meta:A(m(),S()).nullish(),headers:z(X8),name:m(),url:m()}),lL=w({_meta:A(m(),S()).nullish(),headers:z(X8),name:m(),url:m()}),cL=w({_meta:A(m(),S()).nullish(),args:z(m()),command:m(),env:z(j8),name:m()}),Fp=X([aL.and(w({type:$("http")})),lL.and(w({type:$("sse")})),cL]),Mg=m(),uL=w({_meta:A(m(),S()).nullish(),description:m().nullish(),modelId:Mg,name:m()}),hL=X([$("error"),$("warning"),$("information"),$("hint")]),dL=w({_meta:A(m(),S()).nullish()}),pL=w({_meta:A(m(),S()).nullish()}),fL=w({_meta:A(m(),S()).nullish()}),mL=w({_meta:A(m(),S()).nullish()}),gL=w({_meta:A(m(),S()).nullish()}),vL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),yL=w({diff:m(),uri:m()}),wL=w({endLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:m()}),bL=w({_meta:A(m(),S()).nullish()}),SL=w({_meta:A(m(),S()).nullish()}),_L=w({languageId:m(),text:m(),uri:m()}),AL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),EL=X([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),kL=w({excerpts:z(wL),uri:m()}),CL=w({_meta:A(m(),S()).nullish()}),TL=w({_meta:A(m(),S()).nullish()}),$L=w({name:m(),owner:m(),remoteUrl:m()}),RL=w({_meta:A(m(),S()).nullish()}),IL=w({_meta:A(m(),S()).nullish(),jump:bL.nullish(),rename:TL.nullish(),searchAndReplace:RL.nullish()}),xL=w({id:m(),isRegex:Fe().nullish(),replace:m(),search:m(),uri:m()}),PL=X([$("automatic"),$("diagnostic"),$("manual")]),LL=w({_meta:A(m(),S()).nullish(),maxCount:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),DL=w({_meta:A(m(),S()).nullish(),diagnostics:dL.nullish(),editHistory:vL.nullish(),openFiles:SL.nullish(),recentFiles:AL.nullish(),relatedSnippets:CL.nullish(),userActions:LL.nullish()}),ML=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Fp)}),OL=w({default:G().nullish(),description:m().nullish(),maximum:G().nullish(),minimum:G().nullish(),title:m().nullish()}),eb=m(),NL=X([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),zL=w({_meta:A(m(),S()).nullish(),kind:NL,name:m(),optionId:eb}),ZL=X([$("high"),$("medium"),$("low")]),HL=X([$("pending"),$("in_progress"),$("completed")]),UL=w({_meta:A(m(),S()).nullish(),content:m(),priority:ZL,status:HL}),FL=w({_meta:A(m(),S()).nullish(),entries:z(UL)}),Wi=w({character:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),VL=w({id:m(),position:Wi,uri:m()}),BL=w({id:m(),newName:m(),position:Wi,uri:m()}),qL=w({action:m(),position:Wi,timestampMs:G(),uri:m()}),tb=X([$("utf-16"),$("utf-32"),$("utf-8")]),WL=w({_meta:A(m(),S()).nullish(),auth:kP.optional().default({terminal:!1}),elicitation:YP.nullish(),fs:XP.optional().default({readTextFile:!1,writeTextFile:!1}),nes:IL.nullish(),positionEncodings:z(tb).optional(),terminal:Fe().optional().default(!1)}),jL=w({_meta:A(m(),S()).nullish(),audio:Fe().optional().default(!1),embeddedContext:Fe().optional().default(!1),image:Fe().optional().default(!1)}),nb=G().int().gte(0).lte(65535),GL=w({_meta:A(m(),S()).nullish(),clientCapabilities:WL.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Q8.nullish(),protocolVersion:nb}),ml=w({end:Wi,start:Wi}),YL=w({message:m(),range:ml,severity:hL,uri:m()}),JL=w({languageId:m(),lastFocusedMs:G().nullish(),uri:m(),visibleRange:ml.nullish()}),KL=w({_meta:A(m(),S()).nullish(),diagnostics:z(YL).nullish(),editHistory:z(yL).nullish(),openFiles:z(JL).nullish(),recentFiles:z(_L).nullish(),relatedSnippets:z(kL).nullish(),userActions:z(qL).nullish()}),XL=w({newText:m(),range:ml}),QL=w({cursorPosition:Wi.nullish(),edits:z(XL),id:m(),uri:m()}),eD=X([QL.and(w({kind:$("edit")})),VL.and(w({kind:$("jump")})),BL.and(w({kind:$("rename")})),xL.and(w({kind:$("searchAndReplace")}))]),tD=w({_meta:A(m(),S()).nullish(),content:m()}),nD=w({_meta:A(m(),S()).nullish()}),ho=X([G(),m()]).nullable();w({_meta:A(m(),S()).nullish(),requestId:ho});const rD=N8(["assistant","user"]),Vu=w({_meta:A(m(),S()).nullish(),audience:z(rD).nullish(),lastModified:m().nullish(),priority:G().nullish()}),iD=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),data:m(),mimeType:m()}),sD=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),data:m(),mimeType:m(),uri:m().nullish()}),oD=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),description:m().nullish(),mimeType:m().nullish(),name:m(),size:G().nullish(),title:m().nullish(),uri:m()}),aD=w({_meta:A(m(),S()).nullish(),optionId:eb}),lD=X([w({outcome:$("cancelled")}),aD.and(w({outcome:$("selected")}))]),cD=w({_meta:A(m(),S()).nullish(),outcome:lD}),uD=w({_meta:A(m(),S()).nullish()}),hD=w({_meta:A(m(),S()).nullish()}),dD=w({currentValue:Fe()}),pD=m(),rb=m(),fD=X([$("mode"),$("model"),$("thought_level"),m()]),Og=m(),ib=w({_meta:A(m(),S()).nullish(),description:m().nullish(),name:m(),value:Og}),mD=w({_meta:A(m(),S()).nullish(),group:pD,name:m(),options:z(ib)}),gD=X([z(ib),z(mD)]),vD=w({currentValue:Og,options:gD}),gl=Up(X([vD.and(w({type:$("select")})),dD.and(w({type:$("boolean")}))]),w({_meta:A(m(),S()).nullish(),category:fD.nullish(),description:m().nullish(),id:rb,name:m()})),yD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),wD=w({_meta:A(m(),S()).nullish()}),ae=m(),bD=w({_meta:A(m(),S()).nullish(),id:m(),sessionId:ae}),SD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),_D=w({_meta:A(m(),S()).nullish(),sessionId:ae}),AD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),sb=w({_meta:A(m(),S()).nullish(),args:z(m()).optional(),command:m(),cwd:m().nullish(),env:z(j8).optional(),outputByteLimit:G().nullish(),sessionId:ae}),ED=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),kD=w({_meta:A(m(),S()).nullish(),position:Wi,sessionId:ae,uri:m(),version:G(),visibleRange:ml}),CD=w({_meta:A(m(),S()).nullish(),languageId:m(),sessionId:ae,text:m(),uri:m(),version:G()}),TD=w({_meta:A(m(),S()).nullish(),sessionId:ae,uri:m()}),$D=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Fp).optional(),sessionId:ae}),ob=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),RD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Fp),sessionId:ae}),ab=w({_meta:A(m(),S()).nullish(),limit:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m(),sessionId:ae}),ID=w({_meta:A(m(),S()).nullish(),id:m(),reason:EL.nullish(),sessionId:ae}),lb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),xD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),mcpServers:z(Fp).optional(),sessionId:ae}),PD=w({_meta:A(m(),S()).nullish(),additionalDirectories:z(m()).optional(),cwd:m(),sessionId:ae,title:m().nullish(),updatedAt:m().nullish()}),LD=w({_meta:A(m(),S()).nullish(),nextCursor:m().nullish(),sessions:z(PD)}),DD=w({_meta:A(m(),S()).nullish(),title:m().nullish(),updatedAt:m().nullish()}),MD=w({_meta:A(m(),S()).nullish()}),Vp=m(),OD=w({_meta:A(m(),S()).nullish(),currentModeId:Vp}),ND=w({_meta:A(m(),S()).nullish(),description:m().nullish(),id:Vp,name:m()}),Bp=w({_meta:A(m(),S()).nullish(),availableModes:z(ND),currentModeId:Vp}),qp=w({_meta:A(m(),S()).nullish(),availableModels:z(uL),currentModelId:Mg}),zD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),ZD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),HD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish(),sessionId:ae}),UD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl).nullish(),models:qp.nullish(),modes:Bp.nullish()}),FD=w({_meta:A(m(),S()).nullish()}),VD=w({_meta:A(m(),S()).nullish(),additionalDirectories:uD.nullish(),close:hD.nullish(),fork:wD.nullish(),list:MD.nullish(),resume:FD.nullish()}),BD=Up(X([w({type:$("boolean"),value:Fe()}),w({value:Og})]),w({_meta:A(m(),S()).nullish(),configId:rb,sessionId:ae})),qD=w({_meta:A(m(),S()).nullish(),configOptions:z(gl)}),WD=w({_meta:A(m(),S()).nullish(),modeId:Vp,sessionId:ae}),jD=w({_meta:A(m(),S()).nullish()}),GD=w({_meta:A(m(),S()).nullish(),modelId:Mg,sessionId:ae}),YD=w({_meta:A(m(),S()).nullish()}),JD=w({_meta:A(m(),S()).nullish(),sessionId:ae}),KD=X([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),XD=X([$("email"),$("uri"),$("date"),$("date-time")]),QD=w({default:m().nullish(),description:m().nullish(),enum:z(m()).nullish(),format:XD.nullish(),maxLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(W8).nullish(),pattern:m().nullish(),title:m().nullish()}),eM=w({_meta:A(m(),S()).nullish(),context:KL.nullish(),position:Wi,selection:ml.nullish(),sessionId:ae,triggerKind:PL,uri:m(),version:G()}),tM=w({_meta:A(m(),S()).nullish(),suggestions:z(eD)}),nM=w({_meta:A(m(),S()).nullish(),terminalId:m()}),rM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),cb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),iM=w({_meta:A(m(),S()).nullish(),exitStatus:rM.nullish(),output:m(),truncated:Fe()}),sM=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),text:m()}),oM=w({range:ml.nullish(),text:m()}),aM=w({_meta:A(m(),S()).nullish(),contentChanges:z(oM),sessionId:ae,uri:m(),version:G()});w({method:m(),params:X([SD,CD,aM,ED,TD,kD,bD,ID,Y8]).nullish()});const lM=X([$("full"),$("incremental")]),cM=w({_meta:A(m(),S()).nullish(),syncKind:lM}),uM=w({_meta:A(m(),S()).nullish(),didChange:cM.nullish(),didClose:pL.nullish(),didFocus:fL.nullish(),didOpen:mL.nullish(),didSave:gL.nullish()}),hM=w({_meta:A(m(),S()).nullish(),document:uM.nullish()}),dM=w({_meta:A(m(),S()).nullish(),context:DL.nullish(),events:hM.nullish()}),pM=w({_meta:A(m(),S()).nullish(),auth:rL.optional().default({}),loadSession:Fe().optional().default(!1),mcpCapabilities:oL.optional().default({http:!1,sse:!1}),nes:dM.nullish(),positionEncoding:tb.nullish(),promptCapabilities:jL.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:VD.optional().default({})}),fM=w({_meta:A(m(),S()).nullish(),agentCapabilities:pM.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Q8.nullish(),authMethods:z(IP).optional().default([]),protocolVersion:nb}),mM=w({_meta:A(m(),S()).nullish(),mimeType:m().nullish(),text:m(),uri:m()}),gM=X([mM,LP]),vM=w({_meta:A(m(),S()).nullish(),annotations:Vu.nullish(),resource:gM}),Ng=X([sM.and(w({type:$("text")})),sD.and(w({type:$("image")})),iD.and(w({type:$("audio")})),oD.and(w({type:$("resource_link")})),vM.and(w({type:$("resource")}))]),yM=w({_meta:A(m(),S()).nullish(),content:Ng}),qf=w({_meta:A(m(),S()).nullish(),content:Ng,messageId:m().nullish()}),wM=w({_meta:A(m(),S()).nullish(),messageId:m().nullish(),prompt:z(Ng),sessionId:ae}),bM=w({anyOf:z(W8)}),ub=X([yM.and(w({type:$("content")})),ZP.and(w({type:$("diff")})),nM.and(w({type:$("terminal")}))]),hb=m(),db=w({_meta:A(m(),S()).nullish(),line:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:m()}),pb=X([$("pending"),$("in_progress"),$("completed"),$("failed")]),fb=X([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),SM=w({_meta:A(m(),S()).nullish(),content:z(ub).optional(),kind:fb.optional(),locations:z(db).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:pb.optional(),title:m(),toolCallId:hb}),mb=w({_meta:A(m(),S()).nullish(),content:z(ub).nullish(),kind:fb.nullish(),locations:z(db).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:pb.nullish(),title:m().nullish(),toolCallId:hb}),gb=w({_meta:A(m(),S()).nullish(),options:z(zL),sessionId:ae,toolCall:mb}),_M=w({_meta:A(m(),S()).nullish(),hint:m()}),AM=_M,EM=w({_meta:A(m(),S()).nullish(),description:m(),input:AM.nullish(),name:m()}),kM=w({_meta:A(m(),S()).nullish(),availableCommands:z(EM)}),CM=w({enum:z(m()),type:jP}),TM=X([CM,bM]),$M=w({default:z(m()).nullish(),description:m().nullish(),items:TM,maxItems:G().nullish(),minItems:G().nullish(),title:m().nullish()}),RM=X([QD.and(w({type:$("string")})),OL.and(w({type:$("number")})),QP.and(w({type:$("integer")})),DP.and(w({type:$("boolean")})),$M.and(w({type:$("array")}))]),IM=w({description:m().nullish(),properties:A(m(),RM).optional().default({}),required:z(m()).nullish(),title:m().nullish(),type:WP.optional().default("object")}),xM=w({requestedSchema:IM}),PM=Up(X([xM.and(w({mode:$("form")})),JP.and(w({mode:$("url")}))]),w({_meta:A(m(),S()).nullish(),message:m(),sessionId:ae})),LM=w({cachedReadTokens:G().nullish(),cachedWriteTokens:G().nullish(),inputTokens:G(),outputTokens:G(),thoughtTokens:G().nullish(),totalTokens:G()}),DM=w({_meta:A(m(),S()).nullish(),stopReason:KD,usage:LM.nullish(),userMessageId:m().nullish()});X([w({id:ho,result:X([fM,PP,sL,HD,ZD,LD,zD,UD,OP,jD,qD,DM,YD,JD,tM,MP,K8])}),w({error:G8,id:ho})]);const MM=w({_meta:A(m(),S()).nullish(),cost:NP.nullish(),size:G(),used:G()}),OM=X([qf.and(w({sessionUpdate:$("user_message_chunk")})),qf.and(w({sessionUpdate:$("agent_message_chunk")})),qf.and(w({sessionUpdate:$("agent_thought_chunk")})),SM.and(w({sessionUpdate:$("tool_call")})),mb.and(w({sessionUpdate:$("tool_call_update")})),FL.and(w({sessionUpdate:$("plan")})),kM.and(w({sessionUpdate:$("available_commands_update")})),OD.and(w({sessionUpdate:$("current_mode_update")})),yD.and(w({sessionUpdate:$("config_option_update")})),DD.and(w({sessionUpdate:$("session_info_update")})),MM.and(w({sessionUpdate:$("usage_update")}))]),vb=w({_meta:A(m(),S()).nullish(),sessionId:ae,update:OM});w({method:m(),params:X([vb,BP,Y8]).nullish()});const yb=w({_meta:A(m(),S()).nullish(),sessionId:ae,terminalId:m()}),NM=w({_meta:A(m(),S()).nullish(),exitCode:G().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:m().nullish()}),zM=w({name:m(),uri:m()}),ZM=w({_meta:A(m(),S()).nullish(),repository:$L.nullish(),workspaceFolders:z(zM).nullish(),workspaceUri:m().nullish()});w({id:ho,method:m(),params:X([GL,xP,iL,ML,RD,tL,$D,xD,AD,WD,BD,wM,GD,ZM,eM,_D,J8]).nullish()});const wb=w({_meta:A(m(),S()).nullish(),content:m(),path:m(),sessionId:ae});w({id:ho,method:m(),params:X([wb,ab,gb,sb,cb,lb,yb,ob,PM,J8]).nullish()});const HM=w({_meta:A(m(),S()).nullish()});X([w({id:ho,result:X([HM,tD,cD,zP,iM,nD,NM,eL,qP,K8])}),w({error:G8,id:ho})]);var oe;class UM{constructor(e,t){p(this,oe);const r=e(this),i=async(a,l)=>{var c,d,f,g,y,v,_;switch(a){case ur.fs_write_text_file:{const E=wb.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,E)}case ur.fs_read_text_file:{const E=ab.parse(l);return(d=r.readTextFile)==null?void 0:d.call(r,E)}case ur.session_request_permission:{const E=gb.parse(l);return r.requestPermission(E)}case ur.terminal_create:{const E=sb.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,E)}case ur.terminal_output:{const E=cb.parse(l);return(g=r.terminalOutput)==null?void 0:g.call(r,E)}case ur.terminal_release:{const E=lb.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,E))??{}}case ur.terminal_wait_for_exit:{const E=yb.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,E)}case ur.terminal_kill:{const E=ob.parse(l);return await((_=r.killTerminal)==null?void 0:_.call(r,E))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw Oe.methodNotFound(a)}},o=async(a,l)=>{switch(a){case ur.session_update:{const c=vb.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Oe.methodNotFound(a)}};h(this,oe,new FM(i,o,t))}async initialize(e){return await s(this,oe).sendRequest(we.initialize,e)}async newSession(e){return await s(this,oe).sendRequest(we.session_new,e)}async loadSession(e){return await s(this,oe).sendRequest(we.session_load,e)??{}}async unstable_forkSession(e){return await s(this,oe).sendRequest(we.session_fork,e)}async listSessions(e){return await s(this,oe).sendRequest(we.session_list,e)}async unstable_resumeSession(e){return await s(this,oe).sendRequest(we.session_resume,e)}async unstable_closeSession(e){return await s(this,oe).sendRequest(we.session_close,e)}async setSessionMode(e){return await s(this,oe).sendRequest(we.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await s(this,oe).sendRequest(we.session_set_model,e)??{}}async setSessionConfigOption(e){return await s(this,oe).sendRequest(we.session_set_config_option,e)}async authenticate(e){return await s(this,oe).sendRequest(we.authenticate,e)??{}}async unstable_logout(e){return await s(this,oe).sendRequest(we.logout,e)??{}}async prompt(e){return await s(this,oe).sendRequest(we.session_prompt,e)}async cancel(e){return await s(this,oe).sendNotification(we.session_cancel,e)}async unstable_startNes(e){return await s(this,oe).sendRequest(we.nes_start,e)}async unstable_suggestNes(e){return await s(this,oe).sendRequest(we.nes_suggest,e)}async unstable_closeNes(e){return await s(this,oe).sendRequest(we.nes_close,e)??{}}async unstable_didOpenDocument(e){return await s(this,oe).sendNotification(we.document_did_open,e)}async unstable_didChangeDocument(e){return await s(this,oe).sendNotification(we.document_did_change,e)}async unstable_didCloseDocument(e){return await s(this,oe).sendNotification(we.document_did_close,e)}async unstable_didSaveDocument(e){return await s(this,oe).sendNotification(we.document_did_save,e)}async unstable_didFocusDocument(e){return await s(this,oe).sendNotification(we.document_did_focus,e)}async unstable_acceptNes(e){return await s(this,oe).sendNotification(we.nes_accept,e)}async unstable_rejectNes(e){return await s(this,oe).sendNotification(we.nes_reject,e)}async extMethod(e,t){return await s(this,oe).sendRequest(e,t)}async extNotification(e,t){return await s(this,oe).sendNotification(e,t)}get signal(){return s(this,oe).signal}get closed(){return s(this,oe).closed}}oe=new WeakMap;var li,Nd,Tc,$c,ta,na,Pn,Rc,Ae,bb,T0,Sb,_b,Ab,Eb,$0,Vl;class FM{constructor(e,t,r){p(this,Ae);p(this,li,new Map);p(this,Nd,0);p(this,Tc);p(this,$c);p(this,ta);p(this,na,Promise.resolve());p(this,Pn,new AbortController);p(this,Rc);h(this,Tc,e),h(this,$c,t),h(this,ta,r),h(this,Rc,new Promise(i=>{s(this,Pn).signal.addEventListener("abort",()=>i())})),u(this,Ae,bb).call(this)}get signal(){return s(this,Pn).signal}get closed(){return s(this,Rc)}async sendRequest(e,t){u(this,Ae,$0).call(this);const r=nh(this,Nd)._++,i=new Promise((o,a)=>{s(this,li).set(r,{resolve:o,reject:a})});return await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:r,method:e,params:t}),i}async sendNotification(e,t){u(this,Ae,$0).call(this),await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",method:e,params:t})}}li=new WeakMap,Nd=new WeakMap,Tc=new WeakMap,$c=new WeakMap,ta=new WeakMap,na=new WeakMap,Pn=new WeakMap,Rc=new WeakMap,Ae=new WeakSet,bb=async function(){let e;try{const t=s(this,ta).readable.getReader();try{for(;!s(this,Pn).signal.aborted;){const{value:r,done:i}=await t.read();if(i)break;if(r)try{u(this,Ae,Sb).call(this,r)}catch(o){console.error("Unexpected error during message processing:",r,o),"id"in r&&r.id!==void 0&&u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{t.releaseLock()}}catch(t){e=t}finally{u(this,Ae,T0).call(this,e)}},T0=function(e){if(s(this,Pn).signal.aborted)return;const t=e??new Error("ACP connection closed");for(const r of s(this,li).values())r.reject(t);s(this,li).clear(),s(this,Pn).abort(t)},Sb=async function(e){if("method"in e&&"id"in e){const t=await u(this,Ae,_b).call(this,e.method,e.params);"error"in t&&console.error("Error handling request",e,t.error),await u(this,Ae,Vl).call(this,{jsonrpc:"2.0",id:e.id,...t})}else if("method"in e){const t=await u(this,Ae,Ab).call(this,e.method,e.params);"error"in t&&console.error("Error handling notification",e,t.error)}else"id"in e?u(this,Ae,Eb).call(this,e):console.error("Invalid message",{message:e})},_b=async function(e,t){try{return{result:await s(this,Tc).call(this,e,t)??null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof ky)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},Ab=async function(e,t){try{return await s(this,$c).call(this,e,t),{result:null}}catch(r){if(r instanceof Oe)return r.toResult();if(r instanceof ky)return Oe.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 Oe.internalError(i?JSON.parse(i):{}).toResult()}catch{return Oe.internalError({details:i}).toResult()}}},Eb=function(e){const t=s(this,li).get(e.id);if(t){if("result"in e)t.resolve(e.result);else if("error"in e){const{code:r,message:i,data:o}=e.error;t.reject(new Oe(r,i,o))}s(this,li).delete(e.id)}else console.error("Got response to unknown request",e.id)},$0=function(){if(s(this,Pn).signal.aborted)throw s(this,Pn).signal.reason??new Error("ACP connection closed")},Vl=async function(e){return h(this,na,s(this,na).then(async()=>{const t=s(this,ta).writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(t=>{u(this,Ae,T0).call(this,t)})),s(this,na)};class Oe extends Error{constructor(t,r,i){super(r);C(this,"code");C(this,"data");this.code=t,this.name="RequestError",this.data=i}static parseError(t,r){return new Oe(-32700,`Parse error${r?`: ${r}`:""}`,t)}static invalidRequest(t,r){return new Oe(-32600,`Invalid request${r?`: ${r}`:""}`,t)}static methodNotFound(t){return new Oe(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,r){return new Oe(-32602,`Invalid params${r?`: ${r}`:""}`,t)}static internalError(t,r){return new Oe(-32603,`Internal error${r?`: ${r}`:""}`,t)}static authRequired(t,r){return new Oe(-32e3,`Authentication required${r?`: ${r}`:""}`,t)}static resourceNotFound(t){return new Oe(-32002,`Resource not found${t?`: ${t}`:""}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function VM(n,e,t){const r=n.dispose.bind(n);n.dispose=()=>{if(!e())return t(),r()}}function kb(n){var t;class e extends n{constructor(...o){super(...o);p(this,t,!1);VM(this,()=>s(this,t),()=>{h(this,t,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,t)}}return t=new WeakMap,e}const BM=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,qM=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,WM=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,jM=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,GM=/^[A-Za-z0-9_@%+=:,./-]+$/,YM=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,JM="single_session",KM={name:"television-acp-client",version:"0.0.0"},Cb="agent:main:television",XM=kb(Kr);var ra,Ln,Rt,Dn,ci,ln,br,Mn,cn,ui,un,ia,sa,On,tt,Sr,oa,_s,_r,hi,Ic,hn,Nn,zd,zn,R,R0,Tb,$b,Rb,Dh,Ib,xb,Pb,Lb,Db,Mb,Ob,rs,Lo,Do,dr,Nb,Mo,I0,x0,Mh,zb,Oh,P0,L0,xc,Pc,Nh,Oo,D0,Zb;class QM extends XM{constructor(t){super();p(this,R);p(this,ra,"disconnected");p(this,Ln,null);p(this,Rt,new Map);p(this,Dn,null);p(this,ci,null);p(this,ln,null);p(this,br,null);p(this,Mn,null);p(this,cn,null);p(this,ui);p(this,un,null);p(this,ia,0);p(this,sa,1);p(this,On,null);p(this,tt,null);p(this,Sr,!1);p(this,oa,!1);p(this,_s,!1);p(this,_r,null);p(this,hi,new Set);p(this,Ic);p(this,hn);p(this,Nn);p(this,zd,t=>{u(this,R,$b).call(this,t)});p(this,zn,null);p(this,xc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket closed")});p(this,Pc,()=>{u(this,R,Oo).call(this,"ACP bridge websocket error")});h(this,hn,t),h(this,Nn,t.sessionMode??JM),h(this,ui,t.mappedSessionStore??eO()),h(this,Ic,t.createSocket??(r=>new WebSocket(r)))}get status(){return s(this,ra)}get messages(){return[...s(this,Rt).values()]}get enabled(){return s(this,hn).enabled??!1}setToken(t){s(this,hn).token=t??""}setEnabled(t){s(this,hn).enabled=t,t||(u(this,R,Nh).call(this),h(this,Ln,null),u(this,R,dr).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){s(this,ci)===null&&(h(this,Ln,null),h(this,ci,u(this,R,Tb).call(this)));try{await s(this,ci),await u(this,R,Dh).call(this)}catch(t){throw u(this,R,Oo).call(this,Wf(t)),t}}}dispose(){u(this,R,Nh).call(this),h(this,Ln,null),u(this,R,dr).call(this,"disposed")}async sendMessage(t){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,R0).call(this,"ready")),(s(this,Mn)===null||s(this,un)!==u(this,R,Oh).call(this))&&await u(this,R,Dh).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=t.text.trim();if(!r)throw new Error("Cannot send an empty message");u(this,R,Lo).call(this,{id:u(this,R,Mo).call(this,"user"),kind:"user",text:r,status:"final"}),u(this,R,dr).call(this,"running");try{const i=await u(this,R,Mh).call(this).prompt({sessionId:u(this,R,x0).call(this),prompt:[{type:"text",text:u(this,R,Nb).call(this,r)}]});u(this,R,rs).call(this,i.stopReason==="cancelled"?"cancelled":"final"),u(this,R,dr).call(this,"ready")}catch(i){throw u(this,R,Zb).call(this)||(u(this,R,rs).call(this,"error"),u(this,R,dr).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await u(this,R,R0).call(this,"ready"));const t=u(this,R,Oh).call(this);((r=s(this,cn))==null?void 0:r.sessionIdStrategy)==="mapped"?s(this,ui).clearActualSessionId(t):h(this,ia,s(this,ia)+1),h(this,ln,null),h(this,br,null),h(this,Mn,null),h(this,un,null),u(this,R,D0).call(this)}async cancel(){this.status==="running"&&(u(this,R,dr).call(this,"cancelling"),await u(this,R,Mh).call(this).cancel({sessionId:u(this,R,x0).call(this)}))}setChannelContext(t){var o,a,l;if(t===null){if(s(this,tt)===null)return;h(this,tt,null),h(this,Sr,!1);return}const r={channelID:t.channelID,channelName:t.channelName};if(((o=s(this,tt))==null?void 0:o.channelID)===r.channelID&&((a=s(this,tt))==null?void 0:a.channelName)===r.channelName)return;const i=((l=s(this,tt))==null?void 0:l.channelID)??null;if(h(this,tt,r),s(this,Nn)==="single_session"){(!s(this,un)||i!==r.channelID)&&h(this,Sr,!0);return}s(this,un)!==u(this,R,P0).call(this,r.channelID)&&(h(this,ln,null),h(this,br,null),s(this,Dn)&&this.status==="ready"&&u(this,R,Dh).call(this).catch(c=>{u(this,R,Oo).call(this,Wf(c))}))}}ra=new WeakMap,Ln=new WeakMap,Rt=new WeakMap,Dn=new WeakMap,ci=new WeakMap,ln=new WeakMap,br=new WeakMap,Mn=new WeakMap,cn=new WeakMap,ui=new WeakMap,un=new WeakMap,ia=new WeakMap,sa=new WeakMap,On=new WeakMap,tt=new WeakMap,Sr=new WeakMap,oa=new WeakMap,_s=new WeakMap,_r=new WeakMap,hi=new WeakMap,Ic=new WeakMap,hn=new WeakMap,Nn=new WeakMap,zd=new WeakMap,zn=new WeakMap,R=new WeakSet,R0=async function(t){if(this.status!==t){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(s(this,Ln)??"ACPClient is disconnected");await new Promise((r,i)=>{const o=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===t){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,Ln)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},Tb=async function(){try{const{stream:t,socket:r,metadata:i}=await iO({serverURL:s(this,hn).serverURL,token:s(this,hn).token,createSocket:s(this,Ic),onDisconnect:s(this,zd)});h(this,cn,i),h(this,zn,r),r.addEventListener("close",s(this,xc)),r.addEventListener("error",s(this,Pc)),h(this,Dn,new UM(o=>({connection:o,sessionUpdate:async a=>{await u(this,R,xb).call(this,a)},requestPermission:async a=>u(this,R,Pb).call(this,a)}),t)),await s(this,Dn).initialize({protocolVersion:EP,clientCapabilities:{},clientInfo:KM})}catch(t){throw t}},$b=function(t){u(this,R,Oo).call(this,Wf(t))},Rb=function(t){const r=t==null?void 0:t.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})`)},Dh=async function(){const t=u(this,R,Oh).call(this);if(s(this,ln)&&s(this,br)===t){await s(this,ln);return}h(this,br,t),h(this,ln,u(this,R,Ib).call(this,t)),await s(this,ln)},Ib=async function(t){var c;const r=u(this,R,Mh).call(this);u(this,R,D0).call(this);let i,o=!1,a=null;const l={cwd:u(this,R,zb).call(this),mcpServers:[],_meta:{sessionKey:t}};try{if(h(this,_s,!0),h(this,_r,null),((c=s(this,cn))==null?void 0:c.sessionIdStrategy)==="mapped"){const d=s(this,ui).getActualSessionId(t);if(d)try{const f=await r.loadSession({...l,sessionId:d});if(tO(f))throw new Error("Mapped ACP session was not found");a=f,i=d,o=!0}catch{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}else{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,ui).setActualSessionId(t,i),o=!1}}else try{a=await r.loadSession({...l,sessionId:t}),i=t,o=s(this,Rt).size>0}catch{const d=await r.newSession(l);a=d,i=d.sessionId,o=!1}}finally{h(this,_s,!1),h(this,_r,null),u(this,R,rs).call(this,"final")}u(this,R,Rb).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),h(this,Mn,i),h(this,un,t),h(this,oa,!0),o?(s(this,hi).add(t),s(this,Nn)==="single_session"&&h(this,Sr,!1)):(s(this,hi).delete(t),h(this,Sr,s(this,Nn)==="single_session")),h(this,Ln,null),u(this,R,dr).call(this,"ready")},xb=async function(t){const r=t.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&u(this,R,Ob).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&u(this,R,Lb).call(this,r.content.text);return;case"tool_call":u(this,R,Db).call(this,r);return;case"tool_call_update":u(this,R,Mb).call(this,r);return;case"agent_thought_chunk":return;default:return}},Pb=async function(t){return{outcome:{outcome:"cancelled"}}},Lb=function(t){h(this,_r,null);const r=rO(t);if(!r)return;if(!s(this,On)){const o={id:u(this,R,Mo).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};h(this,On,o.id),u(this,R,Lo).call(this,o);return}const i=s(this,Rt).get(s(this,On));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");u(this,R,Do).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Db=function(t){u(this,R,rs).call(this,"final");const r=u(this,R,I0).call(this,t.toolCallId),i=Ny("content"in t?t.content:void 0),o={id:(r==null?void 0:r.id)??u(this,R,Mo).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:t.title,toolKind:t.kind??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:t.locations??(r==null?void 0:r.locations)};if(r){u(this,R,Do).call(this,o);return}u(this,R,Lo).call(this,o)},Mb=function(t){const r=u(this,R,I0).call(this,t.toolCallId),i=(r==null?void 0:r.text)??"",o=Ny(t.content),a=o?`${i}${o}`:i,l={id:(r==null?void 0:r.id)??u(this,R,Mo).call(this,"tool"),kind:"tool_call",toolCallId:t.toolCallId,title:(r==null?void 0:r.title)??t.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:t.status==="failed"?"failed":t.status==="completed"?"completed":"in_progress",text:a,locations:t.locations??(r==null?void 0:r.locations)};if(r){u(this,R,Do).call(this,l);return}u(this,R,Lo).call(this,l)},Ob=function(t){if(u(this,R,rs).call(this,"final"),!t)return;const r=s(this,_s)?s(this,_r):null;if(!r){const o=Oy(t);if(!o)return;const a={id:u(this,R,Mo).call(this,"user"),kind:"user",text:o,status:"final"};u(this,R,Lo).call(this,a),s(this,_s)&&h(this,_r,a.id);return}const i=s(this,Rt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");u(this,R,Do).call(this,{...i,text:Oy(`${i.text}${t}`)})},rs=function(t){if(!s(this,On))return;const r=s(this,Rt).get(s(this,On));(r==null?void 0:r.kind)==="assistant"&&u(this,R,Do).call(this,{...r,status:t}),h(this,On,null)},Lo=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Ff("messages-changed"))},Do=function(t){s(this,Rt).set(t.id,t),this.dispatchEvent(new Ff("messages-changed"))},dr=function(t){s(this,ra)!==t&&(h(this,ra,t),this.dispatchEvent(new a$("status-changed")))},Nb=function(t){var d;const r=s(this,un);if(!r)return t;const i=s(this,tt)?s(this,Nn)==="single_session"?s(this,Sr)||!s(this,hi).has(r):!s(this,hi).has(r):!1,o=s(this,oa)&&(s(this,tt)!==null||jM.test(t));if(!(o||i))return t;o&&h(this,oa,!1),i&&(h(this,Sr,!1),s(this,hi).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=((d=s(this,cn))==null?void 0:d.tvArgs)??[];return c.length>0&&l.push(`To reach this Television server, add these arguments to each tv command that contacts it: ${c.map(aO).join(" ")}`),s(this,tt)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${s(this,tt).channelID}`),l.push(`channel_name: ${s(this,tt).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]","",t),l.join(`
43
- `)},Mo=function(t){const r=`${t}-${s(this,sa)}`;return h(this,sa,s(this,sa)+1),r},I0=function(t){for(const r of s(this,Rt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===t)return r;return null},x0=function(){if(!s(this,Mn))throw new Error("ACP session is not ready");return s(this,Mn)},Mh=function(){if(!s(this,Dn))throw new Error("ACP connection is not ready");return s(this,Dn)},zb=function(){var r;const t=(r=s(this,cn))==null?void 0:r.sessionCwd;if(!t)throw new Error("ACP bridge session cwd is not ready");return t},Oh=function(){var r;if(s(this,Nn)==="single_session")return u(this,R,L0).call(this,`${Cb}-${(s(this,hn).clientGUID??"default-client").toLowerCase()}`);const t=(r=s(this,tt))==null?void 0:r.channelID;if(!t)throw new Error("Channel context is required for per-channel session mode");return u(this,R,P0).call(this,t)},P0=function(t){return u(this,R,L0).call(this,nO(s(this,Nn),t,s(this,hn).clientGUID??"default-client"))},L0=function(t){var r;return((r=s(this,cn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&s(this,ia)>0?`${t}:epoch-${s(this,ia)}`:t},xc=new WeakMap,Pc=new WeakMap,Nh=function(){h(this,Dn,null),h(this,ci,null),h(this,ln,null),h(this,br,null),h(this,Mn,null),h(this,un,null),h(this,cn,null),s(this,zn)&&(s(this,zn).removeEventListener("close",s(this,xc)),s(this,zn).removeEventListener("error",s(this,Pc)),s(this,zn).close(),h(this,zn,null))},Oo=function(t){const r=s(this,Dn)!==null||s(this,ci)!==null||s(this,ln)!==null||s(this,br)!==null||s(this,Mn)!==null||s(this,un)!==null||s(this,cn)!==null||s(this,zn)!==null;this.disposed||this.status==="disconnected"&&!r||(u(this,R,rs).call(this,"error"),u(this,R,Nh).call(this),h(this,Ln,t??null),u(this,R,dr).call(this,"disconnected"))},D0=function(){const t=s(this,Rt).size>0;h(this,On,null),h(this,_r,null),h(this,sa,1),s(this,Rt).clear(),t&&this.dispatchEvent(new Ff("messages-changed"))},Zb=function(){return this.status==="disconnected"};function eO(){const n=new Map;return{getActualSessionId(e){return n.get(e)??null},setActualSessionId(e,t){n.set(e,t)},clearActualSessionId(e){n.delete(e)}}}function tO(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function nO(n,e,t){return n==="single_session"?`${Cb}-${t.toLowerCase()}`:`agent:main:television-${t.toLowerCase()}-${e.toLowerCase()}`}function Hb(n){return n.replace(/^(?:\s*\n)+/,"")}function Oy(n){let e=n;return e=e.replace(BM,""),e=e.replace(qM,""),e=e.replace(WM,""),e=Hb(e),e}function rO(n){let e=n;return e=e.replace(YM,""),e=Hb(e),e}function Ny(n){return!n||n.length===0?"":n.flatMap(e=>e.type==="content"&&e.content.type==="text"?[e.content.text]:[]).join("")}async function iO(n){const e=n.createSocket(cO(n.serverURL,n.token));let t=!1,r,i;const o=new Promise((d,f)=>{r=d,i=f}),a=new ReadableStream({start(d){let f=!1;const g=()=>{e.send(JSON.stringify({type:"acp-bridge-connect"}))},y=E=>{const x=lO(E);if(!x)return;let B;try{B=JSON.parse(x)}catch(P){const J=P instanceof Error?P:new Error(String(P));i(J),d.error(J);return}switch(B.type){case"acp-bridge-status":if(B.status==="ready"){let P;try{P=sO(B)}catch(J){const O=J instanceof Error?J:new Error(String(J));t||i(O),d.error(O);return}t||(t=!0,r(P));return}if(B.status==="error"||B.status==="exited"){const P=new Error(B.error??`ACP bridge ${B.status}`);t||i(P),d.error(P)}return;case"acp-bridge-message":d.enqueue(B.message);return}},v=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket closed");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.close()},_=()=>{var x;if(f)return;f=!0;const E=new Error("ACP bridge websocket error");t||i(E),(x=n.onDisconnect)==null||x.call(n,E),d.error(E)};e.addEventListener("open",g),e.addEventListener("message",y),e.addEventListener("close",v),e.addEventListener("error",_)}}),l=new WritableStream({async write(d){await o,e.send(JSON.stringify({type:"acp-bridge-message",message:d}))},close(){e.close()},abort(){e.close()}}),c=await o;return{stream:{readable:a,writable:l},socket:e,metadata:c}}function sO(n){const{agent:e,sessionIdStrategy:t,sessionCwd:r,tvArgs:i}=n;if((e==="openclaw"||e==="hermes")&&(t==="deterministic"||t==="mapped")&&typeof r=="string"&&r.length>0&&oO(i))return{agent:e,sessionIdStrategy:t,sessionCwd:r,tvArgs:i};throw new Error("ACP bridge ready status missing bootstrap metadata")}function oO(n){return Array.isArray(n)&&n.every(e=>typeof e=="string")}function aO(n){return GM.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`}function lO(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 e=n.data;if(typeof e=="string")return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(Array.isArray(e))return Buffer.concat(e).toString("utf8")}return null}function cO(n,e){const t=new URL(n);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.pathname="/acp",t.search="",t.searchParams.set("token",e),t.hash="",t.toString()}function Wf(n){return n instanceof Error?n.message:String(n)}const zy="television.acpClientGUID",Zy="television.acpMappedSessions",Hy=1;var aa;class uO{constructor(){p(this,aa,new Map)}getActualSessionId(e){return s(this,aa).get(e)??null}setActualSessionId(e,t){s(this,aa).set(e,t)}clearActualSessionId(e){s(this,aa).delete(e)}}aa=new WeakMap;var la,Lc,Mt,zh,Zh,M0;class hO{constructor(e,t){p(this,Mt);p(this,la);p(this,Lc);h(this,la,e),h(this,Lc,t)}getActualSessionId(e){const t=u(this,Mt,Zh).call(this)[u(this,Mt,zh).call(this,e)];return typeof t=="string"&&t.length>0?t:null}setActualSessionId(e,t){const r=u(this,Mt,Zh).call(this);r[u(this,Mt,zh).call(this,e)]=t,u(this,Mt,M0).call(this,r)}clearActualSessionId(e){const t=u(this,Mt,Zh).call(this);delete t[u(this,Mt,zh).call(this,e)],u(this,Mt,M0).call(this,t)}}la=new WeakMap,Lc=new WeakMap,Mt=new WeakSet,zh=function(e){return JSON.stringify([s(this,Lc),e])},Zh=function(){const e=s(this,la).getItem(Zy);if(!e)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!="object"||t===null||Array.isArray(t))return{};const r=t;return r.version!==Hy?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},M0=function(e){const t={version:Hy,entries:e};s(this,la).setItem(Zy,JSON.stringify(t))};function Ub(){return typeof window>"u"?null:window.localStorage}function dO(n){const e=n.getItem(zy);if(e)return e;const t=$g().toLowerCase();return n.setItem(zy,t),t}const Uy=4401,pO=401,fh=1e3,fO=3e4;class Hh extends Error{constructor(e="Authentication required"){super(e),this.name="AuthError"}}class mO extends Kr{constructor(t){var a,l;super();C(this,"url");C(this,"name");C(this,"telemetryMeta");C(this,"status","unauthorized");C(this,"channels",new Map);C(this,"client");C(this,"acpClient");C(this,"_token");C(this,"attempting",!1);C(this,"nextRetryAt",null);C(this,"hasEverConnected",!1);C(this,"browserDemoMode",!1);C(this,"hasAuthRejected",!1);C(this,"hasAuthTokenRejected",!1);C(this,"bootState","pending");C(this,"serverVersion",null);C(this,"updateState",null);C(this,"decideBoot");C(this,"navigationPending");C(this,"createSocket");C(this,"createClient");C(this,"socket",null);C(this,"connectAttempt",0);C(this,"autoReconnect",!1);C(this,"retryTimer",null);C(this,"retryDelay",fh);C(this,"visibilityEventTarget");C(this,"networkEventTarget");C(this,"onVisibilityChange");C(this,"onNetworkOnline");C(this,"telemetryActivityAgent");this.url=Vi(t.url),this.name=t.name,this.decideBoot=t.decideBoot??null,this.navigationPending=t.navigationPending??(()=>!1),this._token=t.token??null,this.telemetryMeta=t.telemetryMeta??null,this.createSocket=t.createSocket??(c=>new WebSocket(c)),this.createClient=t.createClient??((c,d,f)=>new DT(c,{token:d??void 0,onUnauthorized:()=>this.handleAuthRejected(),...f?{telemetryMeta:f}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=t.mappedSessionStore??(t.acpStorage?new hO(t.acpStorage,this.url):new uO);this.acpClient=new QM({serverURL:this.url,token:this._token??"",...t.createACPSocket?{createSocket:t.createACPSocket}:t.createSocket?{createSocket:t.createSocket}:{},...t.clientGUID?{clientGUID:t.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=t.visibilityEventTarget!==void 0?t.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=t.networkEventTarget!==void 0?t.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=t.telemetryDocumentTarget!==void 0?t.telemetryDocumentTarget:typeof document<"u"?document:null,o=t.telemetryWindowTarget!==void 0?t.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&o?SP({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(t){this._token=t,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(t),this.cancelRetryTimer(),this.retryDelay=fh,this.autoReconnect=!0,await this.attempt()}dispose(){var t,r,i,o;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(t=this.socket)==null||t.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(t){const r=Ad(t,this.renderOptions());return Br()?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:Br(),browserDemo:this.browserDemoMode}}getContentURL(t){const r=Ad(t,this.renderOptions()).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(t){const{channel:r}=await this.client.channels.create({name:t});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(t){switch(t.type){case"channel-created":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Ul("channels-changed"));break;case"channel-updated":this.channels.set(t.channel.id,structuredClone(t.channel)),this.dispatchEvent(new Ul("channels-changed"));break;case"channel-removed":this.channels.delete(t.channelID),this.dispatchEvent(new Ul("channels-changed"));break;case"artifact-created":{const r=this.channels.get(t.channelID);r&&!vT(r).includes(t.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[t.artifact.id],geometry:{...B2},size:{...q2}}]);break}case"artifact-removed":{const r=this.channels.get(t.channelID);r&&(r.layout=g0(r.layout,t.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 gO(t,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const t=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new At("change"));const r=this.createSocket(vO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((o,a)=>{let l=!1;const c=()=>{var g;l||this.connectAttempt!==t||(l=!0,this.retryDelay=fh,this.hasEverConnected=!0,this.setStatus("connected"),(g=this.telemetryActivityAgent)==null||g.start(),o())},d=g=>{l||this.connectAttempt!==t||(l=!0,a(g))},f=async()=>{const g=this.hasEverConnected;try{const[{channels:y},v,_]=await Promise.all([this.client.channels.list(),this.client.display.get(),g?null:this.readDemoMode()]);g||(this.browserDemoMode=(_==null?void 0:_.browserExternalPages)===!0),this.channels=new Map(y.map(E=>[E.id,structuredClone(E)])),this.acpClient.setEnabled(v.acpEnabled),this.dispatchEvent(new At("change")),g&&this.dispatchEvent(new Ul("channels-changed")),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:v.focusedChannelId}})),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...v.pinnedChannelIds]}})),c(),g&&this.connectAttempt===t&&this.dispatchEvent(new n8("server-reconnected",{serverURL:this.url}))}catch(y){if(AO(y)){d(new Hh);return}d(y instanceof Error?y:new Error(String(y)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",g=>{const y=_O(g);if(!y)return;if(y.type==="server-status"){const _=y;this.serverVersion=_.version,this.updateState=_.update??null;let E=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===t&&(this.decideBoot(_)==="boot"?(this.bootState="booted",E=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new r8("server-status",{serverURL:this.url,message:_})),E?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new At("change"));return}if(!SO(y.type))return;const v=y;this.applyServerEvent(v),this.dispatchEvent(new Ph("server-event",{serverURL:this.url,event:v}))}),r.addEventListener("close",g=>{if(this.connectAttempt!==t)return;this.socket=null;const y=yO(g);if(!l){d(y===Uy?new Hh:new Error("Connection closed before initialization"));return}if(y===Uy){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===t){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}d(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(t){if(t instanceof Hh){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(t){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const t=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,fO),this.nextRetryAt=Date.now()+t,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},t),this.dispatchEvent(new At("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new At("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=fh,this.attempt().catch(()=>{})))}sendTelemetryActivity(t){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(t)))}sendTelemetrySignal(t,r){var o;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:gT,clientId:this.telemetryMeta.clientId,event:t,properties:r};(o=this.socket)==null||o.send(JSON.stringify(i))}setStatus(t){this.status!==t&&(this.status=t,this.dispatchEvent(new At("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function gO(n,e){throw new Error(`Unexpected ${e}: ${JSON.stringify(n)}`)}function vO(n,e,t=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",e&&r.searchParams.set("token",e),t)for(const[i,o]of bP(t))r.searchParams.set(i,o);return r.hash="",r.toString()}function yO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const wO={"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},bO=new Set(Object.keys(wO));function SO(n){return bO.has(n)}function _O(n){const e=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||!("type"in t)||typeof t.type!="string"?null:t}function AO(n){return n instanceof pl&&n.status===pO}const EO="Local";var Ft,dn,rr,O0,N0,Fb,Dc,Mc,Oc,Nc,zc;class kO extends Kr{constructor(t){super();p(this,rr);C(this,"connection");C(this,"clientGUID");C(this,"acpStorage");C(this,"connectError",null);p(this,Ft);p(this,dn,!1);p(this,Dc,()=>{s(this,dn)||(u(this,rr,Fb).call(this),this.dispatchEvent(new At("change")))});p(this,Mc,t=>{s(this,dn)||this.dispatchEvent(new Ph("server-event",{serverURL:t.serverURL,event:t.event}))});p(this,Oc,()=>{s(this,dn)||this.dispatchEvent(new Ul("channels-changed"))});p(this,Nc,t=>{s(this,dn)||this.dispatchEvent(new n8("server-reconnected",{serverURL:t.serverURL}))});p(this,zc,t=>{s(this,dn)||this.dispatchEvent(new r8("server-status",{serverURL:t.serverURL,message:t.message}))});h(this,Ft,t.localStore),this.acpStorage=t.acpStorage===void 0?Ub():t.acpStorage,this.clientGUID=t.clientGUID??(this.acpStorage?dO(this.acpStorage):$g().toLowerCase());const r=Vi(t.serverURL);t.launchToken!==void 0&&t.launchToken!==null&&s(this,Ft).set(ly(s(this,Ft).get(),r,t.launchToken));const i=t.launchToken??ay(s(this,Ft).get(),r),o=t.createSocket??(l=>new WebSocket(l)),a=t.createConnection??(l=>new mO(l));this.connection=a({url:r,name:t.connectionName??EO,token:i,createSocket:o,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:t.telemetryMeta??null,decideBoot:t.decideBoot,navigationPending:t.navigationPending}),this.connection.addEventListener("change",s(this,Dc)),this.connection.addEventListener("server-event",s(this,Mc)),this.connection.addEventListener("channels-changed",s(this,Oc)),this.connection.addEventListener("server-reconnected",s(this,Nc)),this.connection.addEventListener("server-status",s(this,zc))}get storedAuthToken(){return ay(s(this,Ft).get(),this.connection.url)}async connect(){await u(this,rr,O0).call(this,this.connection.token)}async authenticate(t){s(this,Ft).set(ly(s(this,Ft).get(),this.connection.url,t)),await u(this,rr,O0).call(this,t)}dispose(){s(this,dn)||(h(this,dn,!0),this.connection.removeEventListener("change",s(this,Dc)),this.connection.removeEventListener("server-event",s(this,Mc)),this.connection.removeEventListener("channels-changed",s(this,Oc)),this.connection.removeEventListener("server-reconnected",s(this,Nc)),this.connection.removeEventListener("server-status",s(this,zc)),this.connection.dispose())}}Ft=new WeakMap,dn=new WeakMap,rr=new WeakSet,O0=async function(t){if(!s(this,dn)){u(this,rr,N0).call(this,null);try{await this.connection.connect(t)}catch(r){u(this,rr,N0).call(this,r instanceof Hh?null:r instanceof Error?r.message:String(r))}}},N0=function(t){this.connectError!==t&&(this.connectError=t,this.dispatchEvent(new At("change")))},Fb=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const t=s(this,Ft).get(),r=h$(t,this.connection.url);r!==t&&s(this,Ft).set(r),this.connection.token!==null&&this.connection.clearToken()},Dc=new WeakMap,Mc=new WeakMap,Oc=new WeakMap,Nc=new WeakMap,zc=new WeakMap;const z0="tv-nav:",nl="tv-reload",Fy=100,CO=1e3,TO=60,$O=60,RO=24,IO=30,xO=IO*RO*$O*TO*CO;function qr(n){try{const e=new URL(n,window.location.href),t=e.searchParams.has(nl);return e.searchParams.delete(nl),e.origin===window.location.origin?`${e.pathname}${e.search}${e.hash}`:t?e.toString():n}catch{return n}}var Zc,ca,ge,pe,As,Pe,Vb,Qr,Bb,Z0,H0;class PO extends Kr{constructor(t,r){super();p(this,Pe);p(this,Zc);p(this,ca);p(this,ge,[]);p(this,pe,-1);p(this,As,0);h(this,Zc,t),h(this,ca,qr(r)),u(this,Pe,Vb).call(this)}get currentURL(){var t;return s(this,pe)===-1?null:((t=s(this,ge)[s(this,pe)])==null?void 0:t.url)??null}get canGoBack(){return s(this,pe)>-1}get canGoForward(){return s(this,pe)<s(this,ge).length-1}get entries(){return s(this,ge).map(t=>({...t}))}get cursor(){return s(this,pe)}navigate(t){const r=qr(t);if(r===s(this,ca)){if(s(this,pe)===-1)return;h(this,pe,-1),u(this,Pe,Qr).call(this);return}s(this,pe)<s(this,ge).length-1&&h(this,ge,s(this,ge).slice(0,s(this,pe)+1)),s(this,ge).push({url:r}),h(this,pe,s(this,ge).length-1),u(this,Pe,Z0).call(this),u(this,Pe,Qr).call(this)}replace(t){var i;if(s(this,pe)===-1){this.navigate(t);return}const r=qr(t);if(r===s(this,ca)){h(this,ge,s(this,ge).filter((o,a)=>a!==s(this,pe))),h(this,pe,-1),u(this,Pe,Qr).call(this);return}((i=s(this,ge)[s(this,pe)])==null?void 0:i.url)!==r&&(h(this,ge,s(this,ge).map((o,a)=>a===s(this,pe)?{url:r}:o)),u(this,Pe,Qr).call(this))}back(){s(this,pe)!==-1&&(h(this,pe,s(this,pe)-1),u(this,Pe,Qr).call(this))}forward(){this.canGoForward&&(h(this,pe,s(this,pe)+1),u(this,Pe,Qr).call(this))}reset(){s(this,pe)===-1&&s(this,ge).length===0||(h(this,ge,[]),h(this,pe,-1),u(this,Pe,Qr).call(this))}}Zc=new WeakMap,ca=new WeakMap,ge=new WeakMap,pe=new WeakMap,As=new WeakMap,Pe=new WeakSet,Vb=function(){const t=localStorage.getItem(s(this,Pe,H0));if(t!==null)try{const r=JSON.parse(t);if(!qb(r))return;h(this,ge,r.entries.map(i=>({url:i.url}))),h(this,pe,r.cursor),h(this,As,r.lastWritten),u(this,Pe,Z0).call(this)}catch{h(this,ge,[]),h(this,pe,-1),h(this,As,0)}},Qr=function(){h(this,As,Date.now());try{localStorage.setItem(s(this,Pe,H0),JSON.stringify(u(this,Pe,Bb).call(this)))}catch(t){if(!MO(t))throw t}this.dispatchEvent(new At("change"))},Bb=function(){return{v:1,entries:s(this,ge).map(t=>({...t})),cursor:s(this,pe),lastWritten:s(this,As)}},Z0=function(){if(s(this,ge).length<=Fy)return;const t=s(this,ge).length-Fy;h(this,ge,s(this,ge).slice(t)),h(this,pe,Math.max(-1,s(this,pe)-t))},H0=function(){return LO(s(this,Zc))};function LO(n){return`${z0}${n}`}function DO(n){const e=Date.now()-xO,t=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(z0)))continue;const o=i.slice(z0.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{t.push(i);continue}if(!qb(l)){t.push(i);continue}!n.has(o)&&l.lastWritten<e&&t.push(i)}for(const r of t)localStorage.removeItem(r)}function MO(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function qb(n){if(typeof n!="object"||n===null)return!1;const e=n;if(e.v!==1||!Array.isArray(e.entries))return!1;const t=e.cursor;return typeof t!="number"||!Number.isInteger(t)||typeof e.lastWritten!="number"||!Number.isFinite(e.lastWritten)||t<-1||t>=e.entries.length?!1:e.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const jf="tv-channel-sidebar-collapsed";var Es;class OO{constructor(e){p(this,Es);h(this,Es,e)}read(){return s(this,Es).getItem(jf)==="true"}setCollapsed(e){try{e?s(this,Es).setItem(jf,"true"):s(this,Es).removeItem(jf)}catch{}}}Es=new WeakMap;const Gf="tv-channel-sidebar-width",U0=160,F0=350,mh=260,NO=/^-?\d+$/;var ks;class zO{constructor(e){p(this,ks);h(this,ks,e)}read(){const e=s(this,ks).getItem(Gf);if(e===null||!NO.test(e))return null;const t=BigInt(e);return t<BigInt(U0)?U0:t>BigInt(F0)?F0:Number(t)}commit(e){const t=Wb(Math.round(e));try{s(this,ks).setItem(Gf,String(t))}catch{}return t}clear(){try{s(this,ks).removeItem(Gf)}catch{}}}ks=new WeakMap;function Wb(n){return Math.min(Math.max(n,U0),F0)}const ZO="1.4.11";function zg(n=ZO){return n!==void 0&&n.length>0?n:"0.0.0"}function Zg(){let n=!1;return{get pending(){return n},begin(e){n||(n=!0,e())}}}const V0="tv-reload-attempted";function HO(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:NT(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 UO(n){const e=n.getItem(V0);if(e===null)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;const r=t;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function FO(n){const e=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,t=n.reload??(()=>location.reload()),r=n.navigationLatch??Zg(),i=n.bundleVersion??zg();if(e===null)return{dispose(){}};let o=null;const a=()=>{if(o===null)return;const d=n.owner.connection;if(d.url!==n.primaryServerURL||d.status!=="connected")return;const f=o;o=null,d.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=d=>{if(r.pending)return;const f=HO({bundleVersion:i,serverVersion:d.message.version,originMatch:d.serverURL===n.primaryServerURL,marker:UO(e)});switch(f.action){case"reload":e.setItem(V0,JSON.stringify(f.marker)),r.begin(t);return;case"signal-autoreloaded":e.removeItem(V0),o={fromVersion:f.fromVersion,toVersion:f.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 VO(n){const e=Br(n.search),t=V8(n.search),r=t!==null&&Op(t)?t:null;return{electron:e,shellVersion:r}}function BO(n){return!n.electron||n.requiredDesktopVersion===null||!Op(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===vd?!1:Tg(n.requiredDesktopVersion,n.shellVersion)}const qO=`# 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.`,WO=`# 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 jb(n,e=!1){return e?qO:n===null?WO:n.upgradeMarkdown}function jO(n){const e=BO(n);return{gated:e,instructionsMarkdown:e?jb(n.desktop):null,suppressUpdateToast:e}}function GO(n){const e=n.reload??(()=>location.reload()),t=n.navigationLatch??Zg();let r=null,i=!1;const o=new Set,a=f=>{var g;return jO({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((g=f.update)==null?void 0:g.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const g=f.requiredDesktopVersion;if(g===null||o.has(g))return;o.add(g);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:g})}const d=f=>{t.pending||f.serverURL===n.primaryServerURL&&(a(f.message).gated?(i=!0,l(),c(f.message)):i&&t.begin(e))};return{get gated(){return i},decideBoot(f){return a(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",d)},dispose(){r==null||r.removeEventListener("server-status",d),r=null}}}var ua;class YO extends Kr{constructor(){super(...arguments);p(this,ua,!1)}get toastsSuppressed(){return s(this,ua)}suppressToasts(){s(this,ua)||(h(this,ua,!0),this.dispatchEvent(new At("change")))}}ua=new WeakMap;const JO=`### Desktop app update ready
48
-
49
- Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,KO="tv-desktop-self-update-dismissed";function XO(n){return JO.replace("{version}",n)}var Hc,ha,Uc,Cs,da;class QO extends Kr{constructor({electron:t,bridge:r}){super();p(this,Hc);p(this,ha);p(this,Uc,!1);p(this,Cs,null);p(this,da,!1);h(this,Hc,t),h(this,ha,r??null)}get version(){return s(this,Cs)}get restarting(){return s(this,da)}subscribe(){if(s(this,Uc))return;h(this,Uc,!0);const t=s(this,ha);!s(this,Hc)||typeof(t==null?void 0:t.onDesktopUpdateDownloaded)!="function"||t.onDesktopUpdateDownloaded(r=>{typeof r!="string"||r.length===0||r===s(this,Cs)||(h(this,Cs,r),this.dispatchEvent(new At("change")))})}restart(){var t,r;s(this,Cs)===null||s(this,da)||(h(this,da,!0),(r=(t=s(this,ha))==null?void 0:t.restartToInstallUpdate)==null||r.call(t),this.dispatchEvent(new At("change")))}}Hc=new WeakMap,ha=new WeakMap,Uc=new WeakMap,Cs=new WeakMap,da=new WeakMap;function e9(n,e=window){const t=e.__televisionAppearanceResolver;if(t!==void 0)return t;const r=e.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;e.document.documentElement.dataset.theme=c},l={setPreference(c){o(c)&&(i=c,a())}};return e.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function Gb(n){return typeof n=="object"&&n!==null}function Yb(n){return!Gb(n)||n.type!=="ready"?!1:!("id"in n)}function Jb(n){return!(!Gb(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const Kb=sn(),Xb="No handler registered for update-content",Qb="handleUpdateContent: handler already registered",Vy="television-artifact-bridge";function e6(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const t6=kb(Kr);var pa,fa,ma,Ts,$s,ga,Ne,B0,n6,r6,No,Uh,Bw;let t9=(Bw=class extends t6{constructor(t){super();p(this,Ne);p(this,pa);p(this,fa);p(this,ma);p(this,Ts,null);p(this,$s,null);p(this,ga,!1);h(this,pa,t);const r=t.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");h(this,fa,r),h(this,ma,i=>u(this,Ne,n6).call(this,i)),s(this,fa).addEventListener("message",s(this,ma))}get content(){return s(this,$s)}set content(t){u(this,Ne,Uh).call(this),h(this,$s,t),s(this,ga)&&u(this,Ne,B0).call(this,t)}handleUpdateContent(t){if(u(this,Ne,Uh).call(this),s(this,Ts)!==null)throw new Error(Qb);h(this,Ts,t)}notifyStylesChanged(){if(u(this,Ne,Uh).call(this),!s(this,ga))return;const t={type:"styles-changed"};u(this,Ne,No).call(this,t)}dispose(){s(this,fa).removeEventListener("message",s(this,ma)),h(this,Ts,null)}},pa=new WeakMap,fa=new WeakMap,ma=new WeakMap,Ts=new WeakMap,$s=new WeakMap,ga=new WeakMap,Ne=new WeakSet,B0=function(t){const r={type:"content-updated",content:t};u(this,Ne,No).call(this,r)},n6=function(t){if(this.disposed||t.source!==s(this,pa).contentWindow)return;const r=t.data;if(Yb(r)){h(this,ga,!0),this.dispatchEvent(new Kb("ready")),s(this,$s)!==null&&u(this,Ne,B0).call(this,s(this,$s));return}if(Jb(r)){u(this,Ne,r6).call(this,r);return}},r6=async function(t){const r=s(this,Ts);if(r===null){u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:Xb}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,Ne,No).call(this,{type:"response",id:t.id,error:{message:e6(i)}});return}this.disposed||u(this,Ne,No).call(this,{type:"response",id:t.id,result:{}})},No=function(t){const r=s(this,pa).contentWindow;r&&r.postMessage(t,"*")},Uh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},Bw);var Rs,va,Is,xs,ya,ze,q0,i6,s6,zo,Fh;class n9 extends t6{constructor(t){super();p(this,ze);p(this,Rs);p(this,va);p(this,Is,null);p(this,xs,null);p(this,ya,!1);h(this,Rs,t),h(this,va,r=>u(this,ze,i6).call(this,r)),s(this,Rs).addEventListener("ipc-message",s(this,va))}get content(){return s(this,xs)}set content(t){u(this,ze,Fh).call(this),h(this,xs,t),s(this,ya)&&u(this,ze,q0).call(this,t)}handleUpdateContent(t){if(u(this,ze,Fh).call(this),s(this,Is)!==null)throw new Error(Qb);h(this,Is,t)}notifyStylesChanged(){if(u(this,ze,Fh).call(this),!s(this,ya))return;const t={type:"styles-changed"};u(this,ze,zo).call(this,t)}dispose(){s(this,Rs).removeEventListener("ipc-message",s(this,va)),h(this,Is,null)}}Rs=new WeakMap,va=new WeakMap,Is=new WeakMap,xs=new WeakMap,ya=new WeakMap,ze=new WeakSet,q0=function(t){const r={type:"content-updated",content:t};u(this,ze,zo).call(this,r)},i6=function(t){var o;if(this.disposed)return;const r=t.detail??t;if(!r||r.channel!==Vy)return;const i=(o=r.args)==null?void 0:o[0];if(Yb(i)){h(this,ya,!0),this.dispatchEvent(new Kb("ready")),s(this,xs)!==null&&u(this,ze,q0).call(this,s(this,xs));return}if(Jb(i)){u(this,ze,s6).call(this,i);return}},s6=async function(t){const r=s(this,Is);if(r===null){u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:Xb}});return}try{await r(t.content)}catch(i){if(this.disposed)return;u(this,ze,zo).call(this,{type:"response",id:t.id,error:{message:e6(i)}});return}this.disposed||u(this,ze,zo).call(this,{type:"response",id:t.id,result:{}})},zo=function(t){var r,i;(i=(r=s(this,Rs)).send)==null||i.call(r,Vy,t)},Fh=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 cc=globalThis,By=n=>n,Ed=cc.trustedTypes,qy=Ed?Ed.createPolicy("lit-html",{createHTML:n=>n}):void 0,o6="$lit$",ii=`lit$${Math.random().toFixed(9).slice(2)}$`,a6="?"+ii,r9=`<${a6}>`,po=document,gc=()=>po.createComment(""),vc=n=>n===null||typeof n!="object"&&typeof n!="function",Hg=Array.isArray,i9=n=>Hg(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Yf=`[
54
- \f\r]`,Tl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wy=/-->/g,jy=/>/g,es=RegExp(`>|${Yf}(?:([^\\s"'>=/]+)(${Yf}*=${Yf}*(?:[^
55
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Gy=/'/g,Yy=/"/g,l6=/^(?:script|style|textarea|title)$/i,s9=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),M=s9(1),at=Symbol.for("lit-noChange"),te=Symbol.for("lit-nothing"),Jy=new WeakMap,ds=po.createTreeWalker(po,129);function c6(n,e){if(!Hg(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return qy!==void 0?qy.createHTML(e):e}const o9=(n,e)=>{const t=n.length-1,r=[];let i,o=e===2?"<svg>":e===3?"<math>":"",a=Tl;for(let l=0;l<t;l++){const c=n[l];let d,f,g=-1,y=0;for(;y<c.length&&(a.lastIndex=y,f=a.exec(c),f!==null);)y=a.lastIndex,a===Tl?f[1]==="!--"?a=Wy:f[1]!==void 0?a=jy:f[2]!==void 0?(l6.test(f[2])&&(i=RegExp("</"+f[2],"g")),a=es):f[3]!==void 0&&(a=es):a===es?f[0]===">"?(a=i??Tl,g=-1):f[1]===void 0?g=-2:(g=a.lastIndex-f[2].length,d=f[1],a=f[3]===void 0?es:f[3]==='"'?Yy:Gy):a===Yy||a===Gy?a=es:a===Wy||a===jy?a=Tl:(a=es,i=void 0);const v=a===es&&n[l+1].startsWith("/>")?" ":"";o+=a===Tl?c+r9:g>=0?(r.push(d),c.slice(0,g)+o6+c.slice(g)+ii+v):c+ii+(g===-2?l:v)}return[c6(n,o+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class yc{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,a=0;const l=e.length-1,c=this.parts,[d,f]=o9(e,t);if(this.el=yc.createElement(d,r),ds.currentNode=this.el.content,t===2||t===3){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(i=ds.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const g of i.getAttributeNames())if(g.endsWith(o6)){const y=f[a++],v=i.getAttribute(g).split(ii),_=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:_[2],strings:v,ctor:_[1]==="."?l9:_[1]==="?"?c9:_[1]==="@"?u9:jp}),i.removeAttribute(g)}else g.startsWith(ii)&&(c.push({type:6,index:o}),i.removeAttribute(g));if(l6.test(i.tagName)){const g=i.textContent.split(ii),y=g.length-1;if(y>0){i.textContent=Ed?Ed.emptyScript:"";for(let v=0;v<y;v++)i.append(g[v],gc()),ds.nextNode(),c.push({type:2,index:++o});i.append(g[y],gc())}}}else if(i.nodeType===8)if(i.data===a6)c.push({type:2,index:o});else{let g=-1;for(;(g=i.data.indexOf(ii,g+1))!==-1;)c.push({type:7,index:o}),g+=ii.length-1}o++}}static createElement(e,t){const r=po.createElement("template");return r.innerHTML=e,r}}function rl(n,e,t=n,r){var a,l;if(e===at)return e;let i=r!==void 0?(a=t._$Co)==null?void 0:a[r]:t._$Cl;const o=vc(e)?void 0:e._$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,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=i:t._$Cl=i),i!==void 0&&(e=rl(n,i._$AS(n,e.values),i,r)),e}class a9{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,i=((e==null?void 0:e.creationScope)??po).importNode(t,!0);ds.currentNode=i;let o=ds.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new Wp(o,o.nextSibling,this,e):c.type===1?d=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(d=new h9(o,this,e)),this._$AV.push(d),c=r[++l]}a!==(c==null?void 0:c.index)&&(o=ds.nextNode(),a++)}return ds.currentNode=po,i}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}let Wp=class u6{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=te,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=rl(this,e,t),vc(e)?e===te||e==null||e===""?(this._$AH!==te&&this._$AR(),this._$AH=te):e!==this._$AH&&e!==at&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):i9(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==te&&vc(this._$AH)?this._$AA.nextSibling.data=e:this.T(po.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=yc.createElement(c6(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(t);else{const a=new a9(i,this),l=a.u(this.options);a.p(t),this.T(l),this._$AH=a}}_$AC(e){let t=Jy.get(e.strings);return t===void 0&&Jy.set(e.strings,t=new yc(e)),t}k(e){Hg(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const o of e)i===t.length?t.push(r=new u6(this.O(gc()),this.O(gc()),this,this.options)):r=t[i],r._$AI(o),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){const i=By(e).nextSibling;By(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},jp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,o){this.type=1,this._$AH=te,this._$AN=void 0,this.element=e,this.name=t,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=te}_$AI(e,t=this,r,i){const o=this.strings;let a=!1;if(o===void 0)e=rl(this,e,t,0),a=!vc(e)||e!==this._$AH&&e!==at,a&&(this._$AH=e);else{const l=e;let c,d;for(e=o[0],c=0;c<o.length-1;c++)d=rl(this,l[r+c],t,c),d===at&&(d=this._$AH[c]),a||(a=!vc(d)||d!==this._$AH[c]),d===te?e=te:e!==te&&(e+=(d??"")+o[c+1]),this._$AH[c]=d}a&&!i&&this.j(e)}j(e){e===te?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},l9=class extends jp{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===te?void 0:e}},c9=class extends jp{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==te)}},u9=class extends jp{constructor(e,t,r,i,o){super(e,t,r,i,o),this.type=5}_$AI(e,t=this){if((e=rl(this,e,t,0)??te)===at)return;const r=this._$AH,i=e===te&&r!==te||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==te&&(r===te||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}};class h9{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){rl(this,e)}}const d9={I:Wp},Jf=cc.litHtmlPolyfillSupport;Jf==null||Jf(yc,Wp),(cc.litHtmlVersions??(cc.litHtmlVersions=[])).push("3.3.2");const Vh=(n,e,t)=>{const r=e;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Wp(e.insertBefore(gc(),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:p9}=d9,Ky=n=>n,h6=n=>n.strings===void 0,Xy=()=>document.createComment(""),$l=(n,e,t)=>{var o;const r=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const a=r.insertBefore(Xy(),i),l=r.insertBefore(Xy(),i);t=new p9(a,l,n,n.options)}else{const a=t._$AB.nextSibling,l=t._$AM,c=l!==n;if(c){let d;(o=t._$AQ)==null||o.call(t,n),t._$AM=n,t._$AP!==void 0&&(d=n._$AU)!==l._$AU&&t._$AP(d)}if(a!==i||c){let d=t._$AA;for(;d!==a;){const f=Ky(d).nextSibling;Ky(r).insertBefore(d,i),d=f}}}return t},ts=(n,e,t=n)=>(n._$AI(e,t),n),f9={},d6=(n,e=f9)=>n._$AH=e,m9=n=>n._$AH,Kf=n=>{n._$AR(),n._$AA.remove()};/**
60
- * @license
61
- * Copyright 2017 Google LLC
62
- * SPDX-License-Identifier: BSD-3-Clause
63
- */const nr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},vl=n=>(...e)=>({_$litDirective$:n,values:e});let Bu=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
64
- * @license
65
- * Copyright 2017 Google LLC
66
- * SPDX-License-Identifier: BSD-3-Clause
67
- */const uc=(n,e)=>{var r;const t=n._$AN;if(t===void 0)return!1;for(const i of t)(r=i._$AO)==null||r.call(i,e,!1),uc(i,e);return!0},kd=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},p6=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),y9(e)}};function g9(n){this._$AN!==void 0?(kd(this),this._$AM=n,p6(this)):this._$AM=n}function v9(n,e=!1,t=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let o=t;o<r.length;o++)uc(r[o],!1),kd(r[o]);else r!=null&&(uc(r,!1),kd(r));else uc(this,n)}const y9=n=>{n.type==nr.CHILD&&(n._$AP??(n._$AP=v9),n._$AQ??(n._$AQ=g9))};class f6 extends Bu{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),p6(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(uc(this,e),kd(this))}setValue(e){if(h6(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}var Fc,Vc,di,Ps;class Nt extends f6{constructor(){super(...arguments);p(this,Fc,[]);p(this,Vc,!1);p(this,di,!1);p(this,Ps,!1)}connected(){}template(...t){return at}render(...t){return!this.isConnected||s(this,di)||this.setValue(t.length?t[0]:this.template(...s(this,Fc))),at}update(t,r){h(this,Fc,r),h(this,Ps,!1),h(this,di,!0);try{return s(this,Vc)||(h(this,Vc,!0),this.connected()),this.template(...r)}finally{h(this,di,!1)}}reconnected(){h(this,di,!0);try{this.connected()}finally{h(this,di,!1)}h(this,Ps,!0),queueMicrotask(()=>{s(this,Ps)&&(h(this,Ps,!1),this.render())})}}Fc=new WeakMap,Vc=new WeakMap,di=new WeakMap,Ps=new WeakMap;function zt(n){return vl(n)}function w9(n,e){var r;const t=n.connection;return t.authorizationRequired?t.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:t.gateHalted?{kind:"needs-upgrade",instructions:t.upgradeInstructions}:t.status!=="connected"?t.hasEverConnected?{kind:"disconnected",nextRetryAt:t.nextRetryAt}:t.firstConnectError!==null?{kind:"error",serverURL:e,message:t.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 b9='<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>',S9='<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>',_9='<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>',A9='<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>',E9='<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>',k9='<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>',C9='<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>',T9='<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>',$9='<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>',R9='<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>',I9='<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>',x9='<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>',P9='<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>',L9='<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>',D9='<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>',M9='<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>',O9='<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>',N9='<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>',z9='<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>',Z9='<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>',H9='<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>',U9='<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>',F9='<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>',V9='<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>',B9='<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>',q9='<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>',W9='<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>',j9='<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>',G9='<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>',Y9='<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>',J9='<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>',K9='<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>',X9='<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>',Q9='<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>',eN='<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>',tN='<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>',nN='<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>',rN='<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>',iN='<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>',sN='<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>',oN='<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>',aN='<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>',lN='<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>',cN='<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>',uN='<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>',hN='<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>',dN='<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>',pN='<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>',fN='<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>',mN='<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>',gN='<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>',vN='<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>',yN='<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>',wN='<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>',bN='<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>',SN='<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>',_N='<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>',AN='<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>',EN='<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>',kN='<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>',CN='<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>',TN='<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>',$N='<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>',RN='<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>',IN='<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>',xN='<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>',PN='<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>',LN='<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>',DN='<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>',MN='<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>',ON='<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>',NN='<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>',zN='<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>',ZN='<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>',HN='<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>',UN='<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>',FN='<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>',VN='<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>',BN='<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>',qN='<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>',WN='<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>',jN='<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>',GN='<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>',YN='<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>',JN='<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>',KN='<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>',XN='<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>',QN='<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>',ez='<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>',tz='<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>',nz='<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>',rz='<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>',iz='<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>',sz='<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>',oz='<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>',az='<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>',lz='<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>',cz='<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>',uz='<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>',hz='<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>',dz='<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>',pz=':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}}',m6=new CSSStyleSheet;m6.replaceSync(pz);const g6={check:b9,close:S9,copy:_9,pin:A9,search:E9,add:k9,more:C9,settings:T9,expand:$9,collapse:R9,"collapse-up":I9,select:x9,skills:P9,notification:L9,artifact:D9,spinner:M9,locked:O9,unpin:N9,back:z9,forward:Z9,television:H9,calendar:U9,grid:F9,hash:V9,delete:B9,edit:q9,link:W9,external:j9,download:G9,reload:Y9,warning:J9,info:K9,file:X9,folder:Q9,clock:eN,user:tN,upload:nN,star:rN,home:iN,send:sN,filter:oN,sort:aN,help:lN,chart:cN,image:uN,chat:hN,location:dN,play:pN,pause:fN,stop:mN,video:gN,music:vN,error:yN,email:wN,phone:bN,web:SN,tag:_N,bookmark:AN,table:EN,code:kN,group:CN,up:TN,down:$N,money:RN,bank:IN,card:xN,wallet:PN,gauge:LN,activity:DN,"trend-up":MN,"trend-down":ON,database:NN,server:zN,deploy:ZN,list:HN,terminal:UN,branch:FN,shield:VN,sidebar:BN,plane:qN,car:WN,bus:jN,bed:GN,food:YN,cake:JN,tent:KN,microphone:XN,luggage:QN,key:ez,sun:tz,moon:nz,at:rz,briefcase:iz,bicycle:sz,train:oz,gift:az,book:lz,camera:cz,inbox:uz,hourglass:hz,printer:dz};function fz(n){return n!==null&&Object.hasOwn(g6,n)}var Bc,W0;class v6 extends HTMLElement{constructor(){super(...arguments);p(this,Bc)}connectedCallback(){u(this,Bc,W0).call(this)}attributeChangedCallback(){this.isConnected&&u(this,Bc,W0).call(this)}}Bc=new WeakSet,W0=function(){const t=this.shadowRoot??this.attachShadow({mode:"open"});t.adoptedStyleSheets=[m6],this.replaceChildren();const r=this.getAttribute("name");t.innerHTML=fz(r)?g6[r]:""},C(v6,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",v6);function Gp(n){return M`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function Yp(n,e){let t=!1;const r=o=>{o.preventDefault(),e("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||e("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(){t||(t=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}function wc(n){n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:"nearest"})}function y6(n,e){if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||e.length===0)return!1;const t=e.indexOf(e[0].ownerDocument.activeElement),r=n.key==="ArrowDown",i=t<0?r?0:e.length-1:Math.max(0,Math.min(e.length-1,t+(r?1:-1)));return n.preventDefault(),n.stopImmediatePropagation(),wc(e[i]),!0}const j0=new WeakMap;function Zo(n,e,t){t===null?n.hasAttribute(e)&&n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}var Ar,qc,Wc,wa,pi,ji,G0,Zd,Hd,Ud,Fd,Vd,Y0;class mz{constructor(e){p(this,ji);C(this,"document");C(this,"panels",new Set);p(this,Ar,new Map);p(this,qc,new WeakMap);p(this,Wc,new AbortController);p(this,wa);p(this,pi,0);p(this,Zd,e=>{if(!(e.target instanceof Element))return;const t=e.target;s(this,qc).set(e,{inside:new Set([...this.panels].filter(r=>{var i;return this.contains(r,t)||((i=r.trigger)==null?void 0:i.contains(t))})),open:[...this.panels].filter(r=>r.open)})});p(this,Hd,e=>{var o,a,l;if(!(e.target instanceof Element))return;const t=e.target,r=s(this,qc).get(e),i=[...this.panels].find(c=>{var d;return(d=c.trigger)==null?void 0:d.contains(t)});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(e.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(t)&&((l=(a=c.behavior).click)==null||l.call(a,t))});p(this,Ud,e=>{var t,r;if(e.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(e.target)&&((r=(t=i.behavior).pointermove)==null||r.call(t,e.target))});p(this,Fd,e=>{var o,a,l,c;const t=u(this,ji,G0).call(this),r=t.find(d=>d.behavior.select),i=r??t.find(d=>d.behavior.keydown);if(!((a=i==null?void 0:(o=i.behavior).keydown)!=null&&a.call(o,e))){if(e.key==="Escape"&&r){u(this,ji,Y0).call(this,e,t,r);return}for(const d of this.panels)if(!d.open&&d.trigger===this.document.activeElement&&((c=(l=d.behavior).keydown)!=null&&c.call(l,e)))return}});p(this,Vd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;const t=u(this,ji,G0).call(this);u(this,ji,Y0).call(this,e,t)});this.document=e;const t={signal:s(this,Wc).signal};e.addEventListener("click",s(this,Zd),{...t,capture:!0}),e.addEventListener("click",s(this,Hd),t),e.addEventListener("keydown",s(this,Fd),{...t,capture:!0}),e.addEventListener("keydown",s(this,Vd),t),e.addEventListener("pointermove",s(this,Ud),t),h(this,wa,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),s(this,wa).observe(e,{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,pi))return;const e=()=>{h(this,pi,0);for(const t of this.panels)t.open&&t.place();[...this.panels].some(t=>t.open)&&h(this,pi,this.document.defaultView.requestAnimationFrame(e))};h(this,pi,this.document.defaultView.requestAnimationFrame(e))}remove(e){this.closed(e),this.panels.delete(e),!this.panels.size&&(s(this,Wc).abort(),s(this,wa).disconnect(),this.document.defaultView.cancelAnimationFrame(s(this,pi)),j0.delete(this.document))}prepareOpen(e){let t=null;for(const r of this.panels)r===e||!r.open||!e.trigger||!r.host.contains(e.trigger)||(t===null||t.host.contains(r.host))&&(t=r);if(s(this,Ar).set(e,t),!(e.manual||e.behavior.select))for(const r of this.panels)r.open&&r!==e&&!r.manual&&!r.behavior.select&&!this.isDescendant(e,r)&&r.close()}isDescendant(e,t){for(let r=s(this,Ar).get(e);r;r=s(this,Ar).get(r))if(r===t)return!0;return!1}contains(e,t){return t?e.host.contains(t)||[...this.panels].some(r=>this.isDescendant(r,e)&&r.host.contains(t)):!1}closeDescendants(e){for(const t of[...this.panels])this.isDescendant(t,e)&&t.close(!1)}closed(e){s(this,Ar).delete(e)}}Ar=new WeakMap,qc=new WeakMap,Wc=new WeakMap,wa=new WeakMap,pi=new WeakMap,ji=new WeakSet,G0=function(){const e=t=>{let r=0;for(let i=s(this,Ar).get(t);i;i=s(this,Ar).get(i))r++;return r};return[...this.panels].filter(t=>t.open).reverse().sort((t,r)=>e(r)-e(t))},Zd=new WeakMap,Hd=new WeakMap,Ud=new WeakMap,Fd=new WeakMap,Vd=new WeakMap,Y0=function(e,t,r){if(!r&&t.some(o=>o.manual&&e.composedPath().includes(o.host)))return;const i=r??t.find(o=>!o.manual);i&&!i.manual&&(e.preventDefault(),e.stopImmediatePropagation(),i.close())};var $e,fi,Ls,ba,mi,gi,ht,J0,w6,K0,jc,b6,X0;class Ug{constructor(e,t={}){p(this,ht);C(this,"host");C(this,"behavior");C(this,"trigger",null);p(this,$e);p(this,fi,!1);p(this,Ls,!1);p(this,ba,!0);p(this,mi,new Map);p(this,gi,new Set);p(this,jc,e=>{const t=e.target;t instanceof HTMLElement&&t!==this.host&&this.host.contains(t)&&s(this,gi).add(t)});this.host=e,this.behavior=t}get open(){return this.host.hasAttribute("open")&&s(this,fi)}get manual(){return this.host.hasAttribute("manual")}connect(){if(s(this,$e))return;const e=this.host.ownerDocument;h(this,$e,j0.get(e)),s(this,$e)||(h(this,$e,new mz(e)),j0.set(e,s(this,$e))),s(this,$e).panels.add(this),this.refresh()}disconnect(){var t,r,i,o;if(!s(this,$e))return;const e=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),this.host.removeAttribute("open"),(r=(t=this.behavior).closed)==null||r.call(t),u(this,ht,K0).call(this),u(this,ht,X0).call(this),e&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),u(this,ht,J0).call(this),(o=s(this,$e))==null||o.remove(this),h(this,$e,void 0)}refresh(){var r,i,o,a,l,c,d;if(!s(this,$e))return;const e=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),t=e instanceof HTMLButtonElement?e:null;if(t!==this.trigger&&(u(this,ht,J0).call(this),this.trigger=t),this.trigger&&Zo(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,fi))if(this.host.hasAttribute("open"))s(this,$e).prepareOpen(this),h(this,fi,!0),u(this,ht,w6).call(this),u(this,ht,b6).call(this),this.place(),(a=(o=this.behavior).opened)==null||a.call(o,s(this,Ls)),h(this,Ls,!1),s(this,$e).animate();else{const f=s(this,$e).contains(this,this.host.ownerDocument.activeElement);h(this,fi,!1),s(this,$e).closeDescendants(this),s(this,$e).closed(this),(c=(l=this.behavior).closed)==null||c.call(l),u(this,ht,K0).call(this),u(this,ht,X0).call(this),f&&s(this,ba)&&((d=this.trigger)!=null&&d.isConnected)&&this.trigger.focus({preventScroll:!0})}}toggle(e=!1){h(this,Ls,e),this.host.toggleAttribute("open")}show(e=!1){h(this,Ls,e),this.host.setAttribute("open","")}close(e=!0){h(this,ba,e),this.host.removeAttribute("open"),this.refresh(),h(this,ba,!0)}place(){var ve,Xe,Ze;if(!this.open||!this.trigger)return;const e=this.host,t=e.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(t.getComputedStyle(e).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const o=e.scrollTop,a=e.scrollLeft,l=[];for(const le of s(this,gi)){if(!le.isConnected||!e.contains(le)){s(this,gi).delete(le);continue}l.push({element:le,scrollTop:le.scrollTop,scrollLeft:le.scrollLeft})}e.style.maxWidth="none";const c=s(this,mi).get("max-height");c!=null&&c.value?e.style.setProperty("max-height",c.value,c.priority):e.style.removeProperty("max-height");const d=t.getComputedStyle(e).maxHeight;e.style.minWidth=this.behavior.select?`${Math.min(r.width,t.innerWidth-2*i)}px`:((ve=s(this,mi).get("min-width"))==null?void 0:ve.value)??"";const f=e.getBoundingClientRect(),g=Math.max(0,t.innerWidth-i-r.left),y=Math.max(0,r.right-i),v=f.width>g&&y>g,_=Math.min(t.innerWidth-2*i,v?y:g),E=Number.parseFloat(t.getComputedStyle(e).minWidth)||0;e.style.minWidth=`${Math.max(0,Math.min(E,_))}px`,e.style.maxWidth=`${Math.max(0,_)}px`;const x=e.getBoundingClientRect(),B=x.width,P=x.height,J=Math.max(i,Math.min(v?r.right-B:r.left,t.innerWidth-i-B));let O,Y;if(this.behavior.select){const le=(Ze=(Xe=this.behavior).selectedRow)==null?void 0:Ze.call(Xe),sr=le?le.getBoundingClientRect().top+le.offsetHeight/2-x.top:0,Zt=r.top+r.height/2-sr;if(Zt>=i&&Zt+P<=t.innerHeight-i)O=Zt,Y=t.innerHeight-i-Zt;else{const wl=t.innerHeight-i-r.top,bl=r.bottom-i,ju=P>wl&&bl>wl;Y=ju?bl:wl,O=ju?r.bottom-Math.min(P,Y):r.top}}else{const le=Math.max(0,t.innerHeight-i-r.bottom-i),sr=Math.max(0,r.top-2*i),Zt=P>le&&sr>le;Y=Zt?sr:le,O=Zt?r.top-i-Math.min(P,sr):r.bottom+i}const U=`${Math.max(0,Y)}px`;e.style.maxHeight=d==="none"?U:`min(${d}, ${U})`,e.style.left=`${J}px`,e.style.top=`${Math.max(i,Math.min(O,t.innerHeight-i-Math.min(P,Y)))}px`;const j=t.getComputedStyle(e),fe=j.boxSizing==="border-box",de=parseFloat(j.width)+(fe?0:parseFloat(j.paddingLeft)+parseFloat(j.paddingRight)+parseFloat(j.borderLeftWidth)+parseFloat(j.borderRightWidth)),Ve=parseFloat(j.height)+(fe?0:parseFloat(j.paddingTop)+parseFloat(j.paddingBottom)+parseFloat(j.borderTopWidth)+parseFloat(j.borderBottomWidth));e.style.setProperty("--_panel-edge-inset",`${e.style.top} auto auto ${e.style.left}`),e.style.setProperty("--_panel-edge-width",`${de}px`),e.style.setProperty("--_panel-edge-height",`${Ve}px`),e.scrollTop=o,e.scrollLeft=a;for(const le of l)le.element.scrollTop=le.scrollTop,le.element.scrollLeft=le.scrollLeft}}$e=new WeakMap,fi=new WeakMap,Ls=new WeakMap,ba=new WeakMap,mi=new WeakMap,gi=new WeakMap,ht=new WeakSet,J0=function(){var e,t;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(t=(e=this.behavior).unpair)==null||t.call(e,this.trigger),this.trigger=null)},w6=function(){s(this,gi).clear(),this.host.addEventListener("scroll",s(this,jc),!0)},K0=function(){this.host.removeEventListener("scroll",s(this,jc),!0),s(this,gi).clear()},jc=new WeakMap,b6=function(){const e=this.host;for(const t 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,mi).set(t,{value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)});e.style.position="fixed",e.style.zIndex="var(--layer-panel)",e.style.margin="0",e.style.overflow="auto",e.style.setProperty("--_panel-edge-position","fixed")},X0=function(){for(const[e,{value:t,priority:r}]of s(this,mi))t?this.host.style.setProperty(e,t,r):this.host.style.removeProperty(e);s(this,mi).clear()};class gz extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var vi,ir,Q0,em,_6;class S6 extends HTMLElement{constructor(){super();p(this,ir);p(this,vi,new Ug(this,{opened:t=>{t&&wc(u(this,ir,Q0).call(this)[0])},keydown:t=>u(this,ir,_6).call(this,t),pointermove:t=>wc(u(this,ir,em).call(this,t)??void 0),click:t=>{u(this,ir,em).call(this,t)&&s(this,vi).close()}}));this.attachInternals().role="menu"}connectedCallback(){s(this,vi).connect()}disconnectedCallback(){s(this,vi).disconnect()}attributeChangedCallback(){s(this,vi).refresh()}}vi=new WeakMap,ir=new WeakSet,Q0=function(){return[...this.querySelectorAll("tv-menu-item")]},em=function(t){const r=t.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},_6=function(t){if(!s(this,vi).open)return!1;const r=u(this,ir,Q0).call(this),i=r.indexOf(this.ownerDocument.activeElement);return y6(t,r)?!0:t.key==="Enter"&&i>=0?(t.preventDefault(),t.stopImmediatePropagation(),r[i].click(),!0):!1},C(S6,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",gz);customElements.get("tv-menu")||customElements.define("tv-menu",S6);let vz=0;var Gc;class yz extends Nt{constructor(){super(...arguments);p(this,Gc,`menu-trigger-${++vz}`)}template(t,{trigger:r}){return M`${r(s(this,Gc))}<tv-menu trigger=${s(this,Gc)}>
68
- ${t.map(i=>"separator"in i?M`<hr>`:M`<tv-menu-item intent=${i.destructive?"danger":te} @click=${i.action}>${i.label}</tv-menu-item>`)}
69
- </tv-menu>`}}Gc=new WeakMap;const A6=zt(yz);/**
70
- * @license
71
- * Copyright 2020 Google LLC
72
- * SPDX-License-Identifier: BSD-3-Clause
73
- */const bn=()=>new wz;class wz{}const Xf=new WeakMap,Je=vl(class extends f6{render(n){return te}update(n,[e]){var r;const t=e!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),te}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let t=Xf.get(e);t===void 0&&(t=new WeakMap,Xf.set(e,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,e;return typeof this.G=="function"?(n=Xf.get(this.ht??globalThis))==null?void 0:n.get(this.G):(e=this.G)==null?void 0:e.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 Qy=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},Cd=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const i=[],o=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,o[a]=t(l,a),a++;return{values:o,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=m9(n),{values:o,keys:a}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=a,o;const l=this.ut??(this.ut=[]),c=[];let d,f,g=0,y=i.length-1,v=0,_=o.length-1;for(;g<=y&&v<=_;)if(i[g]===null)g++;else if(i[y]===null)y--;else if(l[g]===a[v])c[v]=ts(i[g],o[v]),g++,v++;else if(l[y]===a[_])c[_]=ts(i[y],o[_]),y--,_--;else if(l[g]===a[_])c[_]=ts(i[g],o[_]),$l(n,c[_+1],i[g]),g++,_--;else if(l[y]===a[v])c[v]=ts(i[y],o[v]),$l(n,i[g],i[y]),y--,v++;else if(d===void 0&&(d=Qy(a,v,_),f=Qy(l,g,y)),d.has(l[g]))if(d.has(l[y])){const E=f.get(a[v]),x=E!==void 0?i[E]:null;if(x===null){const B=$l(n,i[g]);ts(B,o[v]),c[v]=B}else c[v]=ts(x,o[v]),$l(n,i[g],x),i[E]=null;v++}else Kf(i[y]),y--;else Kf(i[g]),g++;for(;v<=_;){const E=$l(n,c[_+1]);ts(E,o[v]),c[v++]=E}for(;g<=y;){const E=i[g++];E!==null&&Kf(E)}return this.ut=a,d6(n,c),at}});/**
78
- * @license
79
- * Copyright 2018 Google LLC
80
- * SPDX-License-Identifier: BSD-3-Clause
81
- */const E6="important",bz=" !"+E6,Td=vl(class extends Bu{constructor(n){var e;if(super(n),n.type!==nr.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.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((e,t)=>{const r=n[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const i=e[r];if(i!=null){this.ft.add(r);const o=typeof i=="string"&&i.endsWith(bz);r.includes("-")||o?t.setProperty(r,o?i.slice(0,-11):i,o?E6:""):t[r]=i}}return at}}),Sz=24;function _z(n){return!ew(n.source)||!ew(n.current)||!Rz(n.source,n.current)||!Iz(n)||!$z(n.geometry)?{kind:"invalidated"}:kz(n.pointer,n.geometry)==="pinned"?Az(n):Ez(n)}function Az(n){var c;const{source:e,current:t,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)??Cz(r.y,i.pinnedRows),l=t.pinnedChannelIds.filter(d=>d!==e.channelId);return l.splice(a,0,e.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function Ez(n){const{source:e,current:t}=n,r=e.pinnedChannelIds.includes(e.channelId),i=r?Tz(t.unpinnedChannelIds,e.channelId):e.unpinnedChannelIds.indexOf(e.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&t.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?t.pinnedChannelIds.filter(o=>o!==e.channelId):null}}function kz(n,e){const{sidebar:t}=e;if(n.x<t.left||n.x>t.right||n.y<t.top||n.y>t.bottom)return"unpinned";const i=e.unpinnedGroupTop??(e.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:e.pinnedContentBottom+Sz);return n.y<i?"pinned":"unpinned"}function Cz(n,e){const t=e.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return t===-1?e.length:t}function Tz(n,e){const t=n.filter(i=>i!==e),r=t.findIndex(i=>i<e);return r===-1?t.length:r}function $z(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function ew(n){const e=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(e).size===e.length}function Rz(n,e){return tm(n.pinnedChannelIds,e.pinnedChannelIds)&&tm(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Iz(n){const e=n.current.pinnedChannelIds.filter(o=>o!==n.source.channelId),t=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"?e.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&tm(e,t)&&i}function tm(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}const k6=4,Go=200,Qt=28,$d=800,gh="ease",tw=.5,Rl=.5,xz="New channel",ns=".channel-group:not(.channel-group-withdrawal) .channel-row",Pz=24;var pt,It,nt,Ge,xt,ft,Zn,Ds,be,se,Vt,Bt,qt,mt,gt,vt,Wt,yt,Hn,Er,Sa,_a,yi,T,nm,T6,$6,R6,I6,Bh,x6,P6,L6,D6,Bl,Ho,M6,O6,rm,ql,Bd,qd,Wd,jd,N6,im,sm,z6,Yc,Jc,Z6,Gd,Kc,H6,U6,Wl,om,F6,V6,jl,am,lm,cm,B6,qh,Xc,Qc,eu,tu,q6,um,Wh,jh,Gl,hm,dm;class C6{constructor(e){p(this,T);p(this,pt);p(this,It,null);p(this,nt,null);p(this,Ge,{management:!0});p(this,xt,!1);p(this,ft,null);p(this,Zn,"");p(this,Ds,!1);p(this,be,null);p(this,se,null);p(this,Vt,!1);p(this,Bt,null);p(this,qt,null);p(this,mt,null);p(this,gt,null);p(this,vt,null);p(this,Wt,null);p(this,yt,null);p(this,Hn,null);p(this,Er,bn());p(this,Sa,bn());p(this,_a,bn());p(this,yi,null);C(this,"create",()=>{const e=s(this,It),t=s(this,nt);if(e===null||t===null||s(this,Bt)!==null)return;const r={resultChannelId:null};h(this,Bt,r),s(this,pt).call(this),e.createChannel(xz).then(i=>{r.resultChannelId=i.id,e.focusChannel(i.id).catch(()=>{}),s(this,Bt)===r&&s(this,pt).call(this)},()=>{s(this,Bt)!==r||s(this,qt)!==null||(h(this,Bt,null),s(this,pt).call(this))})});p(this,Bd,e=>{h(this,Zn,e.currentTarget.value)});p(this,qd,e=>{e.key==="Enter"?(e.preventDefault(),u(this,T,ql).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),u(this,T,ql).call(this,!1))});p(this,Wd,()=>{u(this,T,ql).call(this,!0)});p(this,jd,e=>{e.preventDefault(),u(this,T,ql).call(this,!0)});p(this,Yc,()=>{h(this,Vt,!1)});p(this,Jc,e=>{!s(this,Vt)||e.detail===0||(h(this,Vt,!1),e.preventDefault(),e.stopImmediatePropagation())});p(this,Gd,e=>{var t;!s(this,Ge).highlightOnPointerMove||s(this,se)!==null||s(this,ft)!==null||(t=s(this,Er).value)!=null&&t.querySelector("tv-menu[open]")||wc(e.currentTarget)});p(this,Kc,e=>{if(s(this,xt)){h(this,be,null);return}const t=s(this,se);if(t!==null){if(t.pointerId!==e.pointerId)return;e.preventDefault(),u(this,T,Wl).call(this,t,e);return}const r=s(this,be);if(!(r===null||r.pointerId!==e.pointerId)){if(e.buttons===0){h(this,be,null);return}Math.hypot(e.clientX-r.x,e.clientY-r.y)<=k6||u(this,T,H6).call(this,r,e)}});p(this,Xc,e=>{var r;const t=s(this,se);if(t!==null&&t.pointerId===e.pointerId){if(t.completed)return;const i=t.captureTarget.hasPointerCapture(e.pointerId);u(this,T,Wl).call(this,t,e);const o=i&&t.placement.kind==="placement"?t.placement.operation:null,a=s(this,It);if(o===null||a===null){u(this,T,Gl).call(this,t,!1);return}t.completed=!0,u(this,T,jl).call(this,t),t.operation=[...o],a.setPinnedChannelIds([...o]).then(()=>{s(this,se)===t&&(t.operationResolved=!0,u(this,T,um).call(this,s(this,nt)))},()=>{s(this,se)===t&&(t.operationResolved=!0,t.operationRejected=!0,u(this,T,Wh).call(this,t))});return}((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,Qc,e=>{var t,r;((t=s(this,se))==null?void 0:t.pointerId)===e.pointerId&&!s(this,se).completed?u(this,T,jh).call(this):((r=s(this,be))==null?void 0:r.pointerId)===e.pointerId&&h(this,be,null)});p(this,eu,e=>{const t=s(this,se);t===null||t.pointerId!==e.pointerId||t.completed||u(this,T,Gl).call(this,t,!1)});p(this,tu,e=>{e.key!=="Escape"||s(this,se)===null||s(this,se).completed||(e.preventDefault(),e.stopImmediatePropagation(),u(this,T,jh).call(this))});h(this,pt,e)}get creating(){return s(this,Bt)!==null}get dragging(){return s(this,se)!==null}connect(){window.addEventListener("pointermove",s(this,Kc)),window.addEventListener("pointerup",s(this,Xc)),window.addEventListener("pointercancel",s(this,Qc)),window.addEventListener("lostpointercapture",s(this,eu)),window.addEventListener("keydown",s(this,tu),!0),window.addEventListener("click",s(this,Jc),!0),window.addEventListener("pointerdown",s(this,Yc),!0)}update(e,t,r){const i=s(this,nt),o=s(this,xt);h(this,It,e),h(this,nt,t),h(this,Ge,r),h(this,xt,r.motionSuppressed??!1),!o&&s(this,xt)&&u(this,T,M6).call(this),u(this,T,q6).call(this,t),u(this,T,R6).call(this,t),u(this,T,L6).call(this,i,t),s(this,ft)!==null&&!t.channels.some(({id:l})=>l===s(this,ft))&&(h(this,ft,null),h(this,Zn,"")),u(this,T,um).call(this,t);const a=s(this,yi);a!==null&&t.display.pinnedChannelIds.includes(a.channelId)===a.pinned&&(h(this,yi,null),queueMicrotask(()=>{const l=u(this,T,im).call(this,a.channelId);l==null||l.scrollIntoView({block:"nearest"}),a.focus&&(l==null||l.focus({preventScroll:!0}))})),o&&!s(this,xt)&&u(this,T,O6).call(this)}template(){var r;const e=s(this,nt);if(e===null)return te;const t=u(this,T,D6).call(this,nw(e,(r=s(this,se))==null?void 0:r.source));return M`
82
- <div
83
- class="channel-list"
84
- role="listbox"
85
- aria-label="Channels"
86
- ${Je(s(this,Er))}
87
- >
88
- ${u(this,T,nm).call(this,"Pinned",t.pinned)}
89
- ${u(this,T,nm).call(this,"Recent",t.unpinned)}
90
- </div>
91
- `}overlayTemplate(){return s(this,Ge).management?u(this,T,P6).call(this):te}disconnect(){var e,t,r;window.removeEventListener("pointermove",s(this,Kc)),window.removeEventListener("pointerup",s(this,Xc)),window.removeEventListener("pointercancel",s(this,Qc)),window.removeEventListener("lostpointercapture",s(this,eu)),window.removeEventListener("keydown",s(this,tu),!0),window.removeEventListener("click",s(this,Jc),!0),window.removeEventListener("pointerdown",s(this,Yc),!0),u(this,T,hm).call(this),(e=s(this,Hn))==null||e.withdraw(),h(this,Hn,null),(t=s(this,Wt))==null||t.cancel(),h(this,Wt,null),(r=s(this,yt))==null||r.cancel(),h(this,yt,null),h(this,It,null),h(this,nt,null),h(this,ft,null),h(this,Zn,""),h(this,Ds,!1),h(this,be,null),h(this,Vt,!1),h(this,Bt,null),h(this,qt,null),h(this,mt,null),h(this,gt,null),h(this,vt,null),h(this,yi,null)}}pt=new WeakMap,It=new WeakMap,nt=new WeakMap,Ge=new WeakMap,xt=new WeakMap,ft=new WeakMap,Zn=new WeakMap,Ds=new WeakMap,be=new WeakMap,se=new WeakMap,Vt=new WeakMap,Bt=new WeakMap,qt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,Wt=new WeakMap,yt=new WeakMap,Hn=new WeakMap,Er=new WeakMap,Sa=new WeakMap,_a=new WeakMap,yi=new WeakMap,T=new WeakSet,nm=function(e,t){var f;const r=e==="Pinned"?"pinned":"unpinned",i=s(this,se);if(i===null&&t.length===0)return null;const o=i===null?void 0:t.find(({channel:g})=>g.id===i.channelId),a=i===null?t:t.filter(({channel:g})=>g.id!==i.channelId),l=(i==null?void 0:i.placement.kind)==="placement"&&((f=i.placement.placeholder)==null?void 0:f.side)===r?i.placement.placeholder:null,c=a.map(g=>({kind:"row",row:g}));l!==null&&c.splice(l.index,0,{kind:"placeholder",key:`channel-placeholder-${r}`}),o!==void 0&&c.push({kind:"row",row:o});const d=i!==null&&a.length===0&&l===null;return M`
92
- <div
93
- class="channel-group"
94
- role="group"
95
- aria-labelledby=${`channel-group-${r}`}
96
- data-channel-side=${r}
97
- ?drag-collapsed=${d}
98
- >
99
- <div class="channel-group-label" id=${`channel-group-${r}`}>${e}</div>
100
- ${Cd(c,g=>g.kind==="row"?g.row.channel.id:g.key,g=>g.kind==="row"?u(this,T,T6).call(this,g.row):M`
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=${Td({height:`${(i==null?void 0:i.rowHeight)??0}px`})}
107
- ></span>
108
- `)}
109
- </div>
110
- `},T6=function(e){var c;const{channel:t,pinned:r,selected:i}=e,o=((c=s(this,se))==null?void 0:c.channelId)===t.id?s(this,se):null,a=o!==null&&r&&o.placement.kind==="placement"&&o.placement.side==="unpinned",l=t.id===s(this,ft);return M`
111
- <div
112
- class=${`channel-row${o!==null?" dragged":""}${a?" unpinning":""}`}
113
- data-channel-id=${t.id}
114
- style=${Td(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?M`
117
- <span class="channel-drag-action" aria-hidden="true">
118
- <tv-icon name="unpin"></tv-icon>
119
- Unpin
120
- </span>
121
- `:null}
122
- ${l?M`
123
- <input
124
- class="channel-rename"
125
- aria-label="Channel name"
126
- .value=${s(this,Zn)}
127
- @input=${s(this,Bd)}
128
- @keydown=${s(this,qd)}
129
- @blur=${s(this,Wd)}
130
- ${Je(s(this,Sa))}
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,jd)}
141
- >
142
- <tv-icon name="check"></tv-icon>
143
- </button>
144
- `:M`
145
- <div
146
- class="channel"
147
- role="option"
148
- tabindex="-1"
149
- @keydown=${d=>{d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),d.stopPropagation(),d.currentTarget.click())}}
150
- @pointermove=${s(this,Gd)}
151
- aria-selected=${i?"true":te}
152
- @pointerdown=${d=>s(this,Ge).dragging??s(this,Ge).management?u(this,T,z6).call(this,t.id,d):void 0}
153
- @click=${d=>u(this,T,Z6).call(this,t.id,d)}
154
- >
155
- ${t.name}
156
- </div>
157
- ${s(this,Ge).management?A6(u(this,T,$6).call(this,e),{trigger:d=>M`
158
- <button
159
- class="channel-menu-trigger"
160
- variant="ghost"
161
- icon
162
- size="sm"
163
- type="button"
164
- tabindex="-1"
165
- id=${d}
166
- aria-haspopup="menu"
167
- title=${`${t.name} menu`}
168
- >
169
- <tv-icon name="expand"></tv-icon>
170
- </button>
171
- `}):te}
172
- `}
173
- </div>
174
- `},$6=function(e){const{channel:t,pinned:r}=e;return[{label:"Rename",action:()=>u(this,T,rm).call(this,t.id)},{label:r?"Unpin":"Pin",action:()=>u(this,T,N6).call(this,t.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>u(this,T,I6).call(this,t.id,t.name)}]},R6=function(e){const t=s(this,Bt);if(t===null||s(this,qt)!==null||t.resultChannelId===null)return;const r=e.channels.find(({id:i})=>i===t.resultChannelId);r!==void 0&&(h(this,qt,r.id),queueMicrotask(()=>u(this,T,Bl).call(this,"create",r.id)))},I6=function(e,t){var i,o,a,l,c;if(s(this,mt)!==null||s(this,gt)!==null)return;u(this,T,sm).call(this,e),h(this,mt,{channelId:e,name:t}),(o=(i=s(this,Ge)).onDeleteStart)==null||o.call(i,e),s(this,pt).call(this);const r=(a=s(this,_a).value)==null?void 0:a.closest("dialog");r instanceof HTMLDialogElement&&(h(this,Hn,Yp(r,()=>{u(this,T,Bh).call(this)})),(c=(l=s(this,_a).value)==null?void 0:l.querySelector(".dialog-actions button"))==null||c.focus())},Bh=function(e=!1){var i,o;const t=s(this,mt),r=s(this,Hn);h(this,Hn,null),h(this,mt,null),r==null||r.withdraw(),s(this,pt).call(this),!e&&t!==null&&((o=(i=s(this,Ge)).onDeleteEnd)==null||o.call(i,t.channelId,!1))},x6=function(){const e=s(this,It),t=s(this,mt);if(e===null||t===null||s(this,gt)!==null)return;h(this,gt,t.channelId),u(this,T,Bh).call(this,!0);const r=s(this,Ge).onDeleteEnd;e.deleteChannel(t.channelId).then(()=>{r==null||r(t.channelId,!0)}).catch(()=>{s(this,gt)===t.channelId&&s(this,vt)===null&&(h(this,gt,null),s(this,pt).call(this)),r==null||r(t.channelId,!1)})},P6=function(){const e=s(this,mt);return e===null?null:Gp(M`
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
- ${Je(s(this,_a))}
181
- >
182
- <h2 id="channel-delete-title">Delete “${e.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=${()=>u(this,T,Bh).call(this)}>
188
- Cancel
189
- </button>
190
- <button type="button" intent="danger" @click=${()=>u(this,T,x6).call(this)}>
191
- Delete
192
- </button>
193
- </div>
194
- </div>
195
- `)},L6=function(e,t){var d,f;if(s(this,mt)!==null&&!t.channels.some(({id:g})=>{var y;return g===((y=s(this,mt))==null?void 0:y.channelId)})){const g=s(this,mt);(d=s(this,Hn))==null||d.withdraw(),h(this,Hn,null),h(this,mt,null),queueMicrotask(()=>{var y,v;return(v=(y=s(this,Ge)).onDeleteEnd)==null?void 0:v.call(y,g.channelId,!0)})}const r=s(this,vt);if(r!==null&&t.channels.some(({id:g})=>g===r.row.channel.id)){(f=s(this,yt))==null||f.cancel(),h(this,yt,null),h(this,vt,null),h(this,gt,null);return}const i=s(this,gt);if(i===null||r!==null||t.channels.some(({id:g})=>g===i))return;if(e===null){h(this,gt,null);return}const o=nw(e),a=o.pinned.findIndex(({channel:g})=>g.id===i),l=o.unpinned.findIndex(({channel:g})=>g.id===i),c=a>=0?o.pinned[a]:o.unpinned[l];if(c===void 0){h(this,gt,null);return}h(this,vt,{row:{...c,selected:!1},side:a>=0?"pinned":"unpinned",index:a>=0?a:l}),queueMicrotask(()=>u(this,T,Bl).call(this,"delete",i))},D6=function(e){const t=s(this,vt);if(t===null)return e;const r=[...e[t.side]];return r.some(({channel:i})=>i.id===t.row.channel.id)||r.splice(t.index,0,t.row),{...e,[t.side]:r}},Bl=function(e,t){var l,c;if(e==="create"&&s(this,qt)!==t||e==="delete"&&((l=s(this,vt))==null?void 0:l.row.channel.id)!==t||s(this,xt))return;const r=[...((c=s(this,Er).value)==null?void 0:c.querySelectorAll(ns))??[]].find(d=>d.dataset.channelId===t);if(r===void 0){e==="delete"&&u(this,T,Ho).call(this,e,t);return}if(typeof r.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,T,Ho).call(this,e,t);return}const i=r.getBoundingClientRect().height,o=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${i}px`,opacity:1}]:[{maxHeight:`${i}px`,opacity:1},{maxHeight:"0px",opacity:0}],a=r.animate(o,{duration:Go,easing:gh});e==="create"?h(this,Wt,a):h(this,yt,a),a.finished.then(()=>{e==="create"&&s(this,Wt)!==a||e==="delete"&&s(this,yt)!==a||(e==="create"?h(this,Wt,null):h(this,yt,null),u(this,T,Ho).call(this,e,t))},()=>{})},Ho=function(e,t){var r;if(e==="create"){if(s(this,qt)!==t)return;h(this,qt,null),h(this,Bt,null),u(this,T,rm).call(this,t);return}((r=s(this,vt))==null?void 0:r.row.channel.id)===t&&(h(this,vt,null),h(this,gt,null),s(this,pt).call(this))},M6=function(){var r;h(this,be,null),u(this,T,hm).call(this);const e=s(this,qt);s(this,Wt)!==null&&(s(this,Wt).cancel(),h(this,Wt,null),e!==null&&queueMicrotask(()=>u(this,T,Ho).call(this,"create",e)));const t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;s(this,yt)!==null&&(s(this,yt).cancel(),h(this,yt,null),t!==null&&queueMicrotask(()=>u(this,T,Ho).call(this,"delete",t)))},O6=function(){var r;const e=s(this,qt),t=((r=s(this,vt))==null?void 0:r.row.channel.id)??null;e!==null&&s(this,Wt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"create",e)),t!==null&&s(this,yt)===null&&queueMicrotask(()=>u(this,T,Bl).call(this,"delete",t))},rm=function(e){var r;const t=(r=s(this,nt))==null?void 0:r.channels.find(({id:i})=>i===e);t!==void 0&&(h(this,ft,e),h(this,Zn,t.name),h(this,be,null),s(this,pt).call(this),queueMicrotask(()=>{var i,o;s(this,ft)===e&&((i=s(this,Sa).value)==null||i.focus(),(o=s(this,Sa).value)==null||o.select())}))},ql=function(e){if(s(this,ft)===null||s(this,Ds)||s(this,It)===null)return;h(this,Ds,!0);const t=s(this,ft),r=s(this,Zn).trim();h(this,ft,null),h(this,Zn,""),s(this,pt).call(this),h(this,Ds,!1),e&&r.length>0&&s(this,It).renameChannel(t,r).catch(()=>{})},Bd=new WeakMap,qd=new WeakMap,Wd=new WeakMap,jd=new WeakMap,N6=function(e,t){var o;if(s(this,It)===null||s(this,nt)===null)return;if(u(this,T,sm).call(this,e),s(this,Ge).revealMovedRow){const a=u(this,T,im).call(this,e);h(this,yi,{channelId:e,pinned:t,focus:((o=a==null?void 0:a.parentElement)==null?void 0:o.contains(document.activeElement))??!1})}const r=s(this,nt).display.pinnedChannelIds,i=t?[...r.filter(a=>a!==e),e]:r.filter(a=>a!==e);s(this,It).setPinnedChannelIds(i).catch(()=>{h(this,yi,null)})},im=function(e){var t,r;return((r=[...((t=s(this,Er).value)==null?void 0:t.querySelectorAll(ns))??[]].find(i=>i.dataset.channelId===e))==null?void 0:r.querySelector(".channel"))??void 0},sm=function(e){var i,o,a;const t=[...((i=s(this,Er).value)==null?void 0:i.querySelectorAll(ns))??[]].find(l=>l.dataset.channelId===e),r=t==null?void 0:t.querySelector(".channel-menu-trigger");r&&((a=(o=s(this,Er).value)==null?void 0:o.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||a.removeAttribute("open"))},z6=function(e,t){if(t.button!==0||s(this,be)!==null||s(this,se)!==null||s(this,nt)===null)return;h(this,Vt,!1);const i=t.currentTarget.closest(".sidebar, .channel-switcher-pop");if(i===null)return;const o=Yl(s(this,nt));!o.pinnedChannelIds.includes(e)&&!o.unpinnedChannelIds.includes(e)||h(this,be,{channelId:e,pointerId:t.pointerId,x:t.clientX,y:t.clientY,source:{channelId:e,...o},captureTarget:i})},Yc=new WeakMap,Jc=new WeakMap,Z6=function(e,t){var r;if(t.detail!==0&&s(this,Vt)){h(this,Vt,!1);return}h(this,Vt,!1),s(this,se)===null&&(s(this,Ge).selectChannel?s(this,Ge).selectChannel(e):(r=s(this,It))==null||r.focusChannel(e).catch(()=>{}))},Gd=new WeakMap,Kc=new WeakMap,H6=function(e,t){if(s(this,xt)){h(this,be,null);return}const r=[...e.captureTarget.querySelectorAll(ns)].find(f=>f.dataset.channelId===e.channelId);if(r===void 0){h(this,be,null);return}const i=r.getBoundingClientRect(),o=u(this,T,U6).call(this,r),a=Lz({wideRow:i,compactPreviewWidth:o,pointer:{x:e.x,y:e.y}}),l=e.captureTarget.querySelector('[data-channel-side="pinned"]'),c=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{h(this,be,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${a.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${a.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${a.correctionX}px`),h(this,Vt,!0);const d={...e,placement:{kind:"invalidated"},currentX:t.clientX,currentY:t.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};h(this,be,null),h(this,se,d),u(this,T,Wl).call(this,d,t)},U6=function(e){const t=e.cloneNode(!0);for(const i of[t,...t.querySelectorAll("[id], [trigger]")])i.removeAttribute("id"),i.removeAttribute("trigger");t.classList.add("dragged"),t.style.position="fixed",t.style.left="-10000px",t.style.top="-10000px",t.style.visibility="hidden",t.style.pointerEvents="none",document.body.append(t);const r=t.getBoundingClientRect().width;return t.remove(),r},Wl=function(e,t,r=!0){if(e.completed)return;const i=s(this,nt);if(i===null){e.placement={kind:"invalidated"};return}e.currentX=t.clientX,e.currentY=t.clientY;const o=Yl(i),a=new Map([...e.captureTarget.querySelectorAll(ns)].map(P=>[P.dataset.channelId,P])),l=o.pinnedChannelIds.filter(P=>P!==e.channelId).flatMap(P=>{const J=a.get(P);if(J===void 0)return[];const O=J.getBoundingClientRect();return[{channelId:P,top:O.top,bottom:O.bottom}]}),c=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),d=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),g=f==null?void 0:f.getBoundingClientRect(),y=f==null?void 0:f.dataset.channelSide,v=Number(f==null?void 0:f.dataset.channelIndex),_=e.captureTarget.getBoundingClientRect(),E=_z({source:e.source,current:o,pointer:{x:t.clientX,y:t.clientY},geometry:{sidebar:{left:_.left,right:_.right,top:_.top,bottom:_.bottom},pinnedRows:l,unpinnedGroupTop:(d==null?void 0:d.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:g!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(v)?{side:y,index:v,top:g.top,bottom:g.bottom}:null}}),x=!Dz(e.placement,E),B=x?u(this,T,lm).call(this,e):null;e.placement=E,(x||r)&&u(this,T,cm).call(this,e,B,!1),u(this,T,om).call(this,e)},om=function(e){const t=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=t?u(this,T,am).call(this,t,e.currentY):0,i=t?Math.max(0,t.scrollHeight-t.clientHeight):0,o=r<0?((t==null?void 0:t.scrollTop)??0)<=tw:((t==null?void 0:t.scrollTop)??0)>=i-tw;if(s(this,xt)||e.completed||r===0||i===0||o||typeof requestAnimationFrame!="function"){u(this,T,jl).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(a=>{u(this,T,F6).call(this,e,a)}))},F6=function(e,t){if(e.edgeScrollFrame=0,s(this,xt)||s(this,se)!==e||e.completed){e.edgeScrollTimestamp=null;return}const r=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");if(r===null){e.edgeScrollTimestamp=null;return}const i=u(this,T,am).call(this,r,e.currentY),o=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=t,i!==0&&o!==null){const a=Math.max(0,t-o)/1e3,l=Math.max(0,r.scrollHeight-r.clientHeight),c=r.scrollTop,d=i*a+e.edgeScrollRemainder,f=Math.max(0,Math.min(l,c+d));r.scrollTop=f;const g=r.scrollTop-c;if(e.edgeScrollRemainder=f===0||f===l?0:d-g,g!==0){r.toggleAttribute("continues-start",r.scrollTop>0),u(this,T,V6).call(this,e);return}}u(this,T,om).call(this,e)},V6=function(e){u(this,T,Wl).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},jl=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},am=function(e,t){const r=e.getBoundingClientRect();return t>=r.top&&t<r.top+Qt?-$d*(r.top+Qt-t)/Qt:t>r.bottom-Qt&&t<=r.bottom?$d*(t-(r.bottom-Qt))/Qt:0},lm=function(e){var i;for(const o of e.displacementAnimations)o.cancel();e.displacementAnimations.clear();const t=new Map;for(const o of e.captureTarget.querySelectorAll(ns)){const a=o.dataset.channelId;if(a===void 0)continue;const l=o.getBoundingClientRect();t.set(a,{left:l.left,top:l.top})}const r=new Map;for(const o of e.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 d of[c,...c.querySelectorAll("[id], [trigger]")])d.removeAttribute("id"),d.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:t,groups:r}},cm=function(e,t,r){const i=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),o=(i==null?void 0:i.scrollTop)??0;s(this,pt).call(this),queueMicrotask(()=>{const a=e.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");a!==null&&(a.scrollTop=o),t!==null&&u(this,T,B6).call(this,e,t,r)})},B6=function(e,t,r){if(!(s(this,xt)||typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of e.captureTarget.querySelectorAll(ns)){const o=i.dataset.channelId;if(o===void 0||!r&&o===e.channelId)continue;const a=t.rows.get(o);if(a===void 0)continue;const l=i.getBoundingClientRect(),c=a.left-l.left,d=a.top-l.top;Math.hypot(c,d)<=Rl||u(this,T,qh).call(this,e,i.animate({translate:[`${c}px ${d}px`,"0px 0px"]},{duration:Go,easing:gh}))}for(const i of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=i.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const a=t.groups.get(o),l=i.getBoundingClientRect(),c=i.hasAttribute("drag-collapsed")?0:l.height;if(a!==void 0){if(a.height<=Rl&&c>Rl)u(this,T,qh).call(this,e,i.animate([{opacity:0,translate:`0px -${c}px`},{opacity:1,translate:"0px 0px"}],{duration:Go,easing:gh}));else if(a.height>Rl&&c<=Rl&&a.withdrawal.childElementCount>0){const d=a.withdrawal;d.style.left=`${a.left}px`,d.style.top=`${a.top}px`,d.style.width=`${a.width}px`,d.style.height=`${a.height}px`,e.captureTarget.append(d);const f=d.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${a.height}px`}],{duration:Go,easing:gh});u(this,T,qh).call(this,e,f),f.finished.finally(()=>d.remove()).catch(()=>{})}}}}},qh=function(e,t){e.displacementAnimations.add(t),t.finished.finally(()=>{e.displacementAnimations.delete(t)}).catch(()=>{})},Xc=new WeakMap,Qc=new WeakMap,eu=new WeakMap,tu=new WeakMap,q6=function(e){const t=Yl(e);s(this,se)!==null&&!s(this,se).completed&&!rw(s(this,se).source,t)&&u(this,T,jh).call(this),s(this,be)!==null&&!rw(s(this,be).source,t)&&h(this,be,null)},um=function(e){const t=s(this,se);if(e===null||t===null||!t.completed||!t.operationResolved||t.restorationQueued)return;if(t.operationRejected){u(this,T,Wh).call(this,t);return}const r=t.operation;r!==null&&Rd(Yl(e).pinnedChannelIds,r)&&u(this,T,Wh).call(this,t)},Wh=function(e){s(this,se)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{s(this,se)===e&&u(this,T,Gl).call(this,e,!1)}))},jh=function(){h(this,be,null);const e=s(this,se);e!==null&&u(this,T,Gl).call(this,e,!0)},Gl=function(e,t){if(s(this,se)!==e)return;u(this,T,jl).call(this,e);const r=u(this,T,lm).call(this,e);h(this,se,null),u(this,T,dm).call(this,e),t&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),u(this,T,cm).call(this,e,r,!0)},hm=function(){h(this,be,null);const e=s(this,se);if(h(this,se,null),e!==null){u(this,T,jl).call(this,e);for(const t of e.displacementAnimations)t.cancel();e.displacementAnimations.clear(),u(this,T,dm).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},dm=function(e){e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")};function Lz(n){const e=Math.max(0,n.wideRow.right-n.wideRow.left),t=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=iw(n.pointer.x-n.wideRow.left,0,e),i=Math.min(r,Math.max(0,n.compactPreviewWidth-Pz));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:iw(n.pointer.y-n.wideRow.top,0,t)}}function nw(n,e=Yl(n)){var l,c;const t=new Map(n.channels.map(d=>[d.id,d])),r=e.pinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),i=e.unpinnedChannelIds.flatMap(d=>{const f=t.get(d);return f===void 0?[]:[f]}),o=n.display.focusedChannelId,a=o!==null&&t.has(o)?o:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(d=>({channel:d,pinned:!0,selected:d.id===a})),unpinned:i.map(d=>({channel:d,pinned:!1,selected:d.id===a}))}}function Yl(n){const e=new Set(n.channels.map(({id:o})=>o)),t=n.display.pinnedChannelIds.filter(o=>e.has(o)),r=new Set(t),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return{pinnedChannelIds:t,unpinnedChannelIds:i}}function rw(n,e){return Rd(n.pinnedChannelIds,e.pinnedChannelIds)&&Rd(n.unpinnedChannelIds,e.unpinnedChannelIds)}function Rd(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function Dz(n,e){var t,r,i,o;return n.kind!==e.kind?!1:n.kind==="invalidated"||e.kind==="invalidated"?!0:n.side===e.side&&((t=n.placeholder)==null?void 0:t.side)===((r=e.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((o=e.placeholder)==null?void 0:o.index)&&n.operation===null==(e.operation===null)&&(n.operation===null||e.operation===null||Rd(n.operation,e.operation))}function iw(n,e,t){return Math.max(e,Math.min(t,n))}var pn,Yd;class Mz extends Nt{constructor(){super(...arguments);p(this,pn,new C6(()=>this.render()));p(this,Yd,t=>{const r=t.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,pn).connect()}template(t,r,i,o,a,l=!1){return s(this,pn).update(t,r,{management:!0,motionSuppressed:l}),M`
196
- <nav class="sidebar" ?dragging=${s(this,pn).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,pn).creating}
209
- @click=${s(this,pn).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?M`
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??M`
231
- <span class="sidebar-toggle-seat" aria-hidden="true"></span>
232
- `}
233
- </header>
234
-
235
- <div class="sidebar-body" @scroll=${s(this,Yd)}>
236
- ${s(this,pn).template()}
237
- </div>
238
- </nav>
239
- ${s(this,pn).overlayTemplate()}
240
- `}disconnected(){s(this,pn).disconnect()}}pn=new WeakMap,Yd=new WeakMap;const Oz=zt(Mz),Nz=1280,zz=800,sw=.4,ow=.4,W6=280,aw=180,Zz=14,Hz=45,Uz=16,lw=64,Fz=90,Vz=1,Bz=24,qz=230,Wz=230;function jz(n,e){const{expandedSidebarWidth:t,expandedToggleLeft:r,collapsedToggleLeft:i,toggleWidth:o,toggleSwitcherGap:a,collapsedLeadReservation:l,hasSwitcher:c}=e,d=t*(1-n),f=t-r,g=Math.max(d-f,i),y=i+f,v=Math.max(0,Math.min(o,d-g)),_=pm((d-y)/(t-y)),E=o+a,x=i+E,B=c?pm((x-d)/E):0;let P=n*l;if(l>t){const J=1-x/t,O=Math.min(1,n/J);P=n*t+O*(l-t)}return{sidebarBoundary:d,toggleLeft:g,toggleWipe:v,titlebarOpacity:_,switcherOpacity:B,leadReservation:P}}function Gz(n,e,t,r){const i=r*Math.abs(e-n);if(i===0)return e;const a=1-(1-pm(t/i))**2;return n+(e-n)*a}function pm(n){return Math.max(0,Math.min(1,n))}var kr,wi,Cr,Aa,Ea,Ms,jr,Gh,fm;class Yz{constructor(e){p(this,jr);p(this,kr,null);p(this,wi,0);p(this,Cr);p(this,Aa);p(this,Ea);p(this,Ms,1);h(this,Cr,e),h(this,Aa,e),h(this,Ea,e)}get boundary(){return u(this,jr,Gh).call(this),s(this,Cr)}move(e){const t=this.boundary;if(u(this,jr,fm).call(this),h(this,Aa,t),h(this,Ea,e.target),h(this,Ms,e.width),e.onFrame(t),matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(e.target-t)<Number.EPSILON){h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}const r=Math.abs(e.target-t)/e.width,i=e.root.animate([{},{}],{duration:aw*r,easing:"linear"});i.id="sidebar-collapse-boundary",h(this,kr,i);const o=()=>{if(s(this,kr)===i){if(u(this,jr,Gh).call(this),e.onFrame(s(this,Cr)),i.playState==="finished"){h(this,kr,null),h(this,wi,0),h(this,Cr,e.target),e.onFrame(e.target),e.onFinish(e.target);return}h(this,wi,requestAnimationFrame(o))}};h(this,wi,requestAnimationFrame(o))}cancel(){u(this,jr,Gh).call(this),u(this,jr,fm).call(this)}}kr=new WeakMap,wi=new WeakMap,Cr=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,Ms=new WeakMap,jr=new WeakSet,Gh=function(){const e=s(this,kr);if(e===null)return;const t=Gz(1-s(this,Aa)/s(this,Ms),1-s(this,Ea)/s(this,Ms),Number(e.currentTime??0),aw);h(this,Cr,s(this,Ms)*(1-t))},fm=function(){var e;cancelAnimationFrame(s(this,wi)),h(this,wi,0),(e=s(this,kr))==null||e.cancel(),h(this,kr,null)};const j6="television-active-theme",Fg="tv-theme";let si=null,Wr=null,Hi=null,Ui=null,ei=null,cw=0,Id=0;function Jz(n){const e=document.createElement("link"),t=new URL("/theme/theme.css",n);t.searchParams.set(Fg,Vg()),e.rel="stylesheet",e.href=t.toString(),e.dataset.televisionStyle=j6;const r=()=>{si===e&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),si==null||si.remove(),document.head.append(e),si=e,e}function Kz(){si&&(si.remove(),si=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function uw(n){const e=document.createElement("script"),t=new URL("/theme/main.js",n);return t.searchParams.set(Fg,Vg()),e.src=t.toString(),e.dataset.televisionScript=j6,Wr==null||Wr.remove(),document.head.append(e),Wr=e,e}function Xz(){Wr==null||Wr.remove(),Wr=null}function Qz(){return Wr}async function e7(n,e,t){const r=G6();if(e===null)return;let i;try{i=await t()}catch{return}if(r!==Id)return;const o=i.themes.find(f=>f.id===e);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?hw(n,"background"):null,d=o.enableIframeOverlayJS===!0?hw(n,"overlay"):null;r===Id&&(c!==null&&(a.before(c),Hi=c),d!==null&&(l.after(d),Ui=d))}function t7(){G6()}function G6(){return Id+=1,Hi==null||Hi.remove(),Ui==null||Ui.remove(),Hi=null,Ui=null,Id}function hw(n,e){const t=e==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);t.searchParams.set(Fg,Vg());const r=document.createElement("iframe");return r.id=e==="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=r7(t.toString(),n7()),r}function n7(){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 r7(n,e){return`<!doctype html>
241
- <html data-theme="${e}">
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: ${e};
252
- }
253
- </style>
254
- </head>
255
- <body>
256
- <script src="${n}"><\/script>
257
- </body>
258
- </html>`}function Y6(n){var o;let e,t=n.button,r=n.buttons;switch(n.eventType){case"pointermove":e="television-theme-pointer-move",t=-1;break;case"pointerdown":e="television-theme-pointer-down";break;case"pointerup":e="television-theme-pointer-up";break;case"pointercancel":e="television-theme-pointer-cancel",t=-1,r=0;break;case"click":e="television-theme-pointer-click",r=0;break}const i={type:e,clientX:n.clientX,clientY:n.clientY,button:t,buttons:r};for(const a of[Hi,Ui])(a==null?void 0:a.isConnected)===!0&&((o=a.contentWindow)==null||o.postMessage(i,"*"))}function qu(n){n.isTrusted&&Y6({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",qu,{capture:!0});document.addEventListener("pointerdown",qu,{capture:!0});document.addEventListener("pointerup",qu,{capture:!0});document.addEventListener("pointercancel",qu,{capture:!0});document.addEventListener("click",qu,{capture:!0});function J6(n){if(n!==Hi&&n!==Ui)return!1;const t=((ei==null?void 0:ei.isConnected)===!0&&ei!==Hi&&ei!==Ui&&ei.closest("#foreground-overlay")===null?ei:null)??document.querySelector("#app");return t==null||t.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const e=n.target;e instanceof HTMLElement&&(J6(e)||e.isConnected&&e.closest("#foreground-overlay")===null&&(ei=e))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>J6(document.activeElement))},{capture:!0});function Vg(){return cw+=1,`${Date.now()}-${cw}`}const i7=404,s7="/views/url-unsupported/";function Yh(n){const e=Ad(n.artifact,{electron:n.electron,browserDemo:n.browserDemo??!1});let t;if(e.renderer==="url-direct")t=e;else if(n.currentURL===null){const r=n.viewURL??e.viewURL;e.renderer==="markdown"?t={renderer:"markdown",viewURL:r,contentURL:n.contentURL??e.contentURL}:e.renderer==="url-webview"&&e.contentURL!==null?t={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??e.contentURL}:t={...e,viewURL:r}}else dw(n.currentURL)&&!n.electron?t=fr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:s7,contentURL:null}:dw(n.currentURL)?t={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:t={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:l7(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...t,viewURL:n.frameSrcOverride}:t}var We,jt,ka,Os,Ns,fn,zs,Ca,wt,Ta,$a,Un,bi,Si,Zs,K,Jh,K6,X6,mm,Q6,Fn,Kh,Jl,gm,eS,vm,ym,is;class o7 extends Nt{constructor(){super(...arguments);p(this,K);p(this,We,null);p(this,jt,null);p(this,ka,"");p(this,Os,()=>{});p(this,Ns,()=>{});p(this,fn,null);p(this,zs,null);p(this,Ca,null);p(this,wt,null);p(this,Ta,null);p(this,$a,null);p(this,Un,null);p(this,bi,null);p(this,Si,null);p(this,Zs,null);p(this,Fn,()=>{!s(this,jt)||s(this,jt)!==s(this,fn)||s(this,Os).call(this,!0)})}get currentFrame(){return s(this,jt)}connected(){u(this,K,Kh).call(this),u(this,K,gm).call(this)}disconnected(){u(this,K,Jl).call(this),u(this,K,is).call(this)}template(t,r,i=()=>{}){return h(this,Os,r),h(this,Ns,i),t(this),s(this,ka)}assignSource(t){const r=s(this,We),i=r?!c7(r.artifact,t.artifact):!0;((r==null?void 0:r.artifact.id)!==t.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&t.artifact.kind==="path"&&r.artifact.path!==t.artifact.path)&&h(this,Zs,null),i&&(h(this,Un,null),s(this,wt)&&(s(this,wt).content=""),h(this,bi,null),h(this,Si,null)),h(this,We,t),u(this,K,Jh).call(this)}handleArtifactContentChanged(t){const r=s(this,We);return t!==(r==null?void 0:r.artifact.id)||!s(this,wt)&&!u(this,K,ym).call(this)?!1:(u(this,K,vm).call(this),!0)}handleThemeChanged(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return(t==null?void 0:t.kind)!=="path"||!C0(t.path)||s(this,wt)===null?!1:(s(this,wt).notifyStylesChanged(),!0)}refreshFrameLoadState(){u(this,K,Kh).call(this)}}We=new WeakMap,jt=new WeakMap,ka=new WeakMap,Os=new WeakMap,Ns=new WeakMap,fn=new WeakMap,zs=new WeakMap,Ca=new WeakMap,wt=new WeakMap,Ta=new WeakMap,$a=new WeakMap,Un=new WeakMap,bi=new WeakMap,Si=new WeakMap,Zs=new WeakMap,K=new WeakSet,Jh=function(){const t=s(this,We);if(!t)return;if(t.artifact.kind==="path"&&u(this,K,ym).call(this)){u(this,K,Q6).call(this,t.artifact);return}const r=Yh(t),i=u(this,K,K6).call(this,r.renderer);u(this,K,X6).call(this,i,r),u(this,K,mm).call(this,i),u(this,K,Kh).call(this),u(this,K,gm).call(this)},K6=function(t){var o;const r=t==="url-webview"?"webview":"iframe";if(((o=s(this,jt))==null?void 0:o.tagName.toLowerCase())===r)return s(this,jt);u(this,K,Jl).call(this),u(this,K,is).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),h(this,jt,i),i},X6=function(t,r){t.getAttribute("src")!==r.viewURL&&(s(this,Ns).call(this,null),s(this,Ns).call(this,t),t.setAttribute("src",r.viewURL)),r.contentURL===null?delete t.dataset.contentUrl:t.dataset.contentUrl=r.contentURL},mm=function(t){s(this,ka)!==t&&(h(this,ka,t),this.render(t))},Q6=function(t){s(this,Ns).call(this,null),u(this,K,Jl).call(this),u(this,K,is).call(this),h(this,jt,null),s(this,Os).call(this,!1),u(this,K,mm).call(this,M`
259
- <section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
260
- <div class="artifact-missing-wrapper">
261
- <h1>${N_()}</h1>
262
- <p>${z_()}</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>${t.path}</code></p>
266
- </section>
267
- <p>${Z_()}</p>
268
- </div>
269
- </section>
270
- `)},Fn=new WeakMap,Kh=function(){var o;const t=s(this,jt),r=t?`${t.tagName.toLowerCase()}:${t.getAttribute("src")??""}:${t.dataset.contentUrl??""}`:null;if(t&&t===s(this,fn)&&r===s(this,zs)||(u(this,K,Jl).call(this),s(this,Os).call(this,!1),!t||!r||!this.isConnected))return;if(h(this,fn,t),h(this,zs,r),t.tagName.toLowerCase()==="webview"){t.addEventListener("did-finish-load",s(this,Fn)),t.addEventListener("did-fail-load",s(this,Fn));return}t.addEventListener("load",s(this,Fn));const i=t;try{i.isConnected&&((o=i.contentDocument)==null?void 0:o.readyState)==="complete"&&s(this,Fn).call(this)}catch{}},Jl=function(){if(!s(this,fn)){h(this,zs,null);return}s(this,fn).removeEventListener("load",s(this,Fn)),s(this,fn).removeEventListener("did-finish-load",s(this,Fn)),s(this,fn).removeEventListener("did-fail-load",s(this,Fn)),h(this,fn,null),h(this,zs,null)},gm=function(){const t=s(this,We),r=s(this,jt),i=(r==null?void 0:r.dataset.contentUrl)??null,o=(t==null?void 0:t.artifact.id)??null;if(!t||!r||!i||!o){u(this,K,is).call(this,{clearContent:!0});return}if(r!==s(this,Ca)||o!==s(this,$a)){u(this,K,is).call(this),h(this,Ca,r),h(this,Ta,i),h(this,$a,o);const a=r.tagName.toLowerCase()==="webview"?new n9(r):new t9(r);h(this,wt,a),a.handleUpdateContent(async l=>{const c=s(this,We),d=c==null?void 0:c.application;if(!c||!d)throw new Error("No markdown artifact selected");await d.writeMarkdown(c.artifact.id,l),h(this,Un,l),s(this,wt)===a&&(a.content=l)}),s(this,Un)!==null&&(a.content=s(this,Un))}else h(this,Ta,i);u(this,K,eS).call(this)},eS=function(){const t=s(this,We),r=t==null?void 0:t.application;!t||!r||!s(this,wt)||s(this,bi)===t.artifact.id&&s(this,Si)===r||(h(this,bi,t.artifact.id),h(this,Si,r),u(this,K,vm).call(this))},vm=async function(){var o,a;const t=s(this,We),r=t==null?void 0:t.application;if(!t||!r)return;const i=t.artifact.id;try{const l=await r.readMarkdown(i);if(((o=s(this,We))==null?void 0:o.artifact.id)!==i||s(this,We).application!==r)return;h(this,Zs,null),h(this,Un,l);const c=s(this,wt);if(!c){u(this,K,Jh).call(this);return}c.content=l}catch(l){if(((a=s(this,We))==null?void 0:a.artifact.id)!==i||s(this,We).application!==r)return;if(l instanceof pl&&l.status===i7){h(this,Zs,i),h(this,Un,null),u(this,K,is).call(this),u(this,K,Jh).call(this);return}h(this,bi,null),h(this,Si,null)}},ym=function(){var r;const t=(r=s(this,We))==null?void 0:r.artifact;return s(this,Zs)===(t==null?void 0:t.id)&&t.kind==="path"&&C0(t.path)},is=function(t={}){var r;(r=s(this,wt))==null||r.dispose(),h(this,wt,null),h(this,Ca,null),h(this,Ta,null),h(this,$a,null),h(this,bi,null),h(this,Si,null),t.clearContent&&h(this,Un,null)};const a7=zt(o7);function dw(n){return n.startsWith("http://")||n.startsWith("https://")}function l7(n,e){if(!n.startsWith("/")||!e)return n;try{return new URL(n,e).toString()}catch{return n}}function c7(n,e){return n.id!==e.id||n.kind!==e.kind?!1:n.kind==="path"&&e.kind==="path"?n.path===e.path:n.kind==="url"&&e.kind==="url"?n.url===e.url:!0}var nu,Ra,Vn,Tr,_i,Ai,Ei,ru,iu,su,ou,Ot,wm,Xh,Qh;class u7{constructor(e,t=()=>{}){p(this,Ot);p(this,nu);p(this,Ra);p(this,Vn,null);p(this,Tr,null);p(this,_i,null);p(this,Ai,null);p(this,Ei,!1);p(this,ru,e=>{const t=fw(e.data);if(!t)return;const r=s(this,_i);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,o=i.contentWindow;if(o===null)return;const a=t.type==="leaving",l=t.type==="navigation-request"&&t.native===!0&&t.sameDocument!==!0,c=o===e.source,d=(a||l)&&s(this,Tr)!==null&&s(this,Tr)===e.source,f=a&&d7(i)===e.origin;!c&&!d&&!f||u(this,Ot,wm).call(this,t,i,{send:g=>{var y;return(y=i.contentWindow)==null?void 0:y.postMessage(g,"*")}})});p(this,iu,e=>{var o;const t=e.detail??e;if(!t||t.channel!==pw)return;const r=fw((o=t.args)==null?void 0:o[0]),i=s(this,Ai);!r||!i||u(this,Ot,wm).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,pw,a)}})});p(this,su,e=>{const t=mw(e);t.isMainFrame===!0&&t.isInPlace!==!0&&this.reset()});p(this,ou,e=>{mw(e).isMainFrame!==!1&&this.reset()});h(this,nu,e),h(this,Ra,t)}get currentGuid(){return s(this,Vn)}get lifecycleWindow(){return s(this,Tr)}get trustState(){return{currentGuid:s(this,Vn),lifecycleWindow:s(this,Tr)}}connect(){s(this,Ei)||(h(this,Ei,!0),window.addEventListener("message",s(this,ru)),u(this,Ot,Xh).call(this))}disconnect(){s(this,Ei)&&(window.removeEventListener("message",s(this,ru)),h(this,Ei,!1),u(this,Ot,Qh).call(this))}reset(){h(this,Vn,null),h(this,Tr,null),s(this,Ra).call(this)}setCurrentFrame(e){if(e===s(this,_i)){u(this,Ot,Xh).call(this);return}u(this,Ot,Qh).call(this),s(this,_i)!==null&&this.reset(),h(this,_i,h7(e)?e:null),u(this,Ot,Xh).call(this)}}nu=new WeakMap,Ra=new WeakMap,Vn=new WeakMap,Tr=new WeakMap,_i=new WeakMap,Ai=new WeakMap,Ei=new WeakMap,ru=new WeakMap,iu=new WeakMap,su=new WeakMap,ou=new WeakMap,Ot=new WeakSet,wm=function(e,t,r){e.type==="bridge-ready"&&e.guid!==s(this,Vn)?(s(this,Vn)!==null&&s(this,Ra).call(this),h(this,Vn,e.guid),h(this,Tr,t.tagName.toLowerCase()==="iframe"?t.contentWindow:null)):e.type==="leaving"&&e.guid===s(this,Vn)&&this.reset(),s(this,nu).call(this,e,r)},Xh=function(){if(!s(this,Ei))return;const e=s(this,_i),t=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;t!==s(this,Ai)&&(u(this,Ot,Qh).call(this),t&&(t.addEventListener("ipc-message",s(this,iu)),t.addEventListener("did-start-navigation",s(this,su)),t.addEventListener("did-fail-load",s(this,ou)),h(this,Ai,t)))},Qh=function(){const e=s(this,Ai);e&&(e.removeEventListener("ipc-message",s(this,iu)),e.removeEventListener("did-start-navigation",s(this,su)),e.removeEventListener("did-fail-load",s(this,ou)),h(this,Ai,null))};const pw="television-artifact-bridge";function fw(n){return C_(n)||T_(n)||$_(n)||R_(n)||I_(n)||x_(n)||P_(n)||L_(n)?n:null}function h7(n){if(!n)return!1;const e=n.tagName.toLowerCase();return e==="iframe"||e==="webview"}function d7(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function mw(n){return n.detail??n}const p7="/views/url-unsupported/";class f7 extends Nt{constructor(){super(...arguments);C(this,"_artifact",null);C(this,"_viewURL",null);C(this,"_contentURL",null);C(this,"_application",null);C(this,"_fullScreen",!1);C(this,"_inert",!1);C(this,"_onFullScreenChange",()=>{});C(this,"_connected",!1);C(this,"_deleteConfirmationOpen",!1);C(this,"_dialogPresentation",null);C(this,"_subscribedWebview",null);C(this,"_documentHost",null);C(this,"_pendingDocumentSource",null);C(this,"_rootRef",bn());C(this,"_trustedChannel",new u7((t,r)=>{this.handleTrustedFrameMessage(t,r)},()=>{this._missingArtifactReplyTransport=null}));C(this,"_activeReloadFrameSrc",null);C(this,"_applicationSubscriptionsAttached",!1);C(this,"_proxyReloadVersion",0);C(this,"_navigationState",null);C(this,"_navigationArtifactId",null);C(this,"_navigationCanonicalURL",null);C(this,"_preserveFrameSrcOnNavigationRender",!1);C(this,"_missingArtifactReplyTransport",null);C(this,"handleNavigationChange",()=>{const t=this._preserveFrameSrcOnNavigationRender,r=!t;r&&!Br()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:t,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});C(this,"handleArtifactContentChanged",t=>{var o;const r=t.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((o=this._documentHost)!=null&&o.handleArtifactContentChanged(r))||this.reloadProxyFrame()});C(this,"handleThemeChanged",()=>{var t,r;((t=this._artifact)==null?void 0:t.kind)==="url"&&fr(this._artifact.url)||this.isDemoPage()||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});C(this,"handleWebviewDidNavigate",t=>{this.handleWebviewNavigationEvent(t)});C(this,"handleWebviewDidNavigateInPage",t=>{if(t.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(t)||(this._preserveFrameSrcOnNavigationRender=!1)});C(this,"captureDocumentHost",t=>{this._documentHost=t,this._pendingDocumentSource&&(t.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});C(this,"handleEmbedLoadChange",t=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",t)});C(this,"handleDocumentFrameChange",t=>{t===null&&this.resetTrustedFrame(),this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(this.bridgeFrame(t)),this.syncWebviewSubscription(t)});C(this,"handleTitleBarDoubleClick",t=>{const r=t.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(t,r){var d;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 f=c?!v7(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&y7(c,o)){const g=this.currentMissingArtifactMessage();g&&((d=this._missingArtifactReplyTransport)==null||d.send(g))}}else f&&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(t,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 t;this._connected=!1,(t=this._dialogPresentation)==null||t.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(t,r){var i;switch(t.type){case"url-target-request":r.send({type:D_,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(t);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(t.key);return;case"artifact-pointer":this.handleArtifactPointer(t);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(t){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();Y6({eventType:t.eventType,clientX:i.left+t.clientX*i.width/r.clientWidth,clientY:i.top+t.clientY*i.height/r.clientHeight,button:t.button,buttons:t.buttons})}currentExternalTargetURL(){var r,i;const t=((r=this._navigationState)==null?void 0:r.currentURL)??null;return t&&g7(t)?t:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const t=this._artifact;return(t==null?void 0:t.kind)!=="path"?null:{type:M_,title:t.title,path:t.path}}handleProxyContentChanged(){var t;((t=this._artifact)==null?void 0:t.kind)!=="url"||!fr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(t){if(!xy(t.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(t.url);if(i===p7||i===r.currentURL)return;const o=t.native===!0;(t.sameDocument||o)&&(this._preserveFrameSrcOnNavigationRender=!0),t.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact||this.isDemoPage()){this.disposeNavigationState();return}const t=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===t||(this.disposeNavigationState(),this._navigationState=new PO(this._artifact.id,t),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=t,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var t;(t=this._navigationState)==null||t.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(t){const r=Yh({artifact:t,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return t.kind==="url"&&fr(t.url)||r.renderer==="url-webview"?qr(i):gw(i,i)}convertIframeNavigationURL(t){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&fr(this._artifact.url)&&fr(t)?qr(t):gw(t,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(t){const r=t.url;if(typeof r!="string"||!xy(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const o=qr(r);return o===i.currentURL?!1:(i.navigate(o),!0)}syncWebviewSubscription(t=this.currentFrame){const r=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t: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 t;return((t=this._documentHost)==null?void 0:t.currentFrame)??null}syncFrameSubscriptions(){const t=this.currentFrame;this.syncFrameTitle(t),this._trustedChannel.setCurrentFrame(this.bridgeFrame(t)),this.syncWebviewSubscription(t)}bridgeFrame(t){return this.isDemoPage()?null:t}get browserDemo(){var t;return((t=this._application)==null?void 0:t.browserDemoMode)===!0}isDemoPage(){const t=this._artifact;return t?Ad(t,{electron:Br(),browserDemo:this.browserDemo}).renderer==="url-direct":!1}returnToOriginalPage(){var i,o;const t=this._artifact,r=this.currentFrame;(t==null?void 0:t.kind)!=="url"||(r==null?void 0:r.tagName.toLowerCase())!=="iframe"||((i=this._rootRef.value)==null||i.removeAttribute("data-embed-loaded"),r.setAttribute("src",t.url),(o=this._documentHost)==null||o.refreshFrameLoadState())}syncFrameTitle(t){t&&this._artifact&&t.getAttribute("title")!==this._artifact.title&&t.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(t={}){var f,g,y;const r=this._artifact;if(!r)return;t.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},o=Yh(i),a=(g=this.currentFrame)==null?void 0:g.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(tS(this._activeReloadFrameSrc,o.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=t.frameSrcOverride??l??(t.preserveFrameSrc&&a?a:o.viewURL),d={...i,frameSrcOverride:c};this._pendingDocumentSource=d,(y=this._documentHost)==null||y.assignSource(d),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,d,f;const t=this.currentFrame;if(!t||t.hasAttribute("data-content-url")||t.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&fr(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&fr(this._artifact.url)?((d=this._navigationState)==null?void 0:d.currentURL)??t.getAttribute("src"):t.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(nl,String(++this._proxyReloadVersion));const o=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=o,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:o,resetTrust:!0})}forceCurrentFrameSrc(){var o,a,l;if(!this._artifact)return;const t=Yh({artifact:this._artifact,application:this._application,electron:Br(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((o=this._navigationState)==null?void 0:o.currentURL)??null});if(t.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",t.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 t=this._rootRef.value,r=t==null?void 0:t.querySelector(".artifact-menu-trigger");r&&((i=t==null?void 0:t.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(t){this.closeMenu(),this._onFullScreenChange(t)}showDeleteConfirmation(){var r,i,o;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const t=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");t&&(this._dialogPresentation=Yp(t,()=>this.dismissDeleteConfirmation()),(o=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||o.focus())}dismissDeleteConfirmation(){const t=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,t==null||t.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const t=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!t||!r)&&r.deleteArtifact(t).catch(()=>{})}artifactIconTemplate(){return this.isDemoPage()?M`
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
- `:M`<tv-icon name="artifact"></tv-icon>`}navigationControlsTemplate(){const t=this._navigationState;return!t||!t.canGoBack&&!t.canGoForward?null:M`
282
- <button
283
- icon
284
- size="sm"
285
- variant="ghost"
286
- class="artifact-back"
287
- ?disabled=${!t.canGoBack}
288
- @click=${()=>t.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=${!t.canGoForward}
299
- @click=${()=>t.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:Gp(M`
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(t,r,i){const o=this._artifact;return M`
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
- ${Je(this._rootRef)}
322
- >
323
- <div class="artifact-frame-clip">
324
- ${a7(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
- ${A6(this.menuEntries(),{trigger:a=>M`
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(t={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:t.preserveFrameSrc??!1,frameSrcOverride:t.frameSrcOverride,resetTrust:t.resetTrust}),this.render(),t.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const m7=zt(f7);function g7(n){return n.startsWith("http://")||n.startsWith("https://")}function v7(n,e){return n.id!==e.id||n.kind!==e.kind?!1:n.kind==="path"&&e.kind==="path"?n.path===e.path:n.kind==="url"&&e.kind==="url"?tS(n.url,e.url):!0}function y7(n,e){return n.kind==="path"&&e.kind==="path"&&n.id===e.id&&(n.title!==e.title||n.path!==e.path)}function tS(n,e){try{const t=new URL(n,window.location.href),r=new URL(e,window.location.href);return t.searchParams.delete(nl),r.searchParams.delete(nl),t.origin===r.origin&&t.pathname===r.pathname&&t.search===r.search}catch{return!1}}function gw(n,e){try{const t=new URL(n,window.location.href);if(e){const r=new URL(e,window.location.href);if(t.origin!=="null"&&t.origin===r.origin)return t.searchParams.delete(nl),`${t.pathname}${t.search}${t.hash}`}}catch{return qr(n)}return qr(n)}function nS(n,e,t,r,i){const o=e.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===t?i:a.geometry.full_screen},size:a===t?{...r}:{...a.size}}));n.updateChannelPages(e.id,o).catch(()=>{})}function bm(n,e,t,r){nS(n,e,t,t.size,r)}function Bg(n){return{width:1-sw+sw*n.width/Nz,height:1-ow+ow*n.height/zz}}function rS(n){return{width:Math.min(qz,n.width),height:Math.min(Wz,n.height)}}function vw(n,e){const t=Bg(e),r=rS(e);return{width:Math.min(e.width,Math.max(r.width,n.width*t.width)),height:Math.min(e.height,Math.max(r.height,n.height*t.height))}}function w7(n,e){const t=Bg(e);return{width:n.width/t.width,height:n.height/t.height}}const yw=.5,vh=2,b7=120,S7=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Hs,Bn,Ia,$r,xa,Us,ki,Ci,Ti,Rr,Fs,Vs,qn,Pa,Ir,Wn,rt,xr,jn,Z,iS,sS,Kl,oS,Xl,Sm,ed,aS,au,lu,cu,uu,Bs,hu,_m,an,Am,Uo,lS,cS,Ql;class _7 extends Nt{constructor(){super(...arguments);p(this,Z);p(this,Hs,bn());p(this,Bn,bn());p(this,Ia);p(this,$r);p(this,xa);p(this,Us);p(this,ki);p(this,Ci,0);p(this,Ti,0);p(this,Rr,null);p(this,Fs,null);p(this,Vs,null);p(this,qn,null);p(this,Pa,[]);p(this,Ir,null);p(this,Wn,null);p(this,rt,null);p(this,xr,new Set);p(this,jn,!1);p(this,au,t=>{const r=s(this,rt);!r||t.pointerId!==r.pointerId||(r.lastPointer={x:t.clientX,y:t.clientY},r.option=t.altKey,u(this,Z,_m).call(this,r))});p(this,lu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!0)});p(this,cu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!1)});p(this,uu,t=>{var r;t.pointerId===((r=s(this,rt))==null?void 0:r.pointerId)&&u(this,Z,an).call(this,!1)});p(this,Bs,t=>{const r=s(this,rt);if(r){if(t.type==="keydown"&&t.key==="Escape"){t.preventDefault(),u(this,Z,an).call(this,!1);return}r.option!==t.altKey&&(r.option=t.altKey,u(this,Z,_m).call(this,r))}});p(this,hu,()=>{const t=s(this,rt);!t||ww(u(this,Z,Kl).call(this,t.filmstrip),t.pageBox)||(u(this,Z,Sm).call(this),u(this,Z,an).call(this,!1))})}connected(){h(this,Ia,void 0),h(this,$r,void 0),h(this,xa,void 0),h(this,Us,void 0),h(this,ki,void 0)}template(t,r,i,o=!1){var fe;const a=!s(this,jn)&&o;if(h(this,jn,o),a){u(this,Z,an).call(this,!1),u(this,Z,Ql).call(this);for(const de of s(this,xr))de.cancel();s(this,xr).clear()}const l=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,c=E7(r,(l==null?void 0:l.pages)??(r==null?void 0:r.pages)),d=(r==null?void 0:r.selectedPage)??null,f=(r==null?void 0:r.id)??null,g=(d==null?void 0:d.artifactIds[0])??null,y=(d==null?void 0:d.geometry.full_screen)??null,v=s(this,Us)!==void 0,_=c.map(({key:de,page:Ve})=>`${de}:${Ve.geometry.full_screen}:${Ve.size.width}:${Ve.size.height}`).sort().join("|"),E=l===null?null:c.map(({key:de})=>de).join("|"),x=f!==s(this,Ia),B=g!==s(this,$r),P=y!==s(this,xa),J=_!==s(this,Us),O=E!==s(this,ki),U=!s(this,jn)&&l!==null&&s(this,ki)!==void 0&&s(this,ki)!==null&&O?u(this,Z,lS).call(this):null,j=!s(this,jn)&&B&&!x&&s(this,$r)!==void 0&&s(this,$r)!==null&&g!==null;return s(this,rt)&&(x||B||P)&&u(this,Z,an).call(this,!1),h(this,Ia,f),h(this,$r,g),h(this,xa,y),h(this,Us,_),h(this,ki,E),h(this,Pa,c),J&&v&&u(this,Z,ed).call(this),x&&((fe=s(this,qn))==null||fe.disconnect(),h(this,Fs,null),h(this,Vs,null),h(this,Ir,null)),queueMicrotask(()=>u(this,Z,Xl).call(this)),x||B||J||a?queueMicrotask(()=>u(this,Z,iS).call(this,g,j)):O&&queueMicrotask(()=>{const de=s(this,Bn).value;de&&(u(this,Z,Uo).call(this,de,g,!1),U&&u(this,Z,cS).call(this,U))}),M`
346
- <section
347
- class="stage"
348
- ${Je(s(this,Hs))}
349
- style=${`--handle-band: ${Zz}px; --handle-reach: ${Hz}px; --handle-thickness: ${Uz}px;`}
350
- >
351
- ${r!==null&&c.length===0?M`
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
- ${Cd([f],de=>de,()=>M`
358
- <div class="filmstrip" ${Je(s(this,Bn))}>
359
- <div class="filmstrip-inner">
360
- ${Cd(c,({key:de})=>de,({page:de,artifact:Ve,key:ve})=>{if(r===null)return null;const Xe=ve===g;return M`
361
- <div
362
- class="page"
363
- data-page-key=${ve}
364
- ?selected=${Xe}
365
- ?full-screen=${de.geometry.full_screen}
366
- style=${u(this,Z,oS).call(this,de)}
367
- @click=${Xe||Ve===null?null:()=>t.selectPage(r.id,Ve.id)}
368
- >
369
- ${Ve?m7(t,Ve,{viewURL:t.getArtifactViewURL(Ve),contentURL:t.getArtifactContentURL(Ve),fullScreen:de.geometry.full_screen,inert:!Xe,onFullScreenChange:Ze=>bm(t,r,de,Ze)}):null}
370
- ${Xe?M`
371
- <div class="page-handles" aria-hidden="true">
372
- ${S7.map(Ze=>M`
373
- <span
374
- class="page-handle ${Ze}"
375
- @pointerdown=${le=>u(this,Z,aS).call(this,le,Ze,t,r,de,ve)}
376
- ></span>
377
- `)}
378
- </div>
379
- `:null}
380
- </div>
381
- `})}
382
- </div>
383
- </div>
384
- `)}
385
- </section>
386
- `}disconnected(){var t;u(this,Z,an).call(this,!1),u(this,Z,ed).call(this),u(this,Z,Ql).call(this),cancelAnimationFrame(s(this,Ci)),h(this,Ci,0),(t=s(this,qn))==null||t.disconnect(),h(this,qn,null),h(this,Fs,null),h(this,Vs,null),h(this,Ir,null),h(this,Pa,[]);for(const r of s(this,xr))r.cancel();s(this,xr).clear()}}Hs=new WeakMap,Bn=new WeakMap,Ia=new WeakMap,$r=new WeakMap,xa=new WeakMap,Us=new WeakMap,ki=new WeakMap,Ci=new WeakMap,Ti=new WeakMap,Rr=new WeakMap,Fs=new WeakMap,Vs=new WeakMap,qn=new WeakMap,Pa=new WeakMap,Ir=new WeakMap,Wn=new WeakMap,rt=new WeakMap,xr=new WeakMap,jn=new WeakMap,Z=new WeakSet,iS=function(t,r){const i=s(this,Bn).value;i&&(cancelAnimationFrame(s(this,Ci)),h(this,Ci,requestAnimationFrame(()=>{h(this,Ci,0),u(this,Z,Uo).call(this,i,t,r)})))},sS=function(t,r){var i;typeof ResizeObserver>"u"||t===s(this,Fs)&&r===s(this,Vs)||((i=s(this,qn))==null||i.disconnect(),h(this,Fs,t),h(this,Vs,r),h(this,qn,new ResizeObserver(()=>{const o=u(this,Z,Kl).call(this,t);ww(o,s(this,Ir))||(u(this,Z,Sm).call(this),s(this,rt)&&u(this,Z,an).call(this,!1),u(this,Z,Xl).call(this,t)),s(this,Rr)===null&&u(this,Z,Uo).call(this,t,s(this,$r)??null,!1)})),s(this,qn).observe(t),s(this,qn).observe(r))},Kl=function(t){const r=Number.parseFloat(getComputedStyle(t).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,t.clientWidth-2*r),height:Math.max(0,t.clientHeight-r)}},oS=function(t){if(t.geometry.full_screen||s(this,Ir)===null)return"";const r=vw(t.size,s(this,Ir));return`width: ${r.width}px; height: ${r.height}px;`},Xl=function(t=s(this,Bn).value){var o;if(!t)return;const r=u(this,Z,Kl).call(this,t);h(this,Ir,r);const i=new Map(s(this,Pa).map(a=>[a.key,a.page]));for(const a of t.querySelectorAll(".page")){if(a===((o=s(this,rt))==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=vw(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},Sm=function(){const t=s(this,Hs).value;t&&(t.setAttribute("window-tracking",""),s(this,Wn)!==null&&clearTimeout(s(this,Wn)),h(this,Wn,setTimeout(()=>{h(this,Wn,null),t.removeAttribute("window-tracking")},b7)))},ed=function(){var t;s(this,Wn)!==null&&(clearTimeout(s(this,Wn)),h(this,Wn,null)),(t=s(this,Hs).value)==null||t.removeAttribute("window-tracking")},aS=function(t,r,i,o,a,l){if(s(this,jn)||t.button!==0||!t.isPrimary)return;const c=t.currentTarget,d=c.closest(".page"),f=s(this,Bn).value,g=s(this,Hs).value;if(!d||!f||!g)return;u(this,Z,an).call(this,!1),u(this,Z,ed).call(this),t.preventDefault(),t.stopPropagation();const y=d.getBoundingClientRect(),v=u(this,Z,Kl).call(this,f),_=Bg(v),E=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),B=r.includes("top")||r.includes("bottom");h(this,rt,{application:i,channel:o,page:a,pageKey:l,pageElement:d,filmstrip:f,stage:g,handle:c,pointerId:t.pointerId,startPointer:{x:t.clientX,y:t.clientY},lastPointer:{x:t.clientX,y:t.clientY},startRendered:{width:y.width,height:y.height},rendered:{width:y.width,height:y.height},baselineSize:E?{width:v.width/_.width,height:v.height/_.height}:{...a.size},pageBox:v,wasFullScreen:E,horizontal:x,vertical:B,leftish:r.includes("left"),topish:r.includes("top"),option:t.altKey,armed:!1,leftFullScreen:!1}),g.setAttribute("resizing",""),c.addEventListener("pointermove",s(this,au)),c.addEventListener("pointerup",s(this,lu)),c.addEventListener("pointercancel",s(this,cu)),c.addEventListener("lostpointercapture",s(this,uu)),window.addEventListener("keydown",s(this,Bs)),window.addEventListener("keyup",s(this,Bs)),window.addEventListener("resize",s(this,hu)),c.setPointerCapture(t.pointerId)},au=new WeakMap,lu=new WeakMap,cu=new WeakMap,uu=new WeakMap,Bs=new WeakMap,hu=new WeakMap,_m=function(t){const r=t.lastPointer.x!==t.startPointer.x||t.lastPointer.y!==t.startPointer.y;if(t.wasFullScreen&&!t.leftFullScreen){if(!r)return;t.leftFullScreen=!0,t.pageElement.removeAttribute("full-screen")}const i=rS(t.pageBox);let o=t.startRendered.width,a=t.startRendered.height;if(t.horizontal){const l=t.leftish?-vh:vh;o=Math.min(t.pageBox.width,Math.max(i.width,t.startRendered.width+(t.lastPointer.x-t.startPointer.x)*l))}if(t.vertical){const l=t.topish?-vh:vh;a=Math.min(t.pageBox.height,Math.max(i.height,t.startRendered.height+(t.lastPointer.y-t.startPointer.y)*l))}t.armed=!t.option&&t.horizontal&&t.vertical&&o>=t.pageBox.width-lw&&a>=t.pageBox.height-lw,t.rendered=t.armed?{...t.pageBox}:{width:o,height:a},t.pageElement.style.width=`${t.rendered.width}px`,t.pageElement.style.height=`${t.rendered.height}px`,u(this,Z,Am).call(this,t.stage,t.armed),u(this,Z,Uo).call(this,t.filmstrip,t.pageKey,!1)},an=function(t){const r=s(this,rt);if(r){if(h(this,rt,null),r.handle.removeEventListener("pointermove",s(this,au)),r.handle.removeEventListener("pointerup",s(this,lu)),r.handle.removeEventListener("pointercancel",s(this,cu)),r.handle.removeEventListener("lostpointercapture",s(this,uu)),window.removeEventListener("keydown",s(this,Bs)),window.removeEventListener("keyup",s(this,Bs)),window.removeEventListener("resize",s(this,hu)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),u(this,Z,Am).call(this,r.stage,!1),t&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),bm(r.application,r.channel,r.page,!0);else if(t){const i={...r.baselineSize},o=w7(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?nS(r.application,r.channel,r.page,i,!1):u(this,Z,Xl).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),u(this,Z,Xl).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),u(this,Z,Uo).call(this,r.filmstrip,r.pageKey,!1)}},Am=function(t,r){const i=t.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"),t.append(o)},Uo=function(t,r,i){const o=[...t.querySelectorAll(".page")].find(y=>y.dataset.pageKey===r);if(!o){u(this,Z,Ql).call(this);return}u(this,Z,sS).call(this,t,o);const a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),c=Math.max(0,Math.min(t.scrollLeft+a.left+a.width/2-(l.left+l.width/2),t.scrollWidth-t.clientWidth));if(u(this,Z,Ql).call(this),s(this,jn)||!i||Math.abs(c-t.scrollLeft)<yw||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:W6,easing:"ease"});h(this,Rr,f);const g=()=>{var v;if(f!==s(this,Rr))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Rr,null),h(this,Ti,0)):h(this,Ti,requestAnimationFrame(g))};h(this,Ti,requestAnimationFrame(g))},lS=function(){const t=s(this,Bn).value;return t?new Map([...t.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},cS=function(t){if(s(this,jn))return;const r=s(this,Bn).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const o=t.get(i.dataset.pageKey??"");if(o===void 0)continue;const a=o-i.getBoundingClientRect().left;if(Math.abs(a)<=yw)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:Go,easing:"ease"});s(this,xr).add(l),l.finished.finally(()=>{s(this,xr).delete(l)}).catch(()=>{})}},Ql=function(){var t;cancelAnimationFrame(s(this,Ti)),h(this,Ti,0),(t=s(this,Rr))==null||t.cancel(),h(this,Rr,null)};const A7=zt(_7);function E7(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{const o=r.artifactIds[0];return{page:r,artifact:o===void 0?null:t.get(o)??null,key:o??`empty-page-${i}`}})}function ww(n,e){return e!==null&&n.width===e.width&&n.height===e.height}/**
387
- * @license
388
- * Copyright 2017 Google LLC
389
- * SPDX-License-Identifier: BSD-3-Clause
390
- */class Em extends Bu{constructor(e){if(super(e),this.it=te,e.type!==nr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===te||e==null)return this._t=void 0,this.it=e;if(e===at)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Em.directiveName="unsafeHTML",Em.resultType=1;const uS=vl(Em);/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:hS,setPrototypeOf:bw,isFrozen:k7,getPrototypeOf:C7,getOwnPropertyDescriptor:T7}=Object;let{freeze:ct,seal:nn,create:td}=Object,{apply:km,construct:Cm}=typeof Reflect<"u"&&Reflect;ct||(ct=function(e){return e});nn||(nn=function(e){return e});km||(km=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Cm||(Cm=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const yh=ut(Array.prototype.forEach),$7=ut(Array.prototype.lastIndexOf),Sw=ut(Array.prototype.pop),Il=ut(Array.prototype.push),R7=ut(Array.prototype.splice),nd=ut(String.prototype.toLowerCase),Qf=ut(String.prototype.toString),e0=ut(String.prototype.match),xl=ut(String.prototype.replace),I7=ut(String.prototype.indexOf),x7=ut(String.prototype.trim),Tt=ut(Object.prototype.hasOwnProperty),Qe=ut(RegExp.prototype.test),Pl=P7(TypeError);function ut(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return km(n,e,r)}}function P7(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Cm(n,t)}}function Q(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nd;bw&&bw(n,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(k7(e)||(e[r]=o),i=o)}n[i]=!0}return n}function L7(n){for(let e=0;e<n.length;e++)Tt(n,e)||(n[e]=null);return n}function In(n){const e=td(null);for(const[t,r]of hS(n))Tt(n,t)&&(Array.isArray(r)?e[t]=L7(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=In(r):e[t]=r);return e}function Ll(n,e){for(;n!==null;){const r=T7(n,e);if(r){if(r.get)return ut(r.get);if(typeof r.value=="function")return ut(r.value)}n=C7(n)}function t(){return null}return t}const _w=ct(["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"]),t0=ct(["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"]),n0=ct(["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"]),D7=ct(["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"]),r0=ct(["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"]),M7=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Aw=ct(["#text"]),Ew=ct(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),i0=ct(["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","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kw=ct(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),wh=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),O7=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),N7=nn(/<%[\w\W]*|[\w\W]*%>/gm),z7=nn(/\$\{[\w\W]*/gm),Z7=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),H7=nn(/^aria-[\-\w]+$/),dS=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U7=nn(/^(?:\w+script|data):/i),F7=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pS=nn(/^html$/i),V7=nn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Cw=Object.freeze({__proto__:null,ARIA_ATTR:H7,ATTR_WHITESPACE:F7,CUSTOM_ELEMENT:V7,DATA_ATTR:Z7,DOCTYPE_NAME:pS,ERB_EXPR:N7,IS_ALLOWED_URI:dS,IS_SCRIPT_OR_DATA:U7,MUSTACHE_EXPR:O7,TMPLIT_EXPR:z7});const Dl={element:1,text:3,progressingInstruction:7,comment:8,document:9},B7=function(){return typeof window>"u"?null:window},q7=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Tw=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function fS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:B7();const e=V=>fS(V);if(e.version="3.3.3",e.removed=[],!n||!n.document||n.document.nodeType!==Dl.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const r=t,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:d,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:g,DOMParser:y,trustedTypes:v}=n,_=c.prototype,E=Ll(_,"cloneNode"),x=Ll(_,"remove"),B=Ll(_,"nextSibling"),P=Ll(_,"childNodes"),J=Ll(_,"parentNode");if(typeof a=="function"){const V=t.createElement("template");V.content&&V.content.ownerDocument&&(t=V.content.ownerDocument)}let O,Y="";const{implementation:U,createNodeIterator:j,createDocumentFragment:fe,getElementsByTagName:de}=t,{importNode:Ve}=r;let ve=Tw();e.isSupported=typeof hS=="function"&&typeof J=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Xe,ERB_EXPR:Ze,TMPLIT_EXPR:le,DATA_ATTR:sr,ARIA_ATTR:Zt,IS_SCRIPT_OR_DATA:wl,ATTR_WHITESPACE:bl,CUSTOM_ELEMENT:ju}=Cw;let{IS_ALLOWED_URI:s1}=Cw,He=null;const o1=Q({},[..._w,...t0,...n0,...r0,...Aw]);let Be=null;const a1=Q({},[...Ew,...i0,...kw,...wh]);let Te=Object.seal(td(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}})),Sl=null,Gu=null;const Xr=Object.seal(td(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let l1=!0,Qp=!0,c1=!1,u1=!0,wo=!1,Yu=!0,Xi=!1,ef=!1,tf=!1,bo=!1,Ju=!1,Ku=!1,h1=!0,d1=!1;const g_="user-content-";let nf=!0,_l=!1,So={},kn=null;const rf=Q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let p1=null;const f1=Q({},["audio","video","img","source","image","track"]);let sf=null;const m1=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xu="http://www.w3.org/1998/Math/MathML",Qu="http://www.w3.org/2000/svg",or="http://www.w3.org/1999/xhtml";let _o=or,of=!1,af=null;const v_=Q({},[Xu,Qu,or],Qf);let eh=Q({},["mi","mo","mn","ms","mtext"]),th=Q({},["annotation-xml"]);const y_=Q({},["title","style","font","a","script"]);let Al=null;const w_=["application/xhtml+xml","text/html"],b_="text/html";let De=null,Ao=null;const S_=t.createElement("form"),g1=function(b){return b instanceof RegExp||b instanceof Function},lf=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ao&&Ao===b)){if((!b||typeof b!="object")&&(b={}),b=In(b),Al=w_.indexOf(b.PARSER_MEDIA_TYPE)===-1?b_:b.PARSER_MEDIA_TYPE,De=Al==="application/xhtml+xml"?Qf:nd,He=Tt(b,"ALLOWED_TAGS")?Q({},b.ALLOWED_TAGS,De):o1,Be=Tt(b,"ALLOWED_ATTR")?Q({},b.ALLOWED_ATTR,De):a1,af=Tt(b,"ALLOWED_NAMESPACES")?Q({},b.ALLOWED_NAMESPACES,Qf):v_,sf=Tt(b,"ADD_URI_SAFE_ATTR")?Q(In(m1),b.ADD_URI_SAFE_ATTR,De):m1,p1=Tt(b,"ADD_DATA_URI_TAGS")?Q(In(f1),b.ADD_DATA_URI_TAGS,De):f1,kn=Tt(b,"FORBID_CONTENTS")?Q({},b.FORBID_CONTENTS,De):rf,Sl=Tt(b,"FORBID_TAGS")?Q({},b.FORBID_TAGS,De):In({}),Gu=Tt(b,"FORBID_ATTR")?Q({},b.FORBID_ATTR,De):In({}),So=Tt(b,"USE_PROFILES")?b.USE_PROFILES:!1,l1=b.ALLOW_ARIA_ATTR!==!1,Qp=b.ALLOW_DATA_ATTR!==!1,c1=b.ALLOW_UNKNOWN_PROTOCOLS||!1,u1=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,wo=b.SAFE_FOR_TEMPLATES||!1,Yu=b.SAFE_FOR_XML!==!1,Xi=b.WHOLE_DOCUMENT||!1,bo=b.RETURN_DOM||!1,Ju=b.RETURN_DOM_FRAGMENT||!1,Ku=b.RETURN_TRUSTED_TYPE||!1,tf=b.FORCE_BODY||!1,h1=b.SANITIZE_DOM!==!1,d1=b.SANITIZE_NAMED_PROPS||!1,nf=b.KEEP_CONTENT!==!1,_l=b.IN_PLACE||!1,s1=b.ALLOWED_URI_REGEXP||dS,_o=b.NAMESPACE||or,eh=b.MATHML_TEXT_INTEGRATION_POINTS||eh,th=b.HTML_INTEGRATION_POINTS||th,Te=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&g1(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&g1(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Te.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),wo&&(Qp=!1),Ju&&(bo=!0),So&&(He=Q({},Aw),Be=td(null),So.html===!0&&(Q(He,_w),Q(Be,Ew)),So.svg===!0&&(Q(He,t0),Q(Be,i0),Q(Be,wh)),So.svgFilters===!0&&(Q(He,n0),Q(Be,i0),Q(Be,wh)),So.mathMl===!0&&(Q(He,r0),Q(Be,kw),Q(Be,wh))),Tt(b,"ADD_TAGS")||(Xr.tagCheck=null),Tt(b,"ADD_ATTR")||(Xr.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?Xr.tagCheck=b.ADD_TAGS:(He===o1&&(He=In(He)),Q(He,b.ADD_TAGS,De))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?Xr.attributeCheck=b.ADD_ATTR:(Be===a1&&(Be=In(Be)),Q(Be,b.ADD_ATTR,De))),b.ADD_URI_SAFE_ATTR&&Q(sf,b.ADD_URI_SAFE_ATTR,De),b.FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,b.FORBID_CONTENTS,De)),b.ADD_FORBID_CONTENTS&&(kn===rf&&(kn=In(kn)),Q(kn,b.ADD_FORBID_CONTENTS,De)),nf&&(He["#text"]=!0),Xi&&Q(He,["html","head","body"]),He.table&&(Q(He,["tbody"]),delete Sl.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=b.TRUSTED_TYPES_POLICY,Y=O.createHTML("")}else O===void 0&&(O=q7(v,i)),O!==null&&typeof Y=="string"&&(Y=O.createHTML(""));ct&&ct(b),Ao=b}},v1=Q({},[...t0,...n0,...D7]),y1=Q({},[...r0,...M7]),__=function(b){let I=J(b);(!I||!I.tagName)&&(I={namespaceURI:_o,tagName:"template"});const N=nd(b.tagName),ye=nd(I.tagName);return af[b.namespaceURI]?b.namespaceURI===Qu?I.namespaceURI===or?N==="svg":I.namespaceURI===Xu?N==="svg"&&(ye==="annotation-xml"||eh[ye]):!!v1[N]:b.namespaceURI===Xu?I.namespaceURI===or?N==="math":I.namespaceURI===Qu?N==="math"&&th[ye]:!!y1[N]:b.namespaceURI===or?I.namespaceURI===Qu&&!th[ye]||I.namespaceURI===Xu&&!eh[ye]?!1:!y1[N]&&(y_[N]||!v1[N]):!!(Al==="application/xhtml+xml"&&af[b.namespaceURI]):!1},Cn=function(b){Il(e.removed,{element:b});try{J(b).removeChild(b)}catch{x(b)}},Qi=function(b,I){try{Il(e.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Il(e.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(bo||Ju)try{Cn(I)}catch{}else try{I.setAttribute(b,"")}catch{}},w1=function(b){let I=null,N=null;if(tf)b="<remove></remove>"+b;else{const Re=e0(b,/^[\r\n\t ]+/);N=Re&&Re[0]}Al==="application/xhtml+xml"&&_o===or&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ye=O?O.createHTML(b):b;if(_o===or)try{I=new y().parseFromString(ye,Al)}catch{}if(!I||!I.documentElement){I=U.createDocument(_o,"template",null);try{I.documentElement.innerHTML=of?Y:ye}catch{}}const je=I.body||I.documentElement;return b&&N&&je.insertBefore(t.createTextNode(N),je.childNodes[0]||null),_o===or?de.call(I,Xi?"html":"body")[0]:Xi?I.documentElement:je},b1=function(b){return j.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},cf=function(b){return b instanceof g&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof f)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},S1=function(b){return typeof l=="function"&&b instanceof l};function ar(V,b,I){yh(V,N=>{N.call(e,b,I,Ao)})}const _1=function(b){let I=null;if(ar(ve.beforeSanitizeElements,b,null),cf(b))return Cn(b),!0;const N=De(b.nodeName);if(ar(ve.uponSanitizeElement,b,{tagName:N,allowedTags:He}),Yu&&b.hasChildNodes()&&!S1(b.firstElementChild)&&Qe(/<[/\w!]/g,b.innerHTML)&&Qe(/<[/\w!]/g,b.textContent)||b.nodeType===Dl.progressingInstruction||Yu&&b.nodeType===Dl.comment&&Qe(/<[/\w]/g,b.data))return Cn(b),!0;if(!(Xr.tagCheck instanceof Function&&Xr.tagCheck(N))&&(!He[N]||Sl[N])){if(!Sl[N]&&E1(N)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N)))return!1;if(nf&&!kn[N]){const ye=J(b)||b.parentNode,je=P(b)||b.childNodes;if(je&&ye){const Re=je.length;for(let dt=Re-1;dt>=0;--dt){const lr=E(je[dt],!0);lr.__removalCount=(b.__removalCount||0)+1,ye.insertBefore(lr,B(b))}}}return Cn(b),!0}return b instanceof c&&!__(b)||(N==="noscript"||N==="noembed"||N==="noframes")&&Qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(Cn(b),!0):(wo&&b.nodeType===Dl.text&&(I=b.textContent,yh([Xe,Ze,le],ye=>{I=xl(I,ye," ")}),b.textContent!==I&&(Il(e.removed,{element:b.cloneNode()}),b.textContent=I)),ar(ve.afterSanitizeElements,b,null),!1)},A1=function(b,I,N){if(Gu[I]||h1&&(I==="id"||I==="name")&&(N in t||N in S_))return!1;if(!(Qp&&!Gu[I]&&Qe(sr,I))){if(!(l1&&Qe(Zt,I))){if(!(Xr.attributeCheck instanceof Function&&Xr.attributeCheck(I,b))){if(!Be[I]||Gu[I]){if(!(E1(b)&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,b)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(b))&&(Te.attributeNameCheck instanceof RegExp&&Qe(Te.attributeNameCheck,I)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(I,b))||I==="is"&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&Qe(Te.tagNameCheck,N)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(N))))return!1}else if(!sf[I]){if(!Qe(s1,xl(N,bl,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&I7(N,"data:")===0&&p1[b])){if(!(c1&&!Qe(wl,xl(N,bl,"")))){if(N)return!1}}}}}}}return!0},E1=function(b){return b!=="annotation-xml"&&e0(b,ju)},k1=function(b){ar(ve.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||cf(b))return;const N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0};let ye=I.length;for(;ye--;){const je=I[ye],{name:Re,namespaceURI:dt,value:lr}=je,Eo=De(Re),uf=lr;let qe=Re==="value"?uf:x7(uf);if(N.attrName=Eo,N.attrValue=qe,N.keepAttr=!0,N.forceKeepAttr=void 0,ar(ve.uponSanitizeAttribute,b,N),qe=N.attrValue,d1&&(Eo==="id"||Eo==="name")&&(Qi(Re,b),qe=g_+qe),Yu&&Qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,qe)){Qi(Re,b);continue}if(Eo==="attributename"&&e0(qe,"href")){Qi(Re,b);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){Qi(Re,b);continue}if(!u1&&Qe(/\/>/i,qe)){Qi(Re,b);continue}wo&&yh([Xe,Ze,le],T1=>{qe=xl(qe,T1," ")});const C1=De(b.nodeName);if(!A1(C1,Eo,qe)){Qi(Re,b);continue}if(O&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!dt)switch(v.getAttributeType(C1,Eo)){case"TrustedHTML":{qe=O.createHTML(qe);break}case"TrustedScriptURL":{qe=O.createScriptURL(qe);break}}if(qe!==uf)try{dt?b.setAttributeNS(dt,Re,qe):b.setAttribute(Re,qe),cf(b)?Cn(b):Sw(e.removed)}catch{Qi(Re,b)}}ar(ve.afterSanitizeAttributes,b,null)},A_=function V(b){let I=null;const N=b1(b);for(ar(ve.beforeSanitizeShadowDOM,b,null);I=N.nextNode();)ar(ve.uponSanitizeShadowNode,I,null),_1(I),k1(I),I.content instanceof o&&V(I.content);ar(ve.afterSanitizeShadowDOM,b,null)};return e.sanitize=function(V){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,N=null,ye=null,je=null;if(of=!V,of&&(V="<!-->"),typeof V!="string"&&!S1(V))if(typeof V.toString=="function"){if(V=V.toString(),typeof V!="string")throw Pl("dirty is not a string, aborting")}else throw Pl("toString is not a function");if(!e.isSupported)return V;if(ef||lf(b),e.removed=[],typeof V=="string"&&(_l=!1),_l){if(V.nodeName){const lr=De(V.nodeName);if(!He[lr]||Sl[lr])throw Pl("root node is forbidden and cannot be sanitized in-place")}}else if(V instanceof l)I=w1("<!---->"),N=I.ownerDocument.importNode(V,!0),N.nodeType===Dl.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?I=N:I.appendChild(N);else{if(!bo&&!wo&&!Xi&&V.indexOf("<")===-1)return O&&Ku?O.createHTML(V):V;if(I=w1(V),!I)return bo?null:Ku?Y:""}I&&tf&&Cn(I.firstChild);const Re=b1(_l?V:I);for(;ye=Re.nextNode();)_1(ye),k1(ye),ye.content instanceof o&&A_(ye.content);if(_l)return V;if(bo){if(Ju)for(je=fe.call(I.ownerDocument);I.firstChild;)je.appendChild(I.firstChild);else je=I;return(Be.shadowroot||Be.shadowrootmode)&&(je=Ve.call(r,je,!0)),je}let dt=Xi?I.outerHTML:I.innerHTML;return Xi&&He["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Qe(pS,I.ownerDocument.doctype.name)&&(dt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
391
- `+dt),wo&&yh([Xe,Ze,le],lr=>{dt=xl(dt,lr," ")}),O&&Ku?O.createHTML(dt):dt},e.setConfig=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf(V),ef=!0},e.clearConfig=function(){Ao=null,ef=!1},e.isValidAttribute=function(V,b,I){Ao||lf({});const N=De(V),ye=De(b);return A1(N,ye,I)},e.addHook=function(V,b){typeof b=="function"&&Il(ve[V],b)},e.removeHook=function(V,b){if(b!==void 0){const I=$7(ve[V],b);return I===-1?void 0:R7(ve[V],I,1)[0]}return Sw(ve[V])},e.removeHooks=function(V){ve[V]=[]},e.removeAllHooks=function(){ve=Tw()},e}var mS=fS();function qg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yo=qg();function gS(n){yo=n}var cs={exec:()=>null};function ie(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(lt.caret,"$1"),t=t.replace(i,a),r},getRegex:()=>new RegExp(t,e)};return r}var W7=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),lt={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)}}>`)},j7=/^(?:[ \t]*(?:\n|$))+/,G7=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Y7=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,J7=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Wg=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yS=ie(vS).replace(/bull/g,Wg).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(),K7=ie(vS).replace(/bull/g,Wg).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(),jg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,X7=/^[^\n]+/,Gg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Q7=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eZ=ie(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wg).getRegex(),Jp="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",Yg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tZ=ie("^ {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",Yg).replace("tag",Jp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wS=ie(jg).replace("hr",Wu).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",Jp).getRegex(),nZ=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wS).getRegex(),Jg={blockquote:nZ,code:G7,def:Q7,fences:Y7,heading:J7,hr:Wu,html:tZ,lheading:yS,list:eZ,newline:j7,paragraph:wS,table:cs,text:X7},$w=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Wu).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",Jp).getRegex(),rZ={...Jg,lheading:K7,table:$w,paragraph:ie(jg).replace("hr",Wu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$w).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",Jp).getRegex()},iZ={...Jg,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yg).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:cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(jg).replace("hr",Wu).replace("heading",` *#{1,6} *[^
392
- ]`).replace("lheading",yS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bS=/^( {2,}|\\)\n(?!\s*$)/,aZ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yl=/[\p{P}\p{S}]/u,Kp=/[\s\p{P}\p{S}]/u,Kg=/[^\s\p{P}\p{S}]/u,lZ=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kp).getRegex(),SS=/(?!~)[\p{P}\p{S}]/u,cZ=/(?!~)[\s\p{P}\p{S}]/u,uZ=/(?:[^\s\p{P}\p{S}]|~)/u,hZ=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",W7?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_S=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dZ=ie(_S,"u").replace(/punct/g,yl).getRegex(),pZ=ie(_S,"u").replace(/punct/g,SS).getRegex(),AS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fZ=ie(AS,"gu").replace(/notPunctSpace/g,Kg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),mZ=ie(AS,"gu").replace(/notPunctSpace/g,uZ).replace(/punctSpace/g,cZ).replace(/punct/g,SS).getRegex(),gZ=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),vZ=ie(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yl).getRegex(),yZ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wZ=ie(yZ,"gu").replace(/notPunctSpace/g,Kg).replace(/punctSpace/g,Kp).replace(/punct/g,yl).getRegex(),bZ=ie(/\\(punct)/,"gu").replace(/punct/g,yl).getRegex(),SZ=ie(/^<(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(),_Z=ie(Yg).replace("(?:-->|$)","-->").getRegex(),AZ=ie("^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",_Z).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,EZ=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ES=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",xd).replace("ref",Gg).getRegex(),kS=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gg).getRegex(),kZ=ie("reflink|nolink(?!\\()","g").replace("reflink",ES).replace("nolink",kS).getRegex(),Rw=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xg={_backpedal:cs,anyPunctuation:bZ,autolink:SZ,blockSkip:hZ,br:bS,code:oZ,del:cs,delLDelim:cs,delRDelim:cs,emStrongLDelim:dZ,emStrongRDelimAst:fZ,emStrongRDelimUnd:gZ,escape:sZ,link:EZ,nolink:kS,punctuation:lZ,reflink:ES,reflinkSearch:kZ,tag:AZ,text:aZ,url:cs},CZ={...Xg,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},Tm={...Xg,emStrongRDelimAst:mZ,emStrongLDelim:pZ,delLDelim:vZ,delRDelim:wZ,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Rw).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:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Rw).getRegex()},TZ={...Tm,br:ie(bS).replace("{2,}","*").getRegex(),text:ie(Tm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bh={normal:Jg,gfm:rZ,pedantic:iZ},Ml={normal:Xg,gfm:Tm,breaks:TZ,pedantic:CZ},$Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Iw=n=>$Z[n];function xn(n,e){if(e){if(lt.escapeTest.test(n))return n.replace(lt.escapeReplace,Iw)}else if(lt.escapeTestNoEncode.test(n))return n.replace(lt.escapeReplaceNoEncode,Iw);return n}function xw(n){try{n=encodeURI(n).replace(lt.percentDecode,"%")}catch{return null}return n}function Pw(n,e){var o;let t=n.replace(lt.findPipe,(a,l,c)=>{let d=!1,f=l;for(;--f>=0&&c[f]==="\\";)d=!d;return d?"|":" |"}),r=t.split(lt.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(lt.slashPipe,"|");return r}function Ol(n,e,t){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===e;)i++;return n.slice(0,r-i)}function RZ(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function IZ(n,e=0){let t=e,r="";for(let i of n)if(i===" "){let o=4-t%4;r+=" ".repeat(o),t+=o}else r+=i,t++;return r}function Lw(n,e,t,r,i){let o=e.href,a=e.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:o,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function xZ(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
393
- `).map(o=>{let a=o.match(t.other.beginningSpace);if(a===null)return o;let[l]=a;return l.length>=i.length?o.slice(i.length):o}).join(`
394
- `)}var Pd=class{constructor(n){C(this,"options");C(this,"rules");C(this,"lexer");this.options=n||yo}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Ol(t,`
395
- `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=xZ(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=Ol(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Ol(e[0],`
396
- `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Ol(e[0],`
397
- `).split(`
398
- `),r="",i="",o=[];for(;t.length>0;){let a=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),a=!0;else if(!a)l.push(t[c]);else break;t=t.slice(c);let d=l.join(`
399
- `),f=d.replace(this.rules.other.blockquoteSetextReplace,`
400
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
401
- ${d}`:d,i=i?`${i}
402
- ${f}`:f;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=g,t.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,_=v.raw+`
403
- `+t.join(`
404
- `),E=this.blockquote(_);o[o.length-1]=E,r=r.substring(0,r.length-v.raw.length)+E.raw,i=i.substring(0,i.length-v.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){let v=y,_=v.raw+`
405
- `+t.join(`
406
- `),E=this.list(_);o[o.length-1]=E,r=r.substring(0,r.length-y.raw.length)+E.raw,i=i.substring(0,i.length-v.raw.length)+E.raw,t=_.substring(o.at(-1).raw.length).split(`
407
- `);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(n){var t,r;let e=this.rules.block.list.exec(n);if(e){let i=e[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 f=!1,g="",y="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;g=e[0],n=n.substring(g.length);let v=IZ(e[2].split(`
408
- `,1)[0],e[1].length),_=n.split(`
409
- `,1)[0],E=!v.trim(),x=0;if(this.options.pedantic?(x=2,y=v.trimStart()):E?x=e[1].length+1:(x=v.search(this.rules.other.nonSpaceChar),x=x>4?1:x,y=v.slice(x),x+=e[1].length),E&&this.rules.other.blankLine.test(_)&&(g+=_+`
410
- `,n=n.substring(_.length+1),f=!0),!f){let B=this.rules.other.nextBulletRegex(x),P=this.rules.other.hrRegex(x),J=this.rules.other.fencesBeginRegex(x),O=this.rules.other.headingBeginRegex(x),Y=this.rules.other.htmlBeginRegex(x),U=this.rules.other.blockquoteBeginRegex(x);for(;n;){let j=n.split(`
411
- `,1)[0],fe;if(_=j,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),fe=_):fe=_.replace(this.rules.other.tabCharGlobal," "),J.test(_)||O.test(_)||Y.test(_)||U.test(_)||B.test(_)||P.test(_))break;if(fe.search(this.rules.other.nonSpaceChar)>=x||!_.trim())y+=`
412
- `+fe.slice(x);else{if(E||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||J.test(v)||O.test(v)||P.test(v))break;y+=`
413
- `+_}E=!_.trim(),g+=j+`
414
- `,n=n.substring(j.length+1),v=fe.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),a.raw+=g}let d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let f of a.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),((t=f.tokens[0])==null?void 0:t.type)==="text"||((r=f.tokens[0])==null?void 0:r.type)==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.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 g=this.rules.other.listTaskCheckbox.exec(f.raw);if(g){let y={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};f.checked=y.checked,a.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=y.raw+f.tokens[0].raw,f.tokens[0].text=y.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(y)):f.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):f.tokens.unshift(y)}}if(!a.loose){let g=f.tokens.filter(v=>v.type==="space"),y=g.length>0&&g.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=y}}if(a.loose)for(let f of a.items){f.loose=!0;for(let g of f.tokens)g.type==="text"&&(g.type="paragraph")}return a}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:i}}}table(n){var a;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Pw(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
415
- `):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.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<t.length;l++)o.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(Pw(l,o.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[d]})));return o}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
416
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let o=Ol(t.slice(0,-1),"\\");if((t.length-o.length)%2===0)return}else{let o=RZ(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Lw(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){let o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return Lw(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...r[0]].length-1,o,a,l=i,c=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(r=d.exec(e))!=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 f=[...r[0]][0].length,g=n.slice(0,i+r.index+f+a);if(Math.min(i,a)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...r[0]].length-1,o,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*n.length+i);(r=c.exec(e))!=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 d=[...r[0]][0].length,f=n.slice(0,i+r.index+d+a),g=f.slice(i,-i);return{type:"del",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let o;do o=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(o!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},yn=class $m{constructor(e){C(this,"tokens");C(this,"options");C(this,"state");C(this,"inlineQueue");C(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yo,this.options.tokenizer=this.options.tokenizer||new Pd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:lt,block:bh.normal,inline:Ml.normal};this.options.pedantic?(t.block=bh.pedantic,t.inline=Ml.pedantic):this.options.gfm&&(t.block=bh.gfm,this.options.breaks?t.inline=Ml.breaks:t.inline=Ml.gfm),this.tokenizer.rules=t}static get rules(){return{block:bh,inline:Ml}}static lex(e,t){return new $m(t).lex(e)}static lexInline(e,t){return new $m(t).inlineTokens(e)}lex(e){e=e.replace(lt.carriageReturn,`
417
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){var i,o,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(lt.tabCharGlobal," ").replace(lt.spaceLine,""));e;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(d=>(l=d.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let d=t.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
418
- `:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
419
- `)?"":`
420
- `)+l.raw,d.text+=`
421
- `+l.text,this.inlineQueue.at(-1).src=d.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
422
- `)?"":`
423
- `)+l.raw,d.text+=`
424
- `+l.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},t.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let c=e;if((a=this.options.extensions)!=null&&a.startBlock){let d=1/0,f=e.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},f),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(c=e.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let d=t.at(-1);r&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
425
- `)?"":`
426
- `)+l.raw,d.text+=`
427
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(l),r=c.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let d=t.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
428
- `)?"":`
429
- `)+l.raw,d.text+=`
430
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):t.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,d,f,g,y;this.tokenizer.lexer=this;let r=e,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=((d=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let v;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(E=>(v=E.call({lexer:this},e,t))?(e=e.substring(v.raw.length),t.push(v),!0):!1))continue;if(v=this.tokenizer.escape(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.tag(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.link(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(v.raw.length);let E=t.at(-1);v.type==="text"&&(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(v=this.tokenizer.emStrong(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.codespan(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.br(e)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.del(e,r,l)){e=e.substring(v.raw.length),t.push(v);continue}if(v=this.tokenizer.autolink(e)){e=e.substring(v.raw.length),t.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(e))){e=e.substring(v.raw.length),t.push(v);continue}let _=e;if((y=this.options.extensions)!=null&&y.startInline){let E=1/0,x=e.slice(1),B;this.options.extensions.startInline.forEach(P=>{B=P.call({lexer:this},x),typeof B=="number"&&B>=0&&(E=Math.min(E,B))}),E<1/0&&E>=0&&(_=e.substring(0,E+1))}if(v=this.tokenizer.inlineText(_)){e=e.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(l=v.raw.slice(-1)),a=!0;let E=t.at(-1);(E==null?void 0:E.type)==="text"?(E.raw+=v.raw,E.text+=v.text):t.push(v);continue}if(e){let E="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(E);break}else throw new Error(E)}}return t}},Ld=class{constructor(n){C(this,"options");C(this,"parser");this.options=n||yo}space(n){return""}code({text:n,lang:e,escaped:t}){var o;let r=(o=(e||"").match(lt.notSpaceStart))==null?void 0:o[0],i=n.replace(lt.endingNewline,"")+`
431
- `;return r?'<pre><code class="language-'+xn(r)+'">'+(t?i:xn(i,!0))+`</code></pre>
432
- `:"<pre><code>"+(t?i:xn(i,!0))+`</code></pre>
433
- `}blockquote({tokens:n}){return`<blockquote>
434
- ${this.parser.parse(n)}</blockquote>
435
- `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
436
- `}hr(n){return`<hr>
437
- `}list(n){let e=n.ordered,t=n.start,r="";for(let a=0;a<n.items.length;a++){let l=n.items[a];r+=this.listitem(l)}let i=e?"ol":"ul",o=e&&t!==1?' start="'+t+'"':"";return"<"+i+o+`>
438
- `+r+"</"+i+`>
439
- `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
440
- `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
441
- `}table(n){let e="",t="";for(let i=0;i<n.header.length;i++)t+=this.tablecell(n.header[i]);e+=this.tablerow({text:t});let r="";for(let i=0;i<n.rows.length;i++){let o=n.rows[i];t="";for(let a=0;a<o.length;a++)t+=this.tablecell(o[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
442
- <thead>
443
- `+e+`</thead>
444
- `+r+`</table>
445
- `}tablerow({text:n}){return`<tr>
446
- ${n}</tr>
447
- `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
448
- `}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>${xn(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),i=xw(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return e&&(o+=' title="'+xn(e)+'"'),o+=">"+r+"</a>",o}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let i=xw(n);if(i===null)return xn(t);n=i;let o=`<img src="${n}" alt="${xn(t)}"`;return e&&(o+=` title="${xn(e)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:xn(n.text)}},Qg=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 Rm{constructor(e){C(this,"options");C(this,"renderer");C(this,"textRenderer");this.options=e||yo,this.options.renderer=this.options.renderer||new Ld,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qg}static parse(e,t){return new Rm(t).parse(e)}static parseInline(e,t){return new Rm(t).parseInline(e)}parse(e){var r,i;this.renderer.parser=this;let t="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){t+=d||"";continue}}let l=a;switch(l.type){case"space":{t+=this.renderer.space(l);break}case"hr":{t+=this.renderer.hr(l);break}case"heading":{t+=this.renderer.heading(l);break}case"code":{t+=this.renderer.code(l);break}case"table":{t+=this.renderer.table(l);break}case"blockquote":{t+=this.renderer.blockquote(l);break}case"list":{t+=this.renderer.list(l);break}case"checkbox":{t+=this.renderer.checkbox(l);break}case"html":{t+=this.renderer.html(l);break}case"def":{t+=this.renderer.def(l);break}case"paragraph":{t+=this.renderer.paragraph(l);break}case"text":{t+=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 t}parseInline(e,t=this.renderer){var i,o;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let l=e[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=d||"";continue}}let c=l;switch(c.type){case"escape":{r+=t.text(c);break}case"html":{r+=t.html(c);break}case"link":{r+=t.link(c);break}case"image":{r+=t.image(c);break}case"checkbox":{r+=t.checkbox(c);break}case"strong":{r+=t.strong(c);break}case"em":{r+=t.em(c);break}case"codespan":{r+=t.codespan(c);break}case"br":{r+=t.br(c);break}case"del":{r+=t.del(c);break}case"text":{r+=t.text(c);break}default:{let d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},Eh,ec=(Eh=class{constructor(n){C(this,"options");C(this,"block");this.options=n||yo}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?yn.lex:yn.lexInline}provideParser(){return this.block?wn.parse:wn.parseInline}},C(Eh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(Eh,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Eh),PZ=class{constructor(...n){C(this,"defaults",qg());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",wn);C(this,"Renderer",Ld);C(this,"TextRenderer",Qg);C(this,"Lexer",yn);C(this,"Tokenizer",Pd);C(this,"Hooks",ec);this.use(...n)}walkTokens(n,e){var r,i;let t=[];for(let o of n)switch(t=t.concat(e.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let c of l)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{let a=o;t=t.concat(this.walkTokens(a.items,e));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);t=t.concat(this.walkTokens(c,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=e.renderers[i.name];o?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:e.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=e[i.level];o?o.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),t.renderer){let i=this.defaults.renderer||new Ld(this.defaults);for(let o in t.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=t.renderer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f||""}}r.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Pd(this.defaults);for(let o in t.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=t.tokenizer[a],c=i[a];i[a]=(...d)=>{let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new ec;for(let o in t.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=t.hooks[a],c=i[a];ec.passThroughHooks.has(o)?i[a]=d=>{if(this.defaults.async&&ec.passThroughHooksRespectAsync.has(o))return(async()=>{let g=await l.call(i,d);return c.call(i,g)})();let f=l.call(i,d);return c.call(i,f)}:i[a]=(...d)=>{if(this.defaults.async)return(async()=>{let g=await l.apply(i,d);return g===!1&&(g=await c.apply(i,d)),g})();let f=l.apply(i,d);return f===!1&&(f=c.apply(i,d)),f}}r.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,o=t.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,e){return yn.lex(n,e??this.defaults)}parser(n,e){return wn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},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 e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", 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(e):e,l=await(i.hooks?await i.hooks.provideLexer():n?yn.lex:yn.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser():n?wn.parse:wn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer():n?yn.lex:yn.lexInline)(e,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,e){return t=>{if(t.message+=`
449
- Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+xn(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},fo=new PZ;function he(n,e){return fo.parse(n,e)}he.options=he.setOptions=function(n){return fo.setOptions(n),he.defaults=fo.defaults,gS(he.defaults),he};he.getDefaults=qg;he.defaults=yo;he.use=function(...n){return fo.use(...n),he.defaults=fo.defaults,gS(he.defaults),he};he.walkTokens=function(n,e){return fo.walkTokens(n,e)};he.parseInline=fo.parseInline;he.Parser=wn;he.parser=wn.parse;he.Renderer=Ld;he.TextRenderer=Qg;he.Lexer=yn;he.lexer=yn.lex;he.Tokenizer=Pd;he.Hooks=ec;he.parse=he;he.options;he.setOptions;he.use;he.walkTokens;he.parseInline;wn.parse;yn.lex;mS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function CS(n){const e=he.parse(n,{async:!1});return mS.sanitize(e,{USE_PROFILES:{html:!0}})}const Dw={restart_to_update:"Restart to update",restarting:"Restarting…"};var qs,du,mn,Jd,TS,La,Kd;class LZ extends Nt{constructor(){super(...arguments);p(this,Jd);p(this,qs,null);p(this,du,bn());p(this,mn,null);p(this,La,()=>{this.render()});p(this,Kd,()=>{var t;(t=s(this,mn))==null||t.restart()})}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||s(this,qs)!==null)return;const t=((r=s(this,du).value)==null?void 0:r.querySelector("dialog"))??null;if(t===null)throw new Error("Desktop upgrade gate requires its composed dialog");h(this,qs,Yp(t,()=>{}))})}disconnected(){var t,r;(t=s(this,qs))==null||t.withdraw(),h(this,qs,null),(r=s(this,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,null)}template(t,r){var a,l;u(this,Jd,TS).call(this,r??null);const i=((a=s(this,mn))==null?void 0:a.version)??null,o=((l=s(this,mn))==null?void 0:l.restarting)??!1;return M`
450
- <div class="desktop-upgrade-gate" ${Je(s(this,du))}>
451
- ${Gp(M`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${uS(CS(jb(t,i!==null)))}</div>${i===null?te:M`<div class="upgrade-gate-actions"><button
452
- intent="primary"
453
- class="upgrade-gate-restart"
454
- ?disabled=${o}
455
- @click=${s(this,Kd)}
456
- >${o?Dw.restarting:Dw.restart_to_update}</button></div>`}`)}
457
- </div>
458
- `}}qs=new WeakMap,du=new WeakMap,mn=new WeakMap,Jd=new WeakSet,TS=function(t){var r;t!==s(this,mn)&&((r=s(this,mn))==null||r.removeEventListener("change",s(this,La)),h(this,mn,t),t==null||t.addEventListener("change",s(this,La)),t==null||t.subscribe())},La=new WeakMap,Kd=new WeakMap;const DZ=zt(LZ),MZ=250,OZ=1e3;var Gn,Yn,Ws,$i,js,Da,En,$S,Xd,Qd,RS,Im,IS;class NZ extends Nt{constructor(){super(...arguments);p(this,En);p(this,Gn,ZZ());p(this,Yn,null);p(this,Ws,!1);p(this,$i,null);p(this,js,"");p(this,Da,null);p(this,Xd,t=>{h(this,js,t.currentTarget.value)});p(this,Qd,t=>{t.preventDefault();const r=s(this,js).trim();r.length===0||s(this,Da)===null||s(this,Da).authenticate(r)})}disconnected(){var t;u(this,En,Im).call(this),(t=s(this,Yn))==null||t.withdraw(),h(this,Yn,null),h(this,Ws,!1),Vh(null,s(this,Gn))}template(t,r,i){var o;return h(this,Da,r),u(this,En,RS).call(this,t),t.kind==="needs-upgrade"?((o=s(this,Yn))==null||o.withdraw(),h(this,Yn,null),Vh(DZ(t.instructions,i),s(this,Gn)),s(this,Gn)):(Vh(Gp(u(this,En,$S).call(this,t)),s(this,Gn)),u(this,En,IS).call(this),s(this,Gn))}}Gn=new WeakMap,Yn=new WeakMap,Ws=new WeakMap,$i=new WeakMap,js=new WeakMap,Da=new WeakMap,En=new WeakSet,$S=function(t){switch(t.kind){case"connecting":return M`
459
- <div class="system-modal" role="status" aria-live="polite">
460
- <tv-icon name="spinner" size="xl" spinning></tv-icon>
461
- <h2>Connecting</h2>
462
- </div>
463
- `;case"disconnected":return M`
464
- <div class="system-modal" role="status" aria-live="polite">
465
- <tv-icon name="spinner" size="xl" spinning></tv-icon>
466
- <h2>Disconnected</h2>
467
- <p>${HZ(t.nextRetryAt)}</p>
468
- </div>
469
- `;case"unauthorized":{const r=!!t.invalid;return r&&h(this,js,""),M`
470
- <form class="system-modal auth-form" @submit=${s(this,Qd)}>
471
- <tv-icon name="locked" size="xl"></tv-icon>
472
- <h2>Enter access token</h2>
473
- <p>This server requires an access token to connect.</p>
474
- <input
475
- class="auth-token"
476
- type="password"
477
- name="token"
478
- placeholder="paste token here"
479
- aria-label="Access token"
480
- aria-invalid=${r?"true":te}
481
- aria-describedby=${r?"auth-token-error":te}
482
- .value=${s(this,js)}
483
- @input=${s(this,Xd)}
484
- autofocus
485
- required
486
- />
487
- ${r?M`<p id="auth-token-error" class="tv-error" role="alert">
488
- The previous token was rejected. Try again.
489
- </p>`:null}
490
- <button type="submit" intent="primary" class="auth-submit">
491
- Connect
492
- </button>
493
- </form>
494
- `}case"error":return M`
495
- <div class="system-modal">
496
- <h2>Can’t connect with server</h2>
497
- <p class="server-url">${t.serverURL}</p>
498
- <p>${t.message}</p>
499
- </div>
500
- `}},Xd=new WeakMap,Qd=new WeakMap,RS=function(t){const r=t.kind==="disconnected"&&t.nextRetryAt!==null;r&&s(this,$i)===null?h(this,$i,setInterval(()=>this.render(),MZ)):r||u(this,En,Im).call(this)},Im=function(){s(this,$i)!==null&&(clearInterval(s(this,$i)),h(this,$i,null))},IS=function(){s(this,Yn)!==null||s(this,Ws)||(h(this,Ws,!0),queueMicrotask(()=>{if(h(this,Ws,!1),!this.isConnected||!s(this,Gn).isConnected||s(this,Yn)!==null)return;const t=s(this,Gn).querySelector("dialog");t!==null&&h(this,Yn,Yp(t,()=>{}))}))};const zZ=zt(NZ);function ZZ(){const n=document.createElement("section");return n.className="system-modal-host",n}function HZ(n){if(n===null)return"Reattempting now…";const e=n-Date.now();return e<=0?"Reattempting now…":`Reattempting in ${Math.ceil(e/OZ)}s…`}const UZ=1400,Sh=new WeakMap;function FZ(n,e){var o;const t=e.ownerDocument,r=(o=t.defaultView)==null?void 0:o.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=t.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",t.body.append(i),i.select();try{t.execCommand("copy")}catch{}i.remove()}const VZ={writeClipboard:FZ,scheduler:{setTimeout(n,e){return globalThis.setTimeout(n,e)},clearTimeout(n){globalThis.clearTimeout(n)}}};function BZ(n,e,t){const r=n.currentTarget;if(!r)return;e.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=Sh.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:e.scheduler};l.handle=e.scheduler.setTimeout(()=>{Sh.get(r)===l&&(Sh.delete(r),r.toggleAttribute("copied",!1),o&&(o.textContent=""))},UZ),Sh.set(r,l),t()}function xS({label:n,prompt:e="",intent:t,copied:r=!1,onActivate:i=()=>{}},o=VZ){return M`
501
- <button
502
- class="copy-button"
503
- size="sm"
504
- aria-label=${n}
505
- intent=${t??te}
506
- ?copied=${r}
507
- prompt=${e}
508
- @click=${a=>BZ(a,o,i)}
509
- >
510
- <span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
511
- <span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
512
- </button>
513
- <span
514
- class="copy-button-status"
515
- role="status"
516
- aria-live="polite"
517
- >${r?"Copied":te}</span
518
- >
519
- `}const PS="1.4.0",qZ="tv-desktop-upgrade-recommendation-dismissed",WZ=`### Recommended desktop upgrade available
520
-
521
- The Television desktop app is now a downloaded Mac app that updates itself. This copy was installed with npm and receives no more updates.
522
-
523
- To move to the downloaded app on an Apple Silicon Mac:
524
-
525
- 1. [Download Television for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64).
526
- 2. Open the downloaded disk image and drag Television to Applications.
527
- 3. Quit this app, then open Television from Applications. It keeps your saved server connection.
528
-
529
- From then on, open Television from Applications, not with \`tv-desktop\`.`;function jZ(n){var e;return!n.electron||n.noticesSuppressed||((e=n.updateState)==null?void 0:e.toast)!=null||n.shellVersion===null||!Op(n.shellVersion)||n.shellVersion===vd?!1:Tg(PS,n.shellVersion)}var Ma;class LS extends HTMLElement{constructor(){super(...arguments);p(this,Ma,new Ug(this))}connectedCallback(){s(this,Ma).connect()}disconnectedCallback(){s(this,Ma).disconnect()}attributeChangedCallback(){s(this,Ma).refresh()}}Ma=new WeakMap,C(LS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",LS);const GZ="tv-update-dismissed",Ro={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},YZ="update-popover";function JZ(n,e){const t=n.target;if(!(t instanceof Element))return!1;const r=t.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&e.contains(r)}var Oa,Pr,Na,pu,fu,ep;class KZ extends Nt{constructor(){super(...arguments);p(this,Oa);p(this,Pr);p(this,Na,!1);p(this,pu,()=>{});p(this,fu,()=>{});p(this,ep,t=>{var r;(r=s(this,Pr))==null||r.disconnect(),h(this,Pr,void 0),h(this,Oa,t),h(this,Na,(t==null?void 0:t.hasAttribute("open"))??!1),t&&(h(this,Pr,new MutationObserver(()=>{const i=t.hasAttribute("open");i!==s(this,Na)&&(h(this,Na,i),i?s(this,pu).call(this):s(this,fu).call(this))})),s(this,Pr).observe(t,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var t;(t=s(this,Pr))==null||t.disconnect(),h(this,Pr,void 0),h(this,Oa,void 0)}template({body:t,prompt:r,copied:i=!1,restart:o,panelRef:a,bellRef:l,onPresent:c=()=>{},onDismiss:d=()=>{},onCopy:f=()=>{},onRestart:g=()=>{}}){h(this,pu,c),h(this,fu,d);const y=()=>{var _;(_=s(this,Oa))==null||_.removeAttribute("open")},v=_=>{const E=_.currentTarget;_.key!=="Escape"||!JZ(_,E)||(_.preventDefault(),_.stopPropagation(),E.removeAttribute("open"))};return M`
530
- <button
531
- class="update-bell"
532
- id="update-bell"
533
- icon
534
- intent="alert"
535
- aria-label=${Ro.update_available}
536
- title=${Ro.update_available}
537
- ${l===void 0?te:Je(l)}
538
- >
539
- <tv-icon name="notification" size="sm"></tv-icon>
540
- </button>
541
-
542
- <tv-popover
543
- id=${YZ}
544
- manual
545
- trigger="update-bell"
546
- role="status"
547
- class="update-popover"
548
- ${Je(s(this,ep))}
549
- ${a===void 0?te:Je(a)}
550
- @keydown=${v}
551
- >
552
- ${t}
553
- <div class="update-actions">
554
- <button size="sm" class="update-later" @click=${y}
555
- >${Ro.later}</button
556
- >
557
- ${r===void 0?te:xS({label:Ro.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:f})}
558
- ${o===void 0?te:M`<button
559
- size="sm"
560
- intent="primary"
561
- class="update-restart"
562
- ?disabled=${o==="restarting"}
563
- @click=${g}
564
- >${o==="restarting"?Ro.restarting:Ro.restart_to_update}</button>`}
565
- </div>
566
- </tv-popover>
567
- `}}Oa=new WeakMap,Pr=new WeakMap,Na=new WeakMap,pu=new WeakMap,fu=new WeakMap,ep=new WeakMap;const XZ=zt(KZ);function QZ(n,e){return e===null?!0:Tg(n,e)}const Mw=new Set;var Gt,Pt,mu,Lt,gu,za,Jn,Gs,Ys,Js,Za,Ye,Lr,Ks,Ha,Ua,Xs,Ri,q,xm,Pm,Lm,Dm,Mm,Om,Nm,Qs,eo,rd,tc,zm,DS,Zm,Hm,Um,tp,np,rp,ip,sp,op,nc,MS;class eH{constructor(e=()=>{}){p(this,q);p(this,Gt,null);p(this,Pt,null);p(this,mu,null);p(this,Lt,null);p(this,gu,"");p(this,za);p(this,Jn,!1);p(this,Gs,!1);p(this,Ys,!1);p(this,Js,!1);p(this,Za,null);p(this,Ye,!1);p(this,Lr,!1);p(this,Ks,null);p(this,Ha,null);p(this,Ua,!1);p(this,Xs,[]);p(this,Ri);p(this,Qs,()=>{s(this,Ri).call(this)});p(this,eo,()=>{u(this,q,Um).call(this),s(this,Ri).call(this)});p(this,tp,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e===null||s(this,Ye)||(h(this,Ye,!0),e.kind==="server"&&u(this,q,Zm).call(this,e.toast),s(this,Ri).call(this))});p(this,np,()=>{var t,r;if(!s(this,Ye))return;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);e!==null&&((r=u(this,q,xm).call(this))==null||r.setItem(u(this,q,zm).call(this,e),e.version)),h(this,Ye,!1),h(this,Lr,!0),s(this,Ri).call(this)});p(this,rp,()=>{var e;(e=s(this,Lt))==null||e.restart()});p(this,ip,()=>{var t;const e=u(this,q,tc).call(this,((t=s(this,Pt))==null?void 0:t.toastsSuppressed)??!1);(e==null?void 0:e.kind)!=="server"||e.prompt===void 0||u(this,q,Hm).call(this,"update_prompt_copy_clicked",e.toast)});p(this,sp,e=>{h(this,Ks,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});p(this,op,e=>{h(this,Ha,e instanceof HTMLElement?e:null),u(this,q,nc).call(this)});h(this,Ri,e)}get presented(){return s(this,Ye)}configure({connectionOwner:e=null,primaryServerURL:t="",presentation:r=null,dismissalStorage:i,desktopRecommendation:o=null,desktopUpdate:a=null}){e!==s(this,Gt)&&(u(this,q,Lm).call(this),h(this,Gt,e),u(this,q,Pm).call(this)),r!==s(this,Pt)&&(u(this,q,Mm).call(this),h(this,Pt,r),u(this,q,Dm).call(this)),a!==s(this,Lt)&&(u(this,q,Nm).call(this),h(this,Lt,a),u(this,q,Om).call(this)),h(this,gu,t),h(this,za,i),h(this,mu,o)}connect(){s(this,Jn)||(h(this,Jn,!0),u(this,q,Pm).call(this),u(this,q,Dm).call(this),u(this,q,Om).call(this))}disconnect(){s(this,Jn)&&(u(this,q,Lm).call(this),u(this,q,Mm).call(this),u(this,q,Nm).call(this),h(this,Jn,!1),h(this,Ks,null),h(this,Ha,null))}template(){var l,c,d;const e=((l=s(this,Pt))==null?void 0:l.toastsSuppressed)??!1,t=u(this,q,tc).call(this,e),r=t===null?null:`${t.kind}:${t.version}`;if(t===null?(h(this,Za,null),h(this,Ye,!1),h(this,Lr,!0)):r!==s(this,Za)&&(h(this,Za,r),h(this,Ye,u(this,q,DS).call(this,t)),h(this,Lr,!0),s(this,Ye)&&t.kind==="server"&&!e&&u(this,q,Zm).call(this,t.toast)),t===null||e)return h(this,Ye,!1),h(this,Lr,!0),u(this,q,nc).call(this),te;const i=(c=s(this,Ks))==null?void 0:c.querySelector(".copy-button"),o=s(this,Ye)&&!s(this,Lr)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=XZ({body:uS(CS(t.markdown)),prompt:t.kind==="server"?t.prompt:void 0,copied:o,restart:t.kind!=="desktop-self-update"?void 0:(d=s(this,Lt))!=null&&d.restarting?"restarting":"ready",presented:s(this,Ye),panelRef:s(this,sp),bellRef:s(this,op),onPresent:s(this,tp),onDismiss:s(this,np),onCopy:s(this,ip),onRestart:s(this,rp)});return h(this,Lr,!1),u(this,q,nc).call(this),a}}Gt=new WeakMap,Pt=new WeakMap,mu=new WeakMap,Lt=new WeakMap,gu=new WeakMap,za=new WeakMap,Jn=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,Js=new WeakMap,Za=new WeakMap,Ye=new WeakMap,Lr=new WeakMap,Ks=new WeakMap,Ha=new WeakMap,Ua=new WeakMap,Xs=new WeakMap,Ri=new WeakMap,q=new WeakSet,xm=function(){return s(this,za)!==void 0?s(this,za):typeof localStorage>"u"?null:localStorage},Pm=function(){!s(this,Jn)||s(this,Gs)||s(this,Gt)===null||(s(this,Gt).addEventListener("server-status",s(this,eo)),s(this,Gt).addEventListener("change",s(this,eo)),h(this,Gs,!0))},Lm=function(){!s(this,Gs)||s(this,Gt)===null||(s(this,Gt).removeEventListener("server-status",s(this,eo)),s(this,Gt).removeEventListener("change",s(this,eo)),h(this,Gs,!1))},Dm=function(){!s(this,Jn)||s(this,Ys)||s(this,Pt)===null||(s(this,Pt).addEventListener("change",s(this,Qs)),h(this,Ys,!0))},Mm=function(){!s(this,Ys)||s(this,Pt)===null||(s(this,Pt).removeEventListener("change",s(this,Qs)),h(this,Ys,!1))},Om=function(){!s(this,Jn)||s(this,Js)||s(this,Lt)===null||(s(this,Lt).addEventListener("change",s(this,Qs)),s(this,Lt).subscribe(),h(this,Js,!0))},Nm=function(){!s(this,Js)||s(this,Lt)===null||(s(this,Lt).removeEventListener("change",s(this,Qs)),h(this,Js,!1))},Qs=new WeakMap,eo=new WeakMap,rd=function(){var t;const e=((t=s(this,Gt))==null?void 0:t.connection)??null;return(e==null?void 0:e.url)===s(this,gu)?e:null},tc=function(e){var a,l;const t=((a=u(this,q,rd).call(this))==null?void 0:a.updateState)??null,r=(t==null?void 0:t.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=e?null:((l=s(this,Lt))==null?void 0:l.version)??null;if(i!==null)return{kind:"desktop-self-update",version:i,markdown:XO(i)};const o=s(this,mu);return o!==null&&jZ({...o,noticesSuppressed:e,updateState:t})?{kind:"recommendation",version:PS,markdown:WZ}:null},zm=function(e){switch(e.kind){case"server":return GZ;case"desktop-self-update":return KO;case"recommendation":return qZ}},DS=function(e){var r;const t=((r=u(this,q,xm).call(this))==null?void 0:r.getItem(u(this,q,zm).call(this,e)))??null;return e.kind==="desktop-self-update"?t!==e.version:QZ(e.version,t!==null&&Op(t)?t:null)},Zm=function(e){Mw.has(e.version)||(Mw.add(e.version),u(this,q,Hm).call(this,"update_toast_shown",e))},Hm=function(e,t){var r;s(this,Xs).push({event:e,properties:{server_version:((r=u(this,q,rd).call(this))==null?void 0:r.serverVersion)??"",channel_version:t.version}}),u(this,q,Um).call(this)},Um=function(){if(s(this,Xs).length===0)return;const e=u(this,q,rd).call(this);if(!e||e.status!=="connected")return;const t=s(this,Xs);h(this,Xs,[]);for(const r of t)e.sendTelemetrySignal(r.event,r.properties)},tp=new WeakMap,np=new WeakMap,rp=new WeakMap,ip=new WeakMap,sp=new WeakMap,op=new WeakMap,nc=function(){s(this,Ua)||(h(this,Ua,!0),queueMicrotask(()=>{h(this,Ua,!1),u(this,q,MS).call(this)}))},MS=function(){const e=s(this,Ks);e!==null&&(s(this,Ye)&&s(this,Ha)===null||e.toggleAttribute("open",s(this,Ye)))};const tH=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,nH=""+new URL("table-oeG9uAN1.png",import.meta.url).href,rH=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,iH=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,Ow="Artifact skills",sH="Artifact skills",oH="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",aH="Copy prompt";function _h({artifactSkill:n,name:e,description:t,prompt:r,thumbnail:i},o){return M`
568
- <article class="skill-card">
569
- <div class="skill-thumb"><img src=${i} alt="" /></div>
570
- <div class="skill-name">${e}</div>
571
- <p class="skill-desc">${t}</p>
572
- ${xS({label:aH,prompt:r,onActivate:()=>o==null?void 0:o.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
573
- </article>
574
- `}class lH extends Nt{template(e=null){return M`
575
- <button
576
- class="skill-trigger"
577
- variant="ghost"
578
- icon
579
- id="skills-trigger"
580
- aria-label=${Ow}
581
- title=${Ow}
582
- >
583
- <tv-icon name="skills" size="sm"></tv-icon>
584
- </button>
585
-
586
- <tv-popover
587
- id="skills-popover"
588
- trigger="skills-trigger"
589
- class="skill-popover"
590
- >
591
- <div class="skill-heading">${sH}</div>
592
- <p class="skill-intro">${oH}</p>
593
- <div class="skill-grid">
594
- ${_h({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:tH},e)}
595
- ${_h({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:nH},e)}
596
- ${_h({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:rH},e)}
597
- ${_h({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:iH},e)}
598
- </div>
599
- </tv-popover>
600
- `}}const cH=zt(lH),uH=600;let hH=0;const Nw=new WeakMap,s0=n=>{if(n.id)return n.id;let e=Nw.get(n);if(!e){do e=`tv-select-${++hH}`;while(n.ownerDocument.getElementById(e));Nw.set(n,e)}return n.id=e,e},Ah=n=>{var e;return((e=n.textContent)==null?void 0:e.trim())??""};var vu;class OS extends HTMLElement{constructor(){super();p(this,vu,this.attachInternals());s(this,vu).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){s(this,vu).ariaSelected=String(this.hasAttribute("selected"))}}vu=new WeakMap,C(OS,"observedAttributes",["selected"]);var it,Dr,Fa,Ii,xi,yu,W,ti,Fo,Fm,id,ni,sd,Vm,zS,od,ZS;class NS extends HTMLElement{constructor(){super();p(this,W);p(this,it,new Ug(this,{select:!0,refresh:()=>u(this,W,sd).call(this),opened:()=>{h(this,xi,""),u(this,W,ni).call(this,u(this,W,Fo).call(this))},closed:()=>{u(this,W,ni).call(this,void 0),h(this,xi,"")},keydown:t=>u(this,W,ZS).call(this,t),pointermove:t=>{const r=u(this,W,Fm).call(this,t);r&&u(this,W,ni).call(this,r)},click:t=>{const r=u(this,W,Fm).call(this,t);r&&u(this,W,od).call(this,r)},selectedRow:()=>u(this,W,Fo).call(this),unpair:t=>u(this,W,zS).call(this,t)}));p(this,Dr);p(this,Fa,"");p(this,Ii);p(this,xi,"");p(this,yu,0);this.attachInternals().role="listbox"}connectedCallback(){s(this,it).connect()}disconnectedCallback(){s(this,it).disconnect()}attributeChangedCallback(){s(this,it).refresh()}get value(){var t;return((t=u(this,W,Fo).call(this))==null?void 0:t.getAttribute("value"))??""}set value(t){const r=u(this,W,ti).call(this).find(i=>i.getAttribute("value")===t);r&&(u(this,W,id).call(this,r),u(this,W,sd).call(this))}}it=new WeakMap,Dr=new WeakMap,Fa=new WeakMap,Ii=new WeakMap,xi=new WeakMap,yu=new WeakMap,W=new WeakSet,ti=function(){return[...this.querySelectorAll("tv-option")].filter(t=>t.closest("tv-select")===this)},Fo=function(){return u(this,W,ti).call(this).find(t=>t.hasAttribute("selected"))},Fm=function(t){const r=t.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},id=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("selected",r===t)},ni=function(t){for(const r of u(this,W,ti).call(this))r.toggleAttribute("highlighted",r===t);if(s(this,it).trigger&&Zo(s(this,it).trigger,"aria-activedescendant",t?s0(t):null),t){const r=t.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)}},sd=function(){var l;const t=u(this,W,ti).call(this),r=u(this,W,Fo).call(this)??t[0];r&&u(this,W,id).call(this,r);const i=s(this,it).trigger;if(!i)return;Zo(i,"role","combobox"),Zo(i,"aria-haspopup","listbox"),Zo(i,"aria-controls",s0(this));for(const c of t)s0(c);const o=t.find(c=>c.hasAttribute("highlighted"));Zo(i,"aria-activedescendant",this.hasAttribute("open")&&o?o.id:null);const a=r?Ah(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)}u(this,W,Vm).call(this,i,t)},Vm=function(t,r){if(s(this,Ii)||(h(this,Ii,new ResizeObserver(()=>{const c=s(this,it).trigger;c&&u(this,W,Vm).call(this,c,u(this,W,ti).call(this))})),s(this,Ii).observe(t)),!t.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(t),o=JSON.stringify([t.id,r.map(Ah),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(o===s(this,Fa))return;h(this,Fa,o);const a=t.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,t.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${Ah(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),s(this,Dr)??h(this,Dr,this.ownerDocument.createElement("style")),s(this,Dr).textContent=`:where(button[id="${CSS.escape(t.id)}"]) { width: ${l}px; }`,s(this,Dr).isConnected||this.ownerDocument.head.append(s(this,Dr))},zS=function(t){var r,i;for(const o of["role","aria-haspopup","aria-controls","aria-activedescendant"])t.removeAttribute(o);(r=s(this,Ii))==null||r.disconnect(),h(this,Ii,void 0),(i=s(this,Dr))==null||i.remove(),h(this,Dr,void 0),h(this,Fa,"")},od=function(t){const r=u(this,W,Fo).call(this)!==t;u(this,W,id).call(this,t),u(this,W,sd).call(this),s(this,it).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},ZS=function(t){if(!s(this,it).open)return this.ownerDocument.activeElement!==s(this,it).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)?!1:(t.preventDefault(),t.stopImmediatePropagation(),s(this,it).show(!0),!0);const r=u(this,W,ti).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(t.key==="Tab")return t.stopImmediatePropagation(),this.ownerDocument.activeElement!==s(this,it).trigger?(t.preventDefault(),!0):(r[i]&&u(this,W,od).call(this,r[i]),!0);if(t.key==="Escape")return!1;const o=t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(t.key)&&!o)return!1;if(t.preventDefault(),t.stopImmediatePropagation(),t.key==="Enter"||t.key===" ")r[i]&&u(this,W,od).call(this,r[i]);else if(t.key==="Home")u(this,W,ni).call(this,r[0]);else if(t.key==="End")u(this,W,ni).call(this,r.at(-1));else if(t.key==="ArrowDown"||t.key==="ArrowUp")u(this,W,ni).call(this,r[Math.max(0,Math.min(r.length-1,i+(t.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();h(this,xi,a-s(this,yu)>uH?t.key.toLowerCase():s(this,xi)+t.key.toLowerCase()),h(this,yu,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(d=>Ah(d).toLowerCase().startsWith(s(this,xi)));c&&u(this,W,ni).call(this,c)}return!0},C(NS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",OS);customElements.get("tv-select")||customElements.define("tv-select",NS);/**
601
- * @license
602
- * Copyright 2020 Google LLC
603
- * SPDX-License-Identifier: BSD-3-Clause
604
- */const dH=vl(class extends Bu{constructor(n){if(super(n),n.type!==nr.PROPERTY&&n.type!==nr.ATTRIBUTE&&n.type!==nr.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!h6(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[e]){if(e===at||e===te)return e;const t=n.element,r=n.name;if(n.type===nr.PROPERTY){if(e===t[r])return at}else if(n.type===nr.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return at}else if(n.type===nr.ATTRIBUTE&&t.getAttribute(r)===e+"")return at;return d6(n),e}}),zw="Settings",Zw="Refresh themes",pH="Themes directory",fH="None";function Hw(n){return n instanceof Error?n.message:String(n)}var bt,to,Mr,Kn,wu,Or,Nr,no,Va,Ba,Sn,HS,ap,lp,Bm,cp,up,hp,ad;class mH extends Nt{constructor(){super(...arguments);p(this,Sn);p(this,bt,null);p(this,to,null);p(this,Mr,!1);p(this,Kn,null);p(this,wu,!1);p(this,Or,0);p(this,Nr,null);p(this,no,!1);p(this,Va,bn());p(this,Ba,bn());p(this,ap,t=>{var i;if((i=s(this,Nr))==null||i.disconnect(),h(this,Nr,null),h(this,no,!1),!t)return;const r=()=>{const o=t.hasAttribute("open");o!==s(this,no)&&(h(this,no,o),o&&u(this,Sn,Bm).call(this,!1))};h(this,Nr,new MutationObserver(r)),s(this,Nr).observe(t,{attributes:!0,attributeFilter:["open"]}),r()});p(this,lp,()=>{u(this,Sn,Bm).call(this,!0)});p(this,cp,t=>{var o;const r=t.currentTarget,i=r.value;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.appearanceMode)??"system",this.render(),u(this,Sn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});p(this,up,t=>{var o;const r=t.currentTarget,i=r.value||null;r.value=((o=s(this,bt))==null?void 0:o.snapshot.display.activeThemeName)??"",this.render(),u(this,Sn,ad).call(this,()=>{var a;return(a=s(this,bt))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});p(this,hp,t=>{var a;const r=t.currentTarget,i=r.value,o=r.checked;r.checked=((a=s(this,bt))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),u(this,Sn,ad).call(this,()=>{var l;return(l=s(this,bt))==null?void 0:l.setThemeJavaScriptConsent(i,o)},"Unable to change theme JavaScript consent")})}template(t){var g,y;h(this,bt,t);const r=t.snapshot.connection.status==="connected";s(this,wu)&&!r&&u(this,Sn,HS).call(this),h(this,wu,r);const{activeThemeName:i,appearanceMode:o,themeJavaScriptConsentIds:a}=t.snapshot.display,l=((g=s(this,to))==null?void 0:g.themes)??[],c=((y=s(this,to))==null?void 0:y.errors)??[],d=i===null?void 0:l.find(v=>v.id===i&&v.enableMainJS===!0),f=i!==null&&a.includes(i);return queueMicrotask(()=>{var v,_;this.isConnected&&(s(this,Va).value&&(s(this,Va).value.value=((v=s(this,bt))==null?void 0:v.snapshot.display.appearanceMode)??"system"),s(this,Ba).value&&(s(this,Ba).value.value=((_=s(this,bt))==null?void 0:_.snapshot.display.activeThemeName)??""))}),M`
605
- <button
606
- class="settings-trigger"
607
- variant="ghost"
608
- icon
609
- id="settings-trigger"
610
- aria-label=${zw}
611
- title=${zw}
612
- >
613
- <tv-icon name="settings" size="sm"></tv-icon>
614
- </button>
615
-
616
- <tv-popover
617
- id="settings-popover"
618
- trigger="settings-trigger"
619
- class="settings-popover"
620
- ${Je(s(this,ap))}
621
- >
622
- <div class="settings-heading">Settings</div>
623
-
624
- <div class="settings-field">
625
- <label id="settings-appearance-label">Light/dark mode</label>
626
- <button id="settings-appearance" aria-labelledby="settings-appearance-label"></button>
627
- <tv-select
628
- trigger="settings-appearance"
629
- name="appearance-mode"
630
- ${Je(s(this,Va))}
631
- @change=${s(this,cp)}
632
- >
633
- <tv-option value="system" ?selected=${o==="system"}>Adapt to system</tv-option>
634
- <tv-option value="light" ?selected=${o==="light"}>Light</tv-option>
635
- <tv-option value="dark" ?selected=${o==="dark"}>Dark</tv-option>
636
- </tv-select>
637
- </div>
638
-
639
- <div class="settings-field">
640
- <label id="settings-theme-label">Theme</label>
641
- <div class="settings-theme-control">
642
- <button id="settings-theme" aria-labelledby="settings-theme-label"></button>
643
- <tv-select
644
- trigger="settings-theme"
645
- name="theme"
646
- ${Je(s(this,Ba))}
647
- @change=${s(this,up)}
648
- >
649
- <tv-option value="" ?selected=${i===null}>${fH}</tv-option>
650
- ${l.map(v=>M`
651
- <tv-option
652
- value=${v.id}
653
- ?selected=${v.id===i}
654
- >${v.name}</tv-option>
655
- `)}
656
- </tv-select>
657
- <button
658
- type="button"
659
- variant="ghost"
660
- icon
661
- aria-label=${Zw}
662
- title=${Zw}
663
- ?disabled=${s(this,Mr)||!r}
664
- @click=${s(this,lp)}
665
- >
666
- <tv-icon name="reload" size="sm"></tv-icon>
667
- </button>
668
- </div>
669
- </div>
670
-
671
- ${d?M`
672
- <section
673
- class="settings-javascript-consent"
674
- aria-label="Experimental main-page JavaScript"
675
- >
676
- <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>
677
- <label class="settings-javascript-toggle">
678
- <input
679
- type="checkbox"
680
- role="switch"
681
- name="theme-javascript-consent"
682
- value=${d.id}
683
- .checked=${dH(f)}
684
- @change=${s(this,hp)}
685
- >
686
- <span>Enable experimental javascript for this theme</span>
687
- </label>
688
- </section>
689
- `:null}
690
-
691
- ${s(this,Mr)?M`<p class="settings-status" role="status">Loading themes…</p>`:null}
692
- ${s(this,Kn)?M`<p class="settings-failure" role="alert">${s(this,Kn)}</p>`:null}
693
- ${c.length>0?M`
694
- <div class="settings-errors" aria-label="Theme validation errors">
695
- ${c.map(v=>M`
696
- <p><strong>${v.folder??pH}</strong>: ${v.error}</p>
697
- `)}
698
- </div>
699
- `:null}
700
- </tv-popover>
701
- `}disconnected(){var t;(t=s(this,Nr))==null||t.disconnect(),h(this,Nr,null),h(this,no,!1),h(this,bt,null),h(this,Or,s(this,Or)+1)}}bt=new WeakMap,to=new WeakMap,Mr=new WeakMap,Kn=new WeakMap,wu=new WeakMap,Or=new WeakMap,Nr=new WeakMap,no=new WeakMap,Va=new WeakMap,Ba=new WeakMap,Sn=new WeakSet,HS=function(){h(this,to,null),h(this,Kn,null),h(this,Mr,!1),h(this,Or,s(this,Or)+1)},ap=new WeakMap,lp=new WeakMap,Bm=async function(t){const r=s(this,bt);if(r===null||r.snapshot.connection.status!=="connected"||s(this,Mr))return;const i=++nh(this,Or)._;h(this,Mr,!0),h(this,Kn,null),this.render();try{const o=await(t?r.refreshThemes():r.listThemes());if(i!==s(this,Or))return;h(this,to,o)}catch(o){if(i!==s(this,Or))return;h(this,Kn,`${t?"Unable to refresh themes":"Unable to load themes"}: ${Hw(o)}`)}finally{i===s(this,Or)&&(h(this,Mr,!1),this.render())}},cp=new WeakMap,up=new WeakMap,hp=new WeakMap,ad=async function(t,r){h(this,Kn,null),this.render();try{await t()}catch(i){h(this,Kn,`${r}: ${Hw(i)}`),this.render()}};const gH=zt(mH),Nl={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},vH=(n,{items:e,distance:t,edges:r})=>{const i=new Set;let o=0,a=!1;const l=v=>{v.removeAttribute("data-item-edge-fade");for(const _ of Object.values(Nl))v.style.removeProperty(_)},c=()=>{o=0;const v=new Set(n.querySelectorAll(e)),_=[];for(const U of i)v.has(U)||(f.unobserve(U),i.delete(U),_.push(U));for(const U of v)i.has(U)||(i.add(U),f.observe(U));const x=n.getBoundingClientRect().left+n.clientLeft,B=x+n.clientWidth,P=Math.max(0,Math.min(t,n.clientWidth/2)),J=n.scrollLeft>1?P:0,O=n.scrollLeft<n.scrollWidth-n.clientWidth-1?P:0,Y=[...v].map(U=>({item:U,bounds:U.getBoundingClientRect()}));for(const U of _)l(U);for(const{item:U,bounds:j}of Y){const fe=J>0&&j.left<x+J&&j.right>x,de=O>0&&j.right>B-O&&j.left<B;if(!fe&&!de){l(U);continue}U.style.setProperty(Nl.start,`${x-j.left}px`),U.style.setProperty(Nl.end,`${B-j.left}px`),U.style.setProperty(Nl.left,`${J}px`),U.style.setProperty(Nl.right,`${O}px`),U.setAttribute("data-item-edge-fade","")}},d=()=>{!a&&!o&&(o=requestAnimationFrame(c))},f=new ResizeObserver(d);f.observe(n);const g=new MutationObserver(d);return g.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",d,{passive:!0}),d(),{refresh:d,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(o),f.disconnect(),g.disconnect(),n.removeEventListener("scroll",d);for(const v of i)l(v);i.clear()}}}},zl=.5;var St,qa,Wa,ro,Pi,Xn,zr,Zr,Li,Di,gn,Mi,ja,Oi,io,bu,Me,Hr,Ur,Yt,dp,D,US,FS,Su,_u,Au,pp,Eu,Vo,qm,VS,ld,Wm,jm,Gm,BS,qS,Ga,ku,WS,ss,cd,jS,GS,YS,JS,Bo,KS,rc;class yH extends Nt{constructor(){super(...arguments);p(this,D);p(this,St,bn());p(this,qa);p(this,Wa);p(this,ro,!1);p(this,Pi,0);p(this,Xn,!1);p(this,zr,!1);p(this,Zr,!1);p(this,Li,0);p(this,Di,null);p(this,gn,!1);p(this,Mi,null);p(this,ja,null);p(this,Oi,null);p(this,io,null);p(this,bu,!1);p(this,Me,null);p(this,Hr,!1);p(this,Ur,!1);p(this,Yt,!1);p(this,dp,()=>{u(this,D,rc).call(this)});p(this,Su,t=>{var o;const r=s(this,Me);if(r===null||r.pointerId!==t.pointerId||!r.dragging&&Math.hypot(t.clientX-r.originX,t.clientY-r.originY)<=k6)return;const i=s(this,St).value;if(i){if(r.currentX=t.clientX,r.currentY=t.clientY,r.dragging)this.render();else{u(this,D,Bo).call(this);const a=r.tab.getBoundingClientRect();h(this,Hr,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(t.pointerId),this.render(),(o=r.onReorderChange)==null||o.call(r,u(this,D,Gm).call(this,r))}u(this,D,jm).call(this,r),u(this,D,qm).call(this,r)}});p(this,_u,t=>{const r=s(this,Me);r===null||r.pointerId!==t.pointerId||u(this,D,Vo).call(this,!0,!0)});p(this,Au,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,D,Vo).call(this,!1,!0)});p(this,pp,t=>{var r;((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&u(this,D,Vo).call(this,!1,!0)});p(this,Eu,t=>{var r;t.key!=="Escape"||!((r=s(this,Me))!=null&&r.dragging)||(t.preventDefault(),u(this,D,Vo).call(this,!1,!0))});p(this,Ga,()=>{h(this,gn,!0),u(this,D,ss).call(this,!1)});p(this,ku,()=>{h(this,gn,!0),u(this,D,ss).call(this,!0)})}connected(){var t;h(this,qa,void 0),h(this,Wa,void 0),h(this,gn,!1),u(this,D,WS).call(this),typeof document<"u"&&((t=document.fonts)==null||t.addEventListener("loadingdone",s(this,ku))),document.addEventListener("television-theme-styles-changed",s(this,Ga)),h(this,io,new MutationObserver(s(this,Ga))),s(this,io).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",s(this,Su)),window.addEventListener("pointerup",s(this,_u)),window.addEventListener("pointercancel",s(this,Au)),window.addEventListener("keydown",s(this,Eu))}template(t,r,i=null,o,a=!1){var x,B;u(this,D,KS).call(this,a);const l=(x=s(this,Me))!=null&&x.dragging?s(this,Me):null,c=(l==null?void 0:l.provisionalPages)??(r==null?void 0:r.pages),d=bH(r,c),f=(l==null?void 0:l.artifactId)??i,g=((B=r==null?void 0:r.selectedPage)==null?void 0:B.artifactIds[0])??null,y=`${(r==null?void 0:r.id)??""}:${d.map(({key:P,label:J})=>`${P}:${J}`).join("|")}`,v=g!==s(this,qa),_=y!==s(this,Wa);v&&h(this,Ur,!1);const E=v||l===null&&_;return _&&h(this,gn,!0),h(this,qa,g),h(this,Wa,y),u(this,D,ss).call(this,E,v,v&&!_),M`
702
- <div
703
- class="tab-strip"
704
- role="tablist"
705
- ${Je(s(this,St))}
706
- ?tab-held=${l!==null}
707
- @scroll=${s(this,dp)}
708
- @lostpointercapture=${s(this,pp)}
709
- >
710
- ${Cd(d,({key:P})=>P,(P,J)=>{const O=P.artifactId!==null&&P.artifactId===g,Y=P.artifactId!==null&&P.artifactId===f,U=Y&&l!==null;return M`
711
- ${Y?M`
712
- <span
713
- class="tab-placeholder"
714
- aria-hidden="true"
715
- style=${Td(U?{width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
716
- ></span>
717
- `:null}
718
- <div
719
- class=${Y?"tab dragged":"tab"}
720
- ?dragging=${U}
721
- style=${Td(U?{left:`${l.tabLeft+l.currentX-l.originX}px`,top:`${l.tabTop+l.currentY-l.originY}px`,width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
722
- @keydown=${j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),j.currentTarget.click())}}
723
- role="tab"
724
- aria-selected=${O?"true":"false"}
725
- tabindex=${O?"0":"-1"}
726
- data-artifact-id=${P.artifactId??""}
727
- @pointerdown=${f===null?j=>u(this,D,US).call(this,j,t,r,P,o):null}
728
- @click=${j=>u(this,D,FS).call(this,j,t,r,P)}
729
- @dblclick=${O&&r!==null&&!U?()=>bm(t,r,P.page,!P.page.geometry.full_screen):null}
730
- >
731
- <span class="tab-label">${P.label}</span>
732
- </div>
733
- `})}
734
- </div>
735
- `}disconnected(){var t,r,i,o;h(this,ro,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Pi)),h(this,Pi,0),h(this,Xn,!1),h(this,zr,!1),h(this,Zr,!1),u(this,D,Bo).call(this),h(this,Ur,!1),h(this,gn,!1),(t=s(this,Mi))==null||t.disconnect(),h(this,Mi,null),h(this,ja,null),(r=s(this,Oi))==null||r.dispose(),h(this,Oi,null),(i=s(this,io))==null||i.disconnect(),h(this,io,null),document.removeEventListener("television-theme-styles-changed",s(this,Ga)),typeof document<"u"&&((o=document.fonts)==null||o.removeEventListener("loadingdone",s(this,ku))),window.removeEventListener("pointermove",s(this,Su)),window.removeEventListener("pointerup",s(this,_u)),window.removeEventListener("pointercancel",s(this,Au)),window.removeEventListener("keydown",s(this,Eu)),u(this,D,Vo).call(this,!1,!1),h(this,Hr,!1)}}St=new WeakMap,qa=new WeakMap,Wa=new WeakMap,ro=new WeakMap,Pi=new WeakMap,Xn=new WeakMap,zr=new WeakMap,Zr=new WeakMap,Li=new WeakMap,Di=new WeakMap,gn=new WeakMap,Mi=new WeakMap,ja=new WeakMap,Oi=new WeakMap,io=new WeakMap,bu=new WeakMap,Me=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Yt=new WeakMap,dp=new WeakMap,D=new WeakSet,US=function(t,r,i,o,a){s(this,Yt)||s(this,Me)!==null||i===null||o.artifactId===null||t.button!==0||!t.isPrimary||(h(this,Hr,!1),h(this,Me,{pointerId:t.pointerId,originX:t.clientX,originY:t.clientY,tab:t.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:t.clientX,currentY:t.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},FS=function(t,r,i,o){var a;if(t.detail!==0&&s(this,Hr)){h(this,Hr,!1);return}h(this,Hr,!1),!((a=s(this,Me))!=null&&a.dragging||i===null||o.artifactId===null)&&r.selectPage(i.id,o.artifactId)},Su=new WeakMap,_u=new WeakMap,Au=new WeakMap,pp=new WeakMap,Eu=new WeakMap,Vo=function(t,r){var a;const i=s(this,Me);if(i===null)return;if(u(this,D,ld).call(this,i),i.edgeScrollMoved&&h(this,Ur,!0),i.dragging&&(h(this,Xn,s(this,zr)),s(this,zr)||h(this,Zr,!1)),i.dragging&&t&&!SH(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(!t)for(const l of i.displacementAnimations)l.cancel();h(this,Me,null),(a=i.onReorderChange)==null||a.call(i,null);const o=s(this,St).value;i.dragging&&(o!=null&&o.hasPointerCapture(i.pointerId))&&o.releasePointerCapture(i.pointerId),r&&this.render()},qm=function(t){const r=s(this,St).value,i=r?u(this,D,Wm).call(this,r,t.currentX):0,o=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=zl:((r==null?void 0:r.scrollLeft)??0)>=o-zl;if(s(this,Yt)||!t.dragging||i===0||o===0||a||typeof requestAnimationFrame!="function"){u(this,D,ld).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(l=>{u(this,D,VS).call(this,t,l)}))},VS=function(t,r){if(t.edgeScrollFrame=0,s(this,Yt)||s(this,Me)!==t||!t.dragging){t.edgeScrollTimestamp=null;return}const i=s(this,St).value;if(!i){t.edgeScrollTimestamp=null;return}const o=u(this,D,Wm).call(this,i,t.currentX),a=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=r,o!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),d=i.scrollLeft,f=o*l+t.edgeScrollRemainder,g=Math.max(0,Math.min(c,d+f));i.scrollLeft=g;const y=i.scrollLeft-d;y!==0&&(t.edgeScrollMoved=!0),t.edgeScrollRemainder=g===0||g===c?0:f-y,y!==0&&(u(this,D,rc).call(this,i),u(this,D,jm).call(this,t))}u(this,D,qm).call(this,t)},ld=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},Wm=function(t,r){const i=t.getBoundingClientRect();return r>=i.left&&r<i.left+Qt?-$d*(i.left+Qt-r)/Qt:r>i.right-Qt&&r<=i.right?$d*(r-(i.right-Qt))/Qt:0},jm=function(t){var _;const r=s(this,St).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const o=i.nextElementSibling,a=t.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=t.slot,d=i.previousElementSibling;for(;d!=null&&d.classList.contains("tab");){const E=d.getBoundingClientRect();if(l>=E.left+E.width/2)break;c-=1,d=d.previousElementSibling}let f=o==null?void 0:o.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const E=f.getBoundingClientRect();if(l<=E.left+E.width/2)break;c+=1,f=f.nextElementSibling}if(c===t.slot)return;const g=u(this,D,BS).call(this,r),y=[...t.provisionalPages],[v]=y.splice(t.slot,1);v&&(y.splice(c,0,v),t.provisionalPages=y,t.slot=c,this.render(),(_=t.onReorderChange)==null||_.call(t,u(this,D,Gm).call(this,t)),queueMicrotask(()=>u(this,D,qS).call(this,t,g)))},Gm=function(t){return{channelId:t.channelId,pages:t.provisionalPages,carriedArtifactId:t.artifactId}},BS=function(t){return new Map([...t.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},qS=function(t,r){if(s(this,Yt))return;const i=s(this,St).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)<=zl)continue;const c=o.animate({translate:[`${l}px 0`,"0px 0"]},{duration:Go,easing:"ease"});t.displacementAnimations.add(c),c.finished.finally(()=>{t.displacementAnimations.delete(c)}).catch(()=>{})}},Ga=new WeakMap,ku=new WeakMap,WS=function(){s(this,bu)||typeof document>"u"||!document.fonts||(h(this,bu,!0),document.fonts.ready.then(()=>{this.isConnected&&(h(this,gn,!0),u(this,D,ss).call(this,!0))}))},ss=function(t,r=!1,i=!1){s(this,Xn)||h(this,Xn,t),t&&r&&(h(this,zr,!0),h(this,Zr,i&&!s(this,Yt))),!(s(this,ro)||s(this,Pi)!==0)&&(h(this,ro,!0),queueMicrotask(()=>{if(h(this,ro,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){u(this,D,cd).call(this);return}h(this,Pi,requestAnimationFrame(()=>{h(this,Pi,0),u(this,D,cd).call(this)}))}}))},cd=function(){var l,c;const t=s(this,St).value;if(!t)return;s(this,gn)&&(h(this,gn,!1),u(this,D,GS).call(this,t)),u(this,D,YS).call(this,t),u(this,D,jS).call(this,t);const r=((l=s(this,Me))==null?void 0:l.dragging)===!0,i=s(this,zr),o=i&&s(this,Zr),a=!r&&(i||s(this,Xn)&&!s(this,Ur));r?h(this,Xn,i):(h(this,Xn,!1),h(this,zr,!1),h(this,Zr,!1),i&&h(this,Ur,!1)),a&&u(this,D,JS).call(this,t,o),u(this,D,rc).call(this,t),(c=s(this,Oi))==null||c.refresh()},jS=function(t){for(const r of t.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},GS=function(t){var r;for(const i of t.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),d=Zl(c.paddingLeft)+Zl(c.paddingRight)+Zl(c.borderLeftWidth)+Zl(c.borderRightWidth),g=Math.ceil(l.width)+d>Fz+Vz?"capped":"hugging";i.dataset.compression!==g&&(i.dataset.compression=g)}},YS=function(t){var r,i;typeof ResizeObserver>"u"||s(this,ja)===t||((r=s(this,Mi))==null||r.disconnect(),s(this,Mi)??h(this,Mi,new ResizeObserver(()=>{s(this,Yt)?(h(this,Xn,!0),u(this,D,cd).call(this)):u(this,D,ss).call(this,!0)})),s(this,Mi).observe(t),h(this,ja,t),(i=s(this,Oi))==null||i.dispose(),h(this,Oi,vH(t,{items:".tab:not(.dragged)",distance:Bz,edges:"both"})))},JS=function(t,r){const i=t.querySelector('.tab[aria-selected="true"]');if(!i){u(this,D,Bo).call(this);return}const o=t.getBoundingClientRect(),a=i.getBoundingClientRect(),l=Zl(getComputedStyle(i).translate),c=Math.max(0,Math.min(t.scrollLeft+a.left-l+a.width/2-(o.left+o.width/2),t.scrollWidth-t.clientWidth));if(u(this,D,Bo).call(this),s(this,Yt)||!r||Math.abs(t.scrollLeft-c)<=zl||matchMedia("(prefers-reduced-motion: reduce)").matches){t.scrollLeft=c;return}const d=t.scrollLeft,f=t.animate([{},{}],{duration:W6,easing:"ease"});h(this,Di,f);const g=()=>{var v;if(f!==s(this,Di))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;t.scrollLeft=d+(c-d)*y,f.playState==="finished"?(t.scrollLeft=c,h(this,Di,null),h(this,Li,0),u(this,D,rc).call(this,t)):h(this,Li,requestAnimationFrame(g))};h(this,Li,requestAnimationFrame(g))},Bo=function(){var t;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Li)),h(this,Li,0),(t=s(this,Di))==null||t.cancel(),h(this,Di,null)},KS=function(t){var i;if(s(this,Yt)===t||(h(this,Yt,t),!t))return;u(this,D,Bo).call(this),h(this,Zr,!1),h(this,Ur,!1);const r=s(this,Me);if(r!==null){u(this,D,ld).call(this,r);for(const o of r.displacementAnimations)o.cancel();r.displacementAnimations.clear(),h(this,Me,null),r.dragging&&((i=s(this,St).value)!=null&&i.hasPointerCapture(r.pointerId))&&s(this,St).value.releasePointerCapture(r.pointerId),queueMicrotask(()=>{var o;return(o=r.onReorderChange)==null?void 0:o.call(r,null)})}u(this,D,ss).call(this,!0,!0,!1)},rc=function(t=s(this,St).value){if(!t)return;const r=Math.max(0,t.scrollWidth-t.clientWidth);t.toggleAttribute("data-overflow",r>zl)};const wH=zt(yH);function bH(n,e){if(!n||!e)return[];const t=new Map(n.artifacts.map(r=>[r.id,r]));return e.map((r,i)=>{var a;const o=r.artifactIds[0]??null;return{page:r,artifactId:o,label:o===null?"":((a=t.get(o))==null?void 0:a.title)??"",key:o??`empty-page-${i}`}})}function SH(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}function Zl(n){const e=Number.parseFloat(n);return Number.isFinite(e)?e:0}let _H=0;var so,_t,Cu,st,Fr,Qn,Ya,Vr,Tu,Jt,fp,mp,$u,il,XS,gp,vp,QS,yp,wp;class AH extends Nt{constructor(){super(...arguments);p(this,il);p(this,so,new eH(()=>this.render()));p(this,_t,new C6(()=>this.render()));p(this,Cu,`channel-switcher-trigger-${++_H}`);p(this,st,null);p(this,Fr,null);p(this,Qn,!1);p(this,Ya,null);p(this,Vr,null);p(this,Tu,bn());p(this,Jt,null);p(this,fp,t=>{var r,i,o;(r=s(this,st))==null||r.removeAttribute("open"),((i=s(this,Vr))==null?void 0:i.display.focusedChannelId)!==t&&((o=s(this,Ya))==null||o.focusChannel(t).catch(()=>{}))});p(this,mp,t=>{s(this,Qn)||(h(this,Qn,!0),this.render(),t.detail===0&&requestAnimationFrame(()=>{var r;(r=s(this,st))!=null&&r.hasAttribute("open")&&u(this,il,XS).call(this,0)}))});p(this,$u,t=>{const r=s(this,st);r===null||!r.hasAttribute("open")||s(this,_t).dragging||r.querySelector("input, tv-menu[open]")||y6(t,[...r.querySelectorAll('.channel[role="option"]')])});p(this,gp,t=>{var r,i;h(this,Jt,{channelId:t,scrollTop:((i=(r=s(this,st))==null?void 0:r.querySelector(".channel-switcher-pop-body"))==null?void 0:i.scrollTop)??0,result:null})});p(this,vp,(t,r)=>{var i;((i=s(this,Jt))==null?void 0:i.channelId)===t&&(s(this,Jt).result=r?"deleted":"cancelled",this.render())});p(this,yp,t=>{var r;(r=s(this,Fr))==null||r.disconnect(),h(this,Fr,null),s(this,st)!==null&&s(this,Jt)===null&&s(this,_t).disconnect(),h(this,st,t instanceof HTMLElement?t:null),s(this,st)!==null&&(s(this,_t).connect(),h(this,Fr,new MutationObserver(s(this,wp))),s(this,Fr).observe(s(this,st),{attributes:!0,attributeFilter:["open"]}))});p(this,wp,()=>{var t;(((t=s(this,st))==null?void 0:t.hasAttribute("open"))??!0)||s(this,Jt)===null&&(h(this,Qn,!1),this.render())})}connected(){s(this,so).connect(),document.addEventListener("keydown",s(this,$u))}template(t,r,i={}){var l;h(this,Ya,t),h(this,Vr,r);const o=i.collapsed||i.sidebarTransitioning;(i.sidebarTransitioning||!o||r.focusedChannel===null)&&h(this,Qn,!1),s(this,_t).update(t,r,{management:!0,dragging:!0,revealMovedRow:!0,onDeleteStart:s(this,gp),onDeleteEnd:s(this,vp),selectChannel:s(this,fp),highlightOnPointerMove:!0,motionSuppressed:i.sidebarTransitioning});const a=s(this,Jt);return a!=null&&a.result&&(r.channels.length===0||r.focusedChannel!==null)&&(a.result==="cancelled"||!r.channels.some(({id:c})=>c===a.channelId))&&queueMicrotask(()=>u(this,il,QS).call(this,a)),s(this,so).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),M`
736
- <header class="top-bar" ${Je(s(this,Tu))}>
737
- ${o?M`
738
- <div class="top-bar-lead">
739
- ${i.sidebarToggle===void 0?M`
740
- <button
741
- class="sidebar-expand"
742
- variant="ghost"
743
- icon
744
- aria-label="Show sidebar"
745
- title="Show sidebar"
746
- type="button"
747
- @click=${i.onExpandSidebar}
748
- >
749
- <tv-icon name="sidebar" size="sm"></tv-icon>
750
- </button>
751
- `:i.sidebarToggle??M`
752
- <span class="sidebar-toggle-seat" aria-hidden="true"></span>
753
- `}
754
- ${r.focusedChannel===null?null:M`
755
- <button
756
- class="channel-switcher"
757
- variant="ghost"
758
- target
759
- aria-haspopup="listbox"
760
- id=${s(this,Cu)}
761
- type="button"
762
- @click=${s(this,mp)}
763
- >
764
- <span class="channel-switcher-name">
765
- ${r.focusedChannel.name}
766
- </span>
767
- <tv-icon name="select" size="sm"></tv-icon>
768
- </button>
769
- ${s(this,Qn)?M`
770
- <tv-popover
771
- class="channel-switcher-pop"
772
- ?dragging=${s(this,_t).dragging}
773
- trigger=${s(this,Cu)}
774
- ${Je(s(this,yp))}
775
- >
776
- <div class="channel-switcher-pop-body">
777
- ${s(this,_t).template()}
778
- </div>
779
- <footer class="channel-switcher-pop-footer">
780
- <button
781
- class="channel-create"
782
- variant="ghost"
783
- icon
784
- aria-label="New channel"
785
- title="New channel"
786
- type="button"
787
- ?disabled=${s(this,_t).creating}
788
- @click=${s(this,_t).create}
789
- >
790
- <tv-icon name="add"></tv-icon>
791
- </button>
792
- </footer>
793
- </tv-popover>
794
- `:null}
795
- `}
796
- </div>
797
- `:null}
798
- ${wH(t,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
799
- <div class="top-bar-controls">
800
- ${cH((l=i.connectionOwner)==null?void 0:l.connection)}
801
- ${gH(t)}
802
- ${s(this,so).template()}
803
- </div>
804
- </header>
805
- ${s(this,_t).overlayTemplate()}
806
- `}disconnected(){var t;s(this,so).disconnect(),document.removeEventListener("keydown",s(this,$u)),s(this,_t).disconnect(),(t=s(this,Fr))==null||t.disconnect(),h(this,Fr,null),h(this,st,null),h(this,Qn,!1),h(this,Ya,null),h(this,Vr,null),h(this,Jt,null)}}so=new WeakMap,_t=new WeakMap,Cu=new WeakMap,st=new WeakMap,Fr=new WeakMap,Qn=new WeakMap,Ya=new WeakMap,Vr=new WeakMap,Tu=new WeakMap,Jt=new WeakMap,fp=new WeakMap,mp=new WeakMap,$u=new WeakMap,il=new WeakSet,XS=function(t){var r;wc((r=s(this,st))==null?void 0:r.querySelectorAll('.channel[role="option"]')[t])},gp=new WeakMap,vp=new WeakMap,QS=function(t){var d,f;if(s(this,Jt)!==t||s(this,Vr)===null)return;h(this,Jt,null);const r=s(this,Vr).focusedChannel;h(this,Qn,r!==null),this.render();const i=s(this,st);if(i===null){s(this,_t).disconnect(),(f=(d=s(this,Tu).value)==null?void 0:d.querySelector(".sidebar-expand"))==null||f.focus();return}i.setAttribute("open","");const o=i.querySelector(".channel-switcher-pop-body");o&&(o.scrollTop=t.scrollTop);const a=t.result==="cancelled"&&s(this,Vr).channels.some(({id:g})=>g===t.channelId)?t.channelId:r==null?void 0:r.id,l=[...i.querySelectorAll(".channel-row")].find(g=>g.dataset.channelId===a),c=l==null?void 0:l.querySelector(".channel");c==null||c.focus({preventScroll:!0}),t.result==="deleted"&&(c==null||c.scrollIntoView({block:"nearest"}))},yp=new WeakMap,wp=new WeakMap;const EH=zt(AH);var er,Ru,oo,Ja,ot,Dt,Kt,Xt,ao,me,vn,Ni,Ka,zi,Iu,bp,lo,Sp,_p,Ap,F,ud,Ym,e_,xu,Ep,ri,os,ic,hd,Jm,t_,n_,kp,Cp,Tp,Pu,$p,as,sc,r_;class kH extends Nt{constructor(){super(...arguments);p(this,F);p(this,er,null);p(this,Ru);p(this,oo,null);p(this,Ja,null);p(this,ot,mh);p(this,Dt,!1);p(this,Kt,null);p(this,Xt,null);p(this,ao,null);p(this,me,!1);p(this,vn,!1);p(this,Ni,mh);p(this,Ka,0);p(this,zi,null);p(this,Iu,t=>{var r;if(t.key==="Escape"&&s(this,Kt)!==null){t.preventDefault(),t.stopPropagation(),u(this,F,as).call(this);return}O_(t,navigator.platform)&&(t.preventDefault(),t.stopPropagation(),(r=s(this,er))==null||r.handleNavigationKey(t.key))});p(this,bp,t=>{h(this,Ru,t??void 0),this.render()});p(this,lo,()=>{this.render()});p(this,Sp,()=>u(this,F,ud).call(this,!0));p(this,_p,()=>u(this,F,ud).call(this,!1));p(this,Ap,()=>{const t=s(this,me)?!s(this,vn):!s(this,Dt);u(this,F,ud).call(this,t)});p(this,xu,t=>{const r=s(this,zi),i=u(this,F,os).call(this).closest("#app");if(!r||!i)return;h(this,Ni,t);const o=jz(1-t/r.expandedSidebarWidth,r),a=(c,d)=>{i.style.setProperty(`--motion-${c}`,`${d}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=u(this,F,os).call(this);l.style.removeProperty("left"),l.style.removeProperty("top")});p(this,Ep,t=>{var o;if(!s(this,me))return;const r=t===0;if(r!==s(this,vn))return;const i=document.activeElement===s(this,Xt);u(this,F,ri).call(this,r),this.render(),i&&((o=s(this,Xt))==null||o.focus({preventScroll:!0}))});p(this,kp,t=>{if(t.button!==0||s(this,Kt)!==null)return;const r=t.currentTarget,i=r.closest("#app");i!==null&&(r.setPointerCapture(t.pointerId),h(this,Kt,{pointerId:t.pointerId,startX:t.clientX,startWidth:s(this,ot),root:i}),t.preventDefault())});p(this,Cp,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,F,sc).call(this,r.root,r.startWidth+t.clientX-r.startX)});p(this,Tp,t=>{var o;const r=s(this,Kt);if(r===null||t.pointerId!==r.pointerId)return;h(this,Kt,null);const i=((o=s(this,oo))==null?void 0:o.commit(s(this,ot)))??s(this,ot);u(this,F,sc).call(this,r.root,i)});p(this,Pu,t=>{const r=s(this,Kt);r===null||t.pointerId!==r.pointerId||u(this,F,as).call(this)});p(this,$p,t=>{var i;const r=t.currentTarget.closest("#app");r!==null&&((i=s(this,oo))==null||i.clear(),u(this,F,sc).call(this,r,mh))})}update(t,r){const i=r[0],o=r[1].sidebarWidthPreference,a=r[1].sidebarCollapsedPreference;s(this,er)!==i&&(s(this,er)!==null&&this.isConnected&&(s(this,er).removeEventListener("change",s(this,lo)),i.addEventListener("change",s(this,lo))),h(this,er,i));const l=s(this,oo)!==o,c=s(this,Ja)!==a;return l&&(u(this,F,as).call(this),h(this,oo,o),h(this,ot,o.read()??mh)),c&&(u(this,F,as).call(this),h(this,Ja,a),h(this,Dt,a.read())),(l||c)&&u(this,F,ri).call(this,s(this,Dt)),super.update(t,r)}connected(){var t;(t=s(this,er))==null||t.addEventListener("change",s(this,lo)),document.addEventListener("keydown",s(this,Iu),{capture:!0})}disconnected(){var t,r;u(this,F,as).call(this),s(this,me)?u(this,F,ri).call(this,s(this,vn)):(t=s(this,ao))==null||t.cancel(),(r=s(this,er))==null||r.removeEventListener("change",s(this,lo)),document.removeEventListener("keydown",s(this,Iu),{capture:!0})}template(t,r){const i=w9(t.snapshot,r.runtimeServerURL),o=t.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),M`
807
- <div
808
- id="app"
809
- tabindex="-1"
810
- data-app-state=${i.kind}
811
- ?data-sidebar-transition=${s(this,me)}
812
- ?data-sidebar-motion=${s(this,me)}
813
- style=${u(this,F,n_).call(this)}
814
- >
815
- ${TH(i)?u(this,F,r_).call(this,t,o,r):null}
816
- ${$H(i)?zZ(i,t,r.desktopUpdate):null}
817
- </div>
818
- <div id="foreground-overlay" inert aria-hidden="true"></div>
819
- `}}er=new WeakMap,Ru=new WeakMap,oo=new WeakMap,Ja=new WeakMap,ot=new WeakMap,Dt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,ao=new WeakMap,me=new WeakMap,vn=new WeakMap,Ni=new WeakMap,Ka=new WeakMap,zi=new WeakMap,Iu=new WeakMap,bp=new WeakMap,lo=new WeakMap,Sp=new WeakMap,_p=new WeakMap,Ap=new WeakMap,F=new WeakSet,ud=function(t){var c,d;if(!s(this,me)&&s(this,Dt)===t||s(this,me)&&s(this,vn)===t)return;u(this,F,as).call(this);const r=document.activeElement===s(this,Xt);if((c=s(this,Ja))==null||c.setCollapsed(t),matchMedia("(prefers-reduced-motion: reduce)").matches){u(this,F,ri).call(this,t),this.render(),r&&((d=s(this,Xt))==null||d.focus({preventScroll:!0}));return}if(h(this,vn,t),s(this,me)){u(this,F,ic).call(this),u(this,F,Ym).call(this);return}const i=u(this,F,os).call(this),o=i.closest("#app"),a=i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();if(!o||!l||a.width===0){u(this,F,ri).call(this,t),this.render();return}for(const f of o.getAnimations({subtree:!0}))f.cancel();h(this,me,!0),h(this,Ka,a.top-l.top),h(this,zi,null),i.style.left=`${a.left-l.left}px`,i.style.top=`${s(this,Ka)}px`,u(this,F,ic).call(this),this.render(),queueMicrotask(()=>{s(this,me)&&(u(this,F,e_).call(this),r&&i.focus({preventScroll:!0}),u(this,F,Ym).call(this))})},Ym=function(){const t=u(this,F,os).call(this).closest("#app"),r=s(this,ao);if(!t||!r||!s(this,zi))return;const i=s(this,vn)?0:s(this,ot);r.move({root:t,width:s(this,ot),target:i,onFrame:s(this,xu),onFinish:s(this,Ep)})},e_=function(){const r=u(this,F,os).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){u(this,F,ri).call(this,s(this,vn)),this.render();return}const d=i.closest(".app-sidebar");r.removeAttribute("data-sidebar-motion");const f=r.getBoundingClientRect(),g=o.style.display;o.style.display="none";const y=i.getBoundingClientRect();d.style.marginLeft=`${-s(this,ot)}px`,o.style.display=g;const v=a.getBoundingClientRect(),_=l==null?void 0:l.getBoundingClientRect();h(this,zi,{expandedSidebarWidth:s(this,ot),expandedToggleLeft:y.left-f.left,collapsedToggleLeft:v.left-f.left,toggleTop:s(this,Ka),toggleWidth:v.width,toggleHeight:v.height,toggleSwitcherGap:_?_.left-v.right:0,collapsedLeadReservation:o.getBoundingClientRect().width,hasSwitcher:!!l,barInset:c.getBoundingClientRect().left-f.left}),d.style.removeProperty("margin-left"),r.setAttribute("data-sidebar-motion",""),s(this,xu).call(this,s(this,Ni))},xu=new WeakMap,Ep=new WeakMap,ri=function(t){var r;(r=s(this,ao))==null||r.cancel(),h(this,Dt,t),h(this,me,!1),h(this,Ni,t?0:s(this,ot)),h(this,ao,new Yz(s(this,Ni))),h(this,zi,null),u(this,F,t_).call(this),u(this,F,ic).call(this)},os=function(){if(s(this,Xt)!==null)return s(this,Xt);const t=document.createElement("button");return t.type="button",t.setAttribute("variant","ghost"),t.setAttribute("icon",""),t.append(u(this,F,hd).call(this)),t.addEventListener("pointerdown",r=>{r.button===0&&t.setPointerCapture(r.pointerId)}),t.addEventListener("click",s(this,Ap)),h(this,Xt,t),u(this,F,ic).call(this),t},ic=function(){var o;const t=s(this,Xt);if(t===null)return;const r=s(this,me)?s(this,vn):s(this,Dt);t.className=s(this,me)?"sidebar-motion-toggle sidebar-toggle":r?"sidebar-expand":"sidebar-collapse",s(this,me)?t.querySelectorAll(":scope > .sidebar-toggle-paint").length!==2&&t.replaceChildren(u(this,F,Jm).call(this,"expanded-paint"),u(this,F,Jm).call(this,"collapsed-paint")):(t.children.length!==1||!((o=t.firstElementChild)!=null&&o.matches("tv-icon[name='sidebar']")))&&t.replaceChildren(u(this,F,hd).call(this));const i=r?"Show sidebar":"Collapse sidebar";t.setAttribute("aria-label",i),t.title=i},hd=function(){const t=document.createElement("tv-icon");return t.setAttribute("name","sidebar"),t.setAttribute("size","sm"),t},Jm=function(t){const r=document.createElement("span");return r.className=`sidebar-toggle-paint ${t}`,r.setAttribute("aria-hidden","true"),r.append(u(this,F,hd).call(this)),r},t_=function(){const t=s(this,Xt);t!==null&&(t.style.removeProperty("left"),t.style.removeProperty("top"))},n_=function(){const t=[`--sidebar-width: ${s(this,ot)}px`];return s(this,me)&&t.push(`--motion-boundary: ${s(this,Ni)}px`),t.join("; ")},kp=new WeakMap,Cp=new WeakMap,Tp=new WeakMap,Pu=new WeakMap,$p=new WeakMap,as=function(){const t=s(this,Kt);if(t===null)return;h(this,Kt,null),u(this,F,sc).call(this,t.root,t.startWidth);const r=t.root.querySelector(".app-sidebar-resize");r!=null&&r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId)},sc=function(t,r){h(this,ot,Wb(r)),u(this,F,ri).call(this,s(this,Dt)),t.style.setProperty("--sidebar-width",`${s(this,ot)}px`)},r_=function(t,r,i){const o=!s(this,Dt)||s(this,me),a=u(this,F,os).call(this);return M`
820
- ${o?M`
821
- <aside class="app-sidebar">
822
- ${Oz(t,r,i.electronMode,s(this,Sp),s(this,me)?null:a,s(this,me))}
823
- </aside>
824
- ${s(this,me)?null:M`
825
- <div
826
- class="app-sidebar-resize"
827
- aria-hidden="true"
828
- @pointerdown=${s(this,kp)}
829
- @pointermove=${s(this,Cp)}
830
- @pointerup=${s(this,Tp)}
831
- @pointercancel=${s(this,Pu)}
832
- @lostpointercapture=${s(this,Pu)}
833
- @dblclick=${s(this,$p)}
834
- ></div>
835
- `}
836
- `:null}
837
- <main class="app-main">
838
- ${EH(t,r,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,onTabReorderChange:s(this,bp),collapsed:s(this,Dt),onExpandSidebar:s(this,_p),sidebarToggle:s(this,me)?null:s(this,Dt)?a:void 0,sidebarTransitioning:s(this,me)})}
839
- ${A7(t,r.focusedChannel,s(this,Ru),s(this,me))}
840
- </main>
841
- ${s(this,me)?a:null}
842
- `};const CH=zt(kH);function TH(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function $H(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const i_="television-appearance-mode";function RH(n){return n==="system"||n==="light"||n==="dark"}function IH(){try{const n=window.localStorage.getItem(i_);return RH(n)?n:"system"}catch{return"system"}}function s_(){return window.__televisionAppearanceResolver??e9(IH())}function xH(n,e){return e==="light"||e==="dark"?e:n}function PH(n){s_().setPreference(n);try{window.localStorage.setItem(i_,n)}catch{}}document.documentElement.dataset.tvBundleVersion=zg();Object.defineProperty(window,"__tvVersion",{value:zg(),writable:!1,configurable:!1});s_();const LH=GH(),_n=Br();_n?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const e1=hP(),o_=dP(),DH=new u$(_n?"television-electron":"television-browser",c$()),MH=new zO(window.localStorage),OH=new OO(window.localStorage),Uw=Ub(),NH=Uw?wP({storage:Uw,clientApp:_n?"desktop":"browser",desktopAppVersion:_n?V8():null}):null,t1=Vi(_n?e1:window.location.origin),n1=VO({search:window.location.search}),An=Zg(),a_=new YO,r1=GO({detection:n1,primaryServerURL:t1,navigationLatch:An,presentation:a_}),Se=new kO({localStore:DH,serverURL:e1,launchToken:o_,telemetryMeta:NH,navigationPending:()=>An.pending,...n1.electron?{decideBoot:n=>r1.decideBoot(n)}:{}}),zH=n=>{XT(Ke,n)},Ke=new FT({connectionOwner:Se,navigationKeyHandler:zH,retainedGateHalted:()=>r1.gated}),ps=globalThis.__televisionNativeBridge;_n&&ps&&ps.onNavigationKey(n=>Ke.handleNavigationKey(n));const ZH=new QO({electron:_n,bridge:ps});if(o_){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}FO({owner:Se,primaryServerURL:t1,navigationLatch:An});r1.attach(Se);const HH=()=>{const n=Se.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:e})=>{const t=new Set(e.map(r=>r.id));DO(t)}).catch(()=>{})},l_=()=>{Se.connection.status==="connected"&&Jz(Se.connection.url)};let Dd=null,Km=null,c_=Se.connection.status;const UH=()=>{An.pending||An.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const e=new URL(window.location.href);e.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${e.pathname}${e.search}${e.hash}`)}window.location.reload()})},u_=(n,e,t)=>{if(An.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(e)},i=Dd,o=Qz(),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),d=i!==null&&!a&&l&&!c,f=i!==null&&m_(i.consentIds,r.consentIds);if(Dd=r,o!==null&&(a||d)){UH();return}if(o===null&&c){uw(Se.connection.url);return}o!==null&&c&&t&&!a&&f&&uw(Se.connection.url)},FH=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},h_=(n,e)=>{if(An.pending||Se.connection.status!=="connected"||Ke.snapshot.connection.status!=="connected"||!Ke.snapshot.ready)return;const t={activeThemeName:n,serverURL:Se.connection.url,appearance:FH()},r=Km;Km=t,!(!e&&(r==null?void 0:r.activeThemeName)===t.activeThemeName&&r.serverURL===t.serverURL&&r.appearance===t.appearance)&&e7(t.serverURL,t.activeThemeName,()=>Ke.listThemes())},d_=()=>{if(!An.pending){if(c_=Se.connection.status,Se.connection.status!=="connected"){Kz(),Xz(),t7(),Dd=null,Km=null;return}l_(),HH()}};let Xm,Qm;const i1=(n,e)=>{const t=xH(n,e);t!==Xm&&(PH(t),Xm=t),t!==Qm&&_n&&typeof(ps==null?void 0:ps.setAppearanceMode)=="function"&&(ps.setAppearanceMode(t),Qm=t)},Xp=()=>{const n=Ke.snapshot;if(n.connection.status!=="connected"){Xm=void 0,Qm=void 0;return}n.ready&&(i1(n.display.appearanceMode,n.display.activeThemeColorScheme),c_===Se.connection.status&&(u_(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),h_(n.display.activeThemeName,!1)))},VH=n=>{if(An.pending)return;i1(Ke.snapshot.display.appearanceMode,n.activeThemeColorScheme);const e=Dd,t=e!==null&&e.activeThemeName===n.themeName&&!m_(e.consentIds,new Set(n.themeJavaScriptConsentIds));u_(n.themeName,n.themeJavaScriptConsentIds,!0),!(An.pending||t)&&(l_(),h_(n.themeName,!0))},BH=n=>{An.pending||i1(n.appearanceMode,Ke.snapshot.display.activeThemeColorScheme)};d_();Xp();Se.addEventListener("change",d_);Ke.addEventListener("change",Xp);Ke.addEventListener("theme-changed",VH);Ke.addEventListener("appearance-changed",BH);const qH=new MutationObserver(()=>{Xp()});qH.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});V2.register("ServerConnectionOwner",()=>Se);V2.register("ApplicationService",()=>Ke);const hc=globalThis.__telepath??(globalThis.__telepath={});hc.applicationService=Ke;hc.connectionOwner=Se;const WH=hc.renderCompleteCallbacks??(hc.renderCompleteCallbacks=new Set);_n&&document.body.classList.add("electron");let Fw=!1,Vw=!1;const jH=n=>{if(!LH||Vw||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const e=document.querySelector("#settings-popover");e!==null&&(Vw=!0,e.setAttribute("open",""))},p_=()=>{Fw||(Vh(CH(Ke,{runtimeServerURL:e1,electronMode:_n,connectionOwner:Se,primaryServerURL:t1,updatePresentation:a_,desktopRecommendation:n1,desktopUpdate:ZH,sidebarWidthPreference:MH,sidebarCollapsedPreference:OH,onRenderComplete(n){jH(n);for(const e of WH)e(n)}}),document.body),Fw=!0,Xp())},f_=()=>{const n=Se.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Se.connectError===null||(Se.removeEventListener("change",f_),p_())};_n?Se.addEventListener("change",f_):p_();Se.connect();function GH(){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 m_(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}