@telepath-computer/television 0.1.214 → 0.1.215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +5 -5
- package/dist/web/assets/main-Z-io-D9l.js +596 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/main-DqW9ZwnO.js +0 -596
|
@@ -1,596 +0,0 @@
|
|
|
1
|
-
var vb=Object.defineProperty;var r0=n=>{throw TypeError(n)};var yb=(n,t,e)=>t in n?vb(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var $=(n,t,e)=>yb(n,typeof t!="symbol"?t+"":t,e),ih=(n,t,e)=>t.has(n)||r0("Cannot "+e);var a=(n,t,e)=>(ih(n,t,"read from private field"),e?e.call(n):t.get(n)),g=(n,t,e)=>t.has(n)?r0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),d=(n,t,e,r)=>(ih(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),h=(n,t,e)=>(ih(n,t,"access private method"),e);var sh=(n,t,e,r)=>({set _(i){d(n,t,i,e)},get _(){return a(n,t,r)}});import{i as wb,a as bb,b as _b,c as Sb,d as Ab,e as kb,f as Eb,U as $b,A as Cb,g as Tb}from"./artifact-bridge-BXDhGuL-.js";import{m as Rb,a as Ib,b as xb}from"./missing-artifact-page-DVzJ41AE.js";var Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pb(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var e=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),e}var i0=Object.prototype.toString,c1=function(t){var e=i0.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&i0.call(t.callee)==="[object Function]"),r},oh,s0;function Db(){if(s0)return oh;s0=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=c1,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(v){var y=v.constructor;return y&&y.prototype===v},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var v in window)try{if(!u["$"+v]&&t.call(window,v)&&window[v]!==null&&typeof window[v]=="object")try{c(window[v])}catch{return!0}}catch{return!0}return!1}(),m=function(v){if(typeof window>"u"||!f)return c(v);try{return c(v)}catch{return!1}};n=function(y){var k=y!==null&&typeof y=="object",S=e.call(y)==="[object Function]",x=r(y),M=k&&e.call(y)==="[object String]",Z=[];if(!k&&!S&&!x)throw new TypeError("Object.keys called on a non-object");var G=o&&S;if(M&&y.length>0&&!t.call(y,0))for(var F=0;F<y.length;++F)Z.push(String(F));if(x&&y.length>0)for(var W=0;W<y.length;++W)Z.push(String(W));else for(var Q in y)!(G&&Q==="prototype")&&t.call(y,Q)&&Z.push(String(Q));if(s)for(var ee=m(y),oe=0;oe<l.length;++oe)!(ee&&l[oe]==="constructor")&&t.call(y,l[oe])&&Z.push(l[oe]);return Z}}return oh=n,oh}var Lb=Array.prototype.slice,Ob=c1,o0=Object.keys,sc=o0?function(t){return o0(t)}:Db(),a0=Object.keys;sc.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(r){return Ob(r)?a0(Lb.call(r)):a0(r)})}else Object.keys=sc;return Object.keys||sc};var zb=sc,oc=Object.defineProperty||!1;if(oc)try{oc({},"a",{value:1})}catch{oc=!1}var pl=oc,Kn=SyntaxError,J=TypeError,Nb=Object.getOwnPropertyDescriptor,ac=Nb;if(ac)try{ac([],"length")}catch{ac=null}var ao=ac,l0=pl,Mb=Kn,Qi=J,c0=ao,u1=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Qi("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Qi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!c0&&c0(t,e);if(l0)l0(t,e,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(l||!i&&!s&&!o)t[e]=r;else throw new Mb("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ed=pl,h1=function(){return!!ed};h1.hasArrayLengthDefineBug=function(){if(!ed)return null;try{return ed([],"length",{value:1}).length!==1}catch{return!0}};var Su=h1,Ub=zb,Zb=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Fb=Object.prototype.toString,Hb=Array.prototype.concat,u0=u1,Vb=function(n){return typeof n=="function"&&Fb.call(n)==="[object Function]"},d1=Su(),Bb=function(n,t,e,r){if(t in n){if(r===!0){if(n[t]===e)return}else if(!Vb(r)||!r())return}d1?u0(n,t,e,!0):u0(n,t,e)},f1=function(n,t){var e=arguments.length>2?arguments[2]:{},r=Ub(t);Zb&&(r=Hb.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)Bb(n,r[i],t[r[i]],e[r[i]])};f1.supportsDescriptors=!!d1;var Vi=f1,lc={exports:{}};typeof self<"u"?lc.exports=self:typeof window<"u"?lc.exports=window:lc.exports=Function("return this")();var p1=lc.exports,qb=p1,m1=function(){return typeof Yr!="object"||!Yr||Yr.Math!==Math||Yr.Array!==Array?qb:Yr},jb=Vi,Wb=ao,Gb=m1,Yb=function(){var t=Gb();if(jb.supportsDescriptors){var e=Wb(t,"globalThis");(!e||e.configurable&&(e.enumerable||!e.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},Kb=Vi,Jb=p1,g1=m1,Xb=Yb,Qb=g1(),v1=function(){return Qb};Kb(v1,{getPolyfill:g1,implementation:Jb,shim:Xb});var Pf=v1,Jn=function(t){return!!t&&(typeof t=="function"||typeof t=="object")},Df=Object,y1=Error,e_=EvalError,t_=RangeError,Lf=ReferenceError,n_=URIError,r_=Math.abs,i_=Math.floor,s_=Math.max,o_=Math.min,a_=Math.pow,l_=Math.round,Of=Number.isNaN||function(t){return t!==t},c_=Of,u_=function(t){return c_(t)||t===0?t:t<0?-1:1},lo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==i||l.enumerable!==!0)return!1}return!0},h0=typeof Symbol<"u"&&Symbol,h_=lo,zf=function(){return typeof h0!="function"||typeof Symbol!="function"||typeof h0("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h_()},ah,d0;function w1(){return d0||(d0=1,ah=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),ah}var lh,f0;function b1(){if(f0)return lh;f0=1;var n=Df;return lh=n.getPrototypeOf||null,lh}var d_="Function.prototype.bind called on incompatible ",f_=Object.prototype.toString,p_=Math.max,m_="[object Function]",p0=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r},g_=function(t,e){for(var r=[],i=e,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},v_=function(n,t){for(var e="",r=0;r<n.length;r+=1)e+=n[r],r+1<n.length&&(e+=t);return e},y_=function(t){var e=this;if(typeof e!="function"||f_.apply(e)!==m_)throw new TypeError(d_+e);for(var r=g_(arguments,1),i,s=function(){if(this instanceof i){var f=e.apply(this,p0(r,arguments));return Object(f)===f?f:this}return e.apply(t,p0(r,arguments))},o=p_(0,e.length-r.length),l=[],c=0;c<o;c++)l[c]="$"+c;if(i=Function("binder","return function ("+v_(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,i.prototype=new u,u.prototype=null}return i},w_=y_,ml=Function.prototype.bind||w_,Nf=Function.prototype.call,Mf=Function.prototype.apply,b_=typeof Reflect<"u"&&Reflect&&Reflect.apply,__=ml,S_=Mf,A_=Nf,k_=b_,_1=k_||__.call(A_,S_),E_=ml,$_=J,C_=Nf,T_=_1,Au=function(t){if(t.length<1||typeof t[0]!="function")throw new $_("a function is required");return T_(E_,C_,t)},ch,m0;function R_(){if(m0)return ch;m0=1;var n=Au,t=ao,e;try{e=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!e&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return ch=r&&typeof r.get=="function"?n([r.get]):typeof s=="function"?function(l){return s(l==null?l:i(l))}:!1,ch}var uh,g0;function S1(){if(g0)return uh;g0=1;var n=w1(),t=b1(),e=R_();return uh=n?function(i){return n(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:e?function(i){return e(i)}:null,uh}var I_=Function.prototype.call,x_=Object.prototype.hasOwnProperty,P_=ml,Xn=P_.call(I_,x_),K,D_=Df,L_=y1,O_=e_,z_=t_,N_=Lf,to=Kn,vs=J,M_=n_,U_=r_,Z_=i_,F_=s_,H_=o_,V_=a_,B_=l_,q_=u_,A1=Function,hh=function(n){try{return A1('"use strict"; return ('+n+").constructor;")()}catch{}},la=ao,j_=pl,dh=function(){throw new vs},W_=la?function(){try{return arguments.callee,dh}catch{try{return la(arguments,"callee").get}catch{return dh}}}():dh,es=zf(),Re=S1(),G_=b1(),Y_=w1(),k1=Mf,gl=Nf,ss={},K_=typeof Uint8Array>"u"||!Re?K:Re(Uint8Array),Mi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":es&&Re?Re([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":ss,"%AsyncGenerator%":ss,"%AsyncGeneratorFunction%":ss,"%AsyncIteratorPrototype%":ss,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":L_,"%eval%":eval,"%EvalError%":O_,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":A1,"%GeneratorFunction%":ss,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":es&&Re?Re(Re([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!es||!Re?K:Re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":D_,"%Object.getOwnPropertyDescriptor%":la,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":z_,"%ReferenceError%":N_,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!es||!Re?K:Re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":es&&Re?Re(""[Symbol.iterator]()):K,"%Symbol%":es?Symbol:K,"%SyntaxError%":to,"%ThrowTypeError%":W_,"%TypedArray%":K_,"%TypeError%":vs,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":M_,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":gl,"%Function.prototype.apply%":k1,"%Object.defineProperty%":j_,"%Object.getPrototypeOf%":G_,"%Math.abs%":U_,"%Math.floor%":Z_,"%Math.max%":F_,"%Math.min%":H_,"%Math.pow%":V_,"%Math.round%":B_,"%Math.sign%":q_,"%Reflect.getPrototypeOf%":Y_};if(Re)try{null.error}catch(n){var J_=Re(Re(n));Mi["%Error.prototype%"]=J_}var X_=function n(t){var e;if(t==="%AsyncFunction%")e=hh("async function () {}");else if(t==="%GeneratorFunction%")e=hh("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=hh("async function* () {}");else if(t==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&Re&&(e=Re(i.prototype))}return Mi[t]=e,e},v0={__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"]},vl=ml,zc=Xn,Q_=vl.call(gl,Array.prototype.concat),eS=vl.call(k1,Array.prototype.splice),y0=vl.call(gl,String.prototype.replace),Nc=vl.call(gl,String.prototype.slice),tS=vl.call(gl,RegExp.prototype.exec),nS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rS=/\\(\\)?/g,iS=function(t){var e=Nc(t,0,1),r=Nc(t,-1);if(e==="%"&&r!=="%")throw new to("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&e!=="%")throw new to("invalid intrinsic syntax, expected opening `%`");var i=[];return y0(t,nS,function(s,o,l,c){i[i.length]=l?y0(c,rS,"$1"):o||s}),i},sS=function(t,e){var r=t,i;if(zc(v0,r)&&(i=v0[r],r="%"+i[0]+"%"),zc(Mi,r)){var s=Mi[r];if(s===ss&&(s=X_(r)),typeof s>"u"&&!e)throw new vs("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new to("intrinsic "+t+" does not exist!")},_t=function(t,e){if(typeof t!="string"||t.length===0)throw new vs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new vs('"allowMissing" argument must be a boolean');if(tS(/^%?[^%]*%?$/,t)===null)throw new to("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=iS(t),i=r.length>0?r[0]:"",s=sS("%"+i+"%",e),o=s.name,l=s.value,c=!1,u=s.alias;u&&(i=u[0],eS(r,Q_([0,1],u)));for(var f=1,m=!0;f<r.length;f+=1){var v=r[f],y=Nc(v,0,1),k=Nc(v,-1);if((y==='"'||y==="'"||y==="`"||k==='"'||k==="'"||k==="`")&&y!==k)throw new to("property names with quotes must have matching quotes");if((v==="constructor"||!m)&&(c=!0),i+="."+v,o="%"+i+"%",zc(Mi,o))l=Mi[o];else if(l!=null){if(!(v in l)){if(!e)throw new vs("base intrinsic for "+t+" exists, but the property is not available.");return}if(la&&f+1>=r.length){var S=la(l,v);m=!!S,m&&"get"in S&&!("originalValue"in S.get)?l=S.get:l=l[v]}else m=zc(l,v),l=l[v];m&&!c&&(Mi[o]=l)}}return l},fh,w0;function zr(){if(w0)return fh;w0=1;var n=_t,t=Au,e=t([n("%String.prototype.indexOf%")]);return fh=function(i,s){var o=n(i,!!s);return typeof o=="function"&&e(i,".prototype.")>-1?t([o]):o},fh}var ph,b0;function Uf(){if(b0)return ph;b0=1;var n=_t,t=n("%Array%"),e=!t.isArray&&zr()("Object.prototype.toString");return ph=t.isArray||function(i){return e(i)==="[object Array]"},ph}var oS=Su,_0=pl,E1=oS.hasArrayLengthDefineBug(),aS=E1&&Uf(),lS=zr(),cS=lS("Object.prototype.propertyIsEnumerable"),Zf=function(t,e,r,i,s,o){if(!_0){if(!t(o)||!o["[[Configurable]]"]||!o["[[Writable]]"]||s in i&&cS(i,s)!==!!o["[[Enumerable]]"])return!1;var l=o["[[Value]]"];return i[s]=l,e(i[s],l)}return E1&&s==="length"&&"[[Value]]"in o&&aS(i)&&i.length!==o["[[Value]]"]?(i.length=o["[[Value]]"],i.length===o["[[Value]]"]):(_0(i,s,r(o)),!0)},uS=J,ko=Xn,hS={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},co=function(t){if(!t||typeof t!="object")return!1;for(var e in t)if(ko(t,e)&&!hS[e])return!1;var r=ko(t,"[[Value]]")||ko(t,"[[Writable]]"),i=ko(t,"[[Get]]")||ko(t,"[[Set]]");if(r&&i)throw new uS("Property Descriptors may not be both accessor and data descriptors");return!0},$1=function(t){if(typeof t>"u")return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e},dS=J,fS=co,pS=$1,C1=function(t){if(typeof t<"u"&&!fS(t))throw new dS("Assertion failed: `Desc` must be a Property Descriptor");return pS(t)},mS=J,S0=Xn,gS=co,T1=function(t){if(typeof t>"u")return!1;if(!gS(t))throw new mS("Assertion failed: `Desc` must be a Property Descriptor");return!(!S0(t,"[[Value]]")&&!S0(t,"[[Writable]]"))},uo=function(t){return typeof t=="string"||typeof t=="symbol"},A0=Of,R1=function(t,e){return t===e?t===0?1/t===1/e:!0:A0(t)&&A0(e)},k0=J,vS=Jn,yS=Zf,wS=C1,bS=T1,_S=uo,SS=R1,Ff=function(t,e,r){if(!vS(t))throw new k0("Assertion failed: Type(O) is not Object");if(!_S(e))throw new k0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return yS(bS,SS,wS,t,e,i)},I1=Function.prototype.toString,fs=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,td,cc;if(typeof fs=="function"&&typeof Object.defineProperty=="function")try{td=Object.defineProperty({},"length",{get:function(){throw cc}}),cc={},fs(function(){throw 42},null,td)}catch(n){n!==cc&&(fs=null)}else fs=null;var AS=/^\s*class\b/,nd=function(t){try{var e=I1.call(t);return AS.test(e)}catch{return!1}},mh=function(t){try{return nd(t)?!1:(I1.call(t),!0)}catch{return!1}},uc=Object.prototype.toString,kS="[object Object]",ES="[object Function]",$S="[object GeneratorFunction]",CS="[object HTMLAllCollection]",TS="[object HTML document.all class]",RS="[object HTMLCollection]",IS=typeof Symbol=="function"&&!!Symbol.toStringTag,xS=!(0 in[,]),rd=function(){return!1};if(typeof document=="object"){var PS=document.all;uc.call(PS)===uc.call(document.all)&&(rd=function(t){if((xS||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=uc.call(t);return(e===CS||e===TS||e===RS||e===kS)&&t("")==null}catch{}return!1})}var x1=fs?function(t){if(rd(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{fs(t,null,td)}catch(e){if(e!==cc)return!1}return!nd(t)&&mh(t)}:function(t){if(rd(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(IS)return mh(t);if(nd(t))return!1;var e=uc.call(t);return e!==ES&&e!==$S&&!/^\[object HTML/.test(e)?!1:mh(t)},DS=x1,LS=function(t){return!!t},Mt=Xn,zl=J,OS=Jn,E0=DS,gh=LS,zS=function(t){if(!OS(t))throw new zl("ToPropertyDescriptor requires an object");var e={};if(Mt(t,"enumerable")&&(e["[[Enumerable]]"]=gh(t.enumerable)),Mt(t,"configurable")&&(e["[[Configurable]]"]=gh(t.configurable)),Mt(t,"value")&&(e["[[Value]]"]=t.value),Mt(t,"writable")&&(e["[[Writable]]"]=gh(t.writable)),Mt(t,"get")){var r=t.get;if(typeof r<"u"&&!E0(r))throw new zl("getter must be a function");e["[[Get]]"]=r}if(Mt(t,"set")){var i=t.set;if(typeof i<"u"&&!E0(i))throw new zl("setter must be a function");e["[[Set]]"]=i}if((Mt(e,"[[Get]]")||Mt(e,"[[Set]]"))&&(Mt(e,"[[Value]]")||Mt(e,"[[Writable]]")))throw new zl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},vh=J,NS=Jn,$0=co,MS=Zf,US=C1,ZS=T1,FS=uo,HS=R1,VS=zS,BS=function(t,e,r){if(!NS(t))throw new vh("Assertion failed: Type(O) is not Object");if(!FS(e))throw new vh("Assertion failed: P is not a Property Key");var i=$0(r)?r:VS(r);if(!$0(i))throw new vh("Assertion failed: Desc is not a valid Property Descriptor");return MS(ZS,HS,US,t,e,i)},C0=J,qS=Jn,jS=BS,WS=uo,GS=function(t,e,r){if(!qS(t))throw new C0("Assertion failed: Type(O) is not Object");if(!WS(e))throw new C0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return jS(t,e,i)},YS=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,KS=Df,JS=KS.setPrototypeOf||null,XS=Au,T0=ao,QS=J,P1={};try{P1.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var e8=!("toString"in P1),yh=T0&&T0(Object.prototype,"__proto__"),t8=e8&&(!!yh&&typeof yh.set=="function"&&XS([yh.set])||function(t,e){if(t==null)throw new QS("set Object.prototype.__proto__ called on null or undefined");return t.__proto__=e,e}),R0=YS,n8=JS,I0=t8,r8=J,i8=R0?function(t,e){if(R0(t,e))return t;throw new r8("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:n8||(I0?function(t,e){return I0(t,e),t}:null),x0=J,s8=Jn,P0=S1(),o8=function(t){if(!s8(t))throw new x0("Assertion failed: O must be an Object");if(!P0)throw new x0("This environment does not support fetching prototypes.");return P0(t)},a8=J,l8=i8,c8=Jn,u8=o8,h8=function(t,e){if(e!==null&&!c8(e))throw new a8("Assertion failed: V must be Object or Null");try{l8(t,e)}catch{return!1}return u8(t)===e},wh=Ff,D0=GS,D1=h8,d8=Su(),Hf=y1;function yl(n,t,e){var r=new Hf(e);return D1(r,hc),delete r.constructor,D0(r,"error",n),D0(r,"suppressed",t),r}d8&&Object.defineProperty(yl,"prototype",{writable:!1});var hc=yl.prototype;if(!wh(hc,"constructor",yl)||!wh(hc,"message","")||!wh(hc,"name","SuppressedError"))throw new Hf("unable to install SuppressedError.prototype properties; please report this!");D1(yl.prototype,Hf.prototype);var f8=yl,p8=f8,L1=function(){return typeof SuppressedError=="function"?SuppressedError:p8},m8=Vi,L0=Pf(),g8=L1,v8=function(){var t=g8();return m8(L0,{SuppressedError:t},{SuppressedError:function(){return L0.SuppressedError!==t}}),t};v8();var y8=J,w8=co,b8=$1,_8=function(t){if(typeof t<"u"&&!w8(t))throw new y8("Assertion failed: `Desc` must be a Property Descriptor");return b8(t)},S8=J,O0=Xn,A8=co,k8=function(t){if(typeof t>"u")return!1;if(!A8(t))throw new S8("Assertion failed: `Desc` must be a Property Descriptor");return!(!O0(t,"[[Value]]")&&!O0(t,"[[Writable]]"))},z0=Of,E8=function(t,e){return t===e?t===0?1/t===1/e:!0:z0(t)&&z0(e)},ho=x1,$8=function(t){return!!t},Ut=Xn,Nl=J,C8=Jn,N0=ho,bh=$8,T8=function(t){if(!C8(t))throw new Nl("ToPropertyDescriptor requires an object");var e={};if(Ut(t,"enumerable")&&(e["[[Enumerable]]"]=bh(t.enumerable)),Ut(t,"configurable")&&(e["[[Configurable]]"]=bh(t.configurable)),Ut(t,"value")&&(e["[[Value]]"]=t.value),Ut(t,"writable")&&(e["[[Writable]]"]=bh(t.writable)),Ut(t,"get")){var r=t.get;if(typeof r<"u"&&!N0(r))throw new Nl("getter must be a function");e["[[Get]]"]=r}if(Ut(t,"set")){var i=t.set;if(typeof i<"u"&&!N0(i))throw new Nl("setter must be a function");e["[[Set]]"]=i}if((Ut(e,"[[Get]]")||Ut(e,"[[Set]]"))&&(Ut(e,"[[Value]]")||Ut(e,"[[Writable]]")))throw new Nl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},_h=J,R8=Jn,M0=co,I8=Zf,x8=_8,P8=k8,D8=uo,L8=E8,O8=T8,wl=function(t,e,r){if(!R8(t))throw new _h("Assertion failed: Type(O) is not Object");if(!D8(e))throw new _h("Assertion failed: P is not a Property Key");var i=M0(r)?r:O8(r);if(!M0(i))throw new _h("Assertion failed: Desc is not a valid Property Descriptor");return I8(P8,L8,x8,t,e,i)},z8=lo(),N8=z8?Symbol.dispose||Symbol("Symbol.dispose"):null,M8=lo,U8=N8,Vf=function(){return M8()&&Symbol.dispose||U8},Z8=zf,F8=wl,H8=Vf,V8=function(){var t=H8();return Z8()&&F8(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},B8=lo(),q8=B8?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,j8=lo,W8=q8,Bf=function(){return j8()&&Symbol.asyncDispose||W8},G8=zf,Y8=wl,K8=Bf,J8=function(){var t=K8();return G8()&&Y8(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},X8=Uf(),Q8=_t,e6=zr(),t6=J,n6=X8,r6=Q8("%Reflect.apply%",!0)||e6("Function.prototype.apply"),ku=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!n6(r))throw new t6("Assertion failed: optional `argumentsList`, if provided, must be a List");return r6(t,e,r)};const i6={},s6=Object.freeze(Object.defineProperty({__proto__:null,default:i6},Symbol.toStringTag,{value:"Module"})),o6=Pb(s6);var qf=typeof Map=="function"&&Map.prototype,Sh=Object.getOwnPropertyDescriptor&&qf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Mc=qf&&Sh&&typeof Sh.get=="function"?Sh.get:null,U0=qf&&Map.prototype.forEach,jf=typeof Set=="function"&&Set.prototype,Ah=Object.getOwnPropertyDescriptor&&jf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Uc=jf&&Ah&&typeof Ah.get=="function"?Ah.get:null,Z0=jf&&Set.prototype.forEach,a6=typeof WeakMap=="function"&&WeakMap.prototype,na=a6?WeakMap.prototype.has:null,l6=typeof WeakSet=="function"&&WeakSet.prototype,ra=l6?WeakSet.prototype.has:null,c6=typeof WeakRef=="function"&&WeakRef.prototype,F0=c6?WeakRef.prototype.deref:null,u6=Boolean.prototype.valueOf,h6=Object.prototype.toString,d6=Function.prototype.toString,f6=String.prototype.match,Wf=String.prototype.slice,Tr=String.prototype.replace,p6=String.prototype.toUpperCase,H0=String.prototype.toLowerCase,O1=RegExp.prototype.test,V0=Array.prototype.concat,pn=Array.prototype.join,m6=Array.prototype.slice,B0=Math.floor,id=typeof BigInt=="function"?BigInt.prototype.valueOf:null,kh=Object.getOwnPropertySymbols,sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,no=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ia=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===no||!0)?Symbol.toStringTag:null,z1=Object.prototype.propertyIsEnumerable,q0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function j0(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||O1.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-B0(-n):B0(n);if(r!==n){var i=String(r),s=Wf.call(t,i.length+1);return Tr.call(i,e,"$&_")+"."+Tr.call(Tr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Tr.call(t,e,"$&_")}var od=o6,W0=od.custom,G0=U1(W0)?W0:null,N1={__proto__:null,double:'"',single:"'"},g6={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},fo=function n(t,e,r,i){var s=e||{};if(Tn(s,"quoteStyle")&&!Tn(N1,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Tn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Tn(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Tn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Tn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return F1(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?j0(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return l?j0(t,u):u}var f=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof t=="object")return ad(t)?"[Array]":"[Object]";var m=L6(s,r);if(typeof i>"u")i=[];else if(Z1(i,t)>=0)return"[Circular]";function v(Ot,Qn,ju){if(Qn&&(i=m6.call(i),i.push(Qn)),ju){var Cl={depth:s.depth};return Tn(s,"quoteStyle")&&(Cl.quoteStyle=s.quoteStyle),n(Ot,Cl,r+1,i)}return n(Ot,s,r+1,i)}if(typeof t=="function"&&!Y0(t)){var y=E6(t),k=Ml(t,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(k.length>0?" { "+pn.call(k,", ")+" }":"")}if(U1(t)){var S=no?Tr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):sd.call(t);return typeof t=="object"&&!no?Eo(S):S}if(x6(t)){for(var x="<"+H0.call(String(t.nodeName)),M=t.attributes||[],Z=0;Z<M.length;Z++)x+=" "+M[Z].name+"="+M1(v6(M[Z].value),"double",s);return x+=">",t.childNodes&&t.childNodes.length&&(x+="..."),x+="</"+H0.call(String(t.nodeName))+">",x}if(ad(t)){if(t.length===0)return"[]";var G=Ml(t,v);return m&&!D6(G)?"["+ld(G,m)+"]":"[ "+pn.call(G,", ")+" ]"}if(w6(t)){var F=Ml(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!z1.call(t,"cause")?"{ ["+String(t)+"] "+pn.call(V0.call("[cause]: "+v(t.cause),F),", ")+" }":F.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+pn.call(F,", ")+" }"}if(typeof t=="object"&&o){if(G0&&typeof t[G0]=="function"&&od)return od(t,{depth:f-r});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if($6(t)){var W=[];return U0&&U0.call(t,function(Ot,Qn){W.push(v(Qn,t,!0)+" => "+v(Ot,t))}),K0("Map",Mc.call(t),W,m)}if(R6(t)){var Q=[];return Z0&&Z0.call(t,function(Ot){Q.push(v(Ot,t))}),K0("Set",Uc.call(t),Q,m)}if(C6(t))return Eh("WeakMap");if(I6(t))return Eh("WeakSet");if(T6(t))return Eh("WeakRef");if(_6(t))return Eo(v(Number(t)));if(A6(t))return Eo(v(id.call(t)));if(S6(t))return Eo(u6.call(t));if(b6(t))return Eo(v(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Yr<"u"&&t===Yr)return"{ [object globalThis] }";if(!y6(t)&&!Y0(t)){var ee=Ml(t,v),oe=q0?q0(t)===Object.prototype:t instanceof Object||t.constructor===Object,yn=t instanceof Object?"":"null prototype",wn=!oe&&ia&&Object(t)===t&&ia in t?Wf.call(Nr(t),8,-1):yn?"Object":"",we=oe||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",bn=we+(wn||yn?"["+pn.call(V0.call([],wn||[],yn||[]),": ")+"] ":"");return ee.length===0?bn+"{}":m?bn+"{"+ld(ee,m)+"}":bn+"{ "+pn.call(ee,", ")+" }"}return String(t)};function M1(n,t,e){var r=e.quoteStyle||t,i=N1[r];return i+n+i}function v6(n){return Tr.call(String(n),/"/g,""")}function Bi(n){return!ia||!(typeof n=="object"&&(ia in n||typeof n[ia]<"u"))}function ad(n){return Nr(n)==="[object Array]"&&Bi(n)}function y6(n){return Nr(n)==="[object Date]"&&Bi(n)}function Y0(n){return Nr(n)==="[object RegExp]"&&Bi(n)}function w6(n){return Nr(n)==="[object Error]"&&Bi(n)}function b6(n){return Nr(n)==="[object String]"&&Bi(n)}function _6(n){return Nr(n)==="[object Number]"&&Bi(n)}function S6(n){return Nr(n)==="[object Boolean]"&&Bi(n)}function U1(n){if(no)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!sd)return!1;try{return sd.call(n),!0}catch{}return!1}function A6(n){if(!n||typeof n!="object"||!id)return!1;try{return id.call(n),!0}catch{}return!1}var k6=Object.prototype.hasOwnProperty||function(n){return n in this};function Tn(n,t){return k6.call(n,t)}function Nr(n){return h6.call(n)}function E6(n){if(n.name)return n.name;var t=f6.call(d6.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function Z1(n,t){if(n.indexOf)return n.indexOf(t);for(var e=0,r=n.length;e<r;e++)if(n[e]===t)return e;return-1}function $6(n){if(!Mc||!n||typeof n!="object")return!1;try{Mc.call(n);try{Uc.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function C6(n){if(!na||!n||typeof n!="object")return!1;try{na.call(n,na);try{ra.call(n,ra)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function T6(n){if(!F0||!n||typeof n!="object")return!1;try{return F0.call(n),!0}catch{}return!1}function R6(n){if(!Uc||!n||typeof n!="object")return!1;try{Uc.call(n);try{Mc.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function I6(n){if(!ra||!n||typeof n!="object")return!1;try{ra.call(n,ra);try{na.call(n,na)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function x6(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function F1(n,t){if(n.length>t.maxStringLength){var e=n.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return F1(Wf.call(n,0,t.maxStringLength),t)+r}var i=g6[t.quoteStyle||"single"];i.lastIndex=0;var s=Tr.call(Tr.call(n,i,"\\$1"),/[\x00-\x1f]/g,P6);return M1(s,"single",t)}function P6(n){var t=n.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+p6.call(t.toString(16))}function Eo(n){return"Object("+n+")"}function Eh(n){return n+" { ? }"}function K0(n,t,e,r){var i=r?ld(e,r):pn.call(e,", ");return n+" ("+t+") {"+i+"}"}function D6(n){for(var t=0;t<n.length;t++)if(Z1(n[t],`
|
|
2
|
-
`)>=0)return!1;return!0}function L6(n,t){var e;if(n.indent===" ")e=" ";else if(typeof n.indent=="number"&&n.indent>0)e=pn.call(Array(n.indent+1)," ");else return null;return{base:e,prev:pn.call(Array(t+1),e)}}function ld(n,t){if(n.length===0)return"";var e=`
|
|
3
|
-
`+t.prev+t.base;return e+pn.call(n,","+e)+`
|
|
4
|
-
`+t.prev}function Ml(n,t){var e=ad(n),r=[];if(e){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Tn(n,i)?t(n[i],n):""}var s=typeof kh=="function"?kh(n):[],o;if(no){o={};for(var l=0;l<s.length;l++)o["$"+s[l]]=s[l]}for(var c in n)Tn(n,c)&&(e&&String(Number(c))===c&&c<n.length||no&&o["$"+c]instanceof Symbol||(O1.call(/[^\w$]/,c)?r.push(t(c,n)+": "+t(n[c],n)):r.push(c+": "+t(n[c],n))));if(typeof kh=="function")for(var u=0;u<s.length;u++)z1.call(n,s[u])&&r.push("["+t(s[u])+"]: "+t(n[s[u]],n));return r}var O6=fo,z6=J,Eu=function(n,t,e){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,e||(i.next=n.next,n.next=i),i},N6=function(n,t){if(n){var e=Eu(n,t);return e&&e.value}},M6=function(n,t,e){var r=Eu(n,t);r?r.value=e:n.next={key:t,next:n.next,value:e}},U6=function(n,t){return n?!!Eu(n,t):!1},Z6=function(n,t){if(n)return Eu(n,t,!0)},F6=function(){var t,e={assert:function(r){if(!e.has(r))throw new z6("Side channel does not contain "+O6(r))},delete:function(r){var i=Z6(t,r);return i&&t&&!t.next&&(t=void 0),!!i},get:function(r){return N6(t,r)},has:function(r){return U6(t,r)},set:function(r,i){t||(t={next:void 0}),M6(t,r,i)}};return e},H6=_t,bl=zr(),V6=fo,B6=J,J0=H6("%Map%",!0),q6=bl("Map.prototype.get",!0),j6=bl("Map.prototype.set",!0),W6=bl("Map.prototype.has",!0),G6=bl("Map.prototype.delete",!0),Y6=bl("Map.prototype.size",!0),H1=!!J0&&function(){var t,e={assert:function(r){if(!e.has(r))throw new B6("Side channel does not contain "+V6(r))},delete:function(r){if(t){var i=G6(t,r);return Y6(t)===0&&(t=void 0),i}return!1},get:function(r){if(t)return q6(t,r)},has:function(r){return t?W6(t,r):!1},set:function(r,i){t||(t=new J0),j6(t,r,i)}};return e},K6=_t,$u=zr(),J6=fo,Ul=H1,X6=J,ts=K6("%WeakMap%",!0),Q6=$u("WeakMap.prototype.get",!0),eA=$u("WeakMap.prototype.set",!0),tA=$u("WeakMap.prototype.has",!0),nA=$u("WeakMap.prototype.delete",!0),rA=ts?function(){var t,e,r={assert:function(i){if(!r.has(i))throw new X6("Side channel does not contain "+J6(i))},delete:function(i){if(ts&&i&&(typeof i=="object"||typeof i=="function")){if(t)return nA(t,i)}else if(Ul&&e)return e.delete(i);return!1},get:function(i){return ts&&i&&(typeof i=="object"||typeof i=="function")&&t?Q6(t,i):e&&e.get(i)},has:function(i){return ts&&i&&(typeof i=="object"||typeof i=="function")&&t?tA(t,i):!!e&&e.has(i)},set:function(i,s){ts&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new ts),eA(t,i,s)):Ul&&(e||(e=Ul()),e.set(i,s))}};return r}:Ul,iA=J,sA=fo,oA=F6,aA=H1,lA=rA,cA=lA||aA||oA,uA=function(){var t,e={assert:function(r){if(!e.has(r)){var i=r&&Object(r)===r?"the given object key":sA(r);throw new iA("Side channel does not contain "+i)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,i){t||(t=cA()),t.set(r,i)}};return e},hA=Xn,$o=uA(),kn=J,Gf={assert:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");if($o.assert(n),!Gf.has(n,t))throw new kn("`"+t+"` is not present on `O`")},get:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var e=$o.get(n);return e&&e["$"+t]},has:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var e=$o.get(n);return!!e&&hA(e,"$"+t)},set:function(n,t,e){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var r=$o.get(n);r||(r={},$o.set(n,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(Gf);var Yf=Gf,V1=Kn,Ir=Yf,_l=function n(t,e){if(!(this instanceof n))return new n(t,e);if(t!=="normal"&&t!=="break"&&t!=="continue"&&t!=="return"&&t!=="throw")throw new V1('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');Ir.set(this,"[[Type]]",t),Ir.set(this,"[[Value]]",e)};_l.prototype.type=function(){return Ir.get(this,"[[Type]]")};_l.prototype.value=function(){return Ir.get(this,"[[Value]]")};_l.prototype["?"]=function(){var t=Ir.get(this,"[[Type]]"),e=Ir.get(this,"[[Value]]");if(t==="throw")throw e;return e};_l.prototype["!"]=function(){var t=Ir.get(this,"[[Type]]");if(t!=="normal")throw new V1('Assertion failed: Completion Record is not of type "normal"');return Ir.get(this,"[[Value]]")};var Kf=_l,dA=Kf,Jf=function(t){return new dA("normal",t)},$h,X0;function fA(){if(X0)return $h;X0=1;var n=lo;return $h=function(){return n()&&!!Symbol.toStringTag},$h}var pA=_t,Q0=pA("%Object.defineProperty%",!0),mA=fA()(),gA=Xn,vA=J,Zl=mA?Symbol.toStringTag:null,B1=function(t,e){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 vA("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Zl&&(r||!gA(t,Zl))&&(Q0?Q0(t,Zl,{configurable:!i,enumerable:!1,value:e,writable:!1}):t[Zl]=e)},q1={exports:{}},yA=_t,em=u1,wA=Su(),tm=ao,nm=J,bA=yA("%Math.floor%"),_A=function(t,e){if(typeof t!="function")throw new nm("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||bA(e)!==e)throw new nm("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&tm){var o=tm(t,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!r)&&(wA?em(t,"length",e,!0,!0):em(t,"length",e)),t},SA=ml,AA=Mf,kA=_1,EA=function(){return kA(SA,AA,arguments)};(function(n){var t=_A,e=pl,r=Au,i=EA;n.exports=function(o){var l=r(arguments),c=1+o.length-(arguments.length-1);return t(l,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(q1);var Xf=q1.exports,$A=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0},CA=Object,TA=function(t){return t&&typeof t=="object"&&(typeof t["[[ResourceValue]]"]>"u"||CA(t["[[ResourceValue]]"])===t["[[ResourceValue]]"])&&(t["[[Hint]]"]==="SYNC-DISPOSE"||t["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof t["[[DisposeMethod]]"]=="function"||typeof t["[[DisposeMethod]]"]>"u")},RA=Xn,IA=Uf(),xA=$A,PA=TA,DA=function(t){return t&&typeof t=="object"&&RA(t,"[[DisposableResourceStack]]")&&IA(t["[[DisposableResourceStack]]"])&&(t["[[DisposableResourceStack]]"].length===0||xA(t["[[DisposableResourceStack]]"],PA))},LA=Jn,OA=function(t){if(t===null)return"Null";if(typeof t>"u")return"Undefined";if(LA(t))return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"},zA=OA,Qf=function(t){return typeof t=="symbol"?"Symbol":typeof t=="bigint"?"BigInt":zA(t)},NA=J,MA=fo,UA=uo,ZA=function(t,e){if(!UA(e))throw new NA("Assertion failed: P is not a Property Key, got "+MA(e));return t[e]},rm=J,FA=ZA,HA=ho,VA=uo,im=fo,BA=function(t,e){if(!VA(e))throw new rm("Assertion failed: P is not a Property Key");var r=FA(t,e);if(r!=null){if(!HA(r))throw new rm(im(e)+" is not a function: "+im(r));return r}},cd={exports:{}},qA=_t,jA=qA,sm=jA("%Reflect.construct%",!0),Zc=wl;try{Zc({},"",{"[[Get]]":function(){}})}catch{Zc=null}if(Zc&&sm){var om={},am={};Zc(am,"length",{"[[Get]]":function(){throw om},"[[Enumerable]]":!0}),cd.exports=function(t){try{sm(t,am)}catch(e){return e===om}}}else cd.exports=function(t){return typeof t=="function"&&!!t.prototype};var WA=cd.exports,Ch=J,lm=ho,GA=WA,YA=function(t){if(!GA(t))throw new Ch("C must be a constructor");var e={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new t(function(i,s){if(typeof e["[[Resolve]]"]<"u"||typeof e["[[Reject]]"]<"u")throw new Ch("executor has already been called");e["[[Resolve]]"]=i,e["[[Reject]]"]=s});if(!lm(e["[[Resolve]]"])||!lm(e["[[Reject]]"]))throw new Ch("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":e["[[Resolve]]"],"[[Reject]]":e["[[Reject]]"]}},cm=Kn,KA=J,Th=ku,um=BA,JA=YA,XA=Qf,hm=Vf(),dm=Bf(),QA=function(t,e){if(XA(t)!=="Object")throw new KA("`V` must be an Object");if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new cm("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(e==="ASYNC-DISPOSE"&&dm&&(r=um(t,dm)),!r){if(!hm)throw new cm("`Symbol.dispose` is not supported");if(r=um(t,hm),typeof r<"u")return function(){var i=this;if(e==="ASYNC-DISPOSE"){var s=JA(Promise);try{Th(r,i),Th(s["[[Resolve]]"],void 0,[void 0])}catch(o){s["[[Reject]]"](o)}return s["[[Promise]]"]}Th(r,i)}}return r},ek=Kn,Rh=J,tk=ho,nk=Qf,rk=QA,ik=function(t,e){if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new ek("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(t==null)t=void 0,r=void 0;else{if(typeof t<"u"&&nk(t)!=="Object")throw new Rh("`V` must be an Object, or `null` or `undefined`");if(r=rk(t,e),typeof r>"u")throw new Rh("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!tk(r))throw new Rh("`method`, when provided, must be a function");return{"[[ResourceValue]]":t,"[[Hint]]":e,"[[DisposeMethod]]":r}},sk=Kn,Fl=J,ok=DA,fm=ik,ak=zr(),lk=ak("Array.prototype.push"),j1=function(t,e,r){if(!ok(t))throw new Fl("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new sk("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 Fl("Assertion failed: `method`, when present, must be a function");if(!t["[[DisposableResourceStack]]"])throw new Fl("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(e==null&&r==="SYNC_DISPOSE")return"UNUSED";s=fm(e,r)}else{if(typeof e<"u")throw new Fl("Assertion failed: `V` must be undefined when `method` is present");s=fm(void 0,r,i)}return lk(t["[[DisposableResourceStack]]"],s),"UNUSED"},Ih,pm;function ep(){if(pm)return Ih;pm=1;var n=_t,t=Xf,e=Kn,r=n("%Promise.resolve%",!0),i=r&&t(r);return Ih=function(o,l){if(!i)throw new e("This environment does not support Promises.");return i(o,l)},Ih}var xh,mm;function ck(){if(mm)return xh;mm=1;var n=_t,t=Kn,e=n("%Promise%",!0),r=ku,i=ep(),s=Qf;return xh=function(l,c,u){if(typeof l<"u"&&s(l)!=="Object")throw new t("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new t("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new t("Assertion failed: `method` must be `undefined` or a function");var f=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(e,f)},xh}var Ph,gm;function uk(){if(gm)return Ph;gm=1;var n=Kf;return Ph=function(e){return new n("throw",e)},Ph}var hk=_t,Dh=Kn,vm=J,dk=hk("%Promise%",!0),fk=zr(),ym=fk("Promise.prototype.then",!0),pk=Kf,wm=ck(),mk=Jf,gk=ep(),bm=uk(),vk=L1(),W1=function(t,e){if(!(e instanceof pk))throw new vm("`completion` must be a Completion Record");var r=t["[[DisposableResourceStack]]"];if(!r)throw new vm("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,s=r.length-1;s>=0;s-=1)if(!i)i=r[s]["[[Hint]]"];else if(i!==r[s]["[[Hint]]"])throw new Dh("mixed hint stacks are not supported");for(var o=i==="ASYNC-DISPOSE"&&gk(dk,e),l=function(v){if(e.type()==="throw"){var y=e.value(),k=new vk(v,y);e=bm(k)}else e=bm(v)},c=i==="ASYNC-DISPOSE"&&function(y){return ym(o,function(){var k=wm(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!k)throw new Dh("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return ym(k,mk)},l)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")o=c(r[u]);else{var f=r[u];try{var m=wm(f["[[ResourceValue]]"],f["[[Hint]]"],f["[[DisposeMethod]]"]);if(m)throw new Dh("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(v){l(v)}}return t["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?o:e},G1=function(){var t=[];return{"[[DisposableResourceStack]]":t}},Cu=Lf,tp=J,yk=ku,po=Ff,wk=wl,Y1=ho,bk=Jf,Je=Yf,_k=B1,K1=Vi.supportsDescriptors,Sk=Xf,np=j1,Ak=W1,J1=G1,_m=Vf(),yt=function n(){if(!(this instanceof n)||Je.has(this,"[[DisposableState]]")||Je.has(this,"[[DisposeCapability]]"))throw new tp("can only be used with new");Je.set(this,"[[DisposableState]]","PENDING"),Je.set(this,"[[DisposeCapability]]",J1())},X1=function(){var t=this;return Je.assert(t,"[[DisposableState]]"),Je.get(t,"[[DisposableState]]")==="DISPOSED"},Sl=Sk(X1);K1?wk(yt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":X1}):yt.prototype.disposed=!1;var Q1=function(t){Je.set(t,"[[DisposableState]]","DISPOSED"),K1||(t.disposed=!0)};po(yt.prototype,"dispose",function(){var t=this;if(!Sl(t))return Q1(t),Ak(Je.get(t,"[[DisposeCapability]]"),bk())["?"]()});po(yt.prototype,"use",function(t){var e=this;if(Sl(e))throw new Cu("a disposed stack can not use anything new");return np(Je.get(e,"[[DisposeCapability]]"),t,"SYNC-DISPOSE"),t});po(yt.prototype,"adopt",function(t,e){var r=this;if(Sl(r))throw new Cu("a disposed stack can not use anything new");if(!Y1(e))throw new tp("`onDispose` must be a function");var i=function(){return yk(e,void 0,[t])};return np(Je.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),t});po(yt.prototype,"defer",function(t){var e=this;if(Sl(e))throw new Cu("a disposed stack can not defer anything new");if(!Y1(t))throw new tp("`onDispose` must be a function");np(Je.get(e,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",t)});po(yt.prototype,"move",function(){var t=this;if(Sl(t))throw new Cu("a disposed stack can not use anything new");var e=new yt;return Je.set(e,"[[DisposeCapability]]",Je.get(t,"[[DisposeCapability]]")),Je.set(t,"[[DisposeCapability]]",J1()),Q1(t),e});_m&&po(yt.prototype,_m,yt.prototype.dispose);_k(yt.prototype,"DisposableStack");var kk=yt,Ek=kk,$k=function(){return typeof DisposableStack=="function"?DisposableStack:Ek},Ck=Vi,Tk=Pf(),Rk=$k,Ik=function(){var t=Rk();return Ck(Tk,{DisposableStack:t},{DisposableStack:!0}),t},xk=_t,Tu=Lf,rp=J,Sm=xk("%Promise%",!0),ip=j1,Pk=ku,mo=Ff,Dk=wl,Lk=W1,ev=ho,tv=G1,Ok=Jf,Am=ep(),Xe=Yf,zk=B1,nv=Vi.supportsDescriptors,Nk=Xf,Mk=zr(),Uk=Mk("Promise.prototype.then",!0),km=Bf(),wt=function n(){if(!(this instanceof n)||Xe.has(this,"[[AsyncDisposableState]]")||Xe.has(this,"[[DisposeCapability]]"))throw new rp("can only be used with new");Xe.set(this,"[[AsyncDisposableState]]","pending"),Xe.set(this,"[[DisposeCapability]]",tv())},rv=function(){var t=this;return Xe.assert(t,"[[AsyncDisposableState]]"),Xe.get(t,"[[AsyncDisposableState]]")==="disposed"},Al=Nk(rv);nv?Dk(wt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":rv}):wt.prototype.disposed=!1;var iv=function(t){Xe.set(t,"[[AsyncDisposableState]]","disposed"),nv||(t.disposed=!0)};mo(wt.prototype,"disposeAsync",function(){var t=this;return Al(t)?Am(Sm):(iv(t),Uk(Am(Sm,Lk(Xe.get(t,"[[DisposeCapability]]"),Ok())),function(e){return e["?"]()}))});mo(wt.prototype,"use",function(t){var e=this;if(Al(e))throw new Tu("a disposed stack can not use anything new");return ip(Xe.get(e,"[[DisposeCapability]]"),t,"ASYNC-DISPOSE"),t});mo(wt.prototype,"adopt",function(t,e){var r=this;if(Al(r))throw new Tu("a disposed stack can not use anything new");if(!ev(e))throw new rp("`onDisposeAsync` must be a function");var i=function(){return Pk(e,void 0,[t])};return i.value=t,ip(Xe.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),t});mo(wt.prototype,"defer",function(t){var e=this;if(Al(e))throw new Tu("a disposed stack can not defer anything new");if(!ev(t))throw new rp("`onDispose` must be a function");ip(Xe.get(e,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",t)});mo(wt.prototype,"move",function(){var t=this;if(Al(t))throw new Tu("a disposed stack can not use anything new");var e=new wt;return Xe.set(e,"[[DisposeCapability]]",Xe.get(t,"[[DisposeCapability]]")),Xe.set(t,"[[DisposeCapability]]",tv()),iv(t),e});km&&mo(wt.prototype,km,wt.prototype.disposeAsync);zk(wt.prototype,"AsyncDisposableStack");var Zk=wt,Fk=Zk,Hk=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:Fk},Vk=Vi,Bk=Pf(),qk=Hk,jk=function(){var t=qk();return Vk(Bk,{AsyncDisposableStack:t},{AsyncDisposableStack:!0}),t},Wk=V8,Gk=J8,Yk=Ik,Kk=jk,Jk=function(){Wk(),Gk(),Yk(),Kk()};Jk();const Em=new WeakMap;function Xk(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function ns(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function $m(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function Qk(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class eE{constructor(){$(this,"entries",new Map);$(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw $m();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw $m();if(e.constructor.name==="AsyncFunction")throw Qk();this.storeFactory(t,e)}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.factory)!==void 0}resolve(t){return this.resolveAny(t)}storeFactory(t,e){const r=this.getOrCreateEntry(t);r.factory=e,r.instance=void 0,r.error=void 0}validateClassRegistration(t){const e=Em.get(t);if(e){if(t.length!==e.length)throw new Error(`${ns(t)} cannot be registered with register(Class). @injectable(...) declared ${e.length} dependencies but constructor arity is ${t.length}. Use register(Key, () => value) instead.`);return}if(t.length!==0)throw new Error(`${ns(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=Em.get(t);if(!e)return new t;const r=e.map(i=>this.resolveAny(i));return new t(...r)}resolveAny(t){return this.getOrCreateEntry(t).proxy}getOrCreateEntry(t){let e=this.entries.get(t);return e||(e={key:t},e.proxy=this.createProxy(e),this.entries.set(t,e),e)}createProxy(t){return new Proxy({},{get:(e,r)=>{if(r==="then")return;const i=this.getInstance(t),s=Reflect.get(i,r,i);return typeof s=="function"?s.bind(i):s},set:(e,r,i)=>{const s=this.getInstance(t);return Reflect.set(s,r,i,s)},has:(e,r)=>{const i=this.getInstance(t);return r in i}})}getInstance(t){if(t.instance)return t.instance;if(t.error)throw t.error;if(!t.factory)throw new Error(`${ns(t.key)} was resolved but never registered`);const e=this.constructionStack.indexOf(t.key);if(e!==-1){const r=[...this.constructionStack.slice(e),t.key].map(i=>ns(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if(Xk(r))throw new Error(`Factory for ${ns(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${ns(t.key)} returned a non-object value. Wrap primitives in an object.`);return t.instance=r,r}catch(r){throw t.error=r,r}finally{this.constructionStack.pop()}}}const sv=new eE,tE=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function nE(n){for(const t of Object.keys(n))if(tE.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function rE(n,t){nE(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Lt(){class n extends Event{constructor(e,r){const{type:i,bubbles:s,cancelable:o,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(e,{bubbles:s,cancelable:o,composed:l}),rE(this,c)}}return n}class Mr extends globalThis.EventTarget{}const iE="X-Television-Client-Meta",sE="telemetry-activity",oE="telemetry-signal",ov={kind:"single",full_screen:!1},av={width:560,height:740};function aE(n){return n.layout.flatMap(t=>t.artifactIds)}function lE(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const t=[];for(const[e,r]of n.entries())cE(r,e,t);return{valid:t.length===0,errors:t}}function ca(n){return n.flatMap(t=>t.artifactIds)}function ud(n,t){return n.flatMap(e=>{if(!e.artifactIds.includes(t))return[e];const r=e.artifactIds.filter(i=>i!==t);return r.length===0?[]:[{...e,artifactIds:r}]})}function cE(n,t,e){if(!Lh(n)){e.push(`Page ${t} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&e.push(`Page ${t} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?e.push(`Page ${t} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&e.push(`Page ${t} artifact ids must be non-empty strings`),!Lh(n.geometry)){e.push(`Page ${t} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&e.push(`Page ${t} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){e.push(`Page ${t} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&e.push(`Page ${t} single geometry must include a boolean full_screen`),!Lh(n.size)){e.push(`Page ${t} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&e.push(`Page ${t} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&e.push(`Page ${t} size ${r} must be a finite positive number`)}}function Lh(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const gt=Lt(),dc=Lt(),Cm=Lt(),uE=Lt(),hE=Lt();function lv(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const go=lv("RequestError"),Tm=lv("ValidationError"),dE=200,fE=300,Hl=401;class pE{constructor(t,e){$(this,"serverURL");$(this,"token");$(this,"onUnauthorized");$(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){var o;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),s=await mE(i);if(!i.ok||i.status<dE||i.status>=fE)throw i.status===Hl&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(typeof s.error=="string"?s.error:i.statusText,i.status);return s}async requestVoid(t,e,r){var s;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Hl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Oh(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===Hl&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Oh(r,r.statusText),r.status);return r.text()}async requestRawVoid(t,e,r){var s;const i=await this.request(t,e,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Hl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Oh(i,i.statusText),i.status)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new go(t,r)}async request(t,e,r,i){const s=`${this.serverURL}${e}`;try{return await fetch(s,{method:t,headers:this.buildHeaders(i),body:r})}catch(o){throw this.createError(o instanceof Error?o.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[iE]=JSON.stringify(this.telemetryMeta)),Object.keys(e).length>0?e:void 0}}async function mE(n){try{return await n.json()}catch{const t=await n.text().catch(()=>"");return t?{message:t}:{}}}async function Oh(n,t){try{const e=await n.json();if(typeof e.error=="string")return e.error;if(typeof e.message=="string")return e.message}catch{}return t}function gE(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var In,tu,cv;class vE{constructor(t){g(this,tu);g(this,In);d(this,In,t)}list(){return a(this,In).requestJSON("GET","/channels")}async get(t={}){const e=await h(this,tu,cv).call(this,t.channelID);return a(this,In).requestJSON("GET",`/channels/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),a(this,In).requestJSON("POST","/channels",e)}update(t){const{channelID:e,...r}=t;return a(this,In).requestJSON("PATCH",`/channels/${encodeURIComponent(e)}`,r)}remove(t){return a(this,In).requestJSON("DELETE",`/channels/${encodeURIComponent(t.channelID)}`)}}In=new WeakMap,tu=new WeakSet,cv=async function(t){if(t!==void 0)return t;const{channels:e}=await this.list();if(e.length===1)return e[0].id;throw e.length===0?new Tm("channelID is required, but no channels exist."):new Tm(`channelID is required when multiple channels exist. Available channels: ${gE(e)}`)};var xn;class yE{constructor(t){g(this,xn);d(this,xn,t)}create(t){const e={kind:t.kind,title:t.title};switch(t.kind){case"path":e.path=t.path;break;case"url":e.url=t.url;break}return e.channelID=t.channelID,a(this,xn).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.channelID!==void 0&&e.set("channelID",t.channelID);const r=e.toString();return a(this,xn).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return a(this,xn).requestJSON("GET",`/artifacts/${encodeURIComponent(t.artifactID)}`)}update(t){const e={};return t.title!==void 0&&(e.title=t.title),t.path!==void 0&&(e.path=t.path),t.url!==void 0&&(e.url=t.url),a(this,xn).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return a(this,xn).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}}xn=new WeakMap;var bs;class wE{constructor(t){g(this,bs);d(this,bs,t)}get(t){return a(this,bs).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return a(this,bs).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}bs=new WeakMap;var ei;class bE{constructor(t){g(this,ei);d(this,ei,t)}status(){return a(this,ei).requestJSON("GET","/telemetry")}enable(){return a(this,ei).requestJSON("POST","/telemetry/enable")}disable(){return a(this,ei).requestJSON("POST","/telemetry/disable")}}ei=new WeakMap;var ti;class _E{constructor(t){g(this,ti);d(this,ti,t)}get(){return a(this,ti).requestJSON("GET","/display")}patch(t){const e={};return t.focusedChannelId!==void 0&&(e.focusedChannelId=t.focusedChannelId),t.pinnedChannelIds!==void 0&&(e.pinnedChannelIds=t.pinnedChannelIds),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),a(this,ti).requestVoid("PATCH","/display",e)}focus(t){return a(this,ti).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}ti=new WeakMap;var Vt;class SE{constructor(t,e={}){$(this,"channels");$(this,"artifacts");$(this,"display");$(this,"markdown");$(this,"telemetry");g(this,Vt);d(this,Vt,new pE(t,e)),this.channels=new vE(a(this,Vt)),this.artifacts=new yE(a(this,Vt)),this.display=new _E(a(this,Vt)),this.markdown=new wE(a(this,Vt)),this.telemetry=new bE(a(this,Vt))}health(){return a(this,Vt).requestJSON("GET","/health")}}Vt=new WeakMap;const hd="0.0.0",AE=/^\d+\.\d+\.\d+$/,kE=3;function sp(n){return AE.test(n)}function uv(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<kE;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function EE(n,t){return n===hd||t===hd?!1:n!==t}const $E=400,CE=404,hv=500,TE=600,RE={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,acpEnabled:!1};var te,ga,va,Pn,Ae,ae,ni,ir,ri,Dn,tt,_s,ya,P,qr,dd,fd,dv,pd,fv,fc,md,pv,os,mv,$n,gd,gv,Ze;class IE extends Mr{constructor(e){super();g(this,P);g(this,te);g(this,ga);g(this,va);g(this,Pn,new Set);$(this,"pendingPageWrites",new Map);g(this,Ae,new Map);g(this,ae,DE());g(this,ni);g(this,ir,!1);g(this,ri,!1);g(this,Dn,0);g(this,tt,!1);g(this,_s,()=>{if(a(this,tt))return;const e=a(this,te).connection.status==="connected";e&&!a(this,ri)?(d(this,ri,!0),h(this,P,mv).call(this)):!e&&a(this,ri)&&(d(this,ri,!1),d(this,Dn,a(this,Dn)+1)),h(this,P,$n).call(this)});g(this,ya,e=>{if(a(this,tt)||e.serverURL!==a(this,te).connection.url)return;for(const i of a(this,Pn))i.push(e.event);const r=e.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new Cm("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){a(this,ir)&&Fc(a(this,ae),a(this,Ae),r.channelID,r.artifactID)&&h(this,P,$n).call(this),this.dispatchEvent(new uE("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new hE("theme-changed",{themeName:r.themeName})),a(this,ir)&&(Vl(a(this,ae),r,this.pendingPageWrites,a(this,Ae)),zh(a(this,ae),a(this,Ae)),h(this,P,$n).call(this))});d(this,te,e.connectionOwner),d(this,ga,e.navigationKeyHandler),d(this,va,e.retainedGateHalted??(()=>!1)),d(this,ni,h(this,P,gd).call(this)),a(this,te).addEventListener("change",a(this,_s)),a(this,te).addEventListener("server-event",a(this,ya)),a(this,_s).call(this)}get snapshot(){return a(this,ni)}handleNavigationKey(e){var r;h(this,P,Ze).call(this),(r=a(this,ga))==null||r.call(this,e)}authenticate(e){return h(this,P,Ze).call(this),a(this,te).authenticate(e)}async createChannel(e){h(this,P,Ze).call(this);const{channel:r}=await h(this,P,qr).call(this,a(this,te).connection.client.channels.create({name:e}),()=>h(this,P,dv).call(this));return r}focusChannel(e){return h(this,P,Ze).call(this),h(this,P,qr).call(this,a(this,te).connection.client.display.patch({focusedChannelId:e}),()=>h(this,P,fd).call(this))}setPinnedChannelIds(e){return h(this,P,Ze).call(this),h(this,P,qr).call(this,a(this,te).connection.client.display.patch({pinnedChannelIds:[...e]}),()=>h(this,P,fd).call(this))}selectPage(e,r){h(this,P,Ze).call(this),Fc(a(this,ae),a(this,Ae),e,r)&&h(this,P,$n).call(this)}async renameChannel(e,r){h(this,P,Ze).call(this),await h(this,P,qr).call(this,a(this,te).connection.client.channels.update({channelID:e,name:r}),()=>h(this,P,pd).call(this,e))}async deleteChannel(e){h(this,P,Ze).call(this),await h(this,P,qr).call(this,a(this,te).connection.client.channels.remove({channelID:e}),()=>h(this,P,fv).call(this,e))}updateChannelPages(e,r){h(this,P,Ze).call(this);const i=lE(r),s=a(this,ae).channels.get(e);if(!i.valid||!s)return Promise.resolve();const o=Jr(r),l=Jr(s.channel.layout),c={previousPages:l};return Ui(a(this,Ae),e,l,o),s.channel={...s.channel,layout:o},this.pendingPageWrites.set(e,c),h(this,P,$n).call(this),a(this,te).connection.client.channels.update({channelID:e,layout:Jr(o)}).then(()=>{this.pendingPageWrites.get(e)===c&&this.pendingPageWrites.delete(e)},async u=>{if(a(this,tt))throw u;const f=this.pendingPageWrites.get(e)===c;if(f&&this.pendingPageWrites.delete(e),Im(u))throw await h(this,P,dd).call(this,()=>h(this,P,pd).call(this,e)),u;if(!f||!ME(u))throw u;const m=a(this,ae).channels.get(e);if(!m)throw u;const v=Jr(c.previousPages);throw Ui(a(this,Ae),e,m.channel.layout,v),m.channel={...m.channel,layout:v},h(this,P,$n).call(this),u})}async deleteArtifact(e){h(this,P,Ze).call(this);const r=xm(a(this,ae),e);await h(this,P,qr).call(this,a(this,te).connection.client.artifacts.delete({artifactID:e}),()=>h(this,P,pv).call(this,e,r))}readMarkdown(e){return h(this,P,Ze).call(this),a(this,te).connection.client.markdown.get({artifactID:e})}writeMarkdown(e,r){return h(this,P,Ze).call(this),a(this,te).connection.client.markdown.update({artifactID:e,content:r})}getArtifactViewURL(e){return h(this,P,Ze).call(this),a(this,te).connection.getViewURL(e)}getArtifactContentURL(e){return h(this,P,Ze).call(this),a(this,te).connection.getContentURL(e)}dispose(){a(this,tt)||(d(this,tt,!0),d(this,Dn,a(this,Dn)+1),a(this,Pn).clear(),this.pendingPageWrites.clear(),a(this,Ae).clear(),a(this,te).removeEventListener("change",a(this,_s)),a(this,te).removeEventListener("server-event",a(this,ya)))}}te=new WeakMap,ga=new WeakMap,va=new WeakMap,Pn=new WeakMap,Ae=new WeakMap,ae=new WeakMap,ni=new WeakMap,ir=new WeakMap,ri=new WeakMap,Dn=new WeakMap,tt=new WeakMap,_s=new WeakMap,ya=new WeakMap,P=new WeakSet,qr=async function(e,r){try{return await e}catch(i){throw!a(this,tt)&&Im(i)&&await h(this,P,dd).call(this,r),i}},dd=async function(e){try{await e()}catch{}},fd=function(){const e=a(this,te).connection.client;return h(this,P,os).call(this,()=>e.display.get(),r=>h(this,P,fc).call(this,r))},dv=function(){const e=a(this,te).connection.client;return h(this,P,os).call(this,async()=>{const[{channels:r},i]=await Promise.all([e.channels.list(),e.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const s=new Set(r.map(({id:o})=>o));for(const o of a(this,ae).channels.keys())s.has(o)||(this.pendingPageWrites.delete(o),a(this,Ae).delete(o),a(this,ae).channels.delete(o));for(const o of r)a(this,ae).channels.has(o.id)||a(this,ae).channels.set(o.id,{channel:ys(o),artifacts:new Map});h(this,P,fc).call(this,i)})},pd=function(e){const r=a(this,te).connection.client;return h(this,P,os).call(this,()=>Nh(()=>r.channels.get({channelID:e})),i=>h(this,P,md).call(this,e,i))},fv=function(e){const r=a(this,te).connection.client;return h(this,P,os).call(this,async()=>{const[i,s]=await Promise.all([Nh(()=>r.channels.get({channelID:e})),r.display.get()]);return{detail:i,display:s}},({detail:i,display:s})=>{h(this,P,md).call(this,e,i),h(this,P,fc).call(this,s)})},fc=function(e){a(this,ae).display=yd(e),a(this,te).connection.acpClient.setEnabled(e.acpEnabled)},md=function(e,r){this.pendingPageWrites.delete(e);const i=a(this,ae).channels.get(e);if(r===null){a(this,Ae).delete(e),a(this,ae).channels.delete(e);return}Ui(a(this,Ae),e,(i==null?void 0:i.channel.layout)??[],r.channel.layout),a(this,ae).channels.set(e,{channel:ys(r.channel),artifacts:new Map(r.artifacts.map(s=>[s.id,structuredClone(s)]))})},pv=function(e,r){const i=a(this,te).connection.client;return h(this,P,os).call(this,()=>Nh(()=>i.artifacts.get({artifactID:e})),s=>{const o=xm(a(this,ae),e)??r;if(s===null){o!==null&&Vl(a(this,ae),{type:"artifact-removed",channelID:o,artifactID:e},this.pendingPageWrites,a(this,Ae));return}const l=o===null?void 0:a(this,ae).channels.get(o);l==null||l.artifacts.set(e,structuredClone(s.artifact))})},os=async function(e,r){const i=a(this,Dn),s=[];a(this,Pn).add(s);try{const o=await e();if(a(this,tt)||i!==a(this,Dn))return;r(o);for(const l of s)Vl(a(this,ae),l,this.pendingPageWrites,a(this,Ae));zh(a(this,ae),a(this,Ae)),h(this,P,$n).call(this)}finally{a(this,Pn).delete(s)}},mv=async function(){const e=++sh(this,Dn)._,r=a(this,te).connection,i=r.client,s=[];a(this,Pn).add(s);try{const[{channels:o},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(o.map(({id:m})=>i.channels.get({channelID:m})));if(a(this,tt)||e!==a(this,Dn))return;const u={channels:new Map,display:yd(l)};for(const m of c)u.channels.set(m.channel.id,{channel:ys(m.channel),artifacts:new Map(m.artifacts.map(v=>[v.id,structuredClone(v)]))});LE(a(this,Ae),a(this,ae),u);for(const m of s)Vl(u,m,this.pendingPageWrites,a(this,Ae));zh(u,a(this,Ae));const f=a(this,ir)?xE(a(this,ae),u):[];this.pendingPageWrites.clear(),d(this,ae,u),d(this,ir,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,P,$n).call(this);for(const m of f)this.dispatchEvent(new Cm("artifact-content-changed",{artifactID:m}))}catch{}finally{a(this,Pn).delete(s)}},$n=function(){a(this,tt)||(d(this,ni,h(this,P,gd).call(this)),h(this,P,gv).call(this),this.dispatchEvent(new gt("change")))},gd=function(){var s;const e=[...a(this,ae).channels.values()].map(o=>zE(o,a(this,Ae).get(o.channel.id))),r=e.find(({id:o})=>o===a(this,ae).display.focusedChannelId)??null,i=a(this,te).connection;return Object.freeze({ready:a(this,ir),channels:Object.freeze(e),display:NE(a(this,ae).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||a(this,va).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:a(this,te).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:PE(((s=i.updateState)==null?void 0:s.desktop)??null)})})},gv=function(){const e=a(this,ni).focusedChannel;a(this,te).connection.acpClient.setChannelContext(e?{channelID:e.id,channelName:e.name}:null)},Ze=function(){if(a(this,tt))throw new Error("ApplicationService is disposed")};function xE(n,t){const e=t.display.focusedChannelId;if(e===null||n.display.focusedChannelId!==e)return[];const r=n.channels.get(e),i=t.channels.get(e);if(!r||!i)return[];const s=new Set(ca(r.channel.layout));return ca(i.channel.layout).filter(o=>{var l,c;return s.has(o)&&((l=r.artifacts.get(o))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(o))==null?void 0:c.kind)==="path"})}function PE(n){return n===null?null:Object.freeze({...n})}function DE(){return{channels:new Map,display:yd(RE)}}function Vl(n,t,e,r){switch(t.type){case"channel-created":r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ys(t.channel),artifacts:new Map});return;case"channel-updated":{e.delete(t.channel.id);const i=n.channels.get(t.channel.id);if(!i){r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ys(t.channel),artifacts:new Map});return}Ui(r,t.channel.id,i.channel.layout,t.channel.layout);const s=new Set(ca(t.channel.layout));i.channel=ys(t.channel);for(const o of i.artifacts.keys())s.has(o)||i.artifacts.delete(o);return}case"channel-removed":e.delete(t.channelID),r.delete(t.channelID),n.channels.delete(t.channelID);return;case"channel-changed":n.display.focusedChannelId=t.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...t.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=t.themeName;return;case"artifact-created":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);if(s&&(s.previousPages=Rm(s.previousPages,t.artifact.id)),!ca(i.channel.layout).includes(t.artifact.id)){const o=i.channel.layout,l=Rm(o,t.artifact.id);Ui(r,t.channelID,o,l),i.channel={...i.channel,layout:l}}i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(t.artifact.id)){i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}return;case"artifact-removed":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);s&&(s.previousPages=ud(s.previousPages,t.artifactID)),i.artifacts.delete(t.artifactID);const o=i.channel.layout,l=ud(o,t.artifactID);Ui(r,t.channelID,o,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Fc(n,r,t.channelID,t.artifactID);return;case"artifact-content-changed":return;default:return UE(t)}}function LE(n,t,e){var r;for(const i of n.keys())e.channels.has(i)||n.delete(i);for(const[i,s]of e.channels)Ui(n,i,((r=t.channels.get(i))==null?void 0:r.channel.layout)??[],s.channel.layout)}function Ui(n,t,e,r){const i=n.get(t);if(i===void 0)return;if(r.length===0){n.delete(t);return}const s=vd(r,i);if(s!==-1){n.set(t,[...r[s].artifactIds]);return}const o=vd(e,i),l=o===-1?0:Math.min(o,r.length-1);n.set(t,[...r[l].artifactIds])}function Fc(n,t,e,r){const i=n.channels.get(e),s=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!s)return!1;const o=t.get(e);return o&&OE(o,s.artifactIds)?!1:(t.set(e,[...s.artifactIds]),!0)}function zh(n,t){var i,s;const e=n.display.focusedChannelId;if(e===null||t.has(e))return;const r=(s=(i=n.channels.get(e))==null?void 0:i.channel.layout[0])==null?void 0:s.artifactIds[0];r!==void 0&&Fc(n,t,e,r)}function vd(n,t){const e=new Set(t);return n.findIndex(r=>r.artifactIds.some(i=>e.has(i)))}function OE(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function zE(n,t){const e=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=t===void 0?0:vd(n.channel.layout,t),i=e[r]??e[0]??null,s=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),o={id:n.channel.id,name:n.channel.name,pages:e,selectedPage:i,artifacts:s};return Object.freeze(n.channel.onboarding?{...o,onboarding:Object.freeze({...n.channel.onboarding})}:o)}function NE(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled})}function Rm(n,t){return ca(n).includes(t)?Jr(n):[...Jr(n),{artifactIds:[t],geometry:{...ov},size:{...av}}]}function ME(n){return n instanceof go&&n.status!==void 0&&n.status>=$E&&n.status<hv}function Im(n){return n instanceof go&&(n.status===void 0||n.status>=hv&&n.status<TE)}async function Nh(n){try{return await n()}catch(t){if(t instanceof go&&t.status===CE)return null;throw t}}function xm(n,t){for(const[e,r]of n.channels)if(r.artifacts.has(t))return e;return null}function Jr(n){return n.map(t=>({artifactIds:[...t.artifactIds],geometry:{...t.geometry},size:{...t.size}}))}function ys(n){return{id:n.id,name:n.name,layout:Jr(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function yd(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,acpEnabled:n.acpEnabled}}function UE(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function ZE(n,t){var c;const e=n.snapshot,r=e.focusedChannel;if(t==="ArrowLeft"||t==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),f=u+(t==="ArrowLeft"?-1:1),m=(c=r.pages[f])==null?void 0:c.artifactIds[0];return u===-1||m===void 0?!1:(Pm(),n.selectPage(r.id,m),!0)}const i=FE(e),s=r===null?-1:i.indexOf(r.id),o=s+(t==="ArrowUp"?-1:1),l=i[o];return s===-1||l===void 0?!1:(Pm(),n.focusChannel(l).catch(()=>{}),!0)}function FE(n){const t=new Map(n.channels.map(s=>[s.id,s])),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return[...e,...i]}function Pm(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const vv="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Hc=32,HE=16,yv=10,Dm=0xffffffffffff;var Xr;(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"})(Xr||(Xr={}));class No extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function VE(n){const t=Math.floor(n()*Hc)%Hc;return vv.charAt(t)}function BE(n){const t=qE(),e=t&&(t.crypto||t.msCrypto)||null;if(typeof(e==null?void 0:e.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]/256};if(typeof(e==null?void 0:e.randomBytes)=="function")return()=>e.randomBytes(1).readUInt8()/256;throw new No(Xr.PRNGDetectFailure,"Failed to find a reliable PRNG")}function qE(){return GE()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function jE(n,t){let e="";for(;n>0;n--)e=VE(t)+e;return e}function WE(n,t=yv){if(isNaN(n))throw new No(Xr.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>Dm)throw new No(Xr.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Dm}: ${n}`);if(n<0)throw new No(Xr.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new No(Xr.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%Hc,r=vv.charAt(e)+r,n=(n-e)/Hc;return r}function GE(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function op(n,t){const e=BE(),r=Date.now();return WE(r,yv)+jE(HE,e)}const Mo=Lt(),wv=Lt(),bv=Lt(),YE=Lt(),Mh=Lt(),KE="store-";function xr(n){return new URL(n).origin}function JE(){return{authTokens:{}}}var ii,si,oi;class XE extends Mr{constructor(e,r,i={}){super();g(this,ii);g(this,si);g(this,oi);d(this,ii,`${KE}${e}`),d(this,si,i.storage??e4());const s=a(this,si).getItem(a(this,ii));s===null?(d(this,oi,r),a(this,si).setItem(a(this,ii),JSON.stringify(r))):d(this,oi,t4(JSON.parse(s),r))}get(){return a(this,oi)}set(e){d(this,oi,e),a(this,si).setItem(a(this,ii),JSON.stringify(e)),this.dispatchEvent(new gt("change"))}}ii=new WeakMap,si=new WeakMap,oi=new WeakMap;function Lm(n,t){return n.authTokens[xr(t)]??null}function Om(n,t,e){return{authTokens:{...n.authTokens,[xr(t)]:e}}}function QE(n,t){const e=xr(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{authTokens:r}}function e4(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function t4(n,t){if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n.authTokens;if(typeof e!="object"||e===null||Array.isArray(e))return t;const r={};for(const[i,s]of Object.entries(e))if(typeof s=="string")try{r[xr(i)]=s}catch{}return{authTokens:r}}function E(n,t,e){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),t(l,c);const u=o.prototype,f=Object.keys(u);for(let m=0;m<f.length;m++){const v=f[m];v in l||(l[v]=u[v].bind(l))}}const i=(e==null?void 0:e.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function o(l){var c;const u=e!=null&&e.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var c,u;return e!=null&&e.Parent&&l instanceof e.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(o,"name",{value:n}),o}class ws extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _v extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Sv={};function Pr(n){return Sv}function Av(n){const t=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function wd(n,t){return typeof t=="bigint"?t.toString():t}function Ru(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function ap(n){return n==null}function lp(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function n4(n,t){const e=(n.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=e>i?e:i,o=Number.parseInt(n.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return o%l/10**s}const zm=Symbol("evaluating");function se(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==zm)return r===void 0&&(r=zm,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function qi(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function Ur(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function Nm(n){return JSON.stringify(n)}function r4(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const kv="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function ua(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const i4=Ru(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function ro(n){if(ua(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(ua(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function Ev(n){return ro(n)?{...n}:Array.isArray(n)?[...n]:n}const s4=new Set(["string","number","symbol"]);function io(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zr(n,t,e){const r=new n._zod.constr(t??n._zod.def);return(!t||e!=null&&e.parent)&&(r._zod.parent=n),r}function N(n){const t=n;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function o4(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const a4={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 l4(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Ur(n._zod.def,{get shape(){const o={};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(o[l]=e.shape[l])}return qi(this,"shape",o),o},checks:[]});return Zr(n,s)}function c4(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Ur(n._zod.def,{get shape(){const o={...n._zod.def.shape};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete o[l]}return qi(this,"shape",o),o},checks:[]});return Zr(n,s)}function u4(n,t){if(!ro(t))throw new Error("Invalid input to extend: expected a plain object");const e=n._zod.def.checks;if(e&&e.length>0){const s=n._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ur(n._zod.def,{get shape(){const s={...n._zod.def.shape,...t};return qi(this,"shape",s),s}});return Zr(n,i)}function h4(n,t){if(!ro(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=Ur(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return qi(this,"shape",r),r}});return Zr(n,e)}function d4(n,t){const e=Ur(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return qi(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Zr(n,e)}function f4(n,t,e){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Ur(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(e)for(const u in e){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return qi(this,"shape",c),c},checks:[]});return Zr(t,o)}function p4(n,t,e){const r=Ur(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(e)for(const o in e){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(s[o]=new n({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new n({type:"nonoptional",innerType:i[o]});return qi(this,"shape",s),s}});return Zr(t,r)}function ps(n,t=0){var e;if(n.aborted===!0)return!0;for(let r=t;r<n.issues.length;r++)if(((e=n.issues[r])==null?void 0:e.continue)!==!0)return!0;return!1}function ms(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function Bl(n){return typeof n=="string"?n:n==null?void 0:n.message}function Dr(n,t,e){var i,s,o,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const f=Bl((o=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,n))??Bl((l=t==null?void 0:t.error)==null?void 0:l.call(t,n))??Bl((c=e.customError)==null?void 0:c.call(e,n))??Bl((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function cp(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function ha(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const $v=(n,t)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:t,enumerable:!1}),n.message=JSON.stringify(t,wd,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Cv=E("$ZodError",$v),Tv=E("$ZodError",$v,{Parent:Error});function m4(n,t=e=>e.message){const e={},r=[];for(const i of n.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}function g4(n,t=e=>e.message){const e={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)e._errors.push(t(s));else{let o=e,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return r(n),e}const up=n=>(t,e,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:e,issues:[]},s);if(o instanceof Promise)throw new ws;if(o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>Dr(c,s,Pr())));throw kv(l,i==null?void 0:i.callee),l}return o.value},hp=n=>async(t,e,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:e,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>Dr(c,s,Pr())));throw kv(l,i==null?void 0:i.callee),l}return o.value},Iu=n=>(t,e,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:e,issues:[]},i);if(s instanceof Promise)throw new ws;return s.issues.length?{success:!1,error:new(n??Cv)(s.issues.map(o=>Dr(o,i,Pr())))}:{success:!0,data:s.value}},v4=Iu(Tv),xu=n=>async(t,e,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:e,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new n(s.issues.map(o=>Dr(o,i,Pr())))}:{success:!0,data:s.value}},y4=xu(Tv),w4=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return up(n)(t,e,i)},b4=n=>(t,e,r)=>up(n)(t,e,r),_4=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hp(n)(t,e,i)},S4=n=>async(t,e,r)=>hp(n)(t,e,r),A4=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Iu(n)(t,e,i)},k4=n=>(t,e,r)=>Iu(n)(t,e,r),E4=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xu(n)(t,e,i)},$4=n=>async(t,e,r)=>xu(n)(t,e,r),C4=/^[cC][^\s-]{8,}$/,T4=/^[0-9a-z]+$/,R4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,I4=/^[0-9a-vA-V]{20}$/,x4=/^[A-Za-z0-9]{27}$/,P4=/^[a-zA-Z0-9_-]{21}$/,D4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,L4=/^([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})$/,Mm=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)$/,O4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,z4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function N4(){return new RegExp(z4,"u")}const M4=/^(?:(?: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])$/,U4=/^(([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}|:))$/,Z4=/^((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])$/,F4=/^(([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])$/,H4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rv=/^[A-Za-z0-9_-]*$/,V4=/^\+[1-9]\d{6,14}$/,Iv="(?:(?:\\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])))",B4=new RegExp(`^${Iv}$`);function xv(n){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${t}`:n.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${n.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function q4(n){return new RegExp(`^${xv(n)}$`)}function j4(n){const t=xv({precision:n.precision}),e=["Z"];n.local&&e.push(""),n.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${e.join("|")})`;return new RegExp(`^${Iv}T(?:${r})$`)}const W4=n=>{const t=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},G4=/^-?\d+$/,Pv=/^-?\d+(?:\.\d+)?$/,Y4=/^(?:true|false)$/i,K4=/^[^A-Z]*$/,J4=/^[^a-z]*$/,Qe=E("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),Dv={number:"number",bigint:"bigint",object:"date"},Lv=E("$ZodCheckLessThan",(n,t)=>{Qe.init(n,t);const e=Dv[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:e,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),Ov=E("$ZodCheckGreaterThan",(n,t)=>{Qe.init(n,t);const e=Dv[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:e,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),X4=E("$ZodCheckMultipleOf",(n,t)=>{Qe.init(n,t),n._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),n._zod.check=e=>{if(typeof e.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof e.value=="bigint"?e.value%t.value===BigInt(0):n4(e.value,t.value)===0)||e.issues.push({origin:typeof e.value,code:"not_multiple_of",divisor:t.value,input:e.value,inst:n,continue:!t.abort})}}),Q4=E("$ZodCheckNumberFormat",(n,t)=>{var o;Qe.init(n,t),t.format=t.format||"float64";const e=(o=t.format)==null?void 0:o.includes("int"),r=e?"int":"number",[i,s]=a4[t.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,e&&(c.pattern=G4)}),n._zod.check=l=>{const c=l.value;if(e){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!t.abort})}}),e$=E("$ZodCheckMaxLength",(n,t)=>{var e;Qe.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!ap(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=cp(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),t$=E("$ZodCheckMinLength",(n,t)=>{var e;Qe.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!ap(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=cp(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),n$=E("$ZodCheckLengthEquals",(n,t)=>{var e;Qe.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!ap(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),n._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=cp(i),l=s>t.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),Pu=E("$ZodCheckStringFormat",(n,t)=>{var e,r;Qe.init(n,t),n._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(e=n._zod).check??(e.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:n,continue:!t.abort})}):(r=n._zod).check??(r.check=()=>{})}),r$=E("$ZodCheckRegex",(n,t)=>{Pu.init(n,t),n._zod.check=e=>{t.pattern.lastIndex=0,!t.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:"regex",input:e.value,pattern:t.pattern.toString(),inst:n,continue:!t.abort})}}),i$=E("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=K4),Pu.init(n,t)}),s$=E("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=J4),Pu.init(n,t)}),o$=E("$ZodCheckIncludes",(n,t)=>{Qe.init(n,t);const e=io(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${e}`:e);t.pattern=r,n._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),n._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:n,continue:!t.abort})}}),a$=E("$ZodCheckStartsWith",(n,t)=>{Qe.init(n,t);const e=new RegExp(`^${io(t.prefix)}.*`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:n,continue:!t.abort})}}),l$=E("$ZodCheckEndsWith",(n,t)=>{Qe.init(n,t);const e=new RegExp(`.*${io(t.suffix)}$`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:n,continue:!t.abort})}}),c$=E("$ZodCheckOverwrite",(n,t)=>{Qe.init(n,t),n._zod.check=e=>{e.value=t.tx(e.value)}});class u${constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
5
|
-
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,e=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...e,i.join(`
|
|
6
|
-
`))}}const h$={major:4,minor:3,patch:6},ge=E("$ZodType",(n,t)=>{var i;var e;n??(n={}),n._zod.def=t,n._zod.bag=n._zod.bag||{},n._zod.version=h$;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const s of r)for(const o of s._zod.onattach)o(n);if(r.length===0)(e=n._zod).deferred??(e.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const s=(l,c,u)=>{let f=ps(l),m;for(const v of c){if(v._zod.def.when){if(!v._zod.def.when(l))continue}else if(f)continue;const y=l.issues.length,k=v._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new ws;if(m||k instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await k,l.issues.length!==y&&(f||(f=ps(l,y)))});else{if(l.issues.length===y)continue;f||(f=ps(l,y))}}return m?m.then(()=>l):l},o=(l,c,u)=>{if(ps(l))return l.aborted=!0,l;const f=s(c,r,u);if(f instanceof Promise){if(u.async===!1)throw new ws;return f.then(m=>n._zod.parse(m,u))}return n._zod.parse(f,u)};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(m=>o(m,l,c)):o(f,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new ws;return u.then(f=>s(f,r,c))}return s(u,r,c)}}se(n,"~standard",()=>({validate:s=>{var o;try{const l=v4(n,s);return l.success?{value:l.data}:{issues:(o=l.error)==null?void 0:o.issues}}catch{return y4(n,s).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),dp=E("$ZodString",(n,t)=>{var e;ge.init(n,t),n._zod.pattern=[...((e=n==null?void 0:n._zod.bag)==null?void 0:e.patterns)??[]].pop()??W4(n._zod.bag),n._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),pe=E("$ZodStringFormat",(n,t)=>{Pu.init(n,t),dp.init(n,t)}),d$=E("$ZodGUID",(n,t)=>{t.pattern??(t.pattern=L4),pe.init(n,t)}),f$=E("$ZodUUID",(n,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Mm(r))}else t.pattern??(t.pattern=Mm());pe.init(n,t)}),p$=E("$ZodEmail",(n,t)=>{t.pattern??(t.pattern=O4),pe.init(n,t)}),m$=E("$ZodURL",(n,t)=>{pe.init(n,t),n._zod.check=e=>{try{const r=e.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:e.value,inst:n,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:e.value,inst:n,continue:!t.abort})),t.normalize?e.value=i.href:e.value=r;return}catch{e.issues.push({code:"invalid_format",format:"url",input:e.value,inst:n,continue:!t.abort})}}}),g$=E("$ZodEmoji",(n,t)=>{t.pattern??(t.pattern=N4()),pe.init(n,t)}),v$=E("$ZodNanoID",(n,t)=>{t.pattern??(t.pattern=P4),pe.init(n,t)}),y$=E("$ZodCUID",(n,t)=>{t.pattern??(t.pattern=C4),pe.init(n,t)}),w$=E("$ZodCUID2",(n,t)=>{t.pattern??(t.pattern=T4),pe.init(n,t)}),b$=E("$ZodULID",(n,t)=>{t.pattern??(t.pattern=R4),pe.init(n,t)}),_$=E("$ZodXID",(n,t)=>{t.pattern??(t.pattern=I4),pe.init(n,t)}),S$=E("$ZodKSUID",(n,t)=>{t.pattern??(t.pattern=x4),pe.init(n,t)}),A$=E("$ZodISODateTime",(n,t)=>{t.pattern??(t.pattern=j4(t)),pe.init(n,t)}),k$=E("$ZodISODate",(n,t)=>{t.pattern??(t.pattern=B4),pe.init(n,t)}),E$=E("$ZodISOTime",(n,t)=>{t.pattern??(t.pattern=q4(t)),pe.init(n,t)}),$$=E("$ZodISODuration",(n,t)=>{t.pattern??(t.pattern=D4),pe.init(n,t)}),C$=E("$ZodIPv4",(n,t)=>{t.pattern??(t.pattern=M4),pe.init(n,t),n._zod.bag.format="ipv4"}),T$=E("$ZodIPv6",(n,t)=>{t.pattern??(t.pattern=U4),pe.init(n,t),n._zod.bag.format="ipv6",n._zod.check=e=>{try{new URL(`http://[${e.value}]`)}catch{e.issues.push({code:"invalid_format",format:"ipv6",input:e.value,inst:n,continue:!t.abort})}}}),R$=E("$ZodCIDRv4",(n,t)=>{t.pattern??(t.pattern=Z4),pe.init(n,t)}),I$=E("$ZodCIDRv6",(n,t)=>{t.pattern??(t.pattern=F4),pe.init(n,t),n._zod.check=e=>{const r=e.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{e.issues.push({code:"invalid_format",format:"cidrv6",input:e.value,inst:n,continue:!t.abort})}}});function zv(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const x$=E("$ZodBase64",(n,t)=>{t.pattern??(t.pattern=H4),pe.init(n,t),n._zod.bag.contentEncoding="base64",n._zod.check=e=>{zv(e.value)||e.issues.push({code:"invalid_format",format:"base64",input:e.value,inst:n,continue:!t.abort})}});function P$(n){if(!Rv.test(n))return!1;const t=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),e=t.padEnd(Math.ceil(t.length/4)*4,"=");return zv(e)}const D$=E("$ZodBase64URL",(n,t)=>{t.pattern??(t.pattern=Rv),pe.init(n,t),n._zod.bag.contentEncoding="base64url",n._zod.check=e=>{P$(e.value)||e.issues.push({code:"invalid_format",format:"base64url",input:e.value,inst:n,continue:!t.abort})}}),L$=E("$ZodE164",(n,t)=>{t.pattern??(t.pattern=V4),pe.init(n,t)});function O$(n,t=null){try{const e=n.split(".");if(e.length!==3)return!1;const[r]=e;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const z$=E("$ZodJWT",(n,t)=>{pe.init(n,t),n._zod.check=e=>{O$(e.value,t.alg)||e.issues.push({code:"invalid_format",format:"jwt",input:e.value,inst:n,continue:!t.abort})}}),Nv=E("$ZodNumber",(n,t)=>{ge.init(n,t),n._zod.pattern=n._zod.bag.pattern??Pv,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=Number(e.value)}catch{}const i=e.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return e;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return e.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...s?{received:s}:{}}),e}}),N$=E("$ZodNumberFormat",(n,t)=>{Q4.init(n,t),Nv.init(n,t)}),M$=E("$ZodBoolean",(n,t)=>{ge.init(n,t),n._zod.pattern=Y4,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=!!e.value}catch{}const i=e.value;return typeof i=="boolean"||e.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),e}}),U$=E("$ZodUnknown",(n,t)=>{ge.init(n,t),n._zod.parse=e=>e}),Z$=E("$ZodNever",(n,t)=>{ge.init(n,t),n._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:n}),e)});function Um(n,t,e){n.issues.length&&t.issues.push(...ms(e,n.issues)),t.value[e]=n.value}const F$=E("$ZodArray",(n,t)=>{ge.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Array.isArray(i))return e.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),e;e.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const l=i[o],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(u=>Um(u,e,o))):Um(c,e,o)}return s.length?Promise.all(s).then(()=>e):e}});function Vc(n,t,e,r,i){if(n.issues.length){if(i&&!(e in r))return;t.issues.push(...ms(e,n.issues))}n.value===void 0?e in r&&(t.value[e]=void 0):t.value[e]=n.value}function Mv(n){var r,i,s,o;const t=Object.keys(n.shape);for(const l of t)if(!((o=(s=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const e=o4(n.shape);return{...n,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(e)}}function Uv(n,t,e,r,i,s){const o=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,f=c.optout==="optional";for(const m in t){if(l.has(m))continue;if(u==="never"){o.push(m);continue}const v=c.run({value:t[m],issues:[]},r);v instanceof Promise?n.push(v.then(y=>Vc(y,e,m,t,f))):Vc(v,e,m,t,f)}return o.length&&e.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),n.length?Promise.all(n).then(()=>e):e}const H$=E("$ZodObject",(n,t)=>{ge.init(n,t);const e=Object.getOwnPropertyDescriptor(t,"shape");if(!(e!=null&&e.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Ru(()=>Mv(t));se(n._zod,"propValues",()=>{const l=t.shape,c={};for(const u in l){const f=l[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const m of f.values)c[u].add(m)}}return c});const i=ua,s=t.catchall;let o;n._zod.parse=(l,c)=>{o??(o=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const f=[],m=o.shape;for(const v of o.keys){const y=m[v],k=y._zod.optout==="optional",S=y._zod.run({value:u[v],issues:[]},c);S instanceof Promise?f.push(S.then(x=>Vc(x,l,v,u,k))):Vc(S,l,v,u,k)}return s?Uv(f,u,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),V$=E("$ZodObjectJIT",(n,t)=>{H$.init(n,t);const e=n._zod.parse,r=Ru(()=>Mv(t)),i=v=>{var G;const y=new u$(["shape","payload","ctx"]),k=r.value,S=F=>{const W=Nm(F);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`};y.write("const input = payload.value;");const x=Object.create(null);let M=0;for(const F of k.keys)x[F]=`key_${M++}`;y.write("const newResult = {};");for(const F of k.keys){const W=x[F],Q=Nm(F),ee=v[F],oe=((G=ee==null?void 0:ee._zod)==null?void 0:G.optout)==="optional";y.write(`const ${W} = ${S(F)};`),oe?y.write(`
|
|
7
|
-
if (${W}.issues.length) {
|
|
8
|
-
if (${Q} in input) {
|
|
9
|
-
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
|
|
10
|
-
...iss,
|
|
11
|
-
path: iss.path ? [${Q}, ...iss.path] : [${Q}]
|
|
12
|
-
})));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (${W}.value === undefined) {
|
|
17
|
-
if (${Q} in input) {
|
|
18
|
-
newResult[${Q}] = undefined;
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
newResult[${Q}] = ${W}.value;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
`):y.write(`
|
|
25
|
-
if (${W}.issues.length) {
|
|
26
|
-
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
|
|
27
|
-
...iss,
|
|
28
|
-
path: iss.path ? [${Q}, ...iss.path] : [${Q}]
|
|
29
|
-
})));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (${W}.value === undefined) {
|
|
33
|
-
if (${Q} in input) {
|
|
34
|
-
newResult[${Q}] = undefined;
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
newResult[${Q}] = ${W}.value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");const Z=y.compile();return(F,W)=>Z(v,F,W)};let s;const o=ua,l=!Sv.jitless,u=l&&i4.value,f=t.catchall;let m;n._zod.parse=(v,y)=>{m??(m=r.value);const k=v.value;return o(k)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),f?Uv([],k,v,y,m,n):v):e(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:k,inst:n}),v)}});function Zm(n,t,e,r){for(const s of n)if(s.issues.length===0)return t.value=s.value,t;const i=n.filter(s=>!ps(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:e,errors:n.map(s=>s.issues.map(o=>Dr(o,r,Pr())))}),t)}const Zv=E("$ZodUnion",(n,t)=>{ge.init(n,t),se(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),se(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),se(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),se(n._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>lp(s.source)).join("|")})$`)}});const e=t.options.length===1,r=t.options[0]._zod.run;n._zod.parse=(i,s)=>{if(e)return r(i,s);let o=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)l.push(u),o=!0;else{if(u.issues.length===0)return u;l.push(u)}}return o?Promise.all(l).then(c=>Zm(c,i,n,s)):Zm(l,i,n,s)}}),B$=E("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,Zv.init(n,t);const e=n._zod.parse;se(n._zod,"propValues",()=>{const i={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(o)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Ru(()=>{var o;const i=t.options,s=new Map;for(const l of i){const c=(o=l._zod.propValues)==null?void 0:o[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,l)}}return s});n._zod.parse=(i,s)=>{const o=i.value;if(!ua(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:n}),i;const l=r.value.get(o==null?void 0:o[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback?e(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:n}),i)}}),q$=E("$ZodIntersection",(n,t)=>{ge.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,u])=>Fm(e,c,u)):Fm(e,s,o)}});function bd(n,t){if(n===t)return{valid:!0,data:n};if(n instanceof Date&&t instanceof Date&&+n==+t)return{valid:!0,data:n};if(ro(n)&&ro(t)){const e=Object.keys(t),r=Object.keys(n).filter(s=>e.indexOf(s)!==-1),i={...n,...t};for(const s of r){const o=bd(n[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return{valid:!1,mergeErrorPath:[]};const e=[];for(let r=0;r<n.length;r++){const i=n[r],s=t[r],o=bd(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};e.push(o.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function Fm(n,t,e){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of e.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&n.issues.push({...i,keys:s}),ps(n))return n;const o=bd(t.value,e.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return n.value=o.data,n}const j$=E("$ZodRecord",(n,t)=>{ge.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!ro(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const s=[],o=t.keyType._zod.values;if(o){e.value={};const l=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const f=t.valueType._zod.run({value:i[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&e.issues.push(...ms(u,m.issues)),e.value[u]=m.value})):(f.issues.length&&e.issues.push(...ms(u,f.issues)),e.value[u]=f.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&e.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{e.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Pv.test(l)&&c.issues.length){const m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(c=m)}if(c.issues.length){t.mode==="loose"?e.value[l]=i[l]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(m=>Dr(m,r,Pr())),input:l,path:[l],inst:n});continue}const f=t.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&e.issues.push(...ms(l,m.issues)),e.value[c.value]=m.value})):(f.issues.length&&e.issues.push(...ms(l,f.issues)),e.value[c.value]=f.value)}}return s.length?Promise.all(s).then(()=>e):e}}),W$=E("$ZodEnum",(n,t)=>{ge.init(n,t);const e=Av(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>s4.has(typeof i)).map(i=>typeof i=="string"?io(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e,input:o,inst:n}),i}}),G$=E("$ZodLiteral",(n,t)=>{if(ge.init(n,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const e=new Set(t.values);n._zod.values=e,n._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?io(r):r?io(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const s=r.value;return e.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:n}),r}}),Y$=E("$ZodTransform",(n,t)=>{ge.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new _v(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(e.value=o,e));if(i instanceof Promise)throw new ws;return e.value=i,e}});function Hm(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const Fv=E("$ZodOptional",(n,t)=>{ge.init(n,t),n._zod.optin="optional",n._zod.optout="optional",se(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),se(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${lp(e.source)})?$`):void 0}),n._zod.parse=(e,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>Hm(s,e.value)):Hm(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),K$=E("$ZodExactOptional",(n,t)=>{Fv.init(n,t),se(n._zod,"values",()=>t.innerType._zod.values),se(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),J$=E("$ZodNullable",(n,t)=>{ge.init(n,t),se(n._zod,"optin",()=>t.innerType._zod.optin),se(n._zod,"optout",()=>t.innerType._zod.optout),se(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${lp(e.source)}|null)$`):void 0}),se(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),n._zod.parse=(e,r)=>e.value===null?e:t.innerType._zod.run(e,r)}),X$=E("$ZodDefault",(n,t)=>{ge.init(n,t),n._zod.optin="optional",se(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);if(e.value===void 0)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>Vm(s,t)):Vm(i,t)}});function Vm(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const Q$=E("$ZodPrefault",(n,t)=>{ge.init(n,t),n._zod.optin="optional",se(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>(r.direction==="backward"||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),eC=E("$ZodNonOptional",(n,t)=>{ge.init(n,t),se(n._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(r=>r!==void 0)):void 0}),n._zod.parse=(e,r)=>{const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>Bm(s,n)):Bm(i,n)}});function Bm(n,t){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:t}),n}const tC=E("$ZodCatch",(n,t)=>{ge.init(n,t),se(n._zod,"optin",()=>t.innerType._zod.optin),se(n._zod,"optout",()=>t.innerType._zod.optout),se(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(o=>Dr(o,r,Pr()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(s=>Dr(s,r,Pr()))},input:e.value}),e.issues=[]),e)}}),nC=E("$ZodPipe",(n,t)=>{ge.init(n,t),se(n._zod,"values",()=>t.in._zod.values),se(n._zod,"optin",()=>t.in._zod.optin),se(n._zod,"optout",()=>t.out._zod.optout),se(n._zod,"propValues",()=>t.in._zod.propValues),n._zod.parse=(e,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(e,r);return s instanceof Promise?s.then(o=>ql(o,t.in,r)):ql(s,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(s=>ql(s,t.out,r)):ql(i,t.out,r)}});function ql(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const rC=E("$ZodReadonly",(n,t)=>{ge.init(n,t),se(n._zod,"propValues",()=>t.innerType._zod.propValues),se(n._zod,"values",()=>t.innerType._zod.values),se(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),se(n._zod,"optout",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optout}),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(qm):qm(i)}});function qm(n){return n.value=Object.freeze(n.value),n}const iC=E("$ZodCustom",(n,t)=>{Qe.init(n,t),ge.init(n,t),n._zod.parse=(e,r)=>e,n._zod.check=e=>{const r=e.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>jm(s,e,r,n));jm(i,e,r,n)}});function jm(n,t,e,r){if(!n){const i={code:"custom",input:e,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(ha(i))}}var Wm;class sC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function oC(){return new sC}(Wm=globalThis).__zod_globalRegistry??(Wm.__zod_globalRegistry=oC());const Uo=globalThis.__zod_globalRegistry;function aC(n,t){return new n({type:"string",...N(t)})}function lC(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...N(t)})}function Gm(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...N(t)})}function cC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...N(t)})}function uC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...N(t)})}function hC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...N(t)})}function dC(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...N(t)})}function fC(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...N(t)})}function pC(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...N(t)})}function mC(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...N(t)})}function gC(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...N(t)})}function vC(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...N(t)})}function yC(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...N(t)})}function wC(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...N(t)})}function bC(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...N(t)})}function _C(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...N(t)})}function SC(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...N(t)})}function AC(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...N(t)})}function kC(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...N(t)})}function EC(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...N(t)})}function $C(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...N(t)})}function CC(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...N(t)})}function TC(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...N(t)})}function RC(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...N(t)})}function IC(n,t){return new n({type:"string",format:"date",check:"string_format",...N(t)})}function xC(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...N(t)})}function PC(n,t){return new n({type:"string",format:"duration",check:"string_format",...N(t)})}function DC(n,t){return new n({type:"number",checks:[],...N(t)})}function LC(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...N(t)})}function OC(n,t){return new n({type:"boolean",...N(t)})}function zC(n){return new n({type:"unknown"})}function NC(n,t){return new n({type:"never",...N(t)})}function Ym(n,t){return new Lv({check:"less_than",...N(t),value:n,inclusive:!1})}function Uh(n,t){return new Lv({check:"less_than",...N(t),value:n,inclusive:!0})}function Km(n,t){return new Ov({check:"greater_than",...N(t),value:n,inclusive:!1})}function Zh(n,t){return new Ov({check:"greater_than",...N(t),value:n,inclusive:!0})}function Jm(n,t){return new X4({check:"multiple_of",...N(t),value:n})}function Hv(n,t){return new e$({check:"max_length",...N(t),maximum:n})}function Bc(n,t){return new t$({check:"min_length",...N(t),minimum:n})}function Vv(n,t){return new n$({check:"length_equals",...N(t),length:n})}function MC(n,t){return new r$({check:"string_format",format:"regex",...N(t),pattern:n})}function UC(n){return new i$({check:"string_format",format:"lowercase",...N(n)})}function ZC(n){return new s$({check:"string_format",format:"uppercase",...N(n)})}function FC(n,t){return new o$({check:"string_format",format:"includes",...N(t),includes:n})}function HC(n,t){return new a$({check:"string_format",format:"starts_with",...N(t),prefix:n})}function VC(n,t){return new l$({check:"string_format",format:"ends_with",...N(t),suffix:n})}function vo(n){return new c$({check:"overwrite",tx:n})}function BC(n){return vo(t=>t.normalize(n))}function qC(){return vo(n=>n.trim())}function jC(){return vo(n=>n.toLowerCase())}function WC(){return vo(n=>n.toUpperCase())}function GC(){return vo(n=>r4(n))}function YC(n,t,e){return new n({type:"array",element:t,...N(e)})}function KC(n,t,e){return new n({type:"custom",check:"custom",fn:t,...N(e)})}function JC(n){const t=XC(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(ha(r,e.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=e.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),e.issues.push(ha(i))}},n(e.value,e)));return t}function XC(n,t){const e=new Qe({check:"custom",...N(t)});return e._zod.check=n,e}function Bv(n){let t=(n==null?void 0:n.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??Uo,target:t,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Ee(n,t,e={path:[],schemaPath:[]}){var f,m;var r;const i=n._zod.def,s=t.seen.get(n);if(s)return s.count++,e.schemaPath.includes(n)&&(s.cycle=e.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,o);const l=(m=(f=n._zod).toJSONSchema)==null?void 0:m.call(f);if(l)o.schema=l;else{const v={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,o.schema,v);else{const k=o.schema,S=t.processors[i.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);S(n,t,k,v)}const y=n._zod.parent;y&&(o.ref||(o.ref=y),Ee(y,t,v),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(o.schema,c),t.io==="input"&&Fe(n)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(n).schema}function qv(n,t){var o,l,c,u;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const f of n.seen.entries()){const m=(o=n.metadataRegistry.get(f[0]))==null?void 0:o.id;if(m){const v=r.get(m);if(v&&v!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,f[0])}}const i=f=>{var S;const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(S=n.external.registry.get(f[0]))==null?void 0:S.id,M=n.external.uri??(G=>G);if(x)return{ref:M(x)};const Z=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=Z,{defId:Z,ref:`${M("__shared")}#/${m}/${Z}`}}if(f[1]===e)return{ref:"#"};const y=`#/${m}/`,k=f[1].schema.id??`__schema${n.counter++}`;return{defId:k,ref:y+k}},s=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:v,defId:y}=i(f);m.def={...m.schema},y&&(m.defId=y);const k=m.schema;for(const S in k)delete k[S];k.$ref=v};if(n.cycles==="throw")for(const f of n.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.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 m=f[1];if(t===f[0]){s(f);continue}if(n.external){const y=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(t!==f[0]&&y){s(f);continue}}if((u=n.metadataRegistry.get(f[0]))==null?void 0:u.id){s(f);continue}if(m.cycle){s(f);continue}if(m.count>1&&n.reused==="ref"){s(f);continue}}}function jv(n,t){var o,l,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const f=n.seen.get(u);if(f.ref===null)return;const m=f.def??f.schema,v={...m},y=f.ref;if(f.ref=null,y){r(y);const S=n.seen.get(y),x=S.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,v),u._zod.parent===y)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in v||delete m[Z];if(x.$ref&&S.def)for(const Z in m)Z==="$ref"||Z==="allOf"||Z in S.def&&JSON.stringify(m[Z])===JSON.stringify(S.def[Z])&&delete m[Z]}const k=u._zod.parent;if(k&&k!==y){r(k);const S=n.seen.get(k);if(S!=null&&S.schema.$ref&&(m.$ref=S.schema.$ref,S.def))for(const x in m)x==="$ref"||x==="allOf"||x in S.def&&JSON.stringify(m[x])===JSON.stringify(S.def[x])&&delete m[x]}n.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(o=n.external)!=null&&o.uri){const u=(l=n.external.registry.get(t))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,e.def??e.schema);const s=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const f=u[1];f.def&&f.defId&&(s[f.defId]=f.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:qc(t,"input",n.processors),output:qc(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Fe(n,t){const e=t??{seen:new Set};if(e.seen.has(n))return!1;e.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Fe(r.element,e);if(r.type==="set")return Fe(r.valueType,e);if(r.type==="lazy")return Fe(r.getter(),e);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Fe(r.innerType,e);if(r.type==="intersection")return Fe(r.left,e)||Fe(r.right,e);if(r.type==="record"||r.type==="map")return Fe(r.keyType,e)||Fe(r.valueType,e);if(r.type==="pipe")return Fe(r.in,e)||Fe(r.out,e);if(r.type==="object"){for(const i in r.shape)if(Fe(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Fe(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Fe(i,e))return!0;return!!(r.rest&&Fe(r.rest,e))}return!1}const QC=(n,t={})=>e=>{const r=Bv({...e,processors:t});return Ee(n,r),qv(r,n),jv(r,n)},qc=(n,t,e={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=Bv({...i??{},target:s,io:t,processors:e});return Ee(n,o),qv(o,n),jv(o,n)},eT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tT=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:s,maximum:o,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),l&&(i.format=eT[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},nT=(n,t,e,r)=>{const i=e,{minimum:s,maximum:o,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f),typeof s=="number"&&(i.minimum=s,typeof f=="number"&&t.target!=="draft-04"&&(f>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof o=="number"&&(i.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},rT=(n,t,e,r)=>{e.type="boolean"},iT=(n,t,e,r)=>{e.not={}},sT=(n,t,e,r)=>{},oT=(n,t,e,r)=>{const i=n._zod.def,s=Av(i.entries);s.every(o=>typeof o=="number")&&(e.type="number"),s.every(o=>typeof o=="string")&&(e.type="string"),e.enum=s},aT=(n,t,e,r)=>{const i=n._zod.def,s=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];e.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[o]:e.const=o}else s.every(o=>typeof o=="number")&&(e.type="number"),s.every(o=>typeof o=="string")&&(e.type="string"),s.every(o=>typeof o=="boolean")&&(e.type="boolean"),s.every(o=>o===null)&&(e.type="null"),e.enum=s},lT=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},cT=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uT=(n,t,e,r)=>{const i=e,s=n._zod.def,{minimum:o,maximum:l}=n._zod.bag;typeof o=="number"&&(i.minItems=o),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Ee(s.element,t,{...r,path:[...r.path,"items"]})},hT=(n,t,e,r)=>{var u;const i=e,s=n._zod.def;i.type="object",i.properties={};const o=s.shape;for(const f in o)i.properties[f]=Ee(o[f],t,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(o)),c=new Set([...l].filter(f=>{const m=s.shape[f]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Ee(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},dT=(n,t,e,r)=>{const i=n._zod.def,s=i.inclusive===!1,o=i.options.map((l,c)=>Ee(l,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?e.oneOf=o:e.anyOf=o},fT=(n,t,e,r)=>{const i=n._zod.def,s=Ee(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Ee(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];e.allOf=c},pT=(n,t,e,r)=>{const i=e,s=n._zod.def;i.type="object";const o=s.keyType,l=o._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const f=Ee(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of c)i.patternProperties[m.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Ee(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Ee(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const f=[...u].filter(m=>typeof m=="string"||typeof m=="number");f.length>0&&(i.required=f)}},mT=(n,t,e,r)=>{const i=n._zod.def,s=Ee(i.innerType,t,r),o=t.seen.get(n);t.target==="openapi-3.0"?(o.ref=i.innerType,e.nullable=!0):e.anyOf=[s,{type:"null"}]},gT=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},vT=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},yT=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,t.io==="input"&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},wT=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=o},bT=(n,t,e,r)=>{const i=n._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ee(s,t,r);const o=t.seen.get(n);o.ref=s},_T=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.readOnly=!0},Wv=(n,t,e,r)=>{const i=n._zod.def;Ee(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},ST=E("ZodISODateTime",(n,t)=>{A$.init(n,t),ye.init(n,t)});function AT(n){return RC(ST,n)}const kT=E("ZodISODate",(n,t)=>{k$.init(n,t),ye.init(n,t)});function ET(n){return IC(kT,n)}const $T=E("ZodISOTime",(n,t)=>{E$.init(n,t),ye.init(n,t)});function CT(n){return xC($T,n)}const TT=E("ZodISODuration",(n,t)=>{$$.init(n,t),ye.init(n,t)});function RT(n){return PC(TT,n)}const Gv=(n,t)=>{Cv.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>g4(n,e)},flatten:{value:e=>m4(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,wd,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,wd,2)}},isEmpty:{get(){return n.issues.length===0}}})},Xm=E("ZodError",Gv),St=E("ZodError",Gv,{Parent:Error}),IT=up(St),xT=hp(St),PT=Iu(St),DT=xu(St),LT=w4(St),OT=b4(St),zT=_4(St),NT=S4(St),MT=A4(St),UT=k4(St),ZT=E4(St),FT=$4(St),ve=E("ZodType",(n,t)=>(ge.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:qc(n,"input"),output:qc(n,"output")}}),n.toJSONSchema=QC(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone(Ur(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(e,r)=>Zr(n,e,r),n.brand=()=>n,n.register=(e,r)=>(e.add(n,r),n),n.parse=(e,r)=>IT(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>PT(n,e,r),n.parseAsync=async(e,r)=>xT(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>DT(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>LT(n,e,r),n.decode=(e,r)=>OT(n,e,r),n.encodeAsync=async(e,r)=>zT(n,e,r),n.decodeAsync=async(e,r)=>NT(n,e,r),n.safeEncode=(e,r)=>MT(n,e,r),n.safeDecode=(e,r)=>UT(n,e,r),n.safeEncodeAsync=async(e,r)=>ZT(n,e,r),n.safeDecodeAsync=async(e,r)=>FT(n,e,r),n.refine=(e,r)=>n.check(DR(e,r)),n.superRefine=e=>n.check(LR(e)),n.overwrite=e=>n.check(vo(e)),n.optional=()=>tg(n),n.exactOptional=()=>bR(n),n.nullable=()=>ng(n),n.nullish=()=>tg(ng(n)),n.nonoptional=e=>$R(n,e),n.array=()=>z(n),n.or=e=>j([n,e]),n.and=e=>Du(n,e),n.transform=e=>rg(n,yR(e)),n.default=e=>AR(n,e),n.prefault=e=>ER(n,e),n.catch=e=>TR(n,e),n.pipe=e=>rg(n,e),n.readonly=()=>xR(n),n.describe=e=>{const r=n.clone();return Uo.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=Uo.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return Uo.get(n);const r=n.clone();return Uo.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),Yv=E("_ZodString",(n,t)=>{dp.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(r,i,s)=>tT(n,r,i);const e=n._zod.bag;n.format=e.format??null,n.minLength=e.minimum??null,n.maxLength=e.maximum??null,n.regex=(...r)=>n.check(MC(...r)),n.includes=(...r)=>n.check(FC(...r)),n.startsWith=(...r)=>n.check(HC(...r)),n.endsWith=(...r)=>n.check(VC(...r)),n.min=(...r)=>n.check(Bc(...r)),n.max=(...r)=>n.check(Hv(...r)),n.length=(...r)=>n.check(Vv(...r)),n.nonempty=(...r)=>n.check(Bc(1,...r)),n.lowercase=r=>n.check(UC(r)),n.uppercase=r=>n.check(ZC(r)),n.trim=()=>n.check(qC()),n.normalize=(...r)=>n.check(BC(...r)),n.toLowerCase=()=>n.check(jC()),n.toUpperCase=()=>n.check(WC()),n.slugify=()=>n.check(GC())}),HT=E("ZodString",(n,t)=>{dp.init(n,t),Yv.init(n,t),n.email=e=>n.check(lC(VT,e)),n.url=e=>n.check(fC(BT,e)),n.jwt=e=>n.check(TC(sR,e)),n.emoji=e=>n.check(pC(qT,e)),n.guid=e=>n.check(Gm(Qm,e)),n.uuid=e=>n.check(cC(jl,e)),n.uuidv4=e=>n.check(uC(jl,e)),n.uuidv6=e=>n.check(hC(jl,e)),n.uuidv7=e=>n.check(dC(jl,e)),n.nanoid=e=>n.check(mC(jT,e)),n.guid=e=>n.check(Gm(Qm,e)),n.cuid=e=>n.check(gC(WT,e)),n.cuid2=e=>n.check(vC(GT,e)),n.ulid=e=>n.check(yC(YT,e)),n.base64=e=>n.check(EC(nR,e)),n.base64url=e=>n.check($C(rR,e)),n.xid=e=>n.check(wC(KT,e)),n.ksuid=e=>n.check(bC(JT,e)),n.ipv4=e=>n.check(_C(XT,e)),n.ipv6=e=>n.check(SC(QT,e)),n.cidrv4=e=>n.check(AC(eR,e)),n.cidrv6=e=>n.check(kC(tR,e)),n.e164=e=>n.check(CC(iR,e)),n.datetime=e=>n.check(AT(e)),n.date=e=>n.check(ET(e)),n.time=e=>n.check(CT(e)),n.duration=e=>n.check(RT(e))});function p(n){return aC(HT,n)}const ye=E("ZodStringFormat",(n,t)=>{pe.init(n,t),Yv.init(n,t)}),VT=E("ZodEmail",(n,t)=>{p$.init(n,t),ye.init(n,t)}),Qm=E("ZodGUID",(n,t)=>{d$.init(n,t),ye.init(n,t)}),jl=E("ZodUUID",(n,t)=>{f$.init(n,t),ye.init(n,t)}),BT=E("ZodURL",(n,t)=>{m$.init(n,t),ye.init(n,t)}),qT=E("ZodEmoji",(n,t)=>{g$.init(n,t),ye.init(n,t)}),jT=E("ZodNanoID",(n,t)=>{v$.init(n,t),ye.init(n,t)}),WT=E("ZodCUID",(n,t)=>{y$.init(n,t),ye.init(n,t)}),GT=E("ZodCUID2",(n,t)=>{w$.init(n,t),ye.init(n,t)}),YT=E("ZodULID",(n,t)=>{b$.init(n,t),ye.init(n,t)}),KT=E("ZodXID",(n,t)=>{_$.init(n,t),ye.init(n,t)}),JT=E("ZodKSUID",(n,t)=>{S$.init(n,t),ye.init(n,t)}),XT=E("ZodIPv4",(n,t)=>{C$.init(n,t),ye.init(n,t)}),QT=E("ZodIPv6",(n,t)=>{T$.init(n,t),ye.init(n,t)}),eR=E("ZodCIDRv4",(n,t)=>{R$.init(n,t),ye.init(n,t)}),tR=E("ZodCIDRv6",(n,t)=>{I$.init(n,t),ye.init(n,t)}),nR=E("ZodBase64",(n,t)=>{x$.init(n,t),ye.init(n,t)}),rR=E("ZodBase64URL",(n,t)=>{D$.init(n,t),ye.init(n,t)}),iR=E("ZodE164",(n,t)=>{L$.init(n,t),ye.init(n,t)}),sR=E("ZodJWT",(n,t)=>{z$.init(n,t),ye.init(n,t)}),Kv=E("ZodNumber",(n,t)=>{Nv.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(r,i,s)=>nT(n,r,i),n.gt=(r,i)=>n.check(Km(r,i)),n.gte=(r,i)=>n.check(Zh(r,i)),n.min=(r,i)=>n.check(Zh(r,i)),n.lt=(r,i)=>n.check(Ym(r,i)),n.lte=(r,i)=>n.check(Uh(r,i)),n.max=(r,i)=>n.check(Uh(r,i)),n.int=r=>n.check(eg(r)),n.safe=r=>n.check(eg(r)),n.positive=r=>n.check(Km(0,r)),n.nonnegative=r=>n.check(Zh(0,r)),n.negative=r=>n.check(Ym(0,r)),n.nonpositive=r=>n.check(Uh(0,r)),n.multipleOf=(r,i)=>n.check(Jm(r,i)),n.step=(r,i)=>n.check(Jm(r,i)),n.finite=()=>n;const e=n._zod.bag;n.minValue=Math.max(e.minimum??Number.NEGATIVE_INFINITY,e.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(e.maximum??Number.POSITIVE_INFINITY,e.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(e.format??"").includes("int")||Number.isSafeInteger(e.multipleOf??.5),n.isFinite=!0,n.format=e.format??null});function H(n){return DC(Kv,n)}const oR=E("ZodNumberFormat",(n,t)=>{N$.init(n,t),Kv.init(n,t)});function eg(n){return LC(oR,n)}const aR=E("ZodBoolean",(n,t)=>{M$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>rT(n,e,r)});function Ie(n){return OC(aR,n)}const lR=E("ZodUnknown",(n,t)=>{U$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>sT()});function _(){return zC(lR)}const cR=E("ZodNever",(n,t)=>{Z$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>iT(n,e,r)});function uR(n){return NC(cR,n)}const hR=E("ZodArray",(n,t)=>{F$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>uT(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(Bc(e,r)),n.nonempty=e=>n.check(Bc(1,e)),n.max=(e,r)=>n.check(Hv(e,r)),n.length=(e,r)=>n.check(Vv(e,r)),n.unwrap=()=>n.element});function z(n,t){return YC(hR,n,t)}const Jv=E("ZodObject",(n,t)=>{V$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>hT(n,e,r,i),se(n,"shape",()=>t.shape),n.keyof=()=>ey(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:_()}),n.loose=()=>n.clone({...n._zod.def,catchall:_()}),n.strict=()=>n.clone({...n._zod.def,catchall:uR()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>u4(n,e),n.safeExtend=e=>h4(n,e),n.merge=e=>d4(n,e),n.pick=e=>l4(n,e),n.omit=e=>c4(n,e),n.partial=(...e)=>f4(ty,n,e[0]),n.required=(...e)=>p4(ny,n,e[0])});function Xv(n,t){const e={type:"object",shape:n??{},...N(t)};return new Jv(e)}function w(n,t){return new Jv({type:"object",shape:n,catchall:_(),...N(t)})}const Qv=E("ZodUnion",(n,t)=>{Zv.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>dT(n,e,r,i),n.options=t.options});function j(n,t){return new Qv({type:"union",options:n,...N(t)})}const dR=E("ZodDiscriminatedUnion",(n,t)=>{Qv.init(n,t),B$.init(n,t)});function fR(n,t,e){return new dR({type:"union",options:t,discriminator:n,...N(e)})}const pR=E("ZodIntersection",(n,t)=>{q$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>fT(n,e,r,i)});function Du(n,t){return new pR({type:"intersection",left:n,right:t})}const mR=E("ZodRecord",(n,t)=>{j$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>pT(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function A(n,t,e){return new mR({type:"record",keyType:n,valueType:t,...N(e)})}const _d=E("ZodEnum",(n,t)=>{W$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(r,i,s)=>oT(n,r,i),n.enum=t.entries,n.options=Object.values(t.entries);const e=new Set(Object.keys(t.entries));n.extract=(r,i)=>{const s={};for(const o of r)if(e.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new _d({...t,checks:[],...N(i),entries:s})},n.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(e.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new _d({...t,checks:[],...N(i),entries:s})}});function ey(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new _d({type:"enum",entries:e,...N(t)})}const gR=E("ZodLiteral",(n,t)=>{G$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>aT(n,e,r),n.values=new Set(t.values),Object.defineProperty(n,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function C(n,t){return new gR({type:"literal",values:Array.isArray(n)?n:[n],...N(t)})}const vR=E("ZodTransform",(n,t)=>{Y$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>cT(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new _v(n.constructor.name);e.addIssue=s=>{if(typeof s=="string")e.issues.push(ha(s,e.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=e.value),o.inst??(o.inst=n),e.issues.push(ha(o))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(s=>(e.value=s,e)):(e.value=i,e)}});function yR(n){return new vR({type:"transform",transform:n})}const ty=E("ZodOptional",(n,t)=>{Fv.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Wv(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function tg(n){return new ty({type:"optional",innerType:n})}const wR=E("ZodExactOptional",(n,t)=>{K$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Wv(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function bR(n){return new wR({type:"optional",innerType:n})}const _R=E("ZodNullable",(n,t)=>{J$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>mT(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function ng(n){return new _R({type:"nullable",innerType:n})}const SR=E("ZodDefault",(n,t)=>{X$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>vT(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function AR(n,t){return new SR({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():Ev(t)}})}const kR=E("ZodPrefault",(n,t)=>{Q$.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>yT(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function ER(n,t){return new kR({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():Ev(t)}})}const ny=E("ZodNonOptional",(n,t)=>{eC.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>gT(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function $R(n,t){return new ny({type:"nonoptional",innerType:n,...N(t)})}const CR=E("ZodCatch",(n,t)=>{tC.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>wT(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function TR(n,t){return new CR({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const RR=E("ZodPipe",(n,t)=>{nC.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>bT(n,e,r,i),n.in=t.in,n.out=t.out});function rg(n,t){return new RR({type:"pipe",in:n,out:t})}const IR=E("ZodReadonly",(n,t)=>{rC.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>_T(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function xR(n){return new IR({type:"readonly",innerType:n})}const PR=E("ZodCustom",(n,t)=>{iC.init(n,t),ve.init(n,t),n._zod.processJSONSchema=(e,r,i)=>lT(n,e)});function DR(n,t={}){return KC(PR,n,t)}function LR(n){return JC(n)}const OR=[".md",".markdown"];function ry(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function iy(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function zR(n){return iy(n).toLowerCase()}function NR(n,t){const e=zR(n);return t.some(r=>e.endsWith(r))}function sy(n){return!ry(n)&&NR(n,OR)}function MR(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function Rn(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const UR=Xv({id:p().min(1),kind:C("path"),title:p(),path:p()}).strict(),ZR=Xv({id:p().min(1),kind:C("url"),title:p(),url:p().refine(MR,{message:"url must be an http(s) URL"})}).strict();fR("kind",[UR,ZR]);const FR="/views/markdown/",HR="/views/url-unsupported/";function oy(n){return`/artifact/${encodeURIComponent(n)}`}function VR(n,t){return`${oy(n)}/${encodeURIComponent(t)}`}function BR(n){return`/markdown/${encodeURIComponent(n)}`}function Sd(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Rn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:HR,contentURL:null};if(sy(n.path)){const r={viewURL:FR,contentURL:BR(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=ry(n.path)?`${oy(n.id)}/`:VR(n.id,iy(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const qR="serverURL",jR="token",WR="mode",GR="desktopAppVersion",YR="electron";function KR(n=window.location.search,t=window.location.origin){const r=new URLSearchParams(n).get(qR);return r?new URL(r).origin:new URL(t).origin}function JR(n=window.location.search){return new URLSearchParams(n).get(jR)}function Gn(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(WR)===YR}function ay(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(GR)}const ig="tv.telemetry.clientId",XR=5,QR=60,e3=1e3,t3=XR*QR*e3,sg=["pointerdown","scroll","keydown"],og=["focus"],ag=["visibilitychange"],n3="hidden";function r3(n,t=l3){const e=n.getItem(ig);if(e)return e;const r=t();return n.setItem(ig,r),r}function i3(n){return{clientId:r3(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function s3(n){const t=new URLSearchParams;return t.set("clientId",n.clientId),t.set("userAgent",n.userAgent),t.set("clientApp",n.clientApp),n.desktopAppVersion&&t.set("desktopAppVersion",n.desktopAppVersion),t}function o3(n){return new a3(n)}var wa,Ln,sr,ba,_a,lt,ai,Sa,nu,ly;class a3{constructor(t){g(this,nu);g(this,wa);g(this,Ln);g(this,sr);g(this,ba);g(this,_a);g(this,lt);g(this,ai,!1);g(this,Sa,Number.NEGATIVE_INFINITY);d(this,wa,t.meta),d(this,Ln,t.documentTarget),d(this,sr,t.windowTarget),d(this,ba,t.send),d(this,_a,t.nowMs??Date.now),d(this,lt,()=>h(this,nu,ly).call(this))}start(){if(!a(this,ai)){d(this,ai,!0);for(const t of sg)a(this,sr).addEventListener(t,a(this,lt)),a(this,Ln).addEventListener(t,a(this,lt));for(const t of og)a(this,sr).addEventListener(t,a(this,lt));for(const t of ag)a(this,Ln).addEventListener(t,a(this,lt))}}stop(){if(a(this,ai)){d(this,ai,!1);for(const t of sg)a(this,sr).removeEventListener(t,a(this,lt)),a(this,Ln).removeEventListener(t,a(this,lt));for(const t of og)a(this,sr).removeEventListener(t,a(this,lt));for(const t of ag)a(this,Ln).removeEventListener(t,a(this,lt))}}}wa=new WeakMap,Ln=new WeakMap,sr=new WeakMap,ba=new WeakMap,_a=new WeakMap,lt=new WeakMap,ai=new WeakMap,Sa=new WeakMap,nu=new WeakSet,ly=function(){if(a(this,Ln).visibilityState===n3)return;const t=a(this,_a).call(this);t-a(this,Sa)<t3||(d(this,Sa,t),a(this,ba).call(this,{type:sE,clientId:a(this,wa).clientId}))};function l3(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():op().toLowerCase()}const fe={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"},En={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"},c3=1,u3=w({_meta:A(p(),_()).nullish(),terminal:Ie().optional().default(!1)}),h3=w({_meta:A(p(),_()).nullish(),label:p().nullish(),name:p(),optional:Ie().optional().default(!1),secret:Ie().optional().default(!0)}),d3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:p(),name:p()}),f3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:z(h3)}),p3=w({_meta:A(p(),_()).nullish(),args:z(p()).optional(),description:p().nullish(),env:A(p(),p()).optional(),id:p(),name:p()}),m3=j([f3.and(w({type:C("env_var")})),p3.and(w({type:C("terminal")})),d3]),g3=w({_meta:A(p(),_()).nullish(),methodId:p()}),v3=w({_meta:A(p(),_()).nullish()}),y3=w({_meta:A(p(),_()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),w3=w({default:Ie().nullish(),description:p().nullish(),title:p().nullish()}),b3=w({_meta:A(p(),_()).nullish()}),_3=w({_meta:A(p(),_()).nullish()}),S3=w({amount:H(),currency:p()}),A3=w({_meta:A(p(),_()).nullish(),terminalId:p()}),k3=w({_meta:A(p(),_()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),E3=j([p(),H(),H(),Ie(),z(p())]),$3=w({content:A(p(),E3).nullish()}),C3=j([$3.and(w({action:C("accept")})),w({action:C("decline")}),w({action:C("cancel")})]),T3=w({_meta:A(p(),_()).nullish()}),cy=p(),R3=w({_meta:A(p(),_()).nullish(),elicitationId:cy}),I3=w({_meta:A(p(),_()).nullish(),action:C3}),x3=C("object"),P3=C("string"),D3=w({_meta:A(p(),_()).nullish()}),L3=w({_meta:A(p(),_()).nullish(),form:T3.nullish(),url:D3.nullish()}),O3=w({elicitationId:cy,url:p().url()}),uy=w({const:p(),title:p()}),hy=w({_meta:A(p(),_()).nullish(),name:p(),value:p()}),z3=j([C(-32700),C(-32600),C(-32601),C(-32602),C(-32603),C(-32800),C(-32e3),C(-32002),C(-32042),H().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),dy=w({code:z3,data:_().optional(),message:p()}),fy=_(),py=_(),my=_(),N3=w({_meta:A(p(),_()).nullish(),readTextFile:Ie().optional().default(!1),writeTextFile:Ie().optional().default(!1)}),gy=w({_meta:A(p(),_()).nullish(),name:p(),value:p()}),vy=w({_meta:A(p(),_()).nullish(),name:p(),title:p().nullish(),version:p()}),M3=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),U3=w({_meta:A(p(),_()).nullish()}),Z3=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),F3=w({_meta:A(p(),_()).nullish()}),H3=w({_meta:A(p(),_()).nullish(),logout:F3.nullish()}),V3=w({_meta:A(p(),_()).nullish()}),B3=w({_meta:A(p(),_()).nullish()}),q3=w({_meta:A(p(),_()).nullish(),http:Ie().optional().default(!1),sse:Ie().optional().default(!1)}),j3=w({_meta:A(p(),_()).nullish(),headers:z(gy),name:p(),url:p()}),W3=w({_meta:A(p(),_()).nullish(),headers:z(gy),name:p(),url:p()}),G3=w({_meta:A(p(),_()).nullish(),args:z(p()),command:p(),env:z(hy),name:p()}),Lu=j([j3.and(w({type:C("http")})),W3.and(w({type:C("sse")})),G3]),fp=p(),Y3=w({_meta:A(p(),_()).nullish(),description:p().nullish(),modelId:fp,name:p()}),K3=j([C("error"),C("warning"),C("information"),C("hint")]),J3=w({_meta:A(p(),_()).nullish()}),X3=w({_meta:A(p(),_()).nullish()}),Q3=w({_meta:A(p(),_()).nullish()}),eI=w({_meta:A(p(),_()).nullish()}),tI=w({_meta:A(p(),_()).nullish()}),nI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),rI=w({diff:p(),uri:p()}),iI=w({endLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:p()}),sI=w({_meta:A(p(),_()).nullish()}),oI=w({_meta:A(p(),_()).nullish()}),aI=w({languageId:p(),text:p(),uri:p()}),lI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),cI=j([C("rejected"),C("ignored"),C("replaced"),C("cancelled")]),uI=w({excerpts:z(iI),uri:p()}),hI=w({_meta:A(p(),_()).nullish()}),dI=w({_meta:A(p(),_()).nullish()}),fI=w({name:p(),owner:p(),remoteUrl:p()}),pI=w({_meta:A(p(),_()).nullish()}),mI=w({_meta:A(p(),_()).nullish(),jump:sI.nullish(),rename:dI.nullish(),searchAndReplace:pI.nullish()}),gI=w({id:p(),isRegex:Ie().nullish(),replace:p(),search:p(),uri:p()}),vI=j([C("automatic"),C("diagnostic"),C("manual")]),yI=w({_meta:A(p(),_()).nullish(),maxCount:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),wI=w({_meta:A(p(),_()).nullish(),diagnostics:J3.nullish(),editHistory:nI.nullish(),openFiles:oI.nullish(),recentFiles:lI.nullish(),relatedSnippets:hI.nullish(),userActions:yI.nullish()}),bI=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Lu)}),_I=w({default:H().nullish(),description:p().nullish(),maximum:H().nullish(),minimum:H().nullish(),title:p().nullish()}),yy=p(),SI=j([C("allow_once"),C("allow_always"),C("reject_once"),C("reject_always")]),AI=w({_meta:A(p(),_()).nullish(),kind:SI,name:p(),optionId:yy}),kI=j([C("high"),C("medium"),C("low")]),EI=j([C("pending"),C("in_progress"),C("completed")]),$I=w({_meta:A(p(),_()).nullish(),content:p(),priority:kI,status:EI}),CI=w({_meta:A(p(),_()).nullish(),entries:z($I)}),Lr=w({character:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),TI=w({id:p(),position:Lr,uri:p()}),RI=w({id:p(),newName:p(),position:Lr,uri:p()}),II=w({action:p(),position:Lr,timestampMs:H(),uri:p()}),wy=j([C("utf-16"),C("utf-32"),C("utf-8")]),xI=w({_meta:A(p(),_()).nullish(),auth:u3.optional().default({terminal:!1}),elicitation:L3.nullish(),fs:N3.optional().default({readTextFile:!1,writeTextFile:!1}),nes:mI.nullish(),positionEncodings:z(wy).optional(),terminal:Ie().optional().default(!1)}),PI=w({_meta:A(p(),_()).nullish(),audio:Ie().optional().default(!1),embeddedContext:Ie().optional().default(!1),image:Ie().optional().default(!1)}),by=H().int().gte(0).lte(65535),DI=w({_meta:A(p(),_()).nullish(),clientCapabilities:xI.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:vy.nullish(),protocolVersion:by}),yo=w({end:Lr,start:Lr}),LI=w({message:p(),range:yo,severity:K3,uri:p()}),OI=w({languageId:p(),lastFocusedMs:H().nullish(),uri:p(),visibleRange:yo.nullish()}),zI=w({_meta:A(p(),_()).nullish(),diagnostics:z(LI).nullish(),editHistory:z(rI).nullish(),openFiles:z(OI).nullish(),recentFiles:z(aI).nullish(),relatedSnippets:z(uI).nullish(),userActions:z(II).nullish()}),NI=w({newText:p(),range:yo}),MI=w({cursorPosition:Lr.nullish(),edits:z(NI),id:p(),uri:p()}),UI=j([MI.and(w({kind:C("edit")})),TI.and(w({kind:C("jump")})),RI.and(w({kind:C("rename")})),gI.and(w({kind:C("searchAndReplace")}))]),ZI=w({_meta:A(p(),_()).nullish(),content:p()}),FI=w({_meta:A(p(),_()).nullish()}),Zi=j([H(),p()]).nullable();w({_meta:A(p(),_()).nullish(),requestId:Zi});const HI=ey(["assistant","user"]),kl=w({_meta:A(p(),_()).nullish(),audience:z(HI).nullish(),lastModified:p().nullish(),priority:H().nullish()}),VI=w({_meta:A(p(),_()).nullish(),annotations:kl.nullish(),data:p(),mimeType:p()}),BI=w({_meta:A(p(),_()).nullish(),annotations:kl.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),qI=w({_meta:A(p(),_()).nullish(),annotations:kl.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:H().nullish(),title:p().nullish(),uri:p()}),jI=w({_meta:A(p(),_()).nullish(),optionId:yy}),WI=j([w({outcome:C("cancelled")}),jI.and(w({outcome:C("selected")}))]),GI=w({_meta:A(p(),_()).nullish(),outcome:WI}),YI=w({_meta:A(p(),_()).nullish()}),KI=w({_meta:A(p(),_()).nullish()}),JI=w({currentValue:Ie()}),XI=p(),_y=p(),QI=j([C("mode"),C("model"),C("thought_level"),p()]),pp=p(),Sy=w({_meta:A(p(),_()).nullish(),description:p().nullish(),name:p(),value:pp}),ex=w({_meta:A(p(),_()).nullish(),group:XI,name:p(),options:z(Sy)}),tx=j([z(Sy),z(ex)]),nx=w({currentValue:pp,options:tx}),wo=Du(j([nx.and(w({type:C("select")})),JI.and(w({type:C("boolean")}))]),w({_meta:A(p(),_()).nullish(),category:QI.nullish(),description:p().nullish(),id:_y,name:p()})),rx=w({_meta:A(p(),_()).nullish(),configOptions:z(wo)}),ix=w({_meta:A(p(),_()).nullish()}),ie=p(),sx=w({_meta:A(p(),_()).nullish(),id:p(),sessionId:ie}),ox=w({_meta:A(p(),_()).nullish(),sessionId:ie}),ax=w({_meta:A(p(),_()).nullish(),sessionId:ie}),lx=w({_meta:A(p(),_()).nullish(),sessionId:ie}),Ay=w({_meta:A(p(),_()).nullish(),args:z(p()).optional(),command:p(),cwd:p().nullish(),env:z(hy).optional(),outputByteLimit:H().nullish(),sessionId:ie}),cx=w({_meta:A(p(),_()).nullish(),sessionId:ie,uri:p()}),ux=w({_meta:A(p(),_()).nullish(),position:Lr,sessionId:ie,uri:p(),version:H(),visibleRange:yo}),hx=w({_meta:A(p(),_()).nullish(),languageId:p(),sessionId:ie,text:p(),uri:p(),version:H()}),dx=w({_meta:A(p(),_()).nullish(),sessionId:ie,uri:p()}),fx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Lu).optional(),sessionId:ie}),ky=w({_meta:A(p(),_()).nullish(),sessionId:ie,terminalId:p()}),px=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Lu),sessionId:ie}),Ey=w({_meta:A(p(),_()).nullish(),limit:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p(),sessionId:ie}),mx=w({_meta:A(p(),_()).nullish(),id:p(),reason:cI.nullish(),sessionId:ie}),$y=w({_meta:A(p(),_()).nullish(),sessionId:ie,terminalId:p()}),gx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),mcpServers:z(Lu).optional(),sessionId:ie}),vx=w({_meta:A(p(),_()).nullish(),additionalDirectories:z(p()).optional(),cwd:p(),sessionId:ie,title:p().nullish(),updatedAt:p().nullish()}),yx=w({_meta:A(p(),_()).nullish(),nextCursor:p().nullish(),sessions:z(vx)}),wx=w({_meta:A(p(),_()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),bx=w({_meta:A(p(),_()).nullish()}),Ou=p(),_x=w({_meta:A(p(),_()).nullish(),currentModeId:Ou}),Sx=w({_meta:A(p(),_()).nullish(),description:p().nullish(),id:Ou,name:p()}),zu=w({_meta:A(p(),_()).nullish(),availableModes:z(Sx),currentModeId:Ou}),Nu=w({_meta:A(p(),_()).nullish(),availableModels:z(Y3),currentModelId:fp}),Ax=w({_meta:A(p(),_()).nullish(),configOptions:z(wo).nullish(),models:Nu.nullish(),modes:zu.nullish(),sessionId:ie}),kx=w({_meta:A(p(),_()).nullish(),configOptions:z(wo).nullish(),models:Nu.nullish(),modes:zu.nullish()}),Ex=w({_meta:A(p(),_()).nullish(),configOptions:z(wo).nullish(),models:Nu.nullish(),modes:zu.nullish(),sessionId:ie}),$x=w({_meta:A(p(),_()).nullish(),configOptions:z(wo).nullish(),models:Nu.nullish(),modes:zu.nullish()}),Cx=w({_meta:A(p(),_()).nullish()}),Tx=w({_meta:A(p(),_()).nullish(),additionalDirectories:YI.nullish(),close:KI.nullish(),fork:ix.nullish(),list:bx.nullish(),resume:Cx.nullish()}),Rx=Du(j([w({type:C("boolean"),value:Ie()}),w({value:pp})]),w({_meta:A(p(),_()).nullish(),configId:_y,sessionId:ie})),Ix=w({_meta:A(p(),_()).nullish(),configOptions:z(wo)}),xx=w({_meta:A(p(),_()).nullish(),modeId:Ou,sessionId:ie}),Px=w({_meta:A(p(),_()).nullish()}),Dx=w({_meta:A(p(),_()).nullish(),modelId:fp,sessionId:ie}),Lx=w({_meta:A(p(),_()).nullish()}),Ox=w({_meta:A(p(),_()).nullish(),sessionId:ie}),zx=j([C("end_turn"),C("max_tokens"),C("max_turn_requests"),C("refusal"),C("cancelled")]),Nx=j([C("email"),C("uri"),C("date"),C("date-time")]),Mx=w({default:p().nullish(),description:p().nullish(),enum:z(p()).nullish(),format:Nx.nullish(),maxLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:z(uy).nullish(),pattern:p().nullish(),title:p().nullish()}),Ux=w({_meta:A(p(),_()).nullish(),context:zI.nullish(),position:Lr,selection:yo.nullish(),sessionId:ie,triggerKind:vI,uri:p(),version:H()}),Zx=w({_meta:A(p(),_()).nullish(),suggestions:z(UI)}),Fx=w({_meta:A(p(),_()).nullish(),terminalId:p()}),Hx=w({_meta:A(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),Cy=w({_meta:A(p(),_()).nullish(),sessionId:ie,terminalId:p()}),Vx=w({_meta:A(p(),_()).nullish(),exitStatus:Hx.nullish(),output:p(),truncated:Ie()}),Bx=w({_meta:A(p(),_()).nullish(),annotations:kl.nullish(),text:p()}),qx=w({range:yo.nullish(),text:p()}),jx=w({_meta:A(p(),_()).nullish(),contentChanges:z(qx),sessionId:ie,uri:p(),version:H()});w({method:p(),params:j([ox,hx,jx,cx,dx,ux,sx,mx,fy]).nullish()});const Wx=j([C("full"),C("incremental")]),Gx=w({_meta:A(p(),_()).nullish(),syncKind:Wx}),Yx=w({_meta:A(p(),_()).nullish(),didChange:Gx.nullish(),didClose:X3.nullish(),didFocus:Q3.nullish(),didOpen:eI.nullish(),didSave:tI.nullish()}),Kx=w({_meta:A(p(),_()).nullish(),document:Yx.nullish()}),Jx=w({_meta:A(p(),_()).nullish(),context:wI.nullish(),events:Kx.nullish()}),Xx=w({_meta:A(p(),_()).nullish(),auth:H3.optional().default({}),loadSession:Ie().optional().default(!1),mcpCapabilities:q3.optional().default({http:!1,sse:!1}),nes:Jx.nullish(),positionEncoding:wy.nullish(),promptCapabilities:PI.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:Tx.optional().default({})}),Qx=w({_meta:A(p(),_()).nullish(),agentCapabilities:Xx.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:vy.nullish(),authMethods:z(m3).optional().default([]),protocolVersion:by}),eP=w({_meta:A(p(),_()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),tP=j([eP,y3]),nP=w({_meta:A(p(),_()).nullish(),annotations:kl.nullish(),resource:tP}),mp=j([Bx.and(w({type:C("text")})),BI.and(w({type:C("image")})),VI.and(w({type:C("audio")})),qI.and(w({type:C("resource_link")})),nP.and(w({type:C("resource")}))]),rP=w({_meta:A(p(),_()).nullish(),content:mp}),Fh=w({_meta:A(p(),_()).nullish(),content:mp,messageId:p().nullish()}),iP=w({_meta:A(p(),_()).nullish(),messageId:p().nullish(),prompt:z(mp),sessionId:ie}),sP=w({anyOf:z(uy)}),Ty=j([rP.and(w({type:C("content")})),k3.and(w({type:C("diff")})),Fx.and(w({type:C("terminal")}))]),Ry=p(),Iy=w({_meta:A(p(),_()).nullish(),line:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p()}),xy=j([C("pending"),C("in_progress"),C("completed"),C("failed")]),Py=j([C("read"),C("edit"),C("delete"),C("move"),C("search"),C("execute"),C("think"),C("fetch"),C("switch_mode"),C("other")]),oP=w({_meta:A(p(),_()).nullish(),content:z(Ty).optional(),kind:Py.optional(),locations:z(Iy).optional(),rawInput:_().optional(),rawOutput:_().optional(),status:xy.optional(),title:p(),toolCallId:Ry}),Dy=w({_meta:A(p(),_()).nullish(),content:z(Ty).nullish(),kind:Py.nullish(),locations:z(Iy).nullish(),rawInput:_().optional(),rawOutput:_().optional(),status:xy.nullish(),title:p().nullish(),toolCallId:Ry}),Ly=w({_meta:A(p(),_()).nullish(),options:z(AI),sessionId:ie,toolCall:Dy}),aP=w({_meta:A(p(),_()).nullish(),hint:p()}),lP=aP,cP=w({_meta:A(p(),_()).nullish(),description:p(),input:lP.nullish(),name:p()}),uP=w({_meta:A(p(),_()).nullish(),availableCommands:z(cP)}),hP=w({enum:z(p()),type:P3}),dP=j([hP,sP]),fP=w({default:z(p()).nullish(),description:p().nullish(),items:dP,maxItems:H().nullish(),minItems:H().nullish(),title:p().nullish()}),pP=j([Mx.and(w({type:C("string")})),_I.and(w({type:C("number")})),M3.and(w({type:C("integer")})),w3.and(w({type:C("boolean")})),fP.and(w({type:C("array")}))]),mP=w({description:p().nullish(),properties:A(p(),pP).optional().default({}),required:z(p()).nullish(),title:p().nullish(),type:x3.optional().default("object")}),gP=w({requestedSchema:mP}),vP=Du(j([gP.and(w({mode:C("form")})),O3.and(w({mode:C("url")}))]),w({_meta:A(p(),_()).nullish(),message:p(),sessionId:ie})),yP=w({cachedReadTokens:H().nullish(),cachedWriteTokens:H().nullish(),inputTokens:H(),outputTokens:H(),thoughtTokens:H().nullish(),totalTokens:H()}),wP=w({_meta:A(p(),_()).nullish(),stopReason:zx,usage:yP.nullish(),userMessageId:p().nullish()});j([w({id:Zi,result:j([Qx,v3,B3,Ex,kx,yx,Ax,$x,_3,Px,Ix,wP,Lx,Ox,Zx,b3,my])}),w({error:dy,id:Zi})]);const bP=w({_meta:A(p(),_()).nullish(),cost:S3.nullish(),size:H(),used:H()}),_P=j([Fh.and(w({sessionUpdate:C("user_message_chunk")})),Fh.and(w({sessionUpdate:C("agent_message_chunk")})),Fh.and(w({sessionUpdate:C("agent_thought_chunk")})),oP.and(w({sessionUpdate:C("tool_call")})),Dy.and(w({sessionUpdate:C("tool_call_update")})),CI.and(w({sessionUpdate:C("plan")})),uP.and(w({sessionUpdate:C("available_commands_update")})),_x.and(w({sessionUpdate:C("current_mode_update")})),rx.and(w({sessionUpdate:C("config_option_update")})),wx.and(w({sessionUpdate:C("session_info_update")})),bP.and(w({sessionUpdate:C("usage_update")}))]),Oy=w({_meta:A(p(),_()).nullish(),sessionId:ie,update:_P});w({method:p(),params:j([Oy,R3,fy]).nullish()});const zy=w({_meta:A(p(),_()).nullish(),sessionId:ie,terminalId:p()}),SP=w({_meta:A(p(),_()).nullish(),exitCode:H().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),AP=w({name:p(),uri:p()}),kP=w({_meta:A(p(),_()).nullish(),repository:fI.nullish(),workspaceFolders:z(AP).nullish(),workspaceUri:p().nullish()});w({id:Zi,method:p(),params:j([DI,g3,V3,bI,px,Z3,fx,gx,lx,xx,Rx,iP,Dx,kP,Ux,ax,py]).nullish()});const Ny=w({_meta:A(p(),_()).nullish(),content:p(),path:p(),sessionId:ie});w({id:Zi,method:p(),params:j([Ny,Ey,Ly,Ay,Cy,$y,zy,ky,vP,py]).nullish()});const EP=w({_meta:A(p(),_()).nullish()});j([w({id:Zi,result:j([EP,ZI,GI,A3,Vx,FI,SP,U3,I3,my])}),w({error:dy,id:Zi})]);var ne;class $P{constructor(t,e){g(this,ne);const r=t(this),i=async(o,l)=>{var c,u,f,m,v,y,k;switch(o){case En.fs_write_text_file:{const S=Ny.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,S)}case En.fs_read_text_file:{const S=Ey.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,S)}case En.session_request_permission:{const S=Ly.parse(l);return r.requestPermission(S)}case En.terminal_create:{const S=Ay.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,S)}case En.terminal_output:{const S=Cy.parse(l);return(m=r.terminalOutput)==null?void 0:m.call(r,S)}case En.terminal_release:{const S=$y.parse(l);return await((v=r.releaseTerminal)==null?void 0:v.call(r,S))??{}}case En.terminal_wait_for_exit:{const S=zy.parse(l);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,S)}case En.terminal_kill:{const S=ky.parse(l);return await((k=r.killTerminal)==null?void 0:k.call(r,S))??{}}default:if(r.extMethod)return r.extMethod(o,l);throw Ce.methodNotFound(o)}},s=async(o,l)=>{switch(o){case En.session_update:{const c=Oy.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(o,l);throw Ce.methodNotFound(o)}};d(this,ne,new CP(i,s,e))}async initialize(t){return await a(this,ne).sendRequest(fe.initialize,t)}async newSession(t){return await a(this,ne).sendRequest(fe.session_new,t)}async loadSession(t){return await a(this,ne).sendRequest(fe.session_load,t)??{}}async unstable_forkSession(t){return await a(this,ne).sendRequest(fe.session_fork,t)}async listSessions(t){return await a(this,ne).sendRequest(fe.session_list,t)}async unstable_resumeSession(t){return await a(this,ne).sendRequest(fe.session_resume,t)}async unstable_closeSession(t){return await a(this,ne).sendRequest(fe.session_close,t)}async setSessionMode(t){return await a(this,ne).sendRequest(fe.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await a(this,ne).sendRequest(fe.session_set_model,t)??{}}async setSessionConfigOption(t){return await a(this,ne).sendRequest(fe.session_set_config_option,t)}async authenticate(t){return await a(this,ne).sendRequest(fe.authenticate,t)??{}}async unstable_logout(t){return await a(this,ne).sendRequest(fe.logout,t)??{}}async prompt(t){return await a(this,ne).sendRequest(fe.session_prompt,t)}async cancel(t){return await a(this,ne).sendNotification(fe.session_cancel,t)}async unstable_startNes(t){return await a(this,ne).sendRequest(fe.nes_start,t)}async unstable_suggestNes(t){return await a(this,ne).sendRequest(fe.nes_suggest,t)}async unstable_closeNes(t){return await a(this,ne).sendRequest(fe.nes_close,t)??{}}async unstable_didOpenDocument(t){return await a(this,ne).sendNotification(fe.document_did_open,t)}async unstable_didChangeDocument(t){return await a(this,ne).sendNotification(fe.document_did_change,t)}async unstable_didCloseDocument(t){return await a(this,ne).sendNotification(fe.document_did_close,t)}async unstable_didSaveDocument(t){return await a(this,ne).sendNotification(fe.document_did_save,t)}async unstable_didFocusDocument(t){return await a(this,ne).sendNotification(fe.document_did_focus,t)}async unstable_acceptNes(t){return await a(this,ne).sendNotification(fe.nes_accept,t)}async unstable_rejectNes(t){return await a(this,ne).sendNotification(fe.nes_reject,t)}async extMethod(t,e){return await a(this,ne).sendRequest(t,e)}async extNotification(t,e){return await a(this,ne).sendNotification(t,e)}get signal(){return a(this,ne).signal}get closed(){return a(this,ne).closed}}ne=new WeakMap;var or,ru,Aa,ka,Ss,As,Bt,Ea,me,My,Ad,Uy,Zy,Fy,Hy,kd,Zo;class CP{constructor(t,e,r){g(this,me);g(this,or,new Map);g(this,ru,0);g(this,Aa);g(this,ka);g(this,Ss);g(this,As,Promise.resolve());g(this,Bt,new AbortController);g(this,Ea);d(this,Aa,t),d(this,ka,e),d(this,Ss,r),d(this,Ea,new Promise(i=>{a(this,Bt).signal.addEventListener("abort",()=>i())})),h(this,me,My).call(this)}get signal(){return a(this,Bt).signal}get closed(){return a(this,Ea)}async sendRequest(t,e){h(this,me,kd).call(this);const r=sh(this,ru)._++,i=new Promise((s,o)=>{a(this,or).set(r,{resolve:s,reject:o})});return await h(this,me,Zo).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){h(this,me,kd).call(this),await h(this,me,Zo).call(this,{jsonrpc:"2.0",method:t,params:e})}}or=new WeakMap,ru=new WeakMap,Aa=new WeakMap,ka=new WeakMap,Ss=new WeakMap,As=new WeakMap,Bt=new WeakMap,Ea=new WeakMap,me=new WeakSet,My=async function(){let t;try{const e=a(this,Ss).readable.getReader();try{for(;!a(this,Bt).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{h(this,me,Uy).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&h(this,me,Zo).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{h(this,me,Ad).call(this,t)}},Ad=function(t){if(a(this,Bt).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of a(this,or).values())r.reject(e);a(this,or).clear(),a(this,Bt).abort(e)},Uy=async function(t){if("method"in t&&"id"in t){const e=await h(this,me,Zy).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await h(this,me,Zo).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await h(this,me,Fy).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?h(this,me,Hy).call(this,t):console.error("Invalid message",{message:t})},Zy=async function(t,e){try{return{result:await a(this,Aa).call(this,t,e)??null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Xm)return Ce.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 Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},Fy=async function(t,e){try{return await a(this,ka).call(this,t,e),{result:null}}catch(r){if(r instanceof Ce)return r.toResult();if(r instanceof Xm)return Ce.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 Ce.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ce.internalError({details:i}).toResult()}}},Hy=function(t){const e=a(this,or).get(t.id);if(e){if("result"in t)e.resolve(t.result);else if("error"in t){const{code:r,message:i,data:s}=t.error;e.reject(new Ce(r,i,s))}a(this,or).delete(t.id)}else console.error("Got response to unknown request",t.id)},kd=function(){if(a(this,Bt).signal.aborted)throw a(this,Bt).signal.reason??new Error("ACP connection closed")},Zo=async function(t){return d(this,As,a(this,As).then(async()=>{const e=a(this,Ss).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{h(this,me,Ad).call(this,e)})),a(this,As)};class Ce extends Error{constructor(e,r,i){super(r);$(this,"code");$(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new Ce(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new Ce(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new Ce(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new Ce(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new Ce(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new Ce(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new Ce(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function TP(n,t,e){const r=n.dispose.bind(n);n.dispose=()=>{if(!t())return e(),r()}}function Vy(n){var e;class t extends n{constructor(...s){super(...s);g(this,e,!1);TP(this,()=>a(this,e),()=>{d(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return a(this,e)}}return e=new WeakMap,t}const RP=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,IP=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,xP=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,PP=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,DP=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,LP="single_session",OP={name:"television-acp-client",version:"0.0.0"},By="agent:main:television",zP=Vy(Mr);var ks,qt,nt,jt,ar,Et,On,Wt,Gt,lr,$t,Es,$s,Yt,He,zn,Cs,li,Nn,cr,$a,Ct,Kt,iu,Jt,R,Ed,qy,jy,Wy,pc,Gy,Yy,Ky,Jy,Xy,Qy,ew,jr,as,ls,Cn,tw,cs,$d,Cd,mc,nw,gc,Td,Rd,Ca,Ta,vc,us,Id,rw;class NP extends zP{constructor(e){super();g(this,R);g(this,ks,"disconnected");g(this,qt,null);g(this,nt,new Map);g(this,jt,null);g(this,ar,null);g(this,Et,null);g(this,On,null);g(this,Wt,null);g(this,Gt,null);g(this,lr);g(this,$t,null);g(this,Es,0);g(this,$s,1);g(this,Yt,null);g(this,He,null);g(this,zn,!1);g(this,Cs,!1);g(this,li,!1);g(this,Nn,null);g(this,cr,new Set);g(this,$a);g(this,Ct);g(this,Kt);g(this,iu,e=>{h(this,R,jy).call(this,e)});g(this,Jt,null);g(this,Ca,()=>{h(this,R,us).call(this,"ACP bridge websocket closed")});g(this,Ta,()=>{h(this,R,us).call(this,"ACP bridge websocket error")});d(this,Ct,e),d(this,Kt,e.sessionMode??LP),d(this,lr,e.mappedSessionStore??MP()),d(this,$a,e.createSocket??(r=>new WebSocket(r)))}get status(){return a(this,ks)}get messages(){return[...a(this,nt).values()]}get enabled(){return a(this,Ct).enabled??!1}setToken(e){a(this,Ct).token=e??""}setEnabled(e){a(this,Ct).enabled=e,e||(h(this,R,vc).call(this),d(this,qt,null),h(this,R,Cn).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){a(this,ar)===null&&(d(this,qt,null),d(this,ar,h(this,R,qy).call(this)));try{await a(this,ar),await h(this,R,pc).call(this)}catch(e){throw h(this,R,us).call(this,Hh(e)),e}}}dispose(){h(this,R,vc).call(this),d(this,qt,null),h(this,R,Cn).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Ed).call(this,"ready")),(a(this,Wt)===null||a(this,$t)!==h(this,R,gc).call(this))&&await h(this,R,pc).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=e.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,R,as).call(this,{id:h(this,R,cs).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,R,Cn).call(this,"running");try{const i=await h(this,R,mc).call(this).prompt({sessionId:h(this,R,Cd).call(this),prompt:[{type:"text",text:h(this,R,tw).call(this,r)}]});h(this,R,jr).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,R,Cn).call(this,"ready")}catch(i){throw h(this,R,rw).call(this)||(h(this,R,jr).call(this,"error"),h(this,R,Cn).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Ed).call(this,"ready"));const e=h(this,R,gc).call(this);((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="mapped"?a(this,lr).clearActualSessionId(e):d(this,Es,a(this,Es)+1),d(this,Et,null),d(this,On,null),d(this,Wt,null),d(this,$t,null),h(this,R,Id).call(this)}async cancel(){this.status==="running"&&(h(this,R,Cn).call(this,"cancelling"),await h(this,R,mc).call(this).cancel({sessionId:h(this,R,Cd).call(this)}))}setChannelContext(e){var s,o,l;if(e===null){if(a(this,He)===null)return;d(this,He,null),d(this,zn,!1);return}const r={channelID:e.channelID,channelName:e.channelName};if(((s=a(this,He))==null?void 0:s.channelID)===r.channelID&&((o=a(this,He))==null?void 0:o.channelName)===r.channelName)return;const i=((l=a(this,He))==null?void 0:l.channelID)??null;if(d(this,He,r),a(this,Kt)==="single_session"){(!a(this,$t)||i!==r.channelID)&&d(this,zn,!0);return}a(this,$t)!==h(this,R,Td).call(this,r.channelID)&&(d(this,Et,null),d(this,On,null),a(this,jt)&&this.status==="ready"&&h(this,R,pc).call(this).catch(c=>{h(this,R,us).call(this,Hh(c))}))}}ks=new WeakMap,qt=new WeakMap,nt=new WeakMap,jt=new WeakMap,ar=new WeakMap,Et=new WeakMap,On=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,lr=new WeakMap,$t=new WeakMap,Es=new WeakMap,$s=new WeakMap,Yt=new WeakMap,He=new WeakMap,zn=new WeakMap,Cs=new WeakMap,li=new WeakMap,Nn=new WeakMap,cr=new WeakMap,$a=new WeakMap,Ct=new WeakMap,Kt=new WeakMap,iu=new WeakMap,Jt=new WeakMap,R=new WeakSet,Ed=async function(e){if(this.status!==e){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(a(this,qt)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",o)},o=()=>{if(this.status===e){s(),r();return}if(this.status==="disposed"){s(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(s(),i(new Error(a(this,qt)??"ACPClient is disconnected")))};this.addEventListener("status-changed",o)})}},qy=async function(){try{const{stream:e,socket:r,metadata:i}=await HP({serverURL:a(this,Ct).serverURL,token:a(this,Ct).token,createSocket:a(this,$a),onDisconnect:a(this,iu)});d(this,Gt,i),d(this,Jt,r),r.addEventListener("close",a(this,Ca)),r.addEventListener("error",a(this,Ta)),d(this,jt,new $P(s=>({connection:s,sessionUpdate:async o=>{await h(this,R,Yy).call(this,o)},requestPermission:async o=>h(this,R,Ky).call(this,o)}),e)),await a(this,jt).initialize({protocolVersion:c3,clientCapabilities:{},clientInfo:OP})}catch(e){throw e}},jy=function(e){h(this,R,us).call(this,Hh(e))},Wy=function(e){const r=e==null?void 0:e.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(s=>s.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},pc=async function(){const e=h(this,R,gc).call(this);if(a(this,Et)&&a(this,On)===e){await a(this,Et);return}d(this,On,e),d(this,Et,h(this,R,Gy).call(this,e)),await a(this,Et)},Gy=async function(e){var c;const r=h(this,R,mc).call(this);h(this,R,Id).call(this);let i,s=!1,o=null;const l={cwd:h(this,R,nw).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(d(this,li,!0),d(this,Nn,null),((c=a(this,Gt))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=a(this,lr).getActualSessionId(e);if(u)try{const f=await r.loadSession({...l,sessionId:u});if(UP(f))throw new Error("Mapped ACP session was not found");o=f,i=u,s=!0}catch{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,lr).setActualSessionId(e,i),s=!1}else{const f=await r.newSession(l);o=f,i=f.sessionId,a(this,lr).setActualSessionId(e,i),s=!1}}else try{o=await r.loadSession({...l,sessionId:e}),i=e,s=a(this,nt).size>0}catch{const u=await r.newSession(l);o=u,i=u.sessionId,s=!1}}finally{d(this,li,!1),d(this,Nn,null),h(this,R,jr).call(this,"final")}h(this,R,Wy).call(this,o),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,Wt,i),d(this,$t,e),d(this,Cs,!0),s?(a(this,cr).add(e),a(this,Kt)==="single_session"&&d(this,zn,!1)):(a(this,cr).delete(e),d(this,zn,a(this,Kt)==="single_session")),d(this,qt,null),h(this,R,Cn).call(this,"ready")},Yy=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,R,ew).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,R,Jy).call(this,r.content.text);return;case"tool_call":h(this,R,Xy).call(this,r);return;case"tool_call_update":h(this,R,Qy).call(this,r);return;case"agent_thought_chunk":return;default:return}},Ky=async function(e){return{outcome:{outcome:"cancelled"}}},Jy=function(e){d(this,Nn,null);const r=FP(e);if(!r)return;if(!a(this,Yt)){const s={id:h(this,R,cs).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,Yt,s.id),h(this,R,as).call(this,s);return}const i=a(this,nt).get(a(this,Yt));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,R,ls).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Xy=function(e){h(this,R,jr).call(this,"final");const r=h(this,R,$d).call(this,e.toolCallId),i=cg("content"in e?e.content:void 0),s={id:(r==null?void 0:r.id)??h(this,R,cs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:e.title,toolKind:e.kind??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,ls).call(this,s);return}h(this,R,as).call(this,s)},Qy=function(e){const r=h(this,R,$d).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",s=cg(e.content),o=s?`${i}${s}`:i,l={id:(r==null?void 0:r.id)??h(this,R,cs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:(r==null?void 0:r.title)??e.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:o,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,ls).call(this,l);return}h(this,R,as).call(this,l)},ew=function(e){if(h(this,R,jr).call(this,"final"),!e)return;const r=a(this,li)?a(this,Nn):null;if(!r){const s=lg(e);if(!s)return;const o={id:h(this,R,cs).call(this,"user"),kind:"user",text:s,status:"final"};h(this,R,as).call(this,o),a(this,li)&&d(this,Nn,o.id);return}const i=a(this,nt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,R,ls).call(this,{...i,text:lg(`${i.text}${e}`)})},jr=function(e){if(!a(this,Yt))return;const r=a(this,nt).get(a(this,Yt));(r==null?void 0:r.kind)==="assistant"&&h(this,R,ls).call(this,{...r,status:e}),d(this,Yt,null)},as=function(e){a(this,nt).set(e.id,e),this.dispatchEvent(new Mh("messages-changed"))},ls=function(e){a(this,nt).set(e.id,e),this.dispatchEvent(new Mh("messages-changed"))},Cn=function(e){a(this,ks)!==e&&(d(this,ks,e),this.dispatchEvent(new YE("status-changed")))},tw=function(e){const r=a(this,$t);if(!r)return e;const i=a(this,He)?a(this,Kt)==="single_session"?a(this,zn)||!a(this,cr).has(r):!a(this,cr).has(r):!1,s=a(this,Cs)&&(a(this,He)!==null||PP.test(e));if(!(s||i))return e;s&&d(this,Cs,!1),i&&(d(this,zn,!1),a(this,cr).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>`."];return a(this,He)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${a(this,He).channelID}`),l.push(`channel_name: ${a(this,He).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",e),l.join(`
|
|
43
|
-
`)},cs=function(e){const r=`${e}-${a(this,$s)}`;return d(this,$s,a(this,$s)+1),r},$d=function(e){for(const r of a(this,nt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},Cd=function(){if(!a(this,Wt))throw new Error("ACP session is not ready");return a(this,Wt)},mc=function(){if(!a(this,jt))throw new Error("ACP connection is not ready");return a(this,jt)},nw=function(){var r;const e=(r=a(this,Gt))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},gc=function(){var r;if(a(this,Kt)==="single_session")return h(this,R,Rd).call(this,`${By}-${(a(this,Ct).clientGUID??"default-client").toLowerCase()}`);const e=(r=a(this,He))==null?void 0:r.channelID;if(!e)throw new Error("Channel context is required for per-channel session mode");return h(this,R,Td).call(this,e)},Td=function(e){return h(this,R,Rd).call(this,ZP(a(this,Kt),e,a(this,Ct).clientGUID??"default-client"))},Rd=function(e){var r;return((r=a(this,Gt))==null?void 0:r.sessionIdStrategy)==="deterministic"&&a(this,Es)>0?`${e}:epoch-${a(this,Es)}`:e},Ca=new WeakMap,Ta=new WeakMap,vc=function(){d(this,jt,null),d(this,ar,null),d(this,Et,null),d(this,On,null),d(this,Wt,null),d(this,$t,null),d(this,Gt,null),a(this,Jt)&&(a(this,Jt).removeEventListener("close",a(this,Ca)),a(this,Jt).removeEventListener("error",a(this,Ta)),a(this,Jt).close(),d(this,Jt,null))},us=function(e){const r=a(this,jt)!==null||a(this,ar)!==null||a(this,Et)!==null||a(this,On)!==null||a(this,Wt)!==null||a(this,$t)!==null||a(this,Gt)!==null||a(this,Jt)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,R,jr).call(this,"error"),h(this,R,vc).call(this),d(this,qt,e??null),h(this,R,Cn).call(this,"disconnected"))},Id=function(){const e=a(this,nt).size>0;d(this,Yt,null),d(this,Nn,null),d(this,$s,1),a(this,nt).clear(),e&&this.dispatchEvent(new Mh("messages-changed"))},rw=function(){return this.status==="disconnected"};function MP(){const n=new Map;return{getActualSessionId(t){return n.get(t)??null},setActualSessionId(t,e){n.set(t,e)},clearActualSessionId(t){n.delete(t)}}}function UP(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function ZP(n,t,e){return n==="single_session"?`${By}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function iw(n){return n.replace(/^(?:\s*\n)+/,"")}function lg(n){let t=n;return t=t.replace(RP,""),t=t.replace(IP,""),t=t.replace(xP,""),t=iw(t),t}function FP(n){let t=n;return t=t.replace(DP,""),t=iw(t),t}function cg(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function HP(n){const t=n.createSocket(qP(n.serverURL,n.token));let e=!1,r,i;const s=new Promise((u,f)=>{r=u,i=f}),o=new ReadableStream({start(u){let f=!1;const m=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},v=S=>{const x=BP(S);if(!x)return;let M;try{M=JSON.parse(x)}catch(Z){const G=Z instanceof Error?Z:new Error(String(Z));i(G),u.error(G);return}switch(M.type){case"acp-bridge-status":if(M.status==="ready"){let Z;try{Z=VP(M)}catch(G){const F=G instanceof Error?G:new Error(String(G));e||i(F),u.error(F);return}e||(e=!0,r(Z));return}if(M.status==="error"||M.status==="exited"){const Z=new Error(M.error??`ACP bridge ${M.status}`);e||i(Z),u.error(Z)}return;case"acp-bridge-message":u.enqueue(M.message);return}},y=()=>{var x;if(f)return;f=!0;const S=new Error("ACP bridge websocket closed");e||i(S),(x=n.onDisconnect)==null||x.call(n,S),u.close()},k=()=>{var x;if(f)return;f=!0;const S=new Error("ACP bridge websocket error");e||i(S),(x=n.onDisconnect)==null||x.call(n,S),u.error(S)};t.addEventListener("open",m),t.addEventListener("message",v),t.addEventListener("close",y),t.addEventListener("error",k)}}),l=new WritableStream({async write(u){await s,t.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){t.close()},abort(){t.close()}}),c=await s;return{stream:{readable:o,writable:l},socket:t,metadata:c}}function VP(n){const{agent:t,sessionIdStrategy:e,sessionCwd:r}=n;if((t==="openclaw"||t==="hermes")&&(e==="deterministic"||e==="mapped")&&typeof r=="string"&&r.length>0)return{agent:t,sessionIdStrategy:e,sessionCwd:r};throw new Error("ACP bridge ready status missing bootstrap metadata")}function BP(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const t=n.data;if(typeof t=="string")return t;if(t instanceof Uint8Array)return new TextDecoder().decode(t);if(Array.isArray(t))return Buffer.concat(t).toString("utf8")}return null}function qP(n,t){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname="/acp",e.search="",e.searchParams.set("token",t),e.hash="",e.toString()}function Hh(n){return n instanceof Error?n.message:String(n)}const ug="television.acpClientGUID",hg="television.acpMappedSessions",dg=1;var Ts;class jP{constructor(){g(this,Ts,new Map)}getActualSessionId(t){return a(this,Ts).get(t)??null}setActualSessionId(t,e){a(this,Ts).set(t,e)}clearActualSessionId(t){a(this,Ts).delete(t)}}Ts=new WeakMap;var Rs,Ra,ot,yc,wc,xd;class WP{constructor(t,e){g(this,ot);g(this,Rs);g(this,Ra);d(this,Rs,t),d(this,Ra,e)}getActualSessionId(t){const e=h(this,ot,wc).call(this)[h(this,ot,yc).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=h(this,ot,wc).call(this);r[h(this,ot,yc).call(this,t)]=e,h(this,ot,xd).call(this,r)}clearActualSessionId(t){const e=h(this,ot,wc).call(this);delete e[h(this,ot,yc).call(this,t)],h(this,ot,xd).call(this,e)}}Rs=new WeakMap,Ra=new WeakMap,ot=new WeakSet,yc=function(t){return JSON.stringify([a(this,Ra),t])},wc=function(){const t=a(this,Rs).getItem(hg);if(!t)return{};let e;try{e=JSON.parse(t)}catch{return{}}if(typeof e!="object"||e===null||Array.isArray(e))return{};const r=e;return r.version!==dg?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},xd=function(t){const e={version:dg,entries:t};a(this,Rs).setItem(hg,JSON.stringify(e))};function sw(){return typeof window>"u"?null:window.localStorage}function GP(n){const t=n.getItem(ug);if(t)return t;const e=op().toLowerCase();return n.setItem(ug,e),e}const fg=4401,YP=401,Wl=1e3,KP=3e4;class bc extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class JP extends Mr{constructor(e){var o,l;super();$(this,"url");$(this,"name");$(this,"telemetryMeta");$(this,"status","unauthorized");$(this,"channels",new Map);$(this,"client");$(this,"acpClient");$(this,"_token");$(this,"attempting",!1);$(this,"nextRetryAt",null);$(this,"hasEverConnected",!1);$(this,"hasAuthRejected",!1);$(this,"hasAuthTokenRejected",!1);$(this,"bootState","pending");$(this,"serverVersion",null);$(this,"updateState",null);$(this,"decideBoot");$(this,"navigationPending");$(this,"createSocket");$(this,"createClient");$(this,"socket",null);$(this,"connectAttempt",0);$(this,"autoReconnect",!1);$(this,"retryTimer",null);$(this,"retryDelay",Wl);$(this,"visibilityEventTarget");$(this,"networkEventTarget");$(this,"onVisibilityChange");$(this,"onNetworkOnline");$(this,"telemetryActivityAgent");this.url=xr(e.url),this.name=e.name,this.decideBoot=e.decideBoot??null,this.navigationPending=e.navigationPending??(()=>!1),this._token=e.token??null,this.telemetryMeta=e.telemetryMeta??null,this.createSocket=e.createSocket??(c=>new WebSocket(c)),this.createClient=e.createClient??((c,u,f)=>new SE(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...f?{telemetryMeta:f}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new WP(e.acpStorage,this.url):new jP);this.acpClient=new NP({serverURL:this.url,token:this._token??"",...e.createACPSocket?{createSocket:e.createACPSocket}:e.createSocket?{createSocket:e.createSocket}:{},...e.clientGUID?{clientGUID:e.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=e.visibilityEventTarget!==void 0?e.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=e.networkEventTarget!==void 0?e.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(o=this.visibilityEventTarget)==null||o.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=e.telemetryDocumentTarget!==void 0?e.telemetryDocumentTarget:typeof document<"u"?document:null,s=e.telemetryWindowTarget!==void 0?e.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&s?o3({meta:this.telemetryMeta,documentTarget:i,windowTarget:s,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(e){this._token=e,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Wl,this.autoReconnect=!0,await this.attempt()}dispose(){var e,r,i,s;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(e=this.socket)==null||e.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(s=this.telemetryActivityAgent)==null||s.stop(),this.acpClient.dispose()}getViewURL(e){const r=Sd(e,{electron:Gn()});return Gn()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(e){const r=Sd(e,{electron:Gn()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(e){const{channel:r}=await this.client.channels.create({name:e});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"channel-created":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Mo("channels-changed"));break;case"channel-updated":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Mo("channels-changed"));break;case"channel-removed":this.channels.delete(e.channelID),this.dispatchEvent(new Mo("channels-changed"));break;case"artifact-created":{const r=this.channels.get(e.channelID);r&&!aE(r).includes(e.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[e.artifact.id],geometry:{...ov},size:{...av}}]);break}case"artifact-removed":{const r=this.channels.get(e.channelID);r&&(r.layout=ud(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"artifact-focus":break;default:return XP(e,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const e=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new gt("change"));const r=this.createSocket(QP(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,o)=>{let l=!1;const c=()=>{var m;l||this.connectAttempt!==e||(l=!0,this.retryDelay=Wl,this.hasEverConnected=!0,this.setStatus("connected"),(m=this.telemetryActivityAgent)==null||m.start(),s())},u=m=>{l||this.connectAttempt!==e||(l=!0,o(m))},f=async()=>{const m=this.hasEverConnected;try{const[{channels:v},y]=await Promise.all([this.client.channels.list(),this.client.display.get()]);this.channels=new Map(v.map(k=>[k.id,structuredClone(k)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new gt("change")),m&&this.dispatchEvent(new Mo("channels-changed")),this.dispatchEvent(new dc("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:y.focusedChannelId}})),this.dispatchEvent(new dc("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...y.pinnedChannelIds]}})),c(),m&&this.connectAttempt===e&&this.dispatchEvent(new wv("server-reconnected",{serverURL:this.url}))}catch(v){if(s5(v)){u(new bc);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||f())}),r.addEventListener("message",m=>{const v=i5(m);if(!v)return;if(v.type==="server-status"){const k=v;this.serverVersion=k.version,this.updateState=k.update??null;let S=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(k)==="boot"?(this.bootState="booted",S=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new bv("server-status",{serverURL:this.url,message:k})),S?this.navigationPending()||f():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new gt("change"));return}if(!r5(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new dc("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",m=>{if(this.connectAttempt!==e)return;this.socket=null;const v=e5(m);if(!l){u(v===fg?new bc:new Error("Connection closed before initialization"));return}if(v===fg){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},s=>{throw this.attempting=!1,this.handleAttemptFailure(s),s})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof bc){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(e){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const e=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,KP),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new gt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new gt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Wl,this.attempt().catch(()=>{})))}sendTelemetryActivity(e){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(e)))}sendTelemetrySignal(e,r){var s;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:oE,clientId:this.telemetryMeta.clientId,event:e,properties:r};(s=this.socket)==null||s.send(JSON.stringify(i))}setStatus(e){this.status!==e&&(this.status=e,this.dispatchEvent(new gt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function XP(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function QP(n,t,e=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",t&&r.searchParams.set("token",t),e)for(const[i,s]of s3(e))r.searchParams.set(i,s);return r.hash="",r.toString()}function e5(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const t5={"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,"artifact-focus":!0},n5=new Set(Object.keys(t5));function r5(n){return n5.has(n)}function i5(n){const t=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||!("type"in e)||typeof e.type!="string"?null:e}function s5(n){return n instanceof go&&n.status===YP}const o5="Local";var ct,Tt,gn,Pd,Dd,ow,Ia,xa,Pa,Da,La;class a5 extends Mr{constructor(e){super();g(this,gn);$(this,"connection");$(this,"clientGUID");$(this,"acpStorage");$(this,"connectError",null);g(this,ct);g(this,Tt,!1);g(this,Ia,()=>{a(this,Tt)||(h(this,gn,ow).call(this),this.dispatchEvent(new gt("change")))});g(this,xa,e=>{a(this,Tt)||this.dispatchEvent(new dc("server-event",{serverURL:e.serverURL,event:e.event}))});g(this,Pa,()=>{a(this,Tt)||this.dispatchEvent(new Mo("channels-changed"))});g(this,Da,e=>{a(this,Tt)||this.dispatchEvent(new wv("server-reconnected",{serverURL:e.serverURL}))});g(this,La,e=>{a(this,Tt)||this.dispatchEvent(new bv("server-status",{serverURL:e.serverURL,message:e.message}))});d(this,ct,e.localStore),this.acpStorage=e.acpStorage===void 0?sw():e.acpStorage,this.clientGUID=e.clientGUID??(this.acpStorage?GP(this.acpStorage):op().toLowerCase());const r=xr(e.serverURL);e.launchToken!==void 0&&e.launchToken!==null&&a(this,ct).set(Om(a(this,ct).get(),r,e.launchToken));const i=e.launchToken??Lm(a(this,ct).get(),r),s=e.createSocket??(l=>new WebSocket(l)),o=e.createConnection??(l=>new JP(l));this.connection=o({url:r,name:e.connectionName??o5,token:i,createSocket:s,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:e.telemetryMeta??null,decideBoot:e.decideBoot,navigationPending:e.navigationPending}),this.connection.addEventListener("change",a(this,Ia)),this.connection.addEventListener("server-event",a(this,xa)),this.connection.addEventListener("channels-changed",a(this,Pa)),this.connection.addEventListener("server-reconnected",a(this,Da)),this.connection.addEventListener("server-status",a(this,La))}get storedAuthToken(){return Lm(a(this,ct).get(),this.connection.url)}async connect(){await h(this,gn,Pd).call(this,this.connection.token)}async authenticate(e){a(this,ct).set(Om(a(this,ct).get(),this.connection.url,e)),await h(this,gn,Pd).call(this,e)}dispose(){a(this,Tt)||(d(this,Tt,!0),this.connection.removeEventListener("change",a(this,Ia)),this.connection.removeEventListener("server-event",a(this,xa)),this.connection.removeEventListener("channels-changed",a(this,Pa)),this.connection.removeEventListener("server-reconnected",a(this,Da)),this.connection.removeEventListener("server-status",a(this,La)),this.connection.dispose())}}ct=new WeakMap,Tt=new WeakMap,gn=new WeakSet,Pd=async function(e){if(!a(this,Tt)){h(this,gn,Dd).call(this,null);try{await this.connection.connect(e)}catch(r){h(this,gn,Dd).call(this,r instanceof bc?null:r instanceof Error?r.message:String(r))}}},Dd=function(e){this.connectError!==e&&(this.connectError=e,this.dispatchEvent(new gt("change")))},ow=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const e=a(this,ct).get(),r=QE(e,this.connection.url);r!==e&&a(this,ct).set(r),this.connection.token!==null&&this.connection.clearToken()},Ia=new WeakMap,xa=new WeakMap,Pa=new WeakMap,Da=new WeakMap,La=new WeakMap;const Ld="tv-nav:",so="tv-reload",pg=100,l5=1e3,c5=60,u5=60,h5=24,d5=30,f5=d5*h5*u5*c5*l5;function Yn(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(so);return t.searchParams.delete(so),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var Oa,Is,he,ce,ci,ke,aw,nr,lw,Od,zd;class p5 extends Mr{constructor(e,r){super();g(this,ke);g(this,Oa);g(this,Is);g(this,he,[]);g(this,ce,-1);g(this,ci,0);d(this,Oa,e),d(this,Is,Yn(r)),h(this,ke,aw).call(this)}get currentURL(){var e;return a(this,ce)===-1?null:((e=a(this,he)[a(this,ce)])==null?void 0:e.url)??null}get canGoBack(){return a(this,ce)>-1}get canGoForward(){return a(this,ce)<a(this,he).length-1}get entries(){return a(this,he).map(e=>({...e}))}get cursor(){return a(this,ce)}navigate(e){const r=Yn(e);if(r===a(this,Is)){if(a(this,ce)===-1)return;d(this,ce,-1),h(this,ke,nr).call(this);return}a(this,ce)<a(this,he).length-1&&d(this,he,a(this,he).slice(0,a(this,ce)+1)),a(this,he).push({url:r}),d(this,ce,a(this,he).length-1),h(this,ke,Od).call(this),h(this,ke,nr).call(this)}replace(e){var i;if(a(this,ce)===-1){this.navigate(e);return}const r=Yn(e);if(r===a(this,Is)){d(this,he,a(this,he).filter((s,o)=>o!==a(this,ce))),d(this,ce,-1),h(this,ke,nr).call(this);return}((i=a(this,he)[a(this,ce)])==null?void 0:i.url)!==r&&(d(this,he,a(this,he).map((s,o)=>o===a(this,ce)?{url:r}:s)),h(this,ke,nr).call(this))}back(){a(this,ce)!==-1&&(d(this,ce,a(this,ce)-1),h(this,ke,nr).call(this))}forward(){this.canGoForward&&(d(this,ce,a(this,ce)+1),h(this,ke,nr).call(this))}reset(){a(this,ce)===-1&&a(this,he).length===0||(d(this,he,[]),d(this,ce,-1),h(this,ke,nr).call(this))}}Oa=new WeakMap,Is=new WeakMap,he=new WeakMap,ce=new WeakMap,ci=new WeakMap,ke=new WeakSet,aw=function(){const e=localStorage.getItem(a(this,ke,zd));if(e!==null)try{const r=JSON.parse(e);if(!cw(r))return;d(this,he,r.entries.map(i=>({url:i.url}))),d(this,ce,r.cursor),d(this,ci,r.lastWritten),h(this,ke,Od).call(this)}catch{d(this,he,[]),d(this,ce,-1),d(this,ci,0)}},nr=function(){d(this,ci,Date.now());try{localStorage.setItem(a(this,ke,zd),JSON.stringify(h(this,ke,lw).call(this)))}catch(e){if(!v5(e))throw e}this.dispatchEvent(new gt("change"))},lw=function(){return{v:1,entries:a(this,he).map(e=>({...e})),cursor:a(this,ce),lastWritten:a(this,ci)}},Od=function(){if(a(this,he).length<=pg)return;const e=a(this,he).length-pg;d(this,he,a(this,he).slice(e)),d(this,ce,Math.max(-1,a(this,ce)-e))},zd=function(){return m5(a(this,Oa))};function m5(n){return`${Ld}${n}`}function g5(n){const t=Date.now()-f5,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(Ld)))continue;const s=i.slice(Ld.length),o=localStorage.getItem(i);if(o===null)continue;let l;try{l=JSON.parse(o)}catch{e.push(i);continue}if(!cw(l)){e.push(i);continue}!n.has(s)&&l.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function v5(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function cw(n){if(typeof n!="object"||n===null)return!1;const t=n;if(t.v!==1||!Array.isArray(t.entries))return!1;const e=t.cursor;return typeof e!="number"||!Number.isInteger(e)||typeof t.lastWritten!="number"||!Number.isFinite(t.lastWritten)||e<-1||e>=t.entries.length?!1:t.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const y5="0.1.214";function gp(n=y5){return n!==void 0&&n.length>0?n:"0.0.0"}function vp(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const Nd="tv-reload-attempted";function w5(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:EE(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 b5(n){const t=n.getItem(Nd);if(t===null)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;const r=e;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function _5(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??vp(),i=n.bundleVersion??gp();if(t===null)return{dispose(){}};let s=null;const o=()=>{if(s===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const f=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=u=>{if(r.pending)return;const f=w5({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:b5(t)});switch(f.action){case"reload":t.setItem(Nd,JSON.stringify(f.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(Nd),s={fromVersion:f.fromVersion,toVersion:f.toVersion},o();return;case"none":return}},c=()=>{o()};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 S5(n){const t=Gn(n.search),e=ay(n.search),r=e!==null&&sp(e)?e:null;return{electron:t,shellVersion:r}}function A5(n){return!n.electron||n.requiredDesktopVersion===null||!sp(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===hd?!1:uv(n.requiredDesktopVersion,n.shellVersion)}const k5=`# Desktop app upgrade required
|
|
44
|
-
|
|
45
|
-
Your Television server requires a newer version of this desktop app.
|
|
46
|
-
In a terminal, please upgrade:
|
|
47
|
-
|
|
48
|
-
\`\`\`bash
|
|
49
|
-
npm install -g @telepath-computer/television-desktop@latest
|
|
50
|
-
\`\`\`
|
|
51
|
-
|
|
52
|
-
Then quit this app, and relaunch it from the terminal with:
|
|
53
|
-
|
|
54
|
-
\`\`\`bash
|
|
55
|
-
tv-desktop
|
|
56
|
-
\`\`\``;function uw(n){return n===null?k5:n.upgradeMarkdown}function E5(n){const t=A5(n);return{gated:t,instructionsMarkdown:t?uw(n.desktop):null,suppressUpdateToast:t}}function $5(n){const t=n.reload??(()=>location.reload()),e=n.navigationLatch??vp();let r=null,i=!1;const s=new Set,o=f=>{var m;return E5({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((m=f.update)==null?void 0:m.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const m=f.requiredDesktopVersion;if(m===null||s.has(m))return;s.add(m);const v=r==null?void 0:r.connection;(v==null?void 0:v.url)===n.primaryServerURL&&v.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:m})}const u=f=>{e.pending||f.serverURL===n.primaryServerURL&&(o(f.message).gated?(i=!0,l(),c(f.message)):i&&e.begin(t))};return{get gated(){return i},decideBoot(f){return o(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var xs;class C5 extends Mr{constructor(){super(...arguments);g(this,xs,!1)}get toastsSuppressed(){return a(this,xs)}suppressToasts(){a(this,xs)||(d(this,xs,!0),this.dispatchEvent(new gt("change")))}}xs=new WeakMap;function hw(n){return typeof n=="object"&&n!==null}function dw(n){return!hw(n)||n.type!=="ready"?!1:!("id"in n)}function fw(n){return!(!hw(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const pw=Lt(),mw="No handler registered for update-content",gw="handleUpdateContent: handler already registered",mg="television-artifact-bridge";function vw(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const yw=Vy(Mr);var Ps,Ds,Ls,ui,hi,za,Le,Md,ww,bw,Fo,Ud,l1;let T5=(l1=class extends yw{constructor(e){super();g(this,Le);g(this,Ps);g(this,Ds);g(this,Ls);g(this,ui,null);g(this,hi,null);g(this,za,!1);d(this,Ps,e);const r=e.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,Ds,r),d(this,Ls,i=>h(this,Le,ww).call(this,i)),a(this,Ds).addEventListener("message",a(this,Ls))}get content(){return a(this,hi)}set content(e){h(this,Le,Ud).call(this),d(this,hi,e),a(this,za)&&h(this,Le,Md).call(this,e)}handleUpdateContent(e){if(h(this,Le,Ud).call(this),a(this,ui)!==null)throw new Error(gw);d(this,ui,e)}dispose(){a(this,Ds).removeEventListener("message",a(this,Ls)),d(this,ui,null)}},Ps=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,ui=new WeakMap,hi=new WeakMap,za=new WeakMap,Le=new WeakSet,Md=function(e){const r={type:"content-updated",content:e};h(this,Le,Fo).call(this,r)},ww=function(e){if(this.disposed||e.source!==a(this,Ps).contentWindow)return;const r=e.data;if(dw(r)){d(this,za,!0),this.dispatchEvent(new pw("ready")),a(this,hi)!==null&&h(this,Le,Md).call(this,a(this,hi));return}if(fw(r)){h(this,Le,bw).call(this,r);return}},bw=async function(e){const r=a(this,ui);if(r===null){h(this,Le,Fo).call(this,{type:"response",id:e.id,error:{message:mw}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,Le,Fo).call(this,{type:"response",id:e.id,error:{message:vw(i)}});return}this.disposed||h(this,Le,Fo).call(this,{type:"response",id:e.id,result:{}})},Fo=function(e){const r=a(this,Ps).contentWindow;r&&r.postMessage(e,"*")},Ud=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},l1);var di,Os,fi,pi,Na,Oe,Zd,_w,Sw,Ho,Fd;class R5 extends yw{constructor(e){super();g(this,Oe);g(this,di);g(this,Os);g(this,fi,null);g(this,pi,null);g(this,Na,!1);d(this,di,e),d(this,Os,r=>h(this,Oe,_w).call(this,r)),a(this,di).addEventListener("ipc-message",a(this,Os))}get content(){return a(this,pi)}set content(e){h(this,Oe,Fd).call(this),d(this,pi,e),a(this,Na)&&h(this,Oe,Zd).call(this,e)}handleUpdateContent(e){if(h(this,Oe,Fd).call(this),a(this,fi)!==null)throw new Error(gw);d(this,fi,e)}dispose(){a(this,di).removeEventListener("ipc-message",a(this,Os)),d(this,fi,null)}}di=new WeakMap,Os=new WeakMap,fi=new WeakMap,pi=new WeakMap,Na=new WeakMap,Oe=new WeakSet,Zd=function(e){const r={type:"content-updated",content:e};h(this,Oe,Ho).call(this,r)},_w=function(e){var s;if(this.disposed)return;const r=e.detail??e;if(!r||r.channel!==mg)return;const i=(s=r.args)==null?void 0:s[0];if(dw(i)){d(this,Na,!0),this.dispatchEvent(new pw("ready")),a(this,pi)!==null&&h(this,Oe,Zd).call(this,a(this,pi));return}if(fw(i)){h(this,Oe,Sw).call(this,i);return}},Sw=async function(e){const r=a(this,fi);if(r===null){h(this,Oe,Ho).call(this,{type:"response",id:e.id,error:{message:mw}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,Oe,Ho).call(this,{type:"response",id:e.id,error:{message:vw(i)}});return}this.disposed||h(this,Oe,Ho).call(this,{type:"response",id:e.id,result:{}})},Ho=function(e){var r,i;(i=(r=a(this,di)).send)==null||i.call(r,mg,e)},Fd=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
|
|
57
|
-
* @license
|
|
58
|
-
* Copyright 2017 Google LLC
|
|
59
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
-
*/const sa=globalThis,gg=n=>n,jc=sa.trustedTypes,vg=jc?jc.createPolicy("lit-html",{createHTML:n=>n}):void 0,Aw="$lit$",rr=`lit$${Math.random().toFixed(9).slice(2)}$`,kw="?"+rr,I5=`<${kw}>`,Fi=document,da=()=>Fi.createComment(""),fa=n=>n===null||typeof n!="object"&&typeof n!="function",yp=Array.isArray,x5=n=>yp(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Vh=`[
|
|
61
|
-
\f\r]`,Co=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yg=/-->/g,wg=/>/g,Vr=RegExp(`>|${Vh}(?:([^\\s"'>=/]+)(${Vh}*=${Vh}*(?:[^
|
|
62
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),bg=/'/g,_g=/"/g,Ew=/^(?:script|style|textarea|title)$/i,P5=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),V=P5(1),Pt=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),Sg=new WeakMap,Qr=Fi.createTreeWalker(Fi,129);function $w(n,t){if(!yp(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return vg!==void 0?vg.createHTML(t):t}const D5=(n,t)=>{const e=n.length-1,r=[];let i,s=t===2?"<svg>":t===3?"<math>":"",o=Co;for(let l=0;l<e;l++){const c=n[l];let u,f,m=-1,v=0;for(;v<c.length&&(o.lastIndex=v,f=o.exec(c),f!==null);)v=o.lastIndex,o===Co?f[1]==="!--"?o=yg:f[1]!==void 0?o=wg:f[2]!==void 0?(Ew.test(f[2])&&(i=RegExp("</"+f[2],"g")),o=Vr):f[3]!==void 0&&(o=Vr):o===Vr?f[0]===">"?(o=i??Co,m=-1):f[1]===void 0?m=-2:(m=o.lastIndex-f[2].length,u=f[1],o=f[3]===void 0?Vr:f[3]==='"'?_g:bg):o===_g||o===bg?o=Vr:o===yg||o===wg?o=Co:(o=Vr,i=void 0);const y=o===Vr&&n[l+1].startsWith("/>")?" ":"";s+=o===Co?c+I5:m>=0?(r.push(u),c.slice(0,m)+Aw+c.slice(m)+rr+y):c+rr+(m===-2?l:y)}return[$w(n,s+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class pa{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let s=0,o=0;const l=t.length-1,c=this.parts,[u,f]=D5(t,e);if(this.el=pa.createElement(u,r),Qr.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Qr.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(Aw)){const v=f[o++],y=i.getAttribute(m).split(rr),k=/([.?@])?(.*)/.exec(v);c.push({type:1,index:s,name:k[2],strings:y,ctor:k[1]==="."?O5:k[1]==="?"?z5:k[1]==="@"?N5:Uu}),i.removeAttribute(m)}else m.startsWith(rr)&&(c.push({type:6,index:s}),i.removeAttribute(m));if(Ew.test(i.tagName)){const m=i.textContent.split(rr),v=m.length-1;if(v>0){i.textContent=jc?jc.emptyScript:"";for(let y=0;y<v;y++)i.append(m[y],da()),Qr.nextNode(),c.push({type:2,index:++s});i.append(m[v],da())}}}else if(i.nodeType===8)if(i.data===kw)c.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(rr,m+1))!==-1;)c.push({type:7,index:s}),m+=rr.length-1}s++}}static createElement(t,e){const r=Fi.createElement("template");return r.innerHTML=t,r}}function oo(n,t,e=n,r){var o,l;if(t===Pt)return t;let i=r!==void 0?(o=e._$Co)==null?void 0:o[r]:e._$Cl;const s=fa(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),s===void 0?i=void 0:(i=new s(n),i._$AT(n,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=oo(n,i._$AS(n,t.values),i,r)),t}class L5{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??Fi).importNode(e,!0);Qr.currentNode=i;let s=Qr.nextNode(),o=0,l=0,c=r[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new Mu(s,s.nextSibling,this,t):c.type===1?u=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(u=new M5(s,this,t)),this._$AV.push(u),c=r[++l]}o!==(c==null?void 0:c.index)&&(s=Qr.nextNode(),o++)}return Qr.currentNode=Fi,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}let Mu=class Cw{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=ue,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=oo(this,t,e),fa(t)?t===ue||t==null||t===""?(this._$AH!==ue&&this._$AR(),this._$AH=ue):t!==this._$AH&&t!==Pt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):x5(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ue&&fa(this._$AH)?this._$AA.nextSibling.data=t:this.T(Fi.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=pa.createElement($w(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(e);else{const o=new L5(i,this),l=o.u(this.options);o.p(e),this.T(l),this._$AH=o}}_$AC(t){let e=Sg.get(t.strings);return e===void 0&&Sg.set(t.strings,e=new pa(t)),e}k(t){yp(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const s of t)i===e.length?e.push(r=new Cw(this.O(da()),this.O(da()),this,this.options)):r=e[i],r._$AI(s),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t!==this._$AB;){const i=gg(t).nextSibling;gg(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Uu=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,s){this.type=1,this._$AH=ue,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ue}_$AI(t,e=this,r,i){const s=this.strings;let o=!1;if(s===void 0)t=oo(this,t,e,0),o=!fa(t)||t!==this._$AH&&t!==Pt,o&&(this._$AH=t);else{const l=t;let c,u;for(t=s[0],c=0;c<s.length-1;c++)u=oo(this,l[r+c],e,c),u===Pt&&(u=this._$AH[c]),o||(o=!fa(u)||u!==this._$AH[c]),u===ue?t=ue:t!==ue&&(t+=(u??"")+s[c+1]),this._$AH[c]=u}o&&!i&&this.j(t)}j(t){t===ue?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},O5=class extends Uu{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ue?void 0:t}},z5=class extends Uu{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ue)}},N5=class extends Uu{constructor(t,e,r,i,s){super(t,e,r,i,s),this.type=5}_$AI(t,e=this){if((t=oo(this,t,e,0)??ue)===Pt)return;const r=this._$AH,i=t===ue&&r!==ue||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==ue&&(r===ue||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class M5{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){oo(this,t)}}const U5={I:Mu},Bh=sa.litHtmlPolyfillSupport;Bh==null||Bh(pa,Mu),(sa.litHtmlVersions??(sa.litHtmlVersions=[])).push("3.3.2");const _c=(n,t,e)=>{const r=t;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Mu(t.insertBefore(da(),null),null,void 0,{})),i._$AI(n),i};/**
|
|
63
|
-
* @license
|
|
64
|
-
* Copyright 2020 Google LLC
|
|
65
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
66
|
-
*/const{I:Z5}=U5,Ag=n=>n,F5=n=>n.strings===void 0,kg=()=>document.createComment(""),To=(n,t,e)=>{var s;const r=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const o=r.insertBefore(kg(),i),l=r.insertBefore(kg(),i);e=new Z5(o,l,n,n.options)}else{const o=e._$AB.nextSibling,l=e._$AM,c=l!==n;if(c){let u;(s=e._$AQ)==null||s.call(e,n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==l._$AU&&e._$AP(u)}if(o!==i||c){let u=e._$AA;for(;u!==o;){const f=Ag(u).nextSibling;Ag(r).insertBefore(u,i),u=f}}}return e},Br=(n,t,e=n)=>(n._$AI(t,e),n),H5={},V5=(n,t=H5)=>n._$AH=t,B5=n=>n._$AH,qh=n=>{n._$AR(),n._$AA.remove()};/**
|
|
67
|
-
* @license
|
|
68
|
-
* Copyright 2017 Google LLC
|
|
69
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const Zu={ATTRIBUTE:1,CHILD:2},El=n=>(...t)=>({_$litDirective$:n,values:t});let Fu=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
71
|
-
* @license
|
|
72
|
-
* Copyright 2017 Google LLC
|
|
73
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/const oa=(n,t)=>{var r;const e=n._$AN;if(e===void 0)return!1;for(const i of e)(r=i._$AO)==null||r.call(i,t,!1),oa(i,t);return!0},Wc=n=>{let t,e;do{if((t=n._$AM)===void 0)break;e=t._$AN,e.delete(n),n=t}while((e==null?void 0:e.size)===0)},Tw=n=>{for(let t;t=n._$AM;n=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(n))break;e.add(n),W5(t)}};function q5(n){this._$AN!==void 0?(Wc(this),this._$AM=n,Tw(this)):this._$AM=n}function j5(n,t=!1,e=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let s=e;s<r.length;s++)oa(r[s],!1),Wc(r[s]);else r!=null&&(oa(r,!1),Wc(r));else oa(this,n)}const W5=n=>{n.type==Zu.CHILD&&(n._$AP??(n._$AP=j5),n._$AQ??(n._$AQ=q5))};class Rw extends Fu{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),Tw(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(oa(this,t),Wc(this))}setValue(t){if(F5(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}var Ma,Ua,ur,mi;class At extends Rw{constructor(){super(...arguments);g(this,Ma,[]);g(this,Ua,!1);g(this,ur,!1);g(this,mi,!1)}connected(){}template(...e){return Pt}render(...e){return!this.isConnected||a(this,ur)||this.setValue(e.length?e[0]:this.template(...a(this,Ma))),Pt}update(e,r){d(this,Ma,r),d(this,mi,!1),d(this,ur,!0);try{return a(this,Ua)||(d(this,Ua,!0),this.connected()),this.template(...r)}finally{d(this,ur,!1)}}reconnected(){d(this,ur,!0);try{this.connected()}finally{d(this,ur,!1)}d(this,mi,!0),queueMicrotask(()=>{a(this,mi)&&(d(this,mi,!1),this.render())})}}Ma=new WeakMap,Ua=new WeakMap,ur=new WeakMap,mi=new WeakMap;function kt(n){return El(n)}function G5(n,t){var r;const e=n.connection;return e.authorizationRequired?e.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:e.gateHalted?{kind:"needs-upgrade",instructions:e.upgradeInstructions}:e.status!=="connected"?e.hasEverConnected?{kind:"disconnected",nextRetryAt:e.nextRetryAt}:e.firstConnectError!==null?{kind:"error",serverURL:t,message:e.firstConnectError}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}function Hu(n,{overlay:t=!1}={}){const e=V`<dialog open>${n}</dialog>`;return t?V`<div class="dialog-overlay">${e}</div>`:e}function Vu(n,t){let e=!1;const r=s=>{s.preventDefault(),t("escape")},i=s=>{if(s.target!==n)return;const o=n.getBoundingClientRect();s.clientX>=o.left&&s.clientX<=o.right&&s.clientY>=o.top&&s.clientY<=o.bottom||t("backdrop")};return n.addEventListener("cancel",r),n.addEventListener("click",i),n.removeAttribute("open"),n.showModal(),{withdraw(){e||(e=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}let Y5=0;function K5(n){return"separator"in n}function Iw(n){return[...n.querySelectorAll(".menu-item")]}function J5(n){var t;n.newState!=="open"||!(n.currentTarget instanceof HTMLElement)||(t=Iw(n.currentTarget)[0])==null||t.focus()}function X5(n){var i;if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||!(n.currentTarget instanceof HTMLElement))return;n.preventDefault();const t=Iw(n.currentTarget),e=t.indexOf(document.activeElement),r=n.key==="ArrowDown"?Math.min(e+1,t.length-1):Math.max(e-1,0);(i=t[r])==null||i.focus()}var Za;class Q5 extends At{constructor(){super(...arguments);g(this,Za,`menu-${++Y5}`)}template(e,{placement:r="bottom-start",trigger:i}){return V`${i(a(this,Za))}<div
|
|
75
|
-
id=${a(this,Za)}
|
|
76
|
-
popover
|
|
77
|
-
placement=${r}
|
|
78
|
-
class="menu"
|
|
79
|
-
role="menu"
|
|
80
|
-
@toggle=${J5}
|
|
81
|
-
@keydown=${X5}
|
|
82
|
-
>
|
|
83
|
-
${e.map(s=>K5(s)?V`<hr class="menu-separator" />`:V`<button
|
|
84
|
-
class=${s.destructive?"menu-item destructive":"menu-item"}
|
|
85
|
-
full-row
|
|
86
|
-
role="menuitem"
|
|
87
|
-
@click=${()=>s.action()}
|
|
88
|
-
>
|
|
89
|
-
${s.label}
|
|
90
|
-
</button>`)}
|
|
91
|
-
</div>`}}Za=new WeakMap;const xw=kt(Q5);/**
|
|
92
|
-
* @license
|
|
93
|
-
* Copyright 2020 Google LLC
|
|
94
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/const Rr=()=>new eD;class eD{}const jh=new WeakMap,mn=El(class extends Rw{render(n){return ue}update(n,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),ue}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=jh.get(t);e===void 0&&(e=new WeakMap,jh.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,t;return typeof this.G=="function"?(n=jh.get(this.ht??globalThis))==null?void 0:n.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
|
|
96
|
-
* @license
|
|
97
|
-
* Copyright 2017 Google LLC
|
|
98
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
-
*/const Eg=(n,t,e)=>{const r=new Map;for(let i=t;i<=e;i++)r.set(n[i],i);return r},Gc=El(class extends Fu{constructor(n){if(super(n),n.type!==Zu.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);const i=[],s=[];let o=0;for(const l of n)i[o]=r?r(l,o):o,s[o]=e(l,o),o++;return{values:s,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,r]){const i=B5(n),{values:s,keys:o}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=o,s;const l=this.ut??(this.ut=[]),c=[];let u,f,m=0,v=i.length-1,y=0,k=s.length-1;for(;m<=v&&y<=k;)if(i[m]===null)m++;else if(i[v]===null)v--;else if(l[m]===o[y])c[y]=Br(i[m],s[y]),m++,y++;else if(l[v]===o[k])c[k]=Br(i[v],s[k]),v--,k--;else if(l[m]===o[k])c[k]=Br(i[m],s[k]),To(n,c[k+1],i[m]),m++,k--;else if(l[v]===o[y])c[y]=Br(i[v],s[y]),To(n,i[m],i[v]),v--,y++;else if(u===void 0&&(u=Eg(o,y,k),f=Eg(l,m,v)),u.has(l[m]))if(u.has(l[v])){const S=f.get(o[y]),x=S!==void 0?i[S]:null;if(x===null){const M=To(n,i[m]);Br(M,s[y]),c[y]=M}else c[y]=Br(x,s[y]),To(n,i[m],x),i[S]=null;y++}else qh(i[v]),v--;else qh(i[m]),m++;for(;y<=k;){const S=To(n,c[k+1]);Br(S,s[y]),c[y++]=S}for(;m<=v;){const S=i[m++];S!==null&&qh(S)}return this.ut=o,V5(n,c),Pt}});/**
|
|
100
|
-
* @license
|
|
101
|
-
* Copyright 2018 Google LLC
|
|
102
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
-
*/const Pw="important",tD=" !"+Pw,Yc=El(class extends Fu{constructor(n){var t;if(super(n),n.type!==Zu.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const r=n[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(tD);r.includes("-")||s?e.setProperty(r,s?i.slice(0,-11):i,s?Pw:""):e[r]=i}}return Pt}}),nD=24;function rD(n){return!$g(n.source)||!$g(n.current)||!uD(n.source,n.current)||!hD(n)||!cD(n.geometry)?{kind:"invalidated"}:oD(n.pointer,n.geometry)==="pinned"?iD(n):sD(n)}function iD(n){var c;const{source:t,current:e,pointer:r,geometry:i}=n,o=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??aD(r.y,i.pinnedRows),l=e.pinnedChannelIds.filter(u=>u!==t.channelId);return l.splice(o,0,t.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:o},operation:l}}function sD(n){const{source:t,current:e}=n,r=t.pinnedChannelIds.includes(t.channelId),i=r?lD(e.unpinnedChannelIds,t.channelId):t.unpinnedChannelIds.indexOf(t.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&e.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?e.pinnedChannelIds.filter(s=>s!==t.channelId):null}}function oD(n,t){const{sidebar:e}=t;if(n.x<e.left||n.x>e.right||n.y<e.top||n.y>e.bottom)return"unpinned";const i=t.unpinnedGroupTop??(t.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:t.pinnedContentBottom+nD);return n.y<i?"pinned":"unpinned"}function aD(n,t){const e=t.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return e===-1?t.length:e}function lD(n,t){const e=n.filter(i=>i!==t),r=e.findIndex(i=>i<t);return r===-1?e.length:r}function cD(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function $g(n){const t=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(t).size===t.length}function uD(n,t){return Hd(n.pinnedChannelIds,t.pinnedChannelIds)&&Hd(n.unpinnedChannelIds,t.unpinnedChannelIds)}function hD(n){const t=n.current.pinnedChannelIds.filter(s=>s!==n.source.channelId),e=n.geometry.pinnedRows.map(({channelId:s})=>s),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?t.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&Hd(t,e)&&i}function Hd(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}const dD='<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>',fD='<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>',pD='<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>',mD='<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>',gD='<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>',vD='<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>',yD='<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>',wD='<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>',bD='<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>',_D='<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>',SD='<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>',AD='<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>',kD='<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>',ED='<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>',$D='<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>',CD='<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>',TD='<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>',RD='<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>',ID='<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>',xD='<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>',PD='<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>',DD='<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>',LD='<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>',OD='<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>',zD='<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>',ND='<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>',MD='<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>',UD='<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>',ZD='<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>',FD='<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>',HD='<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>',VD='<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>',BD='<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>',qD='<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>',jD='<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>',WD='<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>',GD='<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>',YD='<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>',KD='<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>',JD='<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>',XD='<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>',QD='<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>',eL='<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>',tL='<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>',nL='<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>',rL='<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>',iL='<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>',sL='<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>',oL='<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>',aL='<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>',lL='<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>',cL='<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>',uL='<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>',hL='<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>',dL='<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>',fL='<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>',pL='<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>',mL='<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>',gL='<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>',vL='<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>',yL='<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>',wL='<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>',bL='<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>',_L='<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>',SL='<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>',AL='<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>',kL='<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>',EL='<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>',$L='<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>',CL='<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>',TL='<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>',RL='<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>',IL='<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>',xL='<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>',PL='<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>',DL='<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>',LL='<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>',OL=':host{display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]){font-size:16px}:host([size="md"]){font-size:20px}:host([size="lg"]){font-size:24px}:host([size="xl"]){font-size:32px}tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}tv-icon:not(:defined)[size=sm]{font-size:16px}tv-icon:not(:defined)[size=md]{font-size:20px}tv-icon:not(:defined)[size=lg]{font-size:24px}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}}',Dw=new CSSStyleSheet;Dw.replaceSync(OL);const Lw={check:dD,close:fD,copy:pD,pin:mD,search:gD,add:vD,more:yD,settings:wD,expand:bD,collapse:_D,"collapse-up":SD,skills:AD,notification:kD,artifact:ED,spinner:$D,locked:CD,unpin:TD,back:RD,forward:ID,television:xD,calendar:PD,grid:DD,hash:LD,delete:OD,edit:zD,link:ND,external:MD,download:UD,reload:ZD,warning:FD,info:HD,file:VD,folder:BD,clock:qD,user:jD,upload:WD,star:GD,home:YD,send:KD,filter:JD,sort:XD,help:QD,chart:eL,image:tL,chat:nL,location:rL,play:iL,pause:sL,stop:oL,video:aL,music:lL,error:cL,email:uL,phone:hL,web:dL,tag:fL,bookmark:pL,table:mL,code:gL,group:vL,up:yL,down:wL,money:bL,bank:_L,card:SL,wallet:AL,gauge:kL,activity:EL,"trend-up":$L,"trend-down":CL,database:TL,server:RL,deploy:IL,list:xL,terminal:PL,branch:DL,shield:LL};function zL(n){return n!==null&&Object.hasOwn(Lw,n)}var Fa,Vd;class Ow extends HTMLElement{constructor(){super(...arguments);g(this,Fa)}connectedCallback(){h(this,Fa,Vd).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Fa,Vd).call(this)}}Fa=new WeakSet,Vd=function(){const e=this.shadowRoot??this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Dw],this.replaceChildren();const r=this.getAttribute("name");e.innerHTML=zL(r)?Lw[r]:""},$(Ow,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",Ow);const zw=4,gs=200,vt=28,Kc=800,Gl="ease",Cg=.5,Ro=.5,NL="New channel",rs=".channel-group:not(.channel-group-withdrawal) .channel-row",ML=24;var rt,Ye,it,Xt,gi,_e,re,Mn,ut,Qt,ht,Ke,dt,hr,en,tn,zs,Ns,Ms,T,Bd,Nw,Mw,su,Uw,Zw,Sc,Fw,Hw,Vw,Bw,qd,jd,Vo,ou,au,lu,cu,qw,Wd,jw,Ww,Ha,Gw,Yw,Bo,Gd,Kw,Jw,qo,Yd,Kd,Jd,Xw,Ac,Va,Ba,qa,ja,Qw,Xd,kc,Ec,jo,e2,Qd,uu;class UL extends At{constructor(){super(...arguments);g(this,T);g(this,rt,null);g(this,Ye,null);g(this,it,null);g(this,Xt,"");g(this,gi,!1);g(this,_e,null);g(this,re,null);g(this,Mn,!1);g(this,ut,null);g(this,Qt,null);g(this,ht,null);g(this,Ke,null);g(this,dt,null);g(this,hr,null);g(this,en,null);g(this,tn,null);g(this,zs,Rr());g(this,Ns,Rr());g(this,Ms,Rr());g(this,su,()=>{const e=a(this,rt),r=a(this,Ye);if(e===null||r===null||a(this,ut)!==null)return;const i={resultChannelId:null};d(this,ut,i),this.render(),e.createChannel(NL).then(s=>{i.resultChannelId=s.id,e.focusChannel(s.id).catch(()=>{}),a(this,ut)===i&&this.render()},()=>{a(this,ut)!==i||a(this,Qt)!==null||(d(this,ut,null),this.render())})});g(this,ou,e=>{d(this,Xt,e.currentTarget.value)});g(this,au,e=>{e.key==="Enter"?(e.preventDefault(),h(this,T,Vo).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),h(this,T,Vo).call(this,!1))});g(this,lu,()=>{h(this,T,Vo).call(this,!0)});g(this,cu,e=>{e.preventDefault(),h(this,T,Vo).call(this,!0)});g(this,Ha,e=>{const r=a(this,re);if(r!==null){if(r.pointerId!==e.pointerId)return;e.preventDefault(),h(this,T,Bo).call(this,r,e);return}const i=a(this,_e);if(!(i===null||i.pointerId!==e.pointerId)){if(e.buttons===0){d(this,_e,null);return}Math.hypot(e.clientX-i.x,e.clientY-i.y)<=zw||h(this,T,Gw).call(this,i,e)}});g(this,Va,e=>{var i;const r=a(this,re);if(r!==null&&r.pointerId===e.pointerId){if(r.completed)return;const s=r.captureTarget.hasPointerCapture(e.pointerId);h(this,T,Bo).call(this,r,e);const o=s&&r.placement.kind==="placement"?r.placement.operation:null,l=a(this,rt);if(o===null||l===null){h(this,T,jo).call(this,r,!1);return}r.completed=!0,h(this,T,qo).call(this,r),r.operation=[...o],l.setPinnedChannelIds([...o]).then(()=>{a(this,re)===r&&(r.operationResolved=!0,h(this,T,Xd).call(this,a(this,Ye)))},()=>{a(this,re)===r&&(r.operationResolved=!0,r.operationRejected=!0,h(this,T,kc).call(this,r))});return}((i=a(this,_e))==null?void 0:i.pointerId)===e.pointerId&&d(this,_e,null)});g(this,Ba,e=>{var r,i;((r=a(this,re))==null?void 0:r.pointerId)===e.pointerId&&!a(this,re).completed?h(this,T,Ec).call(this):((i=a(this,_e))==null?void 0:i.pointerId)===e.pointerId&&d(this,_e,null)});g(this,qa,e=>{const r=a(this,re);r===null||r.pointerId!==e.pointerId||r.completed||h(this,T,jo).call(this,r,!1)});g(this,ja,e=>{e.key!=="Escape"||a(this,re)===null||a(this,re).completed||(e.preventDefault(),h(this,T,Ec).call(this))});g(this,uu,e=>{const r=e.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){window.addEventListener("pointermove",a(this,Ha)),window.addEventListener("pointerup",a(this,Va)),window.addEventListener("pointercancel",a(this,Ba)),window.addEventListener("lostpointercapture",a(this,qa)),window.addEventListener("keydown",a(this,ja))}template(e,r,i){var l;const s=a(this,Ye);d(this,rt,e),d(this,Ye,r),h(this,T,Qw).call(this,r),h(this,T,Uw).call(this,r),h(this,T,Vw).call(this,s,r),a(this,it)!==null&&!r.channels.some(({id:c})=>c===a(this,it))&&(d(this,it,null),d(this,Xt,"")),h(this,T,Xd).call(this,r);const o=h(this,T,Bw).call(this,Tg(r,(l=a(this,re))==null?void 0:l.source));return V`
|
|
104
|
-
<nav
|
|
105
|
-
class="sidebar"
|
|
106
|
-
aria-label="Channels"
|
|
107
|
-
?dragging=${a(this,re)!==null}
|
|
108
|
-
${mn(a(this,zs))}
|
|
109
|
-
>
|
|
110
|
-
<header
|
|
111
|
-
class="sidebar-titlebar"
|
|
112
|
-
?electron-draggable=${i}
|
|
113
|
-
></header>
|
|
114
|
-
|
|
115
|
-
<div class="sidebar-body" @scroll=${a(this,uu)}>
|
|
116
|
-
${h(this,T,Bd).call(this,"Pinned",o.pinned)}
|
|
117
|
-
${h(this,T,Bd).call(this,"Recent",o.unpinned)}
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<footer class="sidebar-foot">
|
|
121
|
-
<button
|
|
122
|
-
class="channel-create"
|
|
123
|
-
full-row
|
|
124
|
-
variant="ghost"
|
|
125
|
-
type="button"
|
|
126
|
-
?disabled=${a(this,ut)!==null}
|
|
127
|
-
@click=${a(this,su)}
|
|
128
|
-
>
|
|
129
|
-
<tv-icon name="add"></tv-icon>
|
|
130
|
-
New channel
|
|
131
|
-
</button>
|
|
132
|
-
</footer>
|
|
133
|
-
</nav>
|
|
134
|
-
${h(this,T,Hw).call(this)}
|
|
135
|
-
`}disconnected(){var e,r,i;window.removeEventListener("pointermove",a(this,Ha)),window.removeEventListener("pointerup",a(this,Va)),window.removeEventListener("pointercancel",a(this,Ba)),window.removeEventListener("lostpointercapture",a(this,qa)),window.removeEventListener("keydown",a(this,ja)),h(this,T,e2).call(this),(e=a(this,tn))==null||e.withdraw(),d(this,tn,null),(r=a(this,hr))==null||r.cancel(),d(this,hr,null),(i=a(this,en))==null||i.cancel(),d(this,en,null),d(this,rt,null),d(this,Ye,null),d(this,it,null),d(this,Xt,""),d(this,gi,!1),d(this,_e,null),d(this,Mn,!1),d(this,ut,null),d(this,Qt,null),d(this,ht,null),d(this,Ke,null),d(this,dt,null)}}rt=new WeakMap,Ye=new WeakMap,it=new WeakMap,Xt=new WeakMap,gi=new WeakMap,_e=new WeakMap,re=new WeakMap,Mn=new WeakMap,ut=new WeakMap,Qt=new WeakMap,ht=new WeakMap,Ke=new WeakMap,dt=new WeakMap,hr=new WeakMap,en=new WeakMap,tn=new WeakMap,zs=new WeakMap,Ns=new WeakMap,Ms=new WeakMap,T=new WeakSet,Bd=function(e,r){var m;const i=e==="Pinned"?"pinned":"unpinned",s=a(this,re);if(s===null&&r.length===0)return null;const o=s===null?void 0:r.find(({channel:v})=>v.id===s.channelId),l=s===null?r:r.filter(({channel:v})=>v.id!==s.channelId),c=(s==null?void 0:s.placement.kind)==="placement"&&((m=s.placement.placeholder)==null?void 0:m.side)===i?s.placement.placeholder:null,u=l.map(v=>({kind:"row",row:v}));c!==null&&u.splice(c.index,0,{kind:"placeholder",key:`channel-placeholder-${i}`}),o!==void 0&&u.push({kind:"row",row:o});const f=s!==null&&l.length===0&&c===null;return V`
|
|
136
|
-
<section
|
|
137
|
-
class="channel-group"
|
|
138
|
-
data-channel-side=${i}
|
|
139
|
-
?drag-collapsed=${f}
|
|
140
|
-
>
|
|
141
|
-
<h2 class="channel-group-label">${e}</h2>
|
|
142
|
-
${Gc(u,v=>v.kind==="row"?v.row.channel.id:v.key,v=>v.kind==="row"?h(this,T,Nw).call(this,v.row):V`
|
|
143
|
-
<span
|
|
144
|
-
class="channel-placeholder"
|
|
145
|
-
aria-hidden="true"
|
|
146
|
-
data-channel-side=${i}
|
|
147
|
-
data-channel-index=${(c==null?void 0:c.index)??0}
|
|
148
|
-
style=${Yc({height:`${(s==null?void 0:s.rowHeight)??0}px`})}
|
|
149
|
-
></span>
|
|
150
|
-
`)}
|
|
151
|
-
</section>
|
|
152
|
-
`},Nw=function(e){var u;const{channel:r,pinned:i,selected:s}=e,o=((u=a(this,re))==null?void 0:u.channelId)===r.id?a(this,re):null,l=o!==null&&i&&o.placement.kind==="placement"&&o.placement.side==="unpinned",c=r.id===a(this,it);return V`
|
|
153
|
-
<div
|
|
154
|
-
class="channel-row"
|
|
155
|
-
data-channel-id=${r.id}
|
|
156
|
-
?dragged=${o!==null}
|
|
157
|
-
?unpinning=${l}
|
|
158
|
-
style=${Yc(o===null?{}:{left:`${o.currentX-o.grip.previewOffsetX}px`,top:`${o.currentY-o.grip.offsetY}px`,width:`${o.rowWidth}px`,height:`${o.rowHeight}px`})}
|
|
159
|
-
>
|
|
160
|
-
${l?V`
|
|
161
|
-
<span class="channel-drag-action" aria-hidden="true">
|
|
162
|
-
<tv-icon name="unpin"></tv-icon>
|
|
163
|
-
Unpin
|
|
164
|
-
</span>
|
|
165
|
-
`:null}
|
|
166
|
-
${c?V`
|
|
167
|
-
<input
|
|
168
|
-
class="channel-rename"
|
|
169
|
-
aria-label="Channel name"
|
|
170
|
-
.value=${a(this,Xt)}
|
|
171
|
-
@input=${a(this,ou)}
|
|
172
|
-
@keydown=${a(this,au)}
|
|
173
|
-
@blur=${a(this,lu)}
|
|
174
|
-
${mn(a(this,Ns))}
|
|
175
|
-
/>
|
|
176
|
-
<button
|
|
177
|
-
class="channel-rename-commit"
|
|
178
|
-
variant="ghost"
|
|
179
|
-
icon-only
|
|
180
|
-
size="sm"
|
|
181
|
-
type="button"
|
|
182
|
-
tabindex="-1"
|
|
183
|
-
aria-label="Rename"
|
|
184
|
-
@pointerdown=${a(this,cu)}
|
|
185
|
-
>
|
|
186
|
-
<tv-icon name="check"></tv-icon>
|
|
187
|
-
</button>
|
|
188
|
-
`:V`
|
|
189
|
-
<button
|
|
190
|
-
class="channel"
|
|
191
|
-
type="button"
|
|
192
|
-
aria-current=${s?"true":ue}
|
|
193
|
-
@pointerdown=${f=>h(this,T,jw).call(this,r.id,f)}
|
|
194
|
-
@click=${f=>h(this,T,Ww).call(this,r.id,f)}
|
|
195
|
-
>
|
|
196
|
-
${r.name}
|
|
197
|
-
</button>
|
|
198
|
-
${xw(h(this,T,Mw).call(this,e),{trigger:f=>V`
|
|
199
|
-
<button
|
|
200
|
-
class="channel-menu-trigger"
|
|
201
|
-
variant="ghost"
|
|
202
|
-
icon-only
|
|
203
|
-
size="sm"
|
|
204
|
-
type="button"
|
|
205
|
-
tabindex="-1"
|
|
206
|
-
popovertarget=${f}
|
|
207
|
-
aria-label=${`${r.name} menu`}
|
|
208
|
-
>
|
|
209
|
-
<tv-icon name="expand"></tv-icon>
|
|
210
|
-
</button>
|
|
211
|
-
`})}
|
|
212
|
-
`}
|
|
213
|
-
</div>
|
|
214
|
-
`},Mw=function(e){const{channel:r,pinned:i}=e;return[{label:"Rename",action:()=>h(this,T,jd).call(this,r.id)},{label:i?"Unpin":"Pin",action:()=>h(this,T,qw).call(this,r.id,!i)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,T,Zw).call(this,r.id,r.name)}]},su=new WeakMap,Uw=function(e){const r=a(this,ut);if(r===null||a(this,Qt)!==null||r.resultChannelId===null)return;const i=e.channels.find(({id:s})=>s===r.resultChannelId);i!==void 0&&(d(this,Qt,i.id),queueMicrotask(()=>h(this,T,qd).call(this,"create",i.id)))},Zw=function(e,r){var s,o,l;if(a(this,ht)!==null||a(this,Ke)!==null)return;h(this,T,Wd).call(this,e),d(this,ht,{channelId:e,name:r}),this.render();const i=(s=a(this,Ms).value)==null?void 0:s.closest("dialog");i instanceof HTMLDialogElement&&(d(this,tn,Vu(i,()=>{h(this,T,Sc).call(this)})),(l=(o=a(this,Ms).value)==null?void 0:o.querySelector(".dialog-actions button"))==null||l.focus())},Sc=function(){const e=a(this,tn);d(this,tn,null),d(this,ht,null),e==null||e.withdraw(),this.render()},Fw=function(){const e=a(this,rt),r=a(this,ht);e===null||r===null||a(this,Ke)!==null||(d(this,Ke,r.channelId),h(this,T,Sc).call(this),e.deleteChannel(r.channelId).catch(()=>{a(this,Ke)!==r.channelId||a(this,dt)!==null||(d(this,Ke,null),this.render())}))},Hw=function(){const e=a(this,ht);return e===null?null:Hu(V`
|
|
215
|
-
<div
|
|
216
|
-
class="dialog-alert channel-delete-alert"
|
|
217
|
-
role="alertdialog"
|
|
218
|
-
aria-labelledby="channel-delete-title"
|
|
219
|
-
aria-describedby="channel-delete-body"
|
|
220
|
-
${mn(a(this,Ms))}
|
|
221
|
-
>
|
|
222
|
-
<h2 id="channel-delete-title">Delete “${e.name}”?</h2>
|
|
223
|
-
<p id="channel-delete-body">
|
|
224
|
-
This will permanently delete this channel from Television.
|
|
225
|
-
</p>
|
|
226
|
-
<div class="dialog-actions">
|
|
227
|
-
<button type="button" autofocus @click=${()=>h(this,T,Sc).call(this)}>
|
|
228
|
-
Cancel
|
|
229
|
-
</button>
|
|
230
|
-
<button type="button" variant="danger" @click=${()=>h(this,T,Fw).call(this)}>
|
|
231
|
-
Delete
|
|
232
|
-
</button>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
`,{overlay:!0})},Vw=function(e,r){var f,m;a(this,ht)!==null&&!r.channels.some(({id:v})=>{var y;return v===((y=a(this,ht))==null?void 0:y.channelId)})&&((f=a(this,tn))==null||f.withdraw(),d(this,tn,null),d(this,ht,null));const i=a(this,dt);if(i!==null&&r.channels.some(({id:v})=>v===i.row.channel.id)){(m=a(this,en))==null||m.cancel(),d(this,en,null),d(this,dt,null),d(this,Ke,null);return}const s=a(this,Ke);if(s===null||i!==null||r.channels.some(({id:v})=>v===s))return;if(e===null){d(this,Ke,null);return}const o=Tg(e),l=o.pinned.findIndex(({channel:v})=>v.id===s),c=o.unpinned.findIndex(({channel:v})=>v.id===s),u=l>=0?o.pinned[l]:o.unpinned[c];if(u===void 0){d(this,Ke,null);return}d(this,dt,{row:{...u,selected:!1},side:l>=0?"pinned":"unpinned",index:l>=0?l:c}),queueMicrotask(()=>h(this,T,qd).call(this,"delete",s))},Bw=function(e){const r=a(this,dt);if(r===null)return e;const i=[...e[r.side]];return i.some(({channel:s})=>s.id===r.row.channel.id)||i.splice(r.index,0,r.row),{...e,[r.side]:i}},qd=function(e,r){var u,f;if(e==="create"&&a(this,Qt)!==r||e==="delete"&&((u=a(this,dt))==null?void 0:u.row.channel.id)!==r)return;const i=[...((f=a(this,zs).value)==null?void 0:f.querySelectorAll(rs))??[]].find(m=>m.dataset.channelId===r);if(i===void 0)return;const s=()=>{var m;if(e==="create"){if(a(this,Qt)!==r)return;d(this,Qt,null),d(this,ut,null),h(this,T,jd).call(this,r)}else{if(((m=a(this,dt))==null?void 0:m.row.channel.id)!==r)return;d(this,dt,null),d(this,Ke,null),this.render()}};if(typeof i.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){s();return}const o=i.getBoundingClientRect().height,l=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${o}px`,opacity:1}]:[{maxHeight:`${o}px`,opacity:1},{maxHeight:"0px",opacity:0}],c=i.animate(l,{duration:gs,easing:Gl});e==="create"?d(this,hr,c):d(this,en,c),c.finished.then(()=>{e==="create"&&a(this,hr)!==c||e==="delete"&&a(this,en)!==c||(e==="create"?d(this,hr,null):d(this,en,null),s())},()=>{})},jd=function(e){var i;const r=(i=a(this,Ye))==null?void 0:i.channels.find(({id:s})=>s===e);r!==void 0&&(d(this,it,e),d(this,Xt,r.name),d(this,_e,null),this.render(),queueMicrotask(()=>{var s,o;a(this,it)===e&&((s=a(this,Ns).value)==null||s.focus(),(o=a(this,Ns).value)==null||o.select())}))},Vo=function(e){if(a(this,it)===null||a(this,gi)||a(this,rt)===null)return;d(this,gi,!0);const r=a(this,it),i=a(this,Xt).trim();d(this,it,null),d(this,Xt,""),this.render(),d(this,gi,!1),e&&i.length>0&&a(this,rt).renameChannel(r,i).catch(()=>{})},ou=new WeakMap,au=new WeakMap,lu=new WeakMap,cu=new WeakMap,qw=function(e,r){if(a(this,rt)===null||a(this,Ye)===null)return;h(this,T,Wd).call(this,e);const i=a(this,Ye).display.pinnedChannelIds,s=r?[...i.filter(o=>o!==e),e]:i.filter(o=>o!==e);a(this,rt).setPinnedChannelIds(s).catch(()=>{})},Wd=function(e){var s;const r=[...((s=a(this,zs).value)==null?void 0:s.querySelectorAll(rs))??[]].find(o=>o.dataset.channelId===e),i=r==null?void 0:r.querySelector(".menu");i&&typeof i.hidePopover=="function"&&i.matches(":popover-open")&&i.hidePopover()},jw=function(e,r){if(r.button!==0||a(this,_e)!==null||a(this,re)!==null||a(this,Ye)===null)return;d(this,Mn,!1);const s=r.currentTarget.closest(".sidebar");if(s===null)return;const o=Wo(a(this,Ye));!o.pinnedChannelIds.includes(e)&&!o.unpinnedChannelIds.includes(e)||d(this,_e,{channelId:e,pointerId:r.pointerId,x:r.clientX,y:r.clientY,source:{channelId:e,...o},captureTarget:s})},Ww=function(e,r){var i;if(r.detail!==0&&a(this,Mn)){d(this,Mn,!1);return}d(this,Mn,!1),a(this,re)===null&&((i=a(this,rt))==null||i.focusChannel(e).catch(()=>{}))},Ha=new WeakMap,Gw=function(e,r){const i=[...e.captureTarget.querySelectorAll(rs)].find(m=>m.dataset.channelId===e.channelId);if(i===void 0){d(this,_e,null);return}const s=i.getBoundingClientRect(),o=h(this,T,Yw).call(this,i),l=FL({wideRow:s,compactPreviewWidth:o,pointer:{x:e.x,y:e.y}}),c=e.captureTarget.querySelector('[data-channel-side="pinned"]'),u=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{d(this,_e,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${l.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${l.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${l.correctionX}px`),d(this,Mn,!0);const f={...e,placement:{kind:"invalidated"},currentX:r.clientX,currentY:r.clientY,grip:l,rowWidth:o,rowHeight:s.height,originPinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,_e,null),d(this,re,f),h(this,T,Bo).call(this,f,r)},Yw=function(e){const r=e.cloneNode(!0);for(const s of[r,...r.querySelectorAll("[id], [popovertarget]")])s.removeAttribute("id"),s.removeAttribute("popovertarget");r.setAttribute("dragged",""),r.style.position="fixed",r.style.left="-10000px",r.style.top="-10000px",r.style.visibility="hidden",r.style.pointerEvents="none",document.body.append(r);const i=r.getBoundingClientRect().width;return r.remove(),i},Bo=function(e,r,i=!0){if(e.completed)return;const s=a(this,Ye);if(s===null){e.placement={kind:"invalidated"};return}e.currentX=r.clientX,e.currentY=r.clientY;const o=Wo(s),l=new Map([...e.captureTarget.querySelectorAll(rs)].map(G=>[G.dataset.channelId,G])),c=o.pinnedChannelIds.filter(G=>G!==e.channelId).flatMap(G=>{const F=l.get(G);if(F===void 0)return[];const W=F.getBoundingClientRect();return[{channelId:G,top:W.top,bottom:W.bottom}]}),u=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),m=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),v=m==null?void 0:m.getBoundingClientRect(),y=m==null?void 0:m.dataset.channelSide,k=Number(m==null?void 0:m.dataset.channelIndex),S=e.captureTarget.getBoundingClientRect(),x=rD({source:e.source,current:o,pointer:{x:r.clientX,y:r.clientY},geometry:{sidebar:{left:S.left,right:S.right,top:S.top,bottom:S.bottom},pinnedRows:c,unpinnedGroupTop:(f==null?void 0:f.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(u==null?void 0:u.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:v!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(k)?{side:y,index:k,top:v.top,bottom:v.bottom}:null}}),M=!HL(e.placement,x),Z=M?h(this,T,Kd).call(this,e):null;e.placement=x,(M||i)&&h(this,T,Jd).call(this,e,Z,!1),h(this,T,Gd).call(this,e)},Gd=function(e){const r=e.captureTarget.querySelector(".sidebar-body"),i=r?h(this,T,Yd).call(this,r,e.currentY):0,s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=i<0?((r==null?void 0:r.scrollTop)??0)<=Cg:((r==null?void 0:r.scrollTop)??0)>=s-Cg;if(e.completed||i===0||s===0||o||typeof requestAnimationFrame!="function"){h(this,T,qo).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,T,Kw).call(this,e,l)}))},Kw=function(e,r){if(e.edgeScrollFrame=0,a(this,re)!==e||e.completed){e.edgeScrollTimestamp=null;return}const i=e.captureTarget.querySelector(".sidebar-body");if(i===null){e.edgeScrollTimestamp=null;return}const s=h(this,T,Yd).call(this,i,e.currentY),o=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&o!==null){const l=Math.max(0,r-o)/1e3,c=Math.max(0,i.scrollHeight-i.clientHeight),u=i.scrollTop,f=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+f));i.scrollTop=m;const v=i.scrollTop-u;if(e.edgeScrollRemainder=m===0||m===c?0:f-v,v!==0){i.toggleAttribute("continues-start",i.scrollTop>0),h(this,T,Jw).call(this,e);return}}h(this,T,Gd).call(this,e)},Jw=function(e){h(this,T,Bo).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},qo=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},Yd=function(e,r){const i=e.getBoundingClientRect();return r>=i.top&&r<i.top+vt?-Kc*(i.top+vt-r)/vt:r>i.bottom-vt&&r<=i.bottom?Kc*(r-(i.bottom-vt))/vt:0},Kd=function(e){var s;for(const o of e.displacementAnimations)o.cancel();e.displacementAnimations.clear();const r=new Map;for(const o of e.captureTarget.querySelectorAll(rs)){const l=o.dataset.channelId;if(l===void 0)continue;const c=o.getBoundingClientRect();r.set(l,{left:c.left,top:c.top})}const i=new Map;for(const o of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const l=o.dataset.channelSide;if(l!=="pinned"&&l!=="unpinned")continue;const c=o.getBoundingClientRect(),u=o.cloneNode(!0);for(const f of[u,...u.querySelectorAll("[id], [popovertarget]")])f.removeAttribute("id"),f.removeAttribute("popovertarget");(s=u.querySelector(".channel-row[dragged]"))==null||s.remove(),u.classList.add("channel-group-withdrawal"),u.setAttribute("aria-hidden","true"),u.removeAttribute("drag-collapsed"),i.set(l,{left:c.left,top:c.top,width:c.width,height:o.hasAttribute("drag-collapsed")?0:c.height,withdrawal:u})}return{rows:r,groups:i}},Jd=function(e,r,i){const s=e.captureTarget.querySelector(".sidebar-body"),o=(s==null?void 0:s.scrollTop)??0;this.render(),queueMicrotask(()=>{const l=e.captureTarget.querySelector(".sidebar-body");l!==null&&(l.scrollTop=o),r!==null&&h(this,T,Xw).call(this,e,r,i)})},Xw=function(e,r,i){if(!(typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const s of e.captureTarget.querySelectorAll(rs)){const o=s.dataset.channelId;if(o===void 0||!i&&o===e.channelId)continue;const l=r.rows.get(o);if(l===void 0)continue;const c=s.getBoundingClientRect(),u=l.left-c.left,f=l.top-c.top;Math.hypot(u,f)<=Ro||h(this,T,Ac).call(this,e,s.animate({translate:[`${u}px ${f}px`,"0px 0px"]},{duration:gs,easing:Gl}))}for(const s of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=s.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const l=r.groups.get(o),c=s.getBoundingClientRect(),u=s.hasAttribute("drag-collapsed")?0:c.height;if(l!==void 0){if(l.height<=Ro&&u>Ro)h(this,T,Ac).call(this,e,s.animate([{opacity:0,translate:`0px -${u}px`},{opacity:1,translate:"0px 0px"}],{duration:gs,easing:Gl}));else if(l.height>Ro&&u<=Ro&&l.withdrawal.childElementCount>0){const f=l.withdrawal;f.style.left=`${l.left}px`,f.style.top=`${l.top}px`,f.style.width=`${l.width}px`,f.style.height=`${l.height}px`,e.captureTarget.append(f);const m=f.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${l.height}px`}],{duration:gs,easing:Gl});h(this,T,Ac).call(this,e,m),m.finished.finally(()=>f.remove()).catch(()=>{})}}}}},Ac=function(e,r){e.displacementAnimations.add(r),r.finished.finally(()=>{e.displacementAnimations.delete(r)}).catch(()=>{})},Va=new WeakMap,Ba=new WeakMap,qa=new WeakMap,ja=new WeakMap,Qw=function(e){const r=Wo(e);a(this,re)!==null&&!a(this,re).completed&&!Rg(a(this,re).source,r)&&h(this,T,Ec).call(this),a(this,_e)!==null&&!Rg(a(this,_e).source,r)&&d(this,_e,null)},Xd=function(e){const r=a(this,re);if(e===null||r===null||!r.completed||!r.operationResolved||r.restorationQueued)return;if(r.operationRejected){h(this,T,kc).call(this,r);return}const i=r.operation;i!==null&&Jc(Wo(e).pinnedChannelIds,i)&&h(this,T,kc).call(this,r)},kc=function(e){a(this,re)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{a(this,re)===e&&h(this,T,jo).call(this,e,!1)}))},Ec=function(){d(this,_e,null);const e=a(this,re);e!==null&&h(this,T,jo).call(this,e,!0)},jo=function(e,r){if(a(this,re)!==e)return;h(this,T,qo).call(this,e);const i=h(this,T,Kd).call(this,e);d(this,re,null),h(this,T,Qd).call(this,e),r&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),h(this,T,Jd).call(this,e,i,!0)},e2=function(){d(this,_e,null);const e=a(this,re);if(d(this,re,null),e!==null){h(this,T,qo).call(this,e);for(const r of e.displacementAnimations)r.cancel();e.displacementAnimations.clear(),h(this,T,Qd).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},Qd=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")},uu=new WeakMap;const ZL=kt(UL);function FL(n){const t=Math.max(0,n.wideRow.right-n.wideRow.left),e=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=Ig(n.pointer.x-n.wideRow.left,0,t),i=Math.min(r,Math.max(0,n.compactPreviewWidth-ML));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:Ig(n.pointer.y-n.wideRow.top,0,e)}}function Tg(n,t=Wo(n)){var l,c;const e=new Map(n.channels.map(u=>[u.id,u])),r=t.pinnedChannelIds.flatMap(u=>{const f=e.get(u);return f===void 0?[]:[f]}),i=t.unpinnedChannelIds.flatMap(u=>{const f=e.get(u);return f===void 0?[]:[f]}),s=n.display.focusedChannelId,o=s!==null&&e.has(s)?s:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===o})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===o}))}}function Wo(n){const t=new Set(n.channels.map(({id:s})=>s)),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,o)=>o.localeCompare(s));return{pinnedChannelIds:e,unpinnedChannelIds:i}}function Rg(n,t){return Jc(n.pinnedChannelIds,t.pinnedChannelIds)&&Jc(n.unpinnedChannelIds,t.unpinnedChannelIds)}function Jc(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function HL(n,t){var e,r,i,s;return n.kind!==t.kind?!1:n.kind==="invalidated"||t.kind==="invalidated"?!0:n.side===t.side&&((e=n.placeholder)==null?void 0:e.side)===((r=t.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((s=t.placeholder)==null?void 0:s.index)&&n.operation===null==(t.operation===null)&&(n.operation===null||t.operation===null||Jc(n.operation,t.operation))}function Ig(n,t,e){return Math.max(t,Math.min(e,n))}const VL=404,BL="/views/url-unsupported/";function $c(n){const t=Sd(n.artifact,{electron:n.electron});let e;if(n.currentURL===null){const r=n.viewURL??t.viewURL;t.renderer==="markdown"?e={renderer:"markdown",viewURL:r,contentURL:n.contentURL??t.contentURL}:t.renderer==="url-webview"&&t.contentURL!==null?e={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??t.contentURL}:e={...t,viewURL:r}}else xg(n.currentURL)&&!n.electron?e=Rn(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:BL,contentURL:null}:xg(n.currentURL)?e={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:e={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:WL(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...e,viewURL:n.frameSrcOverride}:e}var Ne,ft,Us,vi,yi,Rt,wi,Zs,pt,Fs,Hs,nn,dr,fr,bi,B,Cc,t2,n2,ef,r2,rn,Tc,Go,tf,i2,nf,rf,Wr;class qL extends At{constructor(){super(...arguments);g(this,B);g(this,Ne,null);g(this,ft,null);g(this,Us,"");g(this,vi,()=>{});g(this,yi,()=>{});g(this,Rt,null);g(this,wi,null);g(this,Zs,null);g(this,pt,null);g(this,Fs,null);g(this,Hs,null);g(this,nn,null);g(this,dr,null);g(this,fr,null);g(this,bi,null);g(this,rn,()=>{!a(this,ft)||a(this,ft)!==a(this,Rt)||a(this,vi).call(this,!0)})}get currentFrame(){return a(this,ft)}connected(){h(this,B,Tc).call(this),h(this,B,tf).call(this)}disconnected(){h(this,B,Go).call(this),h(this,B,Wr).call(this)}template(e,r,i=()=>{}){return d(this,vi,r),d(this,yi,i),e(this),a(this,Us)}assignSource(e){const r=a(this,Ne),i=r?!GL(r.artifact,e.artifact):!0;((r==null?void 0:r.artifact.id)!==e.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&e.artifact.kind==="path"&&r.artifact.path!==e.artifact.path)&&d(this,bi,null),i&&(d(this,nn,null),a(this,pt)&&(a(this,pt).content=""),d(this,dr,null),d(this,fr,null)),d(this,Ne,e),h(this,B,Cc).call(this)}handleArtifactContentChanged(e){const r=a(this,Ne);return e!==(r==null?void 0:r.artifact.id)||!a(this,pt)&&!h(this,B,rf).call(this)?!1:(h(this,B,nf).call(this),!0)}refreshFrameLoadState(){h(this,B,Tc).call(this)}}Ne=new WeakMap,ft=new WeakMap,Us=new WeakMap,vi=new WeakMap,yi=new WeakMap,Rt=new WeakMap,wi=new WeakMap,Zs=new WeakMap,pt=new WeakMap,Fs=new WeakMap,Hs=new WeakMap,nn=new WeakMap,dr=new WeakMap,fr=new WeakMap,bi=new WeakMap,B=new WeakSet,Cc=function(){const e=a(this,Ne);if(!e)return;if(e.artifact.kind==="path"&&h(this,B,rf).call(this)){h(this,B,r2).call(this,e.artifact);return}const r=$c(e),i=h(this,B,t2).call(this,r.renderer);h(this,B,n2).call(this,i,r),h(this,B,ef).call(this,i),h(this,B,Tc).call(this),h(this,B,tf).call(this)},t2=function(e){var s;const r=e==="url-webview"?"webview":"iframe";if(((s=a(this,ft))==null?void 0:s.tagName.toLowerCase())===r)return a(this,ft);h(this,B,Go).call(this),h(this,B,Wr).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,ft,i),i},n2=function(e,r){e.getAttribute("src")!==r.viewURL&&(a(this,yi).call(this,null),a(this,yi).call(this,e),e.setAttribute("src",r.viewURL)),r.contentURL===null?delete e.dataset.contentUrl:e.dataset.contentUrl=r.contentURL},ef=function(e){a(this,Us)!==e&&(d(this,Us,e),this.render(e))},r2=function(e){a(this,yi).call(this,null),h(this,B,Go).call(this),h(this,B,Wr).call(this),d(this,ft,null),a(this,vi).call(this,!1),h(this,B,ef).call(this,V`
|
|
236
|
-
<section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
|
|
237
|
-
<div class="artifact-missing-wrapper">
|
|
238
|
-
<h1>${Rb()}</h1>
|
|
239
|
-
<p>${Ib()}</p>
|
|
240
|
-
<section class="artifact-missing-path" aria-label="Missing artifact path">
|
|
241
|
-
<p class="artifact-missing-path-label">Registered path:</p>
|
|
242
|
-
<p><code>${e.path}</code></p>
|
|
243
|
-
</section>
|
|
244
|
-
<p>${xb()}</p>
|
|
245
|
-
</div>
|
|
246
|
-
</section>
|
|
247
|
-
`)},rn=new WeakMap,Tc=function(){var s;const e=a(this,ft),r=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===a(this,Rt)&&r===a(this,wi)||(h(this,B,Go).call(this),a(this,vi).call(this,!1),!e||!r||!this.isConnected))return;if(d(this,Rt,e),d(this,wi,r),e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",a(this,rn)),e.addEventListener("did-fail-load",a(this,rn));return}e.addEventListener("load",a(this,rn));const i=e;try{i.isConnected&&((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&a(this,rn).call(this)}catch{}},Go=function(){if(!a(this,Rt)){d(this,wi,null);return}a(this,Rt).removeEventListener("load",a(this,rn)),a(this,Rt).removeEventListener("did-finish-load",a(this,rn)),a(this,Rt).removeEventListener("did-fail-load",a(this,rn)),d(this,Rt,null),d(this,wi,null)},tf=function(){const e=a(this,Ne),r=a(this,ft),i=(r==null?void 0:r.dataset.contentUrl)??null,s=(e==null?void 0:e.artifact.id)??null;if(!e||!r||!i||!s){h(this,B,Wr).call(this,{clearContent:!0});return}if(r!==a(this,Zs)||s!==a(this,Hs)){h(this,B,Wr).call(this),d(this,Zs,r),d(this,Fs,i),d(this,Hs,s);const o=r.tagName.toLowerCase()==="webview"?new R5(r):new T5(r);d(this,pt,o),o.handleUpdateContent(async l=>{const c=a(this,Ne),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,nn,l),a(this,pt)===o&&(o.content=l)}),a(this,nn)!==null&&(o.content=a(this,nn))}else d(this,Fs,i);h(this,B,i2).call(this)},i2=function(){const e=a(this,Ne),r=e==null?void 0:e.application;!e||!r||!a(this,pt)||a(this,dr)===e.artifact.id&&a(this,fr)===r||(d(this,dr,e.artifact.id),d(this,fr,r),h(this,B,nf).call(this))},nf=async function(){var s,o;const e=a(this,Ne),r=e==null?void 0:e.application;if(!e||!r)return;const i=e.artifact.id;try{const l=await r.readMarkdown(i);if(((s=a(this,Ne))==null?void 0:s.artifact.id)!==i||a(this,Ne).application!==r)return;d(this,bi,null),d(this,nn,l);const c=a(this,pt);if(!c){h(this,B,Cc).call(this);return}c.content=l}catch(l){if(((o=a(this,Ne))==null?void 0:o.artifact.id)!==i||a(this,Ne).application!==r)return;if(l instanceof go&&l.status===VL){d(this,bi,i),d(this,nn,null),h(this,B,Wr).call(this),h(this,B,Cc).call(this);return}d(this,dr,null),d(this,fr,null)}},rf=function(){var r;const e=(r=a(this,Ne))==null?void 0:r.artifact;return a(this,bi)===(e==null?void 0:e.id)&&e.kind==="path"&&sy(e.path)},Wr=function(e={}){var r;(r=a(this,pt))==null||r.dispose(),d(this,pt,null),d(this,Zs,null),d(this,Fs,null),d(this,Hs,null),d(this,dr,null),d(this,fr,null),e.clearContent&&d(this,nn,null)};const jL=kt(qL);function xg(n){return n.startsWith("http://")||n.startsWith("https://")}function WL(n,t){if(!n.startsWith("/")||!t)return n;try{return new URL(n,t).toString()}catch{return n}}function GL(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?n.url===t.url:!0}var Wa,Vs,sn,Un,pr,mr,gr,Ga,Ya,Ka,Ja,at,sf,Rc,Ic;class YL{constructor(t,e=()=>{}){g(this,at);g(this,Wa);g(this,Vs);g(this,sn,null);g(this,Un,null);g(this,pr,null);g(this,mr,null);g(this,gr,!1);g(this,Ga,t=>{const e=Dg(t.data);if(!e)return;const r=a(this,pr);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,s=i.contentWindow;if(s===null)return;const o=e.type==="leaving",l=e.type==="navigation-request"&&e.native===!0&&e.sameDocument!==!0,c=s===t.source,u=(o||l)&&a(this,Un)!==null&&a(this,Un)===t.source,f=o&&JL(i)===t.origin;!c&&!u&&!f||h(this,at,sf).call(this,e,i,{send:m=>{var v;return(v=i.contentWindow)==null?void 0:v.postMessage(m,"*")}})});g(this,Ya,t=>{var s;const e=t.detail??t;if(!e||e.channel!==Pg)return;const r=Dg((s=e.args)==null?void 0:s[0]),i=a(this,mr);!r||!i||h(this,at,sf).call(this,r,i,{send:o=>{var l;return(l=i.send)==null?void 0:l.call(i,Pg,o)}})});g(this,Ka,t=>{const e=Lg(t);e.isMainFrame===!0&&e.isInPlace!==!0&&this.reset()});g(this,Ja,t=>{Lg(t).isMainFrame!==!1&&this.reset()});d(this,Wa,t),d(this,Vs,e)}get currentGuid(){return a(this,sn)}get lifecycleWindow(){return a(this,Un)}get trustState(){return{currentGuid:a(this,sn),lifecycleWindow:a(this,Un)}}connect(){a(this,gr)||(d(this,gr,!0),window.addEventListener("message",a(this,Ga)),h(this,at,Rc).call(this))}disconnect(){a(this,gr)&&(window.removeEventListener("message",a(this,Ga)),d(this,gr,!1),h(this,at,Ic).call(this))}reset(){d(this,sn,null),d(this,Un,null),a(this,Vs).call(this)}setCurrentFrame(t){if(t===a(this,pr)){h(this,at,Rc).call(this);return}h(this,at,Ic).call(this),a(this,pr)!==null&&this.reset(),d(this,pr,KL(t)?t:null),h(this,at,Rc).call(this)}}Wa=new WeakMap,Vs=new WeakMap,sn=new WeakMap,Un=new WeakMap,pr=new WeakMap,mr=new WeakMap,gr=new WeakMap,Ga=new WeakMap,Ya=new WeakMap,Ka=new WeakMap,Ja=new WeakMap,at=new WeakSet,sf=function(t,e,r){t.type==="bridge-ready"&&t.guid!==a(this,sn)?(a(this,sn)!==null&&a(this,Vs).call(this),d(this,sn,t.guid),d(this,Un,e.tagName.toLowerCase()==="iframe"?e.contentWindow:null)):t.type==="leaving"&&t.guid===a(this,sn)&&this.reset(),a(this,Wa).call(this,t,r)},Rc=function(){if(!a(this,gr))return;const t=a(this,pr),e=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;e!==a(this,mr)&&(h(this,at,Ic).call(this),e&&(e.addEventListener("ipc-message",a(this,Ya)),e.addEventListener("did-start-navigation",a(this,Ka)),e.addEventListener("did-fail-load",a(this,Ja)),d(this,mr,e)))},Ic=function(){const t=a(this,mr);t&&(t.removeEventListener("ipc-message",a(this,Ya)),t.removeEventListener("did-start-navigation",a(this,Ka)),t.removeEventListener("did-fail-load",a(this,Ja)),d(this,mr,null))};const Pg="television-artifact-bridge";function Dg(n){return wb(n)||bb(n)||_b(n)||Sb(n)||Ab(n)||kb(n)||Eb(n)?n:null}function KL(n){if(!n)return!1;const t=n.tagName.toLowerCase();return t==="iframe"||t==="webview"}function JL(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function Lg(n){return n.detail??n}const XL="/views/url-unsupported/";class QL extends At{constructor(){super(...arguments);$(this,"_artifact",null);$(this,"_viewURL",null);$(this,"_contentURL",null);$(this,"_application",null);$(this,"_fullScreen",!1);$(this,"_inert",!1);$(this,"_onFullScreenChange",()=>{});$(this,"_connected",!1);$(this,"_deleteConfirmationOpen",!1);$(this,"_dialogPresentation",null);$(this,"_subscribedWebview",null);$(this,"_documentHost",null);$(this,"_pendingDocumentSource",null);$(this,"_rootRef",Rr());$(this,"_trustedChannel",new YL((e,r)=>{this.handleTrustedFrameMessage(e,r)},()=>{this._missingArtifactReplyTransport=null}));$(this,"_activeReloadFrameSrc",null);$(this,"_applicationSubscriptionsAttached",!1);$(this,"_proxyReloadVersion",0);$(this,"_navigationState",null);$(this,"_navigationArtifactId",null);$(this,"_navigationCanonicalURL",null);$(this,"_preserveFrameSrcOnNavigationRender",!1);$(this,"_missingArtifactReplyTransport",null);$(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,r=!e;r&&!Gn()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:e,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});$(this,"handleArtifactContentChanged",e=>{var s;const r=e.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((s=this._documentHost)!=null&&s.handleArtifactContentChanged(r))||this.reloadProxyFrame()});$(this,"handleThemeChanged",()=>{var e;((e=this._artifact)==null?void 0:e.kind)==="url"&&Rn(this._artifact.url)||this.reloadProxyFrame()});$(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});$(this,"handleWebviewDidNavigateInPage",e=>{this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});$(this,"captureDocumentHost",e=>{this._documentHost=e,this._pendingDocumentSource&&(e.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});$(this,"handleEmbedLoadChange",e=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",e)});$(this,"handleDocumentFrameChange",e=>{e===null&&this.resetTrustedFrame(),this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)});$(this,"handleTitleBarDoubleClick",e=>{const r=e.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(e,r){var u;const[i,s,o]=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!==s){const f=c?!nO(c,s):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=s,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&rO(c,s)){const m=this.currentMissingArtifactMessage();m&&((u=this._missingArtifactReplyTransport)==null||u.send(m))}}else f&&this.resetTrustedFrame()}return this._viewURL!==o.viewURL&&(this._viewURL=o.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==o.contentURL&&(this._contentURL=o.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==o.fullScreen&&(this._fullScreen=o.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=o.inert,this._onFullScreenChange=o.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(e,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var e;this._connected=!1,(e=this._dialogPresentation)==null||e.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(e,r){var i;switch(e.type){case"url-target-request":r.send({type:$b,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const s=this.currentMissingArtifactMessage();s&&(this._missingArtifactReplyTransport=r,r.send(s));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(e);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(e.key);return;case"bridge-ready":case"leaving":return}}currentExternalTargetURL(){var r,i;const e=((r=this._navigationState)==null?void 0:r.currentURL)??null;return e&&tO(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:Cb,title:e.title,path:e.path}}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!Rn(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(e.url);if(i===XL||i===r.currentURL)return;const s=e.native===!0;(e.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),e.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new p5(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const r=$c({artifact:e,application:this._application,electron:Gn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return e.kind==="url"&&Rn(e.url)||r.renderer==="url-webview"?Yn(i):Og(i,i)}convertIframeNavigationURL(e){var i,s;if(((i=this._artifact)==null?void 0:i.kind)==="url"&&Rn(this._artifact.url)&&Rn(e))return Yn(e);const r=(s=this.currentFrame)==null?void 0:s.getAttribute("src");return Og(e,r??this._viewURL??null)}handleWebviewNavigationEvent(e){const r=e.url;if(typeof r!="string")return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=Yn(r);return s===i.currentURL?!1:(i.navigate(s),!0)}syncWebviewSubscription(e=this.currentFrame){const r=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var e;return((e=this._documentHost)==null?void 0:e.currentFrame)??null}syncFrameSubscriptions(){const e=this.currentFrame;this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)}syncFrameTitle(e){e&&this._artifact&&e.getAttribute("title")!==this._artifact.title&&e.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(e={}){var f,m,v;const r=this._artifact;if(!r)return;e.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:Gn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},s=$c(i),o=(m=this.currentFrame)==null?void 0:m.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(s2(this._activeReloadFrameSrc,s.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=e.frameSrcOverride??l??(e.preserveFrameSrc&&o?o:s.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(v=this._documentHost)==null||v.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var o,l,c,u,f;const e=this.currentFrame;if(!e||e.hasAttribute("data-content-url")||e.tagName.toLowerCase()==="webview"&&!(((o=this._artifact)==null?void 0:o.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Rn(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Rn(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(so,String(++this._proxyReloadVersion));const s=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:s,resetTrust:!0})}forceCurrentFrameSrc(){var s,o,l;if(!this._artifact)return;const e=$c({artifact:this._artifact,application:this._application,electron:Gn(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((s=this._navigationState)==null?void 0:s.currentURL)??null});if(e.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(o=this._rootRef.value)==null||o.removeAttribute("data-embed-loaded"),i.setAttribute("src",e.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var r;const e=(r=this._rootRef.value)==null?void 0:r.querySelector(".menu");e&&typeof e.hidePopover=="function"&&e.matches(":popover-open")&&e.hidePopover()}requestFullScreen(e){this.closeMenu(),this._onFullScreenChange(e)}showDeleteConfirmation(){var r,i,s;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const e=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");e&&(this._dialogPresentation=Vu(e,()=>this.dismissDeleteConfirmation()),(s=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||s.focus())}dismissDeleteConfirmation(){const e=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,e==null||e.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const e=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!e||!r)&&r.deleteArtifact(e).catch(()=>{})}navigationControlsTemplate(){const e=this._navigationState;return!e||!e.canGoBack&&!e.canGoForward?null:V`
|
|
248
|
-
<button
|
|
249
|
-
icon-only
|
|
250
|
-
size="sm"
|
|
251
|
-
variant="ghost"
|
|
252
|
-
class="artifact-back"
|
|
253
|
-
?disabled=${!e.canGoBack}
|
|
254
|
-
@click=${()=>e.back()}
|
|
255
|
-
aria-label="Back"
|
|
256
|
-
>
|
|
257
|
-
<tv-icon name="back" size="sm"></tv-icon>
|
|
258
|
-
</button>
|
|
259
|
-
<button
|
|
260
|
-
icon-only
|
|
261
|
-
size="sm"
|
|
262
|
-
variant="ghost"
|
|
263
|
-
class="artifact-forward"
|
|
264
|
-
?disabled=${!e.canGoForward}
|
|
265
|
-
@click=${()=>e.forward()}
|
|
266
|
-
aria-label="Forward"
|
|
267
|
-
>
|
|
268
|
-
<tv-icon name="forward" size="sm"></tv-icon>
|
|
269
|
-
</button>
|
|
270
|
-
<span class="artifact-bar-divider" aria-hidden="true"></span>
|
|
271
|
-
`}deleteConfirmationTemplate(){return!this._deleteConfirmationOpen||!this._artifact?null:Hu(V`
|
|
272
|
-
<div class="dialog-alert" role="alertdialog">
|
|
273
|
-
<h2>Delete “${this._artifact.title}”?</h2>
|
|
274
|
-
<p>It’s removed from this channel; the file or web page it points to is not deleted.</p>
|
|
275
|
-
<div class="dialog-actions">
|
|
276
|
-
<button @click=${()=>this.dismissDeleteConfirmation()}>Cancel</button>
|
|
277
|
-
<button variant="danger" @click=${()=>this.confirmDelete()}>Delete</button>
|
|
278
|
-
</div>
|
|
279
|
-
</div>
|
|
280
|
-
`,{overlay:!0})}template(e,r,i){const s=this._artifact;return V`
|
|
281
|
-
<div
|
|
282
|
-
class="artifact-view artifact-frame"
|
|
283
|
-
kind=${s.kind}
|
|
284
|
-
?full-screen=${this._fullScreen}
|
|
285
|
-
?inert=${this._inert}
|
|
286
|
-
._trustedChannel=${this._trustedChannel}
|
|
287
|
-
${mn(this._rootRef)}
|
|
288
|
-
>
|
|
289
|
-
${jL(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
|
|
290
|
-
<footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
|
|
291
|
-
<tv-icon name="artifact" size="sm"></tv-icon>
|
|
292
|
-
<span class="artifact-title">${s.title}</span>
|
|
293
|
-
${this.navigationControlsTemplate()}
|
|
294
|
-
${xw(this.menuEntries(),{placement:"top-end",trigger:o=>V`
|
|
295
|
-
<button
|
|
296
|
-
icon-only
|
|
297
|
-
size="sm"
|
|
298
|
-
variant="ghost"
|
|
299
|
-
class="artifact-menu-trigger"
|
|
300
|
-
popovertarget=${o}
|
|
301
|
-
aria-label=${`${s.title} menu`}
|
|
302
|
-
>
|
|
303
|
-
<tv-icon name="expand" size="sm"></tv-icon>
|
|
304
|
-
</button>
|
|
305
|
-
`})}
|
|
306
|
-
</footer>
|
|
307
|
-
${this.deleteConfirmationTemplate()}
|
|
308
|
-
</div>
|
|
309
|
-
`}renderArtifact(e={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:e.preserveFrameSrc??!1,frameSrcOverride:e.frameSrcOverride,resetTrust:e.resetTrust}),this.render(),e.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const eO=kt(QL);function tO(n){return n.startsWith("http://")||n.startsWith("https://")}function nO(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?s2(n.url,t.url):!0}function rO(n,t){return n.kind==="path"&&t.kind==="path"&&n.id===t.id&&(n.title!==t.title||n.path!==t.path)}function s2(n,t){try{const e=new URL(n,window.location.href),r=new URL(t,window.location.href);return e.searchParams.delete(so),r.searchParams.delete(so),e.origin===r.origin&&e.pathname===r.pathname&&e.search===r.search}catch{return!1}}function Og(n,t){try{const e=new URL(n,window.location.href);if(t){const r=new URL(t,window.location.href);if(e.origin===r.origin)return e.searchParams.delete(so),`${e.pathname}${e.search}${e.hash}`}}catch{return Yn(n)}return Yn(n)}function o2(n,t,e,r,i){const s=t.pages.map(o=>({artifactIds:[...o.artifactIds],geometry:{...o.geometry,full_screen:o===e?i:o.geometry.full_screen},size:o===e?{...r}:{...o.size}}));n.updateChannelPages(t.id,s).catch(()=>{})}function of(n,t,e,r){o2(n,t,e,e.size,r)}const iO=1280,sO=800,zg=.4,Ng=.4,a2=280,oO=14,aO=45,lO=16,Mg=64,cO=100,uO=1,hO=230,dO=230;function wp(n){return{width:1-zg+zg*n.width/iO,height:1-Ng+Ng*n.height/sO}}function l2(n){return{width:Math.min(hO,n.width),height:Math.min(dO,n.height)}}function Ug(n,t){const e=wp(t),r=l2(t);return{width:Math.min(t.width,Math.max(r.width,n.width*e.width)),height:Math.min(t.height,Math.max(r.height,n.height*e.height))}}function fO(n,t){const e=wp(t);return{width:n.width/e.width,height:n.height/e.height}}const Wh=.5,pO=4,Yl=2,mO=120,gO=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var _i,on,Bs,Zn,qs,Si,vr,yr,wr,Fn,Ai,ki,an,js,Hn,ln,Ve,Ei,O,c2,u2,Yo,h2,Ko,af,xc,d2,Xa,Qa,el,tl,$i,nl,lf,Zt,cf,hs,f2,p2,Pc,Dc;class vO extends At{constructor(){super(...arguments);g(this,O);g(this,_i,Rr());g(this,on,Rr());g(this,Bs);g(this,Zn);g(this,qs);g(this,Si);g(this,vr);g(this,yr,0);g(this,wr,0);g(this,Fn,null);g(this,Ai,null);g(this,ki,null);g(this,an,null);g(this,js,[]);g(this,Hn,null);g(this,ln,null);g(this,Ve,null);g(this,Ei,new Set);g(this,Xa,e=>{const r=a(this,Ve);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},r.option=e.altKey,h(this,O,lf).call(this,r))});g(this,Qa,e=>{var r;e.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,O,Zt).call(this,!0)});g(this,el,e=>{var r;e.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,O,Zt).call(this,!1)});g(this,tl,e=>{var r;e.pointerId===((r=a(this,Ve))==null?void 0:r.pointerId)&&h(this,O,Zt).call(this,!1)});g(this,$i,e=>{const r=a(this,Ve);if(r){if(e.type==="keydown"&&e.key==="Escape"){e.preventDefault(),h(this,O,Zt).call(this,!1);return}r.option!==e.altKey&&(r.option=e.altKey,h(this,O,lf).call(this,r))}});g(this,nl,()=>{const e=a(this,Ve);!e||Zg(h(this,O,Yo).call(this,e.filmstrip),e.pageBox)||(h(this,O,af).call(this),h(this,O,Zt).call(this,!1))})}connected(){d(this,Bs,void 0),d(this,Zn,void 0),d(this,qs,void 0),d(this,Si,void 0),d(this,vr,void 0)}template(e,r,i){var Q;const s=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,o=wO(r,(s==null?void 0:s.pages)??(r==null?void 0:r.pages)),l=(r==null?void 0:r.selectedPage)??null,c=(r==null?void 0:r.id)??null,u=(l==null?void 0:l.artifactIds[0])??null,f=(l==null?void 0:l.geometry.full_screen)??null,m=a(this,Si)!==void 0,v=o.map(({key:ee,page:oe})=>`${ee}:${oe.geometry.full_screen}:${oe.size.width}:${oe.size.height}`).sort().join("|"),y=s===null?null:o.map(({key:ee})=>ee).join("|"),k=c!==a(this,Bs),S=u!==a(this,Zn),x=f!==a(this,qs),M=v!==a(this,Si),Z=y!==a(this,vr),F=s!==null&&a(this,vr)!==void 0&&a(this,vr)!==null&&Z?h(this,O,f2).call(this):null,W=S&&!k&&a(this,Zn)!==void 0&&a(this,Zn)!==null&&u!==null;return a(this,Ve)&&(k||S||x)&&h(this,O,Zt).call(this,!1),d(this,Bs,c),d(this,Zn,u),d(this,qs,f),d(this,Si,v),d(this,vr,y),d(this,js,o),M&&m&&h(this,O,xc).call(this),k&&((Q=a(this,an))==null||Q.disconnect(),d(this,Ai,null),d(this,ki,null),d(this,Hn,null)),queueMicrotask(()=>h(this,O,Ko).call(this)),k||S||M?queueMicrotask(()=>h(this,O,c2).call(this,u,W)):Z&&queueMicrotask(()=>{const ee=a(this,on).value;ee&&(h(this,O,hs).call(this,ee,u,!1),F&&h(this,O,p2).call(this,F))}),V`
|
|
310
|
-
<section
|
|
311
|
-
class="stage"
|
|
312
|
-
${mn(a(this,_i))}
|
|
313
|
-
style=${`--handle-band: ${oO}px; --handle-reach: ${aO}px; --handle-thickness: ${lO}px;`}
|
|
314
|
-
>
|
|
315
|
-
${r!==null&&o.length===0?V`
|
|
316
|
-
<div class="stage-empty">
|
|
317
|
-
<tv-icon name="artifact"></tv-icon>
|
|
318
|
-
<p>No artifacts yet — ask your agent to put something here.</p>
|
|
319
|
-
</div>
|
|
320
|
-
`:null}
|
|
321
|
-
${Gc([c],ee=>ee,()=>V`
|
|
322
|
-
<div class="filmstrip" ${mn(a(this,on))}>
|
|
323
|
-
<div class="filmstrip-inner" ?tab-held=${s!==null}>
|
|
324
|
-
${Gc(o,({key:ee})=>ee,({page:ee,artifact:oe,key:yn})=>{if(r===null)return null;const wn=yn===u;return V`
|
|
325
|
-
<div
|
|
326
|
-
class="page"
|
|
327
|
-
data-page-key=${yn}
|
|
328
|
-
?selected=${wn}
|
|
329
|
-
?full-screen=${ee.geometry.full_screen}
|
|
330
|
-
style=${h(this,O,h2).call(this,ee)}
|
|
331
|
-
@click=${wn||oe===null?null:()=>e.selectPage(r.id,oe.id)}
|
|
332
|
-
>
|
|
333
|
-
${oe?eO(e,oe,{viewURL:e.getArtifactViewURL(oe),contentURL:e.getArtifactContentURL(oe),fullScreen:ee.geometry.full_screen,inert:!wn,onFullScreenChange:we=>of(e,r,ee,we)}):null}
|
|
334
|
-
${wn?V`
|
|
335
|
-
<div class="page-handles" aria-hidden="true">
|
|
336
|
-
${gO.map(we=>V`
|
|
337
|
-
<span
|
|
338
|
-
class="page-handle ${we}"
|
|
339
|
-
@pointerdown=${bn=>h(this,O,d2).call(this,bn,we,e,r,ee,yn)}
|
|
340
|
-
></span>
|
|
341
|
-
`)}
|
|
342
|
-
</div>
|
|
343
|
-
`:null}
|
|
344
|
-
</div>
|
|
345
|
-
`})}
|
|
346
|
-
</div>
|
|
347
|
-
</div>
|
|
348
|
-
`)}
|
|
349
|
-
</section>
|
|
350
|
-
`}disconnected(){var e;h(this,O,Zt).call(this,!1),h(this,O,xc).call(this),h(this,O,Dc).call(this),cancelAnimationFrame(a(this,yr)),d(this,yr,0),(e=a(this,an))==null||e.disconnect(),d(this,an,null),d(this,Ai,null),d(this,ki,null),d(this,Hn,null),d(this,js,[]);for(const r of a(this,Ei))r.cancel();a(this,Ei).clear()}}_i=new WeakMap,on=new WeakMap,Bs=new WeakMap,Zn=new WeakMap,qs=new WeakMap,Si=new WeakMap,vr=new WeakMap,yr=new WeakMap,wr=new WeakMap,Fn=new WeakMap,Ai=new WeakMap,ki=new WeakMap,an=new WeakMap,js=new WeakMap,Hn=new WeakMap,ln=new WeakMap,Ve=new WeakMap,Ei=new WeakMap,O=new WeakSet,c2=function(e,r){const i=a(this,on).value;i&&(cancelAnimationFrame(a(this,yr)),d(this,yr,requestAnimationFrame(()=>{d(this,yr,0),h(this,O,hs).call(this,i,e,r)})))},u2=function(e,r){var i;typeof ResizeObserver>"u"||e===a(this,Ai)&&r===a(this,ki)||((i=a(this,an))==null||i.disconnect(),d(this,Ai,e),d(this,ki,r),d(this,an,new ResizeObserver(()=>{const s=h(this,O,Yo).call(this,e);Zg(s,a(this,Hn))||(h(this,O,af).call(this),a(this,Ve)&&h(this,O,Zt).call(this,!1),h(this,O,Ko).call(this,e)),a(this,Fn)===null&&h(this,O,hs).call(this,e,a(this,Zn)??null,!1)})),a(this,an).observe(e),a(this,an).observe(r))},Yo=function(e){const r=Number.parseFloat(getComputedStyle(e).getPropertyValue("--stage-inset"))||0;return{width:Math.max(0,e.clientWidth-2*r),height:Math.max(0,e.clientHeight-r)}},h2=function(e){if(e.geometry.full_screen||a(this,Hn)===null)return"";const r=Ug(e.size,a(this,Hn));return`width: ${r.width}px; height: ${r.height}px;`},Ko=function(e=a(this,on).value){var s;if(!e)return;const r=h(this,O,Yo).call(this,e);d(this,Hn,r);const i=new Map(a(this,js).map(o=>[o.key,o.page]));for(const o of e.querySelectorAll(".page")){if(o===((s=a(this,Ve))==null?void 0:s.pageElement))continue;const l=i.get(o.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){o.style.width="",o.style.height="";continue}const c=Ug(l.size,r);o.style.width=`${c.width}px`,o.style.height=`${c.height}px`}},af=function(){const e=a(this,_i).value;e&&(e.setAttribute("window-tracking",""),a(this,ln)!==null&&clearTimeout(a(this,ln)),d(this,ln,setTimeout(()=>{d(this,ln,null),e.removeAttribute("window-tracking")},mO)))},xc=function(){var e;a(this,ln)!==null&&(clearTimeout(a(this,ln)),d(this,ln,null)),(e=a(this,_i).value)==null||e.removeAttribute("window-tracking")},d2=function(e,r,i,s,o,l){if(e.button!==0||!e.isPrimary)return;const c=e.currentTarget,u=c.closest(".page"),f=a(this,on).value,m=a(this,_i).value;if(!u||!f||!m)return;h(this,O,Zt).call(this,!1),h(this,O,xc).call(this),e.preventDefault(),e.stopPropagation();const v=u.getBoundingClientRect(),y=h(this,O,Yo).call(this,f),k=wp(y),S=o.geometry.full_screen,x=r.includes("left")||r.includes("right"),M=r.includes("top")||r.includes("bottom");d(this,Ve,{application:i,channel:s,page:o,pageKey:l,pageElement:u,filmstrip:f,stage:m,handle:c,pointerId:e.pointerId,startPointer:{x:e.clientX,y:e.clientY},lastPointer:{x:e.clientX,y:e.clientY},startRendered:{width:v.width,height:v.height},rendered:{width:v.width,height:v.height},baselineSize:S?{width:y.width/k.width,height:y.height/k.height}:{...o.size},pageBox:y,wasFullScreen:S,horizontal:x,vertical:M,leftish:r.includes("left"),topish:r.includes("top"),option:e.altKey,armed:!1,leftFullScreen:!1}),m.setAttribute("resizing",""),c.addEventListener("pointermove",a(this,Xa)),c.addEventListener("pointerup",a(this,Qa)),c.addEventListener("pointercancel",a(this,el)),c.addEventListener("lostpointercapture",a(this,tl)),window.addEventListener("keydown",a(this,$i)),window.addEventListener("keyup",a(this,$i)),window.addEventListener("resize",a(this,nl)),c.setPointerCapture(e.pointerId)},Xa=new WeakMap,Qa=new WeakMap,el=new WeakMap,tl=new WeakMap,$i=new WeakMap,nl=new WeakMap,lf=function(e){const r=e.lastPointer.x!==e.startPointer.x||e.lastPointer.y!==e.startPointer.y;if(e.wasFullScreen&&!e.leftFullScreen){if(!r)return;e.leftFullScreen=!0,e.pageElement.removeAttribute("full-screen")}const i=l2(e.pageBox);let s=e.startRendered.width,o=e.startRendered.height;if(e.horizontal){const l=e.leftish?-Yl:Yl;s=Math.min(e.pageBox.width,Math.max(i.width,e.startRendered.width+(e.lastPointer.x-e.startPointer.x)*l))}if(e.vertical){const l=e.topish?-Yl:Yl;o=Math.min(e.pageBox.height,Math.max(i.height,e.startRendered.height+(e.lastPointer.y-e.startPointer.y)*l))}e.armed=!e.option&&e.horizontal&&e.vertical&&s>=e.pageBox.width-Mg&&o>=e.pageBox.height-Mg,e.rendered=e.armed?{...e.pageBox}:{width:s,height:o},e.pageElement.style.width=`${e.rendered.width}px`,e.pageElement.style.height=`${e.rendered.height}px`,h(this,O,cf).call(this,e.stage,e.armed),h(this,O,hs).call(this,e.filmstrip,e.pageKey,!1)},Zt=function(e){const r=a(this,Ve);if(r){if(d(this,Ve,null),r.handle.removeEventListener("pointermove",a(this,Xa)),r.handle.removeEventListener("pointerup",a(this,Qa)),r.handle.removeEventListener("pointercancel",a(this,el)),r.handle.removeEventListener("lostpointercapture",a(this,tl)),window.removeEventListener("keydown",a(this,$i)),window.removeEventListener("keyup",a(this,$i)),window.removeEventListener("resize",a(this,nl)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,O,cf).call(this,r.stage,!1),e&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),of(r.application,r.channel,r.page,!0);else if(e){const i={...r.baselineSize},s=fO(r.rendered,r.pageBox);let o=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=s.width,o=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=s.height,o=!0),o?o2(r.application,r.channel,r.page,i,!1):h(this,O,Ko).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,O,Ko).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,O,hs).call(this,r.filmstrip,r.pageKey,!1)}},cf=function(e,r){const i=e.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const s=document.createElement("div");s.className="snap-outline",s.setAttribute("aria-hidden","true"),e.append(s)},hs=function(e,r,i){const s=[...e.querySelectorAll(".page")].find(v=>v.dataset.pageKey===r);if(!s){h(this,O,Dc).call(this);return}h(this,O,u2).call(this,e,s);const o=s.getBoundingClientRect(),l=e.getBoundingClientRect(),c=Math.max(0,Math.min(e.scrollLeft+o.left+o.width/2-(l.left+l.width/2),e.scrollWidth-e.clientWidth));if(h(this,O,Dc).call(this),!i||Math.abs(c-e.scrollLeft)<Wh||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;for(let v=0;v<pO;v+=1){h(this,O,Pc).call(this,e);const y=s.getBoundingClientRect(),k=e.getBoundingClientRect(),S=y.left+y.width/2-(k.left+k.width/2);if(Math.abs(S)<Wh)break;e.scrollLeft+=S}h(this,O,Pc).call(this,e);return}const u=e.scrollLeft,f=e.animate([{},{}],{duration:a2,easing:"ease"});d(this,Fn,f);const m=()=>{var y;if(f!==a(this,Fn))return;const v=f.playState==="finished"?1:((y=f.effect)==null?void 0:y.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*v,h(this,O,Pc).call(this,e),f.playState==="finished"?(e.scrollLeft=c,d(this,Fn,null),d(this,wr,0)):d(this,wr,requestAnimationFrame(m))};d(this,wr,requestAnimationFrame(m))},f2=function(){const e=a(this,on).value;return e?new Map([...e.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},p2=function(e){const r=a(this,on).value,i=r==null?void 0:r.querySelector(".filmstrip-inner");if(!r||!i)return;const s=i.clientWidth===0?1:i.getBoundingClientRect().width/i.clientWidth;for(const o of r.querySelectorAll(".page")){if(o.hasAttribute("selected"))continue;const l=e.get(o.dataset.pageKey??"");if(l===void 0)continue;const c=(l-o.getBoundingClientRect().left)/(s||1);if(Math.abs(c)<=Wh)continue;const u=o.animate({translate:[`${c}px 0`,"0px 0"]},{duration:gs,easing:"ease"});a(this,Ei).add(u),u.finished.finally(()=>{a(this,Ei).delete(u)}).catch(()=>{})}},Pc=function(e){const r=e.querySelector(".filmstrip-inner");r&&(r.style.transformOrigin=`${e.scrollLeft+e.clientWidth/2}px center`)},Dc=function(){var e;cancelAnimationFrame(a(this,wr)),d(this,wr,0),(e=a(this,Fn))==null||e.cancel(),d(this,Fn,null)};const yO=kt(vO);function wO(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{const s=r.artifactIds[0];return{page:r,artifact:s===void 0?null:e.get(s)??null,key:s??`empty-page-${i}`}})}function Zg(n,t){return t!==null&&n.width===t.width&&n.height===t.height}/**
|
|
351
|
-
* @license
|
|
352
|
-
* Copyright 2017 Google LLC
|
|
353
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
354
|
-
*/class uf extends Fu{constructor(t){if(super(t),this.it=ue,t.type!==Zu.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ue||t==null)return this._t=void 0,this.it=t;if(t===Pt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}uf.directiveName="unsafeHTML",uf.resultType=1;const m2=El(uf);/*! @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:g2,setPrototypeOf:Fg,isFrozen:bO,getPrototypeOf:_O,getOwnPropertyDescriptor:SO}=Object;let{freeze:je,seal:bt,create:Lc}=Object,{apply:hf,construct:df}=typeof Reflect<"u"&&Reflect;je||(je=function(t){return t});bt||(bt=function(t){return t});hf||(hf=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(e,i)});df||(df=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Kl=We(Array.prototype.forEach),AO=We(Array.prototype.lastIndexOf),Hg=We(Array.prototype.pop),Io=We(Array.prototype.push),kO=We(Array.prototype.splice),Oc=We(String.prototype.toLowerCase),Gh=We(String.prototype.toString),Yh=We(String.prototype.match),xo=We(String.prototype.replace),EO=We(String.prototype.indexOf),$O=We(String.prototype.trim),et=We(Object.prototype.hasOwnProperty),Ue=We(RegExp.prototype.test),Po=CO(TypeError);function We(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return hf(n,t,r)}}function CO(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return df(n,e)}}function Y(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oc;Fg&&Fg(n,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=e(i);s!==i&&(bO(t)||(t[r]=s),i=s)}n[i]=!0}return n}function TO(n){for(let t=0;t<n.length;t++)et(n,t)||(n[t]=null);return n}function Ft(n){const t=Lc(null);for(const[e,r]of g2(n))et(n,e)&&(Array.isArray(r)?t[e]=TO(r):r&&typeof r=="object"&&r.constructor===Object?t[e]=Ft(r):t[e]=r);return t}function Do(n,t){for(;n!==null;){const r=SO(n,t);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}n=_O(n)}function e(){return null}return e}const Vg=je(["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"]),Kh=je(["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"]),Jh=je(["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"]),RO=je(["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"]),Xh=je(["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"]),IO=je(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Bg=je(["#text"]),qg=je(["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"]),Qh=je(["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"]),jg=je(["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"]),Jl=je(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xO=bt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PO=bt(/<%[\w\W]*|[\w\W]*%>/gm),DO=bt(/\$\{[\w\W]*/gm),LO=bt(/^data-[\-\w.\u00B7-\uFFFF]+$/),OO=bt(/^aria-[\-\w]+$/),v2=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zO=bt(/^(?:\w+script|data):/i),NO=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),y2=bt(/^html$/i),MO=bt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Wg=Object.freeze({__proto__:null,ARIA_ATTR:OO,ATTR_WHITESPACE:NO,CUSTOM_ELEMENT:MO,DATA_ATTR:LO,DOCTYPE_NAME:y2,ERB_EXPR:PO,IS_ALLOWED_URI:v2,IS_SCRIPT_OR_DATA:zO,MUSTACHE_EXPR:xO,TMPLIT_EXPR:DO});const Lo={element:1,text:3,progressingInstruction:7,comment:8,document:9},UO=function(){return typeof window>"u"?null:window},ZO=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Gg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function w2(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UO();const t=U=>w2(U);if(t.version="3.3.3",t.removed=[],!n||!n.document||n.document.nodeType!==Lo.document||!n.Element)return t.isSupported=!1,t;let{document:e}=n;const r=e,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:u,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:y}=n,k=c.prototype,S=Do(k,"cloneNode"),x=Do(k,"remove"),M=Do(k,"nextSibling"),Z=Do(k,"childNodes"),G=Do(k,"parentNode");if(typeof o=="function"){const U=e.createElement("template");U.content&&U.content.ownerDocument&&(e=U.content.ownerDocument)}let F,W="";const{implementation:Q,createNodeIterator:ee,createDocumentFragment:oe,getElementsByTagName:yn}=e,{importNode:wn}=r;let we=Gg();t.isSupported=typeof g2=="function"&&typeof G=="function"&&Q&&Q.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:bn,ERB_EXPR:Ot,TMPLIT_EXPR:Qn,DATA_ATTR:ju,ARIA_ATTR:Cl,IS_SCRIPT_OR_DATA:ab,ATTR_WHITESPACE:Dp,CUSTOM_ELEMENT:lb}=Wg;let{IS_ALLOWED_URI:Lp}=Wg,Te=null;const Op=Y({},[...Vg,...Kh,...Jh,...Xh,...Bg]);let xe=null;const zp=Y({},[...qg,...Qh,...jg,...Jl]);let be=Object.seal(Lc(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}})),_o=null,Tl=null;const er=Object.seal(Lc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Np=!0,Wu=!0,Mp=!1,Up=!0,Wi=!1,Rl=!0,Fr=!1,Gu=!1,Yu=!1,Gi=!1,Il=!1,xl=!1,Zp=!0,Fp=!1;const cb="user-content-";let Ku=!0,So=!1,Yi={},zt=null;const Ju=Y({},["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 Hp=null;const Vp=Y({},["audio","video","img","source","image","track"]);let Xu=null;const Bp=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pl="http://www.w3.org/1998/Math/MathML",Dl="http://www.w3.org/2000/svg",_n="http://www.w3.org/1999/xhtml";let Ki=_n,Qu=!1,eh=null;const ub=Y({},[Pl,Dl,_n],Gh);let Ll=Y({},["mi","mo","mn","ms","mtext"]),Ol=Y({},["annotation-xml"]);const hb=Y({},["title","style","font","a","script"]);let Ao=null;const db=["application/xhtml+xml","text/html"],fb="text/html";let $e=null,Ji=null;const pb=e.createElement("form"),qp=function(b){return b instanceof RegExp||b instanceof Function},th=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ji&&Ji===b)){if((!b||typeof b!="object")&&(b={}),b=Ft(b),Ao=db.indexOf(b.PARSER_MEDIA_TYPE)===-1?fb:b.PARSER_MEDIA_TYPE,$e=Ao==="application/xhtml+xml"?Gh:Oc,Te=et(b,"ALLOWED_TAGS")?Y({},b.ALLOWED_TAGS,$e):Op,xe=et(b,"ALLOWED_ATTR")?Y({},b.ALLOWED_ATTR,$e):zp,eh=et(b,"ALLOWED_NAMESPACES")?Y({},b.ALLOWED_NAMESPACES,Gh):ub,Xu=et(b,"ADD_URI_SAFE_ATTR")?Y(Ft(Bp),b.ADD_URI_SAFE_ATTR,$e):Bp,Hp=et(b,"ADD_DATA_URI_TAGS")?Y(Ft(Vp),b.ADD_DATA_URI_TAGS,$e):Vp,zt=et(b,"FORBID_CONTENTS")?Y({},b.FORBID_CONTENTS,$e):Ju,_o=et(b,"FORBID_TAGS")?Y({},b.FORBID_TAGS,$e):Ft({}),Tl=et(b,"FORBID_ATTR")?Y({},b.FORBID_ATTR,$e):Ft({}),Yi=et(b,"USE_PROFILES")?b.USE_PROFILES:!1,Np=b.ALLOW_ARIA_ATTR!==!1,Wu=b.ALLOW_DATA_ATTR!==!1,Mp=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Up=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Wi=b.SAFE_FOR_TEMPLATES||!1,Rl=b.SAFE_FOR_XML!==!1,Fr=b.WHOLE_DOCUMENT||!1,Gi=b.RETURN_DOM||!1,Il=b.RETURN_DOM_FRAGMENT||!1,xl=b.RETURN_TRUSTED_TYPE||!1,Yu=b.FORCE_BODY||!1,Zp=b.SANITIZE_DOM!==!1,Fp=b.SANITIZE_NAMED_PROPS||!1,Ku=b.KEEP_CONTENT!==!1,So=b.IN_PLACE||!1,Lp=b.ALLOWED_URI_REGEXP||v2,Ki=b.NAMESPACE||_n,Ll=b.MATHML_TEXT_INTEGRATION_POINTS||Ll,Ol=b.HTML_INTEGRATION_POINTS||Ol,be=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&qp(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&qp(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Wi&&(Wu=!1),Il&&(Gi=!0),Yi&&(Te=Y({},Bg),xe=Lc(null),Yi.html===!0&&(Y(Te,Vg),Y(xe,qg)),Yi.svg===!0&&(Y(Te,Kh),Y(xe,Qh),Y(xe,Jl)),Yi.svgFilters===!0&&(Y(Te,Jh),Y(xe,Qh),Y(xe,Jl)),Yi.mathMl===!0&&(Y(Te,Xh),Y(xe,jg),Y(xe,Jl))),et(b,"ADD_TAGS")||(er.tagCheck=null),et(b,"ADD_ATTR")||(er.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?er.tagCheck=b.ADD_TAGS:(Te===Op&&(Te=Ft(Te)),Y(Te,b.ADD_TAGS,$e))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?er.attributeCheck=b.ADD_ATTR:(xe===zp&&(xe=Ft(xe)),Y(xe,b.ADD_ATTR,$e))),b.ADD_URI_SAFE_ATTR&&Y(Xu,b.ADD_URI_SAFE_ATTR,$e),b.FORBID_CONTENTS&&(zt===Ju&&(zt=Ft(zt)),Y(zt,b.FORBID_CONTENTS,$e)),b.ADD_FORBID_CONTENTS&&(zt===Ju&&(zt=Ft(zt)),Y(zt,b.ADD_FORBID_CONTENTS,$e)),Ku&&(Te["#text"]=!0),Fr&&Y(Te,["html","head","body"]),Te.table&&(Y(Te,["tbody"]),delete _o.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Po('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Po('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=b.TRUSTED_TYPES_POLICY,W=F.createHTML("")}else F===void 0&&(F=ZO(y,i)),F!==null&&typeof W=="string"&&(W=F.createHTML(""));je&&je(b),Ji=b}},jp=Y({},[...Kh,...Jh,...RO]),Wp=Y({},[...Xh,...IO]),mb=function(b){let I=G(b);(!I||!I.tagName)&&(I={namespaceURI:Ki,tagName:"template"});const L=Oc(b.tagName),de=Oc(I.tagName);return eh[b.namespaceURI]?b.namespaceURI===Dl?I.namespaceURI===_n?L==="svg":I.namespaceURI===Pl?L==="svg"&&(de==="annotation-xml"||Ll[de]):!!jp[L]:b.namespaceURI===Pl?I.namespaceURI===_n?L==="math":I.namespaceURI===Dl?L==="math"&&Ol[de]:!!Wp[L]:b.namespaceURI===_n?I.namespaceURI===Dl&&!Ol[de]||I.namespaceURI===Pl&&!Ll[de]?!1:!Wp[L]&&(hb[L]||!jp[L]):!!(Ao==="application/xhtml+xml"&&eh[b.namespaceURI]):!1},Nt=function(b){Io(t.removed,{element:b});try{G(b).removeChild(b)}catch{x(b)}},Hr=function(b,I){try{Io(t.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Io(t.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(Gi||Il)try{Nt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},Gp=function(b){let I=null,L=null;if(Yu)b="<remove></remove>"+b;else{const Se=Yh(b,/^[\r\n\t ]+/);L=Se&&Se[0]}Ao==="application/xhtml+xml"&&Ki===_n&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const de=F?F.createHTML(b):b;if(Ki===_n)try{I=new v().parseFromString(de,Ao)}catch{}if(!I||!I.documentElement){I=Q.createDocument(Ki,"template",null);try{I.documentElement.innerHTML=Qu?W:de}catch{}}const ze=I.body||I.documentElement;return b&&L&&ze.insertBefore(e.createTextNode(L),ze.childNodes[0]||null),Ki===_n?yn.call(I,Fr?"html":"body")[0]:Fr?I.documentElement:ze},Yp=function(b){return ee.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},nh=function(b){return b instanceof m&&(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")},Kp=function(b){return typeof l=="function"&&b instanceof l};function Sn(U,b,I){Kl(U,L=>{L.call(t,b,I,Ji)})}const Jp=function(b){let I=null;if(Sn(we.beforeSanitizeElements,b,null),nh(b))return Nt(b),!0;const L=$e(b.nodeName);if(Sn(we.uponSanitizeElement,b,{tagName:L,allowedTags:Te}),Rl&&b.hasChildNodes()&&!Kp(b.firstElementChild)&&Ue(/<[/\w!]/g,b.innerHTML)&&Ue(/<[/\w!]/g,b.textContent)||b.nodeType===Lo.progressingInstruction||Rl&&b.nodeType===Lo.comment&&Ue(/<[/\w]/g,b.data))return Nt(b),!0;if(!(er.tagCheck instanceof Function&&er.tagCheck(L))&&(!Te[L]||_o[L])){if(!_o[L]&&Qp(L)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,L)||be.tagNameCheck instanceof Function&&be.tagNameCheck(L)))return!1;if(Ku&&!zt[L]){const de=G(b)||b.parentNode,ze=Z(b)||b.childNodes;if(ze&&de){const Se=ze.length;for(let Ge=Se-1;Ge>=0;--Ge){const An=S(ze[Ge],!0);An.__removalCount=(b.__removalCount||0)+1,de.insertBefore(An,M(b))}}}return Nt(b),!0}return b instanceof c&&!mb(b)||(L==="noscript"||L==="noembed"||L==="noframes")&&Ue(/<\/no(script|embed|frames)/i,b.innerHTML)?(Nt(b),!0):(Wi&&b.nodeType===Lo.text&&(I=b.textContent,Kl([bn,Ot,Qn],de=>{I=xo(I,de," ")}),b.textContent!==I&&(Io(t.removed,{element:b.cloneNode()}),b.textContent=I)),Sn(we.afterSanitizeElements,b,null),!1)},Xp=function(b,I,L){if(Tl[I]||Zp&&(I==="id"||I==="name")&&(L in e||L in pb))return!1;if(!(Wu&&!Tl[I]&&Ue(ju,I))){if(!(Np&&Ue(Cl,I))){if(!(er.attributeCheck instanceof Function&&er.attributeCheck(I,b))){if(!xe[I]||Tl[I]){if(!(Qp(b)&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,b)||be.tagNameCheck instanceof Function&&be.tagNameCheck(b))&&(be.attributeNameCheck instanceof RegExp&&Ue(be.attributeNameCheck,I)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(I,b))||I==="is"&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&Ue(be.tagNameCheck,L)||be.tagNameCheck instanceof Function&&be.tagNameCheck(L))))return!1}else if(!Xu[I]){if(!Ue(Lp,xo(L,Dp,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&EO(L,"data:")===0&&Hp[b])){if(!(Mp&&!Ue(ab,xo(L,Dp,"")))){if(L)return!1}}}}}}}return!0},Qp=function(b){return b!=="annotation-xml"&&Yh(b,lb)},e0=function(b){Sn(we.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||nh(b))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let de=I.length;for(;de--;){const ze=I[de],{name:Se,namespaceURI:Ge,value:An}=ze,Xi=$e(Se),rh=An;let Pe=Se==="value"?rh:$O(rh);if(L.attrName=Xi,L.attrValue=Pe,L.keepAttr=!0,L.forceKeepAttr=void 0,Sn(we.uponSanitizeAttribute,b,L),Pe=L.attrValue,Fp&&(Xi==="id"||Xi==="name")&&(Hr(Se,b),Pe=cb+Pe),Rl&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){Hr(Se,b);continue}if(Xi==="attributename"&&Yh(Pe,"href")){Hr(Se,b);continue}if(L.forceKeepAttr)continue;if(!L.keepAttr){Hr(Se,b);continue}if(!Up&&Ue(/\/>/i,Pe)){Hr(Se,b);continue}Wi&&Kl([bn,Ot,Qn],n0=>{Pe=xo(Pe,n0," ")});const t0=$e(b.nodeName);if(!Xp(t0,Xi,Pe)){Hr(Se,b);continue}if(F&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Ge)switch(y.getAttributeType(t0,Xi)){case"TrustedHTML":{Pe=F.createHTML(Pe);break}case"TrustedScriptURL":{Pe=F.createScriptURL(Pe);break}}if(Pe!==rh)try{Ge?b.setAttributeNS(Ge,Se,Pe):b.setAttribute(Se,Pe),nh(b)?Nt(b):Hg(t.removed)}catch{Hr(Se,b)}}Sn(we.afterSanitizeAttributes,b,null)},gb=function U(b){let I=null;const L=Yp(b);for(Sn(we.beforeSanitizeShadowDOM,b,null);I=L.nextNode();)Sn(we.uponSanitizeShadowNode,I,null),Jp(I),e0(I),I.content instanceof s&&U(I.content);Sn(we.afterSanitizeShadowDOM,b,null)};return t.sanitize=function(U){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,L=null,de=null,ze=null;if(Qu=!U,Qu&&(U="<!-->"),typeof U!="string"&&!Kp(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw Po("dirty is not a string, aborting")}else throw Po("toString is not a function");if(!t.isSupported)return U;if(Gu||th(b),t.removed=[],typeof U=="string"&&(So=!1),So){if(U.nodeName){const An=$e(U.nodeName);if(!Te[An]||_o[An])throw Po("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof l)I=Gp("<!---->"),L=I.ownerDocument.importNode(U,!0),L.nodeType===Lo.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?I=L:I.appendChild(L);else{if(!Gi&&!Wi&&!Fr&&U.indexOf("<")===-1)return F&&xl?F.createHTML(U):U;if(I=Gp(U),!I)return Gi?null:xl?W:""}I&&Yu&&Nt(I.firstChild);const Se=Yp(So?U:I);for(;de=Se.nextNode();)Jp(de),e0(de),de.content instanceof s&&gb(de.content);if(So)return U;if(Gi){if(Il)for(ze=oe.call(I.ownerDocument);I.firstChild;)ze.appendChild(I.firstChild);else ze=I;return(xe.shadowroot||xe.shadowrootmode)&&(ze=wn.call(r,ze,!0)),ze}let Ge=Fr?I.outerHTML:I.innerHTML;return Fr&&Te["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Ue(y2,I.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
355
|
-
`+Ge),Wi&&Kl([bn,Ot,Qn],An=>{Ge=xo(Ge,An," ")}),F&&xl?F.createHTML(Ge):Ge},t.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};th(U),Gu=!0},t.clearConfig=function(){Ji=null,Gu=!1},t.isValidAttribute=function(U,b,I){Ji||th({});const L=$e(U),de=$e(b);return Xp(L,de,I)},t.addHook=function(U,b){typeof b=="function"&&Io(we[U],b)},t.removeHook=function(U,b){if(b!==void 0){const I=AO(we[U],b);return I===-1?void 0:kO(we[U],I,1)[0]}return Hg(we[U])},t.removeHooks=function(U){we[U]=[]},t.removeAllHooks=function(){we=Gg()},t}var b2=w2();function bp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ji=bp();function _2(n){ji=n}var Kr={exec:()=>null};function X(n,t=""){let e=typeof n=="string"?n:n.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Be.caret,"$1"),e=e.replace(i,o),r},getRegex:()=>new RegExp(e,t)};return r}var FO=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Be={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)}}>`)},HO=/^(?:[ \t]*(?:\n|$))+/,VO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,BO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$l=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,S2=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,A2=X(S2).replace(/bull/g,_p).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(),jO=X(S2).replace(/bull/g,_p).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(),Sp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,WO=/^[^\n]+/,Ap=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,GO=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ap).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),YO=X(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_p).getRegex(),Bu="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",kp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,KO=X("^ {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",kp).replace("tag",Bu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k2=X(Sp).replace("hr",$l).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",Bu).getRegex(),JO=X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",k2).getRegex(),Ep={blockquote:JO,code:VO,def:GO,fences:BO,heading:qO,hr:$l,html:KO,lheading:A2,list:YO,newline:HO,paragraph:k2,table:Kr,text:WO},Yg=X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$l).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",Bu).getRegex(),XO={...Ep,lheading:jO,table:Yg,paragraph:X(Sp).replace("hr",$l).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yg).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",Bu).getRegex()},QO={...Ep,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",kp).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:Kr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(Sp).replace("hr",$l).replace("heading",` *#{1,6} *[^
|
|
356
|
-
]`).replace("lheading",A2).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ez=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,E2=/^( {2,}|\\)\n(?!\s*$)/,nz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bo=/[\p{P}\p{S}]/u,qu=/[\s\p{P}\p{S}]/u,$p=/[^\s\p{P}\p{S}]/u,rz=X(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qu).getRegex(),$2=/(?!~)[\p{P}\p{S}]/u,iz=/(?!~)[\s\p{P}\p{S}]/u,sz=/(?:[^\s\p{P}\p{S}]|~)/u,oz=X(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",FO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),C2=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,az=X(C2,"u").replace(/punct/g,bo).getRegex(),lz=X(C2,"u").replace(/punct/g,$2).getRegex(),T2="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cz=X(T2,"gu").replace(/notPunctSpace/g,$p).replace(/punctSpace/g,qu).replace(/punct/g,bo).getRegex(),uz=X(T2,"gu").replace(/notPunctSpace/g,sz).replace(/punctSpace/g,iz).replace(/punct/g,$2).getRegex(),hz=X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$p).replace(/punctSpace/g,qu).replace(/punct/g,bo).getRegex(),dz=X(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bo).getRegex(),fz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",pz=X(fz,"gu").replace(/notPunctSpace/g,$p).replace(/punctSpace/g,qu).replace(/punct/g,bo).getRegex(),mz=X(/\\(punct)/,"gu").replace(/punct/g,bo).getRegex(),gz=X(/^<(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(),vz=X(kp).replace("(?:-->|$)","-->").getRegex(),yz=X("^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",vz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,wz=X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Xc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),R2=X(/^!?\[(label)\]\[(ref)\]/).replace("label",Xc).replace("ref",Ap).getRegex(),I2=X(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ap).getRegex(),bz=X("reflink|nolink(?!\\()","g").replace("reflink",R2).replace("nolink",I2).getRegex(),Kg=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cp={_backpedal:Kr,anyPunctuation:mz,autolink:gz,blockSkip:oz,br:E2,code:tz,del:Kr,delLDelim:Kr,delRDelim:Kr,emStrongLDelim:az,emStrongRDelimAst:cz,emStrongRDelimUnd:hz,escape:ez,link:wz,nolink:I2,punctuation:rz,reflink:R2,reflinkSearch:bz,tag:yz,text:nz,url:Kr},_z={...Cp,link:X(/^!?\[(label)\]\((.*?)\)/).replace("label",Xc).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xc).getRegex()},ff={...Cp,emStrongRDelimAst:uz,emStrongLDelim:lz,delLDelim:dz,delRDelim:pz,url:X(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Kg).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:X(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Kg).getRegex()},Sz={...ff,br:X(E2).replace("{2,}","*").getRegex(),text:X(ff.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xl={normal:Ep,gfm:XO,pedantic:QO},Oo={normal:Cp,gfm:ff,breaks:Sz,pedantic:_z},Az={"&":"&","<":"<",">":">",'"':""","'":"'"},Jg=n=>Az[n];function Ht(n,t){if(t){if(Be.escapeTest.test(n))return n.replace(Be.escapeReplace,Jg)}else if(Be.escapeTestNoEncode.test(n))return n.replace(Be.escapeReplaceNoEncode,Jg);return n}function Xg(n){try{n=encodeURI(n).replace(Be.percentDecode,"%")}catch{return null}return n}function Qg(n,t){var s;let e=n.replace(Be.findPipe,(o,l,c)=>{let u=!1,f=l;for(;--f>=0&&c[f]==="\\";)u=!u;return u?"|":" |"}),r=e.split(Be.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Be.slashPipe,"|");return r}function zo(n,t,e){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===t;)i++;return n.slice(0,r-i)}function kz(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===t[0])e++;else if(n[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function Ez(n,t=0){let e=t,r="";for(let i of n)if(i===" "){let s=4-e%4;r+=" ".repeat(s),e+=s}else r+=i,e++;return r}function e1(n,t,e,r,i){let s=t.href,o=t.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:s,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function $z(n,t,e){let r=n.match(e.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
357
|
-
`).map(s=>{let o=s.match(e.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=i.length?s.slice(i.length):s}).join(`
|
|
358
|
-
`)}var Qc=class{constructor(n){$(this,"options");$(this,"rules");$(this,"lexer");this.options=n||ji}space(n){let t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){let t=this.rules.block.code.exec(n);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:zo(e,`
|
|
359
|
-
`)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],r=$z(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=zo(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:zo(t[0],`
|
|
360
|
-
`)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=zo(t[0],`
|
|
361
|
-
`).split(`
|
|
362
|
-
`),r="",i="",s=[];for(;e.length>0;){let o=!1,l=[],c;for(c=0;c<e.length;c++)if(this.rules.other.blockquoteStart.test(e[c]))l.push(e[c]),o=!0;else if(!o)l.push(e[c]);else break;e=e.slice(c);let u=l.join(`
|
|
363
|
-
`),f=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
364
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
365
|
-
${u}`:u,i=i?`${i}
|
|
366
|
-
${f}`:f;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,s,!0),this.lexer.state.top=m,e.length===0)break;let v=s.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let y=v,k=y.raw+`
|
|
367
|
-
`+e.join(`
|
|
368
|
-
`),S=this.blockquote(k);s[s.length-1]=S,r=r.substring(0,r.length-y.raw.length)+S.raw,i=i.substring(0,i.length-y.text.length)+S.text;break}else if((v==null?void 0:v.type)==="list"){let y=v,k=y.raw+`
|
|
369
|
-
`+e.join(`
|
|
370
|
-
`),S=this.list(k);s[s.length-1]=S,r=r.substring(0,r.length-v.raw.length)+S.raw,i=i.substring(0,i.length-y.raw.length)+S.raw,e=k.substring(s.at(-1).raw.length).split(`
|
|
371
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){var e,r;let t=this.rules.block.list.exec(n);if(t){let i=t[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,m="",v="";if(!(t=l.exec(n))||this.rules.block.hr.test(n))break;m=t[0],n=n.substring(m.length);let y=Ez(t[2].split(`
|
|
372
|
-
`,1)[0],t[1].length),k=n.split(`
|
|
373
|
-
`,1)[0],S=!y.trim(),x=0;if(this.options.pedantic?(x=2,v=y.trimStart()):S?x=t[1].length+1:(x=y.search(this.rules.other.nonSpaceChar),x=x>4?1:x,v=y.slice(x),x+=t[1].length),S&&this.rules.other.blankLine.test(k)&&(m+=k+`
|
|
374
|
-
`,n=n.substring(k.length+1),f=!0),!f){let M=this.rules.other.nextBulletRegex(x),Z=this.rules.other.hrRegex(x),G=this.rules.other.fencesBeginRegex(x),F=this.rules.other.headingBeginRegex(x),W=this.rules.other.htmlBeginRegex(x),Q=this.rules.other.blockquoteBeginRegex(x);for(;n;){let ee=n.split(`
|
|
375
|
-
`,1)[0],oe;if(k=ee,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),oe=k):oe=k.replace(this.rules.other.tabCharGlobal," "),G.test(k)||F.test(k)||W.test(k)||Q.test(k)||M.test(k)||Z.test(k))break;if(oe.search(this.rules.other.nonSpaceChar)>=x||!k.trim())v+=`
|
|
376
|
-
`+oe.slice(x);else{if(S||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(y)||F.test(y)||Z.test(y))break;v+=`
|
|
377
|
-
`+k}S=!k.trim(),m+=ee+`
|
|
378
|
-
`,n=n.substring(ee.length+1),y=oe.slice(x)}}o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),o.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(v),loose:!1,text:v,tokens:[]}),o.raw+=m}let u=o.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f of o.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,""),((e=f.tokens[0])==null?void 0:e.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 v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(f.raw);if(m){let v={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};f.checked=v.checked,o.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=v.raw+f.tokens[0].raw,f.tokens[0].text=v.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(v)):f.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):f.tokens.unshift(v)}}if(!o.loose){let m=f.tokens.filter(y=>y.type==="space"),v=m.length>0&&m.some(y=>this.rules.other.anyLine.test(y.raw));o.loose=v}}if(o.loose)for(let f of o.items){f.loose=!0;for(let m of f.tokens)m.type==="text"&&(m.type="paragraph")}return o}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:i}}}table(n){var o;let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=Qg(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
379
|
-
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<e.length;l++)s.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(Qg(l,s.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[u]})));return s}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
380
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let s=zo(e.slice(0,-1),"\\");if((e.length-s.length)%2===0)return}else{let s=kz(t[2],"()");if(s===-2)return;if(s>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),e1(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return e1(e,i,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,o,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+i);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);let f=[...r[0]][0].length,m=n.slice(0,i+r.index+f+o);if(Math.min(i,o)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n,t,e=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,o,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*n.length+i);(r=c.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(o=[...s].length,o!==i))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let u=[...r[0]][0].length,f=n.slice(0,i+r.index+u+o),m=f.slice(i,-i);return{type:"del",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(n){var e;let t;if(t=this.rules.inline.url.exec(n)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let s;do s=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(s!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},It=class pf{constructor(t){$(this,"tokens");$(this,"options");$(this,"state");$(this,"inlineQueue");$(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ji,this.options.tokenizer=this.options.tokenizer||new Qc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Be,block:Xl.normal,inline:Oo.normal};this.options.pedantic?(e.block=Xl.pedantic,e.inline=Oo.pedantic):this.options.gfm&&(e.block=Xl.gfm,this.options.breaks?e.inline=Oo.breaks:e.inline=Oo.gfm),this.tokenizer.rules=e}static get rules(){return{block:Xl,inline:Oo}}static lex(t,e){return new pf(e).lex(t)}static lexInline(t,e){return new pf(e).inlineTokens(t)}lex(t){t=t.replace(Be.carriageReturn,`
|
|
381
|
-
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let r=this.inlineQueue[e];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){var i,s,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Be.tabCharGlobal," ").replace(Be.spaceLine,""));t;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(u=>(l=u.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let u=e.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
382
|
-
`:e.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
383
|
-
`)?"":`
|
|
384
|
-
`)+l.raw,u.text+=`
|
|
385
|
-
`+l.text,this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
386
|
-
`)?"":`
|
|
387
|
-
`)+l.raw,u.text+=`
|
|
388
|
-
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},e.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0,f=t.slice(1),m;this.options.extensions.startBlock.forEach(v=>{m=v.call({lexer:this},f),typeof m=="number"&&m>=0&&(u=Math.min(u,m))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let u=e.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
389
|
-
`)?"":`
|
|
390
|
-
`)+l.raw,u.text+=`
|
|
391
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
392
|
-
`)?"":`
|
|
393
|
-
`)+l.raw,u.text+=`
|
|
394
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){var c,u,f,m,v;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)y.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 s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let o=!1,l="";for(;t;){o||(l=""),o=!1;let y;if((m=(f=this.options.extensions)==null?void 0:f.inline)!=null&&m.some(S=>(y=S.call({lexer:this},t,e))?(t=t.substring(y.raw.length),e.push(y),!0):!1))continue;if(y=this.tokenizer.escape(t)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.tag(t)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.link(t)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(y.raw.length);let S=e.at(-1);y.type==="text"&&(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):e.push(y);continue}if(y=this.tokenizer.emStrong(t,r,l)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.codespan(t)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.br(t)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.del(t,r,l)){t=t.substring(y.raw.length),e.push(y);continue}if(y=this.tokenizer.autolink(t)){t=t.substring(y.raw.length),e.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(t))){t=t.substring(y.raw.length),e.push(y);continue}let k=t;if((v=this.options.extensions)!=null&&v.startInline){let S=1/0,x=t.slice(1),M;this.options.extensions.startInline.forEach(Z=>{M=Z.call({lexer:this},x),typeof M=="number"&&M>=0&&(S=Math.min(S,M))}),S<1/0&&S>=0&&(k=t.substring(0,S+1))}if(y=this.tokenizer.inlineText(k)){t=t.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(l=y.raw.slice(-1)),o=!0;let S=e.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=y.raw,S.text+=y.text):e.push(y);continue}if(t){let S="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return e}},eu=class{constructor(n){$(this,"options");$(this,"parser");this.options=n||ji}space(n){return""}code({text:n,lang:t,escaped:e}){var s;let r=(s=(t||"").match(Be.notSpaceStart))==null?void 0:s[0],i=n.replace(Be.endingNewline,"")+`
|
|
395
|
-
`;return r?'<pre><code class="language-'+Ht(r)+'">'+(e?i:Ht(i,!0))+`</code></pre>
|
|
396
|
-
`:"<pre><code>"+(e?i:Ht(i,!0))+`</code></pre>
|
|
397
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
398
|
-
${this.parser.parse(n)}</blockquote>
|
|
399
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:t}){return`<h${t}>${this.parser.parseInline(n)}</h${t}>
|
|
400
|
-
`}hr(n){return`<hr>
|
|
401
|
-
`}list(n){let t=n.ordered,e=n.start,r="";for(let o=0;o<n.items.length;o++){let l=n.items[o];r+=this.listitem(l)}let i=t?"ol":"ul",s=t&&e!==1?' start="'+e+'"':"";return"<"+i+s+`>
|
|
402
|
-
`+r+"</"+i+`>
|
|
403
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
404
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
405
|
-
`}table(n){let t="",e="";for(let i=0;i<n.header.length;i++)e+=this.tablecell(n.header[i]);t+=this.tablerow({text:e});let r="";for(let i=0;i<n.rows.length;i++){let s=n.rows[i];e="";for(let o=0;o<s.length;o++)e+=this.tablecell(s[o]);r+=this.tablerow({text:e})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
406
|
-
<thead>
|
|
407
|
-
`+t+`</thead>
|
|
408
|
-
`+r+`</table>
|
|
409
|
-
`}tablerow({text:n}){return`<tr>
|
|
410
|
-
${n}</tr>
|
|
411
|
-
`}tablecell(n){let t=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
|
|
412
|
-
`}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>${Ht(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let r=this.parser.parseInline(e),i=Xg(n);if(i===null)return r;n=i;let s='<a href="'+n+'"';return t&&(s+=' title="'+Ht(t)+'"'),s+=">"+r+"</a>",s}image({href:n,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let i=Xg(n);if(i===null)return Ht(e);n=i;let s=`<img src="${n}" alt="${Ht(e)}"`;return t&&(s+=` title="${Ht(t)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Ht(n.text)}},Tp=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}},xt=class mf{constructor(t){$(this,"options");$(this,"renderer");$(this,"textRenderer");this.options=t||ji,this.options.renderer=this.options.renderer||new eu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tp}static parse(t,e){return new mf(e).parse(t)}static parseInline(t,e){return new mf(e).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let e="";for(let s=0;s<t.length;s++){let o=t[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[o.type]){let c=o,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){e+=u||"";continue}}let l=o;switch(l.type){case"space":{e+=this.renderer.space(l);break}case"hr":{e+=this.renderer.hr(l);break}case"heading":{e+=this.renderer.heading(l);break}case"code":{e+=this.renderer.code(l);break}case"table":{e+=this.renderer.table(l);break}case"blockquote":{e+=this.renderer.blockquote(l);break}case"list":{e+=this.renderer.list(l);break}case"checkbox":{e+=this.renderer.checkbox(l);break}case"html":{e+=this.renderer.html(l);break}case"def":{e+=this.renderer.def(l);break}case"paragraph":{e+=this.renderer.paragraph(l);break}case"text":{e+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return e}parseInline(t,e=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let l=t[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=e.text(c);break}case"html":{r+=e.html(c);break}case"link":{r+=e.link(c);break}case"image":{r+=e.image(c);break}case"checkbox":{r+=e.checkbox(c);break}case"strong":{r+=e.strong(c);break}case"em":{r+=e.em(c);break}case"codespan":{r+=e.codespan(c);break}case"br":{r+=e.br(c);break}case"del":{r+=e.del(c);break}case"text":{r+=e.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},ic,Jo=(ic=class{constructor(n){$(this,"options");$(this,"block");this.options=n||ji}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?It.lex:It.lexInline}provideParser(){return this.block?xt.parse:xt.parseInline}},$(ic,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$(ic,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ic),Cz=class{constructor(...n){$(this,"defaults",bp());$(this,"options",this.setOptions);$(this,"parse",this.parseMarkdown(!0));$(this,"parseInline",this.parseMarkdown(!1));$(this,"Parser",xt);$(this,"Renderer",eu);$(this,"TextRenderer",Tp);$(this,"Lexer",It);$(this,"Tokenizer",Qc);$(this,"Hooks",Jo);this.use(...n)}walkTokens(n,t){var r,i;let e=[];for(let s of n)switch(e=e.concat(t.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)e=e.concat(this.walkTokens(l.tokens,t));for(let l of o.rows)for(let c of l)e=e.concat(this.walkTokens(c.tokens,t));break}case"list":{let o=s;e=e.concat(this.walkTokens(o.items,t));break}default:{let o=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let c=o[l].flat(1/0);e=e.concat(this.walkTokens(c,t))}):o.tokens&&(e=e.concat(this.walkTokens(o.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...o){let l=i.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),e.renderer){let i=this.defaults.renderer||new eu(this.defaults);for(let s in e.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=e.renderer[o],c=i[o];i[o]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f||""}}r.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new Qc(this.defaults);for(let s in e.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=e.tokenizer[o],c=i[o];i[o]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new Jo;for(let s in e.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=e.hooks[o],c=i[o];Jo.passThroughHooks.has(s)?i[o]=u=>{if(this.defaults.async&&Jo.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await l.call(i,u);return c.call(i,m)})();let f=l.call(i,u);return c.call(i,f)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(i,u);return m===!1&&(m=await c.apply(i,u)),m})();let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,t){return It.lex(n,t??this.defaults)}parser(n,t){return xt.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let r={...e},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer():n?It.lex:It.lexInline)(o,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?xt.parse:xt.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer():n?It.lex:It.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?xt.parse:xt.parseInline)(o,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(n,t){return e=>{if(e.message+=`
|
|
413
|
-
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+Ht(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},Hi=new Cz;function le(n,t){return Hi.parse(n,t)}le.options=le.setOptions=function(n){return Hi.setOptions(n),le.defaults=Hi.defaults,_2(le.defaults),le};le.getDefaults=bp;le.defaults=ji;le.use=function(...n){return Hi.use(...n),le.defaults=Hi.defaults,_2(le.defaults),le};le.walkTokens=function(n,t){return Hi.walkTokens(n,t)};le.parseInline=Hi.parseInline;le.Parser=xt;le.parser=xt.parse;le.Renderer=eu;le.TextRenderer=Tp;le.Lexer=It;le.lexer=It.lex;le.Tokenizer=Qc;le.Hooks=Jo;le.parse=le;le.options;le.setOptions;le.use;le.walkTokens;le.parseInline;xt.parse;It.lex;b2.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function x2(n){const t=le.parse(n,{async:!1});return b2.sanitize(t,{USE_PROFILES:{html:!0}})}var Ci,rl;class Tz extends At{constructor(){super(...arguments);g(this,Ci,null);g(this,rl,Rr())}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||a(this,Ci)!==null)return;const e=((r=a(this,rl).value)==null?void 0:r.querySelector("dialog"))??null;if(e===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,Ci,Vu(e,()=>{}))})}disconnected(){var e;(e=a(this,Ci))==null||e.withdraw(),d(this,Ci,null)}template(e){return V`
|
|
414
|
-
<div class="desktop-upgrade-gate" ${mn(a(this,rl))}>
|
|
415
|
-
${Hu(V`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${m2(x2(uw(e)))}</div>`,{overlay:!0})}
|
|
416
|
-
</div>
|
|
417
|
-
`}}Ci=new WeakMap,rl=new WeakMap;const Rz=kt(Tz),Iz=250,xz=1e3;var cn,un,Ti,br,Ri,Ws,Dt,P2,hu,du,D2,gf,L2;class Pz extends At{constructor(){super(...arguments);g(this,Dt);g(this,cn,Lz());g(this,un,null);g(this,Ti,!1);g(this,br,null);g(this,Ri,"");g(this,Ws,null);g(this,hu,e=>{d(this,Ri,e.currentTarget.value)});g(this,du,e=>{e.preventDefault();const r=a(this,Ri).trim();r.length===0||a(this,Ws)===null||a(this,Ws).authenticate(r)})}disconnected(){var e;h(this,Dt,gf).call(this),(e=a(this,un))==null||e.withdraw(),d(this,un,null),d(this,Ti,!1),_c(null,a(this,cn))}template(e,r){var i;return d(this,Ws,r),h(this,Dt,D2).call(this,e),e.kind==="needs-upgrade"?((i=a(this,un))==null||i.withdraw(),d(this,un,null),_c(Rz(e.instructions),a(this,cn)),a(this,cn)):(_c(Hu(h(this,Dt,P2).call(this,e),{overlay:!0}),a(this,cn)),h(this,Dt,L2).call(this),a(this,cn))}}cn=new WeakMap,un=new WeakMap,Ti=new WeakMap,br=new WeakMap,Ri=new WeakMap,Ws=new WeakMap,Dt=new WeakSet,P2=function(e){switch(e.kind){case"connecting":return V`
|
|
418
|
-
<div class="system-modal" role="status" aria-live="polite">
|
|
419
|
-
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
420
|
-
<h2>Connecting</h2>
|
|
421
|
-
</div>
|
|
422
|
-
`;case"disconnected":return V`
|
|
423
|
-
<div class="system-modal" role="status" aria-live="polite">
|
|
424
|
-
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
425
|
-
<h2>Disconnected</h2>
|
|
426
|
-
<p>${Oz(e.nextRetryAt)}</p>
|
|
427
|
-
</div>
|
|
428
|
-
`;case"unauthorized":{const r=!!e.invalid;return r&&d(this,Ri,""),V`
|
|
429
|
-
<form class="system-modal auth-form" @submit=${a(this,du)}>
|
|
430
|
-
<tv-icon name="locked" size="xl"></tv-icon>
|
|
431
|
-
<h2>Enter access token</h2>
|
|
432
|
-
<p>This server requires an access token to connect.</p>
|
|
433
|
-
<input
|
|
434
|
-
class=${r?"auth-token invalid":"auth-token"}
|
|
435
|
-
type="password"
|
|
436
|
-
name="token"
|
|
437
|
-
placeholder="paste token here"
|
|
438
|
-
aria-label="Access token"
|
|
439
|
-
.value=${a(this,Ri)}
|
|
440
|
-
@input=${a(this,hu)}
|
|
441
|
-
autofocus
|
|
442
|
-
required
|
|
443
|
-
/>
|
|
444
|
-
${r?V`<p class="auth-error" role="alert">
|
|
445
|
-
The previous token was rejected. Try again.
|
|
446
|
-
</p>`:null}
|
|
447
|
-
<button type="submit" variant="primary" class="auth-submit">
|
|
448
|
-
Connect
|
|
449
|
-
</button>
|
|
450
|
-
</form>
|
|
451
|
-
`}case"error":return V`
|
|
452
|
-
<div class="system-modal">
|
|
453
|
-
<h2>Can’t connect with server</h2>
|
|
454
|
-
<p class="server-url">${e.serverURL}</p>
|
|
455
|
-
<p>${e.message}</p>
|
|
456
|
-
</div>
|
|
457
|
-
`}},hu=new WeakMap,du=new WeakMap,D2=function(e){const r=e.kind==="disconnected"&&e.nextRetryAt!==null;r&&a(this,br)===null?d(this,br,setInterval(()=>this.render(),Iz)):r||h(this,Dt,gf).call(this)},gf=function(){a(this,br)!==null&&(clearInterval(a(this,br)),d(this,br,null))},L2=function(){a(this,un)!==null||a(this,Ti)||(d(this,Ti,!0),queueMicrotask(()=>{if(d(this,Ti,!1),!this.isConnected||!a(this,cn).isConnected||a(this,un)!==null)return;const e=a(this,cn).querySelector("dialog");e!==null&&d(this,un,Vu(e,()=>{}))}))};const Dz=kt(Pz);function Lz(){const n=document.createElement("section");return n.className="system-modal-host",n}function Oz(n){if(n===null)return"Reattempting now…";const t=n-Date.now();return t<=0?"Reattempting now…":`Reattempting in ${Math.ceil(t/xz)}s…`}const zz=1400,Ql=new WeakMap;function Nz(n,t){var s;const e=t.ownerDocument,r=(s=e.defaultView)==null?void 0:s.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=e.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",e.body.append(i),i.select();try{e.execCommand("copy")}catch{}i.remove()}const Mz={writeClipboard:Nz,scheduler:{setTimeout(n,t){return globalThis.setTimeout(n,t)},clearTimeout(n){globalThis.clearTimeout(n)}}};function Uz(n,t,e){const r=n.currentTarget;if(!r)return;t.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,s=i!=null&&i.classList.contains("copy-button-status")?i:null;s&&(s.textContent="",s.textContent="Copied");const o=Ql.get(r);o&&o.scheduler.clearTimeout(o.handle);const l={handle:void 0,scheduler:t.scheduler};l.handle=t.scheduler.setTimeout(()=>{Ql.get(r)===l&&(Ql.delete(r),r.toggleAttribute("copied",!1),s&&(s.textContent=""))},zz),Ql.set(r,l),e()}function O2({label:n,prompt:t="",variant:e,copied:r=!1,onActivate:i=()=>{}},s=Mz){return V`
|
|
458
|
-
<button
|
|
459
|
-
class="copy-button"
|
|
460
|
-
size="sm"
|
|
461
|
-
aria-label=${n}
|
|
462
|
-
variant=${e??ue}
|
|
463
|
-
?copied=${r}
|
|
464
|
-
prompt=${t}
|
|
465
|
-
@click=${o=>Uz(o,s,i)}
|
|
466
|
-
>
|
|
467
|
-
<span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
|
|
468
|
-
<span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
|
|
469
|
-
</button>
|
|
470
|
-
<span
|
|
471
|
-
class="copy-button-status"
|
|
472
|
-
role="status"
|
|
473
|
-
aria-live="polite"
|
|
474
|
-
>${r?"Copied":ue}</span
|
|
475
|
-
>
|
|
476
|
-
`}const t1="tv-update-dismissed",ec={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later"},n1="update-popover";function z2(n){try{return n.matches(":popover-open")}catch{return!1}}function Zz(n){const t=n.nextElementSibling;return t instanceof HTMLElement&&t.hasAttribute("popover")?t:null}function vf(n){typeof n.hidePopover=="function"&&z2(n)&&n.hidePopover()}function Fz(n,t){const e=n.target;if(!(e instanceof Element))return!1;const r=e.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&t.contains(r)}class Hz extends At{template({body:t,prompt:e,copied:r=!1,presented:i=!1,panelRef:s,bellRef:o,onPresent:l=()=>{},onDismiss:c=()=>{},onCopy:u=()=>{}}){const f=y=>{const k=y.currentTarget,S=Zz(k);if(S!==null){if(typeof S.showPopover=="function"){S.addEventListener("toggle",x=>{x.newState==="open"?l():c()},{once:!0});return}i?c():l()}},m=y=>{const S=y.currentTarget.closest("[popover]");S!==null&&vf(S),c()},v=y=>{const k=y.currentTarget;y.key!=="Escape"||!Fz(y,k)||(y.preventDefault(),y.stopPropagation(),vf(k),c())};return V`
|
|
477
|
-
<button
|
|
478
|
-
class="update-bell"
|
|
479
|
-
icon-only
|
|
480
|
-
popovertarget=${n1}
|
|
481
|
-
aria-label=${ec.update_available}
|
|
482
|
-
title=${ec.update_available}
|
|
483
|
-
${mn(o)}
|
|
484
|
-
@click=${f}
|
|
485
|
-
>
|
|
486
|
-
<tv-icon name="notification" size="sm"></tv-icon>
|
|
487
|
-
</button>
|
|
488
|
-
|
|
489
|
-
<div
|
|
490
|
-
id=${n1}
|
|
491
|
-
popover="manual"
|
|
492
|
-
placement="bottom-end"
|
|
493
|
-
role="status"
|
|
494
|
-
class="update-popover"
|
|
495
|
-
${mn(s)}
|
|
496
|
-
@keydown=${v}
|
|
497
|
-
>
|
|
498
|
-
${t}
|
|
499
|
-
<div class="update-actions">
|
|
500
|
-
<button size="sm" class="update-later" @click=${m}
|
|
501
|
-
>${ec.later}</button
|
|
502
|
-
>
|
|
503
|
-
${e===void 0?ue:O2({label:ec.copy_prompt,prompt:e,variant:"primary",copied:r,onActivate:u})}
|
|
504
|
-
</div>
|
|
505
|
-
</div>
|
|
506
|
-
`}}const Vz=kt(Hz);function Bz(n,t){return t===null?!0:uv(n,t)}const r1=new Set;var mt,hn,il,Gs,Vn,Ii,xi,Ys,Me,Bn,Pi,Ks,Js,Di,_r,q,yf,wf,bf,_f,Sf,sl,Li,Gr,N2,Af,kf,Ef,fu,pu,mu,gu,vu,Xo,M2;class qz{constructor(t=()=>{}){g(this,q);g(this,mt,null);g(this,hn,null);g(this,il,"");g(this,Gs);g(this,Vn,!1);g(this,Ii,!1);g(this,xi,!1);g(this,Ys,null);g(this,Me,!1);g(this,Bn,!1);g(this,Pi,null);g(this,Ks,null);g(this,Js,!1);g(this,Di,[]);g(this,_r);g(this,sl,()=>{a(this,_r).call(this)});g(this,Li,()=>{h(this,q,Ef).call(this),a(this,_r).call(this)});g(this,fu,()=>{var e,r;const t=((r=(e=h(this,q,Gr).call(this))==null?void 0:e.updateState)==null?void 0:r.toast)??null;t===null||a(this,Me)||(d(this,Me,!0),h(this,q,Af).call(this,t),a(this,_r).call(this))});g(this,pu,()=>{var e,r,i;if(!a(this,Me))return;const t=((r=(e=h(this,q,Gr).call(this))==null?void 0:e.updateState)==null?void 0:r.toast)??null;t!==null&&((i=h(this,q,yf).call(this))==null||i.setItem(t1,t.version)),d(this,Me,!1),d(this,Bn,!0),a(this,_r).call(this)});g(this,mu,()=>{var e,r;const t=((r=(e=h(this,q,Gr).call(this))==null?void 0:e.updateState)==null?void 0:r.toast)??null;(t==null?void 0:t.prompt)!==void 0&&h(this,q,kf).call(this,"update_prompt_copy_clicked",t)});g(this,gu,t=>{d(this,Pi,t instanceof HTMLElement?t:null),h(this,q,Xo).call(this)});g(this,vu,t=>{d(this,Ks,t instanceof HTMLElement?t:null),h(this,q,Xo).call(this)});d(this,_r,t)}get presented(){return a(this,Me)}configure({connectionOwner:t=null,primaryServerURL:e="",presentation:r=null,dismissalStorage:i}){t!==a(this,mt)&&(h(this,q,bf).call(this),d(this,mt,t),h(this,q,wf).call(this)),r!==a(this,hn)&&(h(this,q,Sf).call(this),d(this,hn,r),h(this,q,_f).call(this)),d(this,il,e),d(this,Gs,i)}connect(){a(this,Vn)||(d(this,Vn,!0),h(this,q,wf).call(this),h(this,q,_f).call(this))}disconnect(){a(this,Vn)&&(h(this,q,bf).call(this),h(this,q,Sf).call(this),d(this,Vn,!1),d(this,Pi,null),d(this,Ks,null))}template(){var o,l,c,u;const t=((l=(o=h(this,q,Gr).call(this))==null?void 0:o.updateState)==null?void 0:l.toast)??null,e=((c=a(this,hn))==null?void 0:c.toastsSuppressed)??!1;if(t===null?(d(this,Ys,null),d(this,Me,!1),d(this,Bn,!0)):t.version!==a(this,Ys)&&(d(this,Ys,t.version),d(this,Me,Bz(t.version,h(this,q,N2).call(this))),d(this,Bn,!0),a(this,Me)&&!e&&h(this,q,Af).call(this,t)),t===null||e)return d(this,Me,!1),d(this,Bn,!0),h(this,q,Xo).call(this),ue;const r=(u=a(this,Pi))==null?void 0:u.querySelector(".copy-button"),i=a(this,Me)&&!a(this,Bn)&&(r==null?void 0:r.hasAttribute("copied"))===!0,s=Vz({body:m2(x2(t.markdown)),prompt:t.prompt,copied:i,presented:a(this,Me),panelRef:a(this,gu),bellRef:a(this,vu),onPresent:a(this,fu),onDismiss:a(this,pu),onCopy:a(this,mu)});return d(this,Bn,!1),h(this,q,Xo).call(this),s}}mt=new WeakMap,hn=new WeakMap,il=new WeakMap,Gs=new WeakMap,Vn=new WeakMap,Ii=new WeakMap,xi=new WeakMap,Ys=new WeakMap,Me=new WeakMap,Bn=new WeakMap,Pi=new WeakMap,Ks=new WeakMap,Js=new WeakMap,Di=new WeakMap,_r=new WeakMap,q=new WeakSet,yf=function(){return a(this,Gs)!==void 0?a(this,Gs):typeof localStorage>"u"?null:localStorage},wf=function(){!a(this,Vn)||a(this,Ii)||a(this,mt)===null||(a(this,mt).addEventListener("server-status",a(this,Li)),a(this,mt).addEventListener("change",a(this,Li)),d(this,Ii,!0))},bf=function(){!a(this,Ii)||a(this,mt)===null||(a(this,mt).removeEventListener("server-status",a(this,Li)),a(this,mt).removeEventListener("change",a(this,Li)),d(this,Ii,!1))},_f=function(){!a(this,Vn)||a(this,xi)||a(this,hn)===null||(a(this,hn).addEventListener("change",a(this,sl)),d(this,xi,!0))},Sf=function(){!a(this,xi)||a(this,hn)===null||(a(this,hn).removeEventListener("change",a(this,sl)),d(this,xi,!1))},sl=new WeakMap,Li=new WeakMap,Gr=function(){var e;const t=((e=a(this,mt))==null?void 0:e.connection)??null;return(t==null?void 0:t.url)===a(this,il)?t:null},N2=function(){var e;const t=((e=h(this,q,yf).call(this))==null?void 0:e.getItem(t1))??null;return t!==null&&sp(t)?t:null},Af=function(t){r1.has(t.version)||(r1.add(t.version),h(this,q,kf).call(this,"update_toast_shown",t))},kf=function(t,e){var r;a(this,Di).push({event:t,properties:{server_version:((r=h(this,q,Gr).call(this))==null?void 0:r.serverVersion)??"",channel_version:e.version}}),h(this,q,Ef).call(this)},Ef=function(){if(a(this,Di).length===0)return;const t=h(this,q,Gr).call(this);if(!t||t.status!=="connected")return;const e=a(this,Di);d(this,Di,[]);for(const r of e)t.sendTelemetrySignal(r.event,r.properties)},fu=new WeakMap,pu=new WeakMap,mu=new WeakMap,gu=new WeakMap,vu=new WeakMap,Xo=function(){a(this,Js)||(d(this,Js,!0),queueMicrotask(()=>{d(this,Js,!1),h(this,q,M2).call(this)}))},M2=function(){const t=a(this,Pi);if(t!==null)if(a(this,Me)&&!z2(t)&&typeof t.showPopover=="function"){const e=a(this,Ks);if(e===null)return;t.showPopover({source:e})}else a(this,Me)||vf(t)};const jz=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,Wz=""+new URL("table-oeG9uAN1.png",import.meta.url).href,Gz=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,Yz=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,i1="Artifact skills",Kz="Artifact skills",Jz="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",Xz="Copy prompt";function tc({artifactSkill:n,name:t,description:e,prompt:r,thumbnail:i},s){return V`
|
|
507
|
-
<article class="skill-card">
|
|
508
|
-
<div class="skill-thumb"><img src=${i} alt="" /></div>
|
|
509
|
-
<div class="skill-name">${t}</div>
|
|
510
|
-
<p class="skill-desc">${e}</p>
|
|
511
|
-
${O2({label:Xz,prompt:r,onActivate:()=>s==null?void 0:s.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
|
|
512
|
-
</article>
|
|
513
|
-
`}class Qz extends At{template(t=null){return V`
|
|
514
|
-
<button
|
|
515
|
-
class="skill-trigger"
|
|
516
|
-
variant="ghost"
|
|
517
|
-
icon-only
|
|
518
|
-
popovertarget="skills-popover"
|
|
519
|
-
aria-label=${i1}
|
|
520
|
-
title=${i1}
|
|
521
|
-
>
|
|
522
|
-
<tv-icon name="skills" size="sm"></tv-icon>
|
|
523
|
-
</button>
|
|
524
|
-
|
|
525
|
-
<div
|
|
526
|
-
id="skills-popover"
|
|
527
|
-
popover
|
|
528
|
-
placement="bottom-end"
|
|
529
|
-
class="skill-popover"
|
|
530
|
-
>
|
|
531
|
-
<div class="skill-heading">${Kz}</div>
|
|
532
|
-
<p class="skill-intro">${Jz}</p>
|
|
533
|
-
<div class="skill-grid">
|
|
534
|
-
${tc({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:jz},t)}
|
|
535
|
-
${tc({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:Wz},t)}
|
|
536
|
-
${tc({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:Gz},t)}
|
|
537
|
-
${tc({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:Yz},t)}
|
|
538
|
-
</div>
|
|
539
|
-
</div>
|
|
540
|
-
`}}const eN=kt(Qz),is=.5;var st,Xs,Qs,Oi,Sr,qn,jn,Ar,kr,Er,dn,$r,eo,ol,De,Wn,Cr,yu,D,U2,Z2,al,ll,cl,wu,ul,ds,$f,F2,Cf,Tf,Rf,If,H2,V2,B2,q2,hl,j2,Qo,xf,W2,G2,Y2,ea,ta;class tN extends At{constructor(){super(...arguments);g(this,D);g(this,st,Rr());g(this,Xs);g(this,Qs);g(this,Oi,!1);g(this,Sr,0);g(this,qn,!1);g(this,jn,!1);g(this,Ar,!1);g(this,kr,0);g(this,Er,null);g(this,dn,!1);g(this,$r,null);g(this,eo,null);g(this,ol,!1);g(this,De,null);g(this,Wn,!1);g(this,Cr,!1);g(this,yu,()=>{h(this,D,ta).call(this)});g(this,al,e=>{var s;const r=a(this,De);if(r===null||r.pointerId!==e.pointerId||!r.dragging&&Math.hypot(e.clientX-r.originX,e.clientY-r.originY)<=zw)return;const i=a(this,st).value;if(i){if(r.currentX=e.clientX,r.currentY=e.clientY,r.dragging)this.render();else{h(this,D,ea).call(this);const o=r.tab.getBoundingClientRect();d(this,Wn,!0),r.dragging=!0,r.tabLeft=o.left,r.tabTop=o.top,r.tabWidth=o.width,r.tabHeight=o.height,i.setPointerCapture(e.pointerId),this.render(),(s=r.onReorderChange)==null||s.call(r,h(this,D,If).call(this,r))}h(this,D,Rf).call(this,r),h(this,D,$f).call(this,r)}});g(this,ll,e=>{const r=a(this,De);r===null||r.pointerId!==e.pointerId||h(this,D,ds).call(this,!0,!0)});g(this,cl,e=>{var r;((r=a(this,De))==null?void 0:r.pointerId)===e.pointerId&&h(this,D,ds).call(this,!1,!0)});g(this,wu,e=>{var r;((r=a(this,De))==null?void 0:r.pointerId)===e.pointerId&&h(this,D,ds).call(this,!1,!0)});g(this,ul,e=>{var r;e.key!=="Escape"||!((r=a(this,De))!=null&&r.dragging)||(e.preventDefault(),h(this,D,ds).call(this,!1,!0))});g(this,hl,()=>{d(this,dn,!0),h(this,D,Qo).call(this,!0)})}connected(){var e;d(this,Xs,void 0),d(this,Qs,void 0),d(this,dn,!1),h(this,D,j2).call(this),typeof document<"u"&&((e=document.fonts)==null||e.addEventListener("loadingdone",a(this,hl),{once:!0})),window.addEventListener("pointermove",a(this,al)),window.addEventListener("pointerup",a(this,ll)),window.addEventListener("pointercancel",a(this,cl)),window.addEventListener("keydown",a(this,ul))}template(e,r,i=null,s){var S,x;const o=(S=a(this,De))!=null&&S.dragging?a(this,De):null,l=(o==null?void 0:o.provisionalPages)??(r==null?void 0:r.pages),c=rN(r,l),u=(o==null?void 0:o.artifactId)??i,f=((x=r==null?void 0:r.selectedPage)==null?void 0:x.artifactIds[0])??null,m=`${(r==null?void 0:r.id)??""}:${c.map(({key:M,label:Z})=>`${M}:${Z}`).join("|")}`,v=f!==a(this,Xs),y=m!==a(this,Qs);v&&d(this,Cr,!1);const k=v||o===null&&y;return y&&d(this,dn,!0),d(this,Xs,f),d(this,Qs,m),h(this,D,Qo).call(this,k,v,v&&!y),V`
|
|
541
|
-
<div
|
|
542
|
-
class="tab-strip"
|
|
543
|
-
role="tablist"
|
|
544
|
-
${mn(a(this,st))}
|
|
545
|
-
?tab-held=${o!==null}
|
|
546
|
-
@scroll=${a(this,yu)}
|
|
547
|
-
@lostpointercapture=${a(this,wu)}
|
|
548
|
-
>
|
|
549
|
-
${Gc(c,({key:M})=>M,(M,Z)=>{const G=M.artifactId!==null&&M.artifactId===f,F=M.artifactId!==null&&M.artifactId===u,W=F&&o!==null;return V`
|
|
550
|
-
${F?V`
|
|
551
|
-
<span
|
|
552
|
-
class="tab-placeholder"
|
|
553
|
-
aria-hidden="true"
|
|
554
|
-
style=${Yc(W?{width:`${o.tabWidth}px`,height:`${o.tabHeight}px`}:{})}
|
|
555
|
-
></span>
|
|
556
|
-
`:null}
|
|
557
|
-
<button
|
|
558
|
-
class="tab"
|
|
559
|
-
?dragged=${F}
|
|
560
|
-
?dragging=${W}
|
|
561
|
-
style=${Yc(W?{left:`${o.tabLeft+o.currentX-o.originX}px`,top:`${o.tabTop+o.currentY-o.originY}px`,width:`${o.tabWidth}px`,height:`${o.tabHeight}px`}:{})}
|
|
562
|
-
role="tab"
|
|
563
|
-
aria-selected=${G?"true":"false"}
|
|
564
|
-
tabindex=${G?"0":"-1"}
|
|
565
|
-
data-artifact-id=${M.artifactId??""}
|
|
566
|
-
@pointerdown=${u===null?Q=>h(this,D,U2).call(this,Q,e,r,M,s):null}
|
|
567
|
-
@click=${Q=>h(this,D,Z2).call(this,Q,e,r,M)}
|
|
568
|
-
@dblclick=${G&&r!==null&&!W?()=>of(e,r,M.page,!M.page.geometry.full_screen):null}
|
|
569
|
-
@keydown=${Q=>h(this,D,B2).call(this,Q,e,r,c,Z)}
|
|
570
|
-
>
|
|
571
|
-
<span class="tab-label">${M.label}</span>
|
|
572
|
-
</button>
|
|
573
|
-
`})}
|
|
574
|
-
</div>
|
|
575
|
-
`}disconnected(){var e,r;d(this,Oi,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a(this,Sr)),d(this,Sr,0),d(this,qn,!1),d(this,jn,!1),d(this,Ar,!1),h(this,D,ea).call(this),d(this,Cr,!1),d(this,dn,!1),(e=a(this,$r))==null||e.disconnect(),d(this,$r,null),d(this,eo,null),typeof document<"u"&&((r=document.fonts)==null||r.removeEventListener("loadingdone",a(this,hl))),window.removeEventListener("pointermove",a(this,al)),window.removeEventListener("pointerup",a(this,ll)),window.removeEventListener("pointercancel",a(this,cl)),window.removeEventListener("keydown",a(this,ul)),h(this,D,ds).call(this,!1,!1),d(this,Wn,!1)}}st=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Oi=new WeakMap,Sr=new WeakMap,qn=new WeakMap,jn=new WeakMap,Ar=new WeakMap,kr=new WeakMap,Er=new WeakMap,dn=new WeakMap,$r=new WeakMap,eo=new WeakMap,ol=new WeakMap,De=new WeakMap,Wn=new WeakMap,Cr=new WeakMap,yu=new WeakMap,D=new WeakSet,U2=function(e,r,i,s,o){a(this,De)!==null||i===null||s.artifactId===null||e.button!==0||!e.isPrimary||(d(this,Wn,!1),d(this,De,{pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,tab:e.currentTarget,application:r,channelId:i.id,artifactId:s.artifactId,originalPages:i.pages,onReorderChange:o,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(s.page),currentX:e.clientX,currentY:e.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},Z2=function(e,r,i,s){var o;if(e.detail!==0&&a(this,Wn)){d(this,Wn,!1);return}d(this,Wn,!1),!((o=a(this,De))!=null&&o.dragging||i===null||s.artifactId===null)&&r.selectPage(i.id,s.artifactId)},al=new WeakMap,ll=new WeakMap,cl=new WeakMap,wu=new WeakMap,ul=new WeakMap,ds=function(e,r){var o;const i=a(this,De);if(i===null)return;if(h(this,D,Cf).call(this,i),i.edgeScrollMoved&&d(this,Cr,!0),i.dragging&&(d(this,qn,a(this,jn)),a(this,jn)||d(this,Ar,!1)),i.dragging&&e&&!iN(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!e)for(const l of i.displacementAnimations)l.cancel();d(this,De,null),(o=i.onReorderChange)==null||o.call(i,null);const s=a(this,st).value;i.dragging&&(s!=null&&s.hasPointerCapture(i.pointerId))&&s.releasePointerCapture(i.pointerId),r&&this.render()},$f=function(e){const r=a(this,st).value,i=r?h(this,D,Tf).call(this,r,e.currentX):0,s=r?Math.max(0,r.scrollWidth-r.clientWidth):0,o=i<0?((r==null?void 0:r.scrollLeft)??0)<=is:((r==null?void 0:r.scrollLeft)??0)>=s-is;if(!e.dragging||i===0||s===0||o||typeof requestAnimationFrame!="function"){h(this,D,Cf).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,D,F2).call(this,e,l)}))},F2=function(e,r){if(e.edgeScrollFrame=0,a(this,De)!==e||!e.dragging){e.edgeScrollTimestamp=null;return}const i=a(this,st).value;if(!i){e.edgeScrollTimestamp=null;return}const s=h(this,D,Tf).call(this,i,e.currentX),o=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&o!==null){const l=Math.max(0,r-o)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,f=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+f));i.scrollLeft=m;const v=i.scrollLeft-u;v!==0&&(e.edgeScrollMoved=!0),e.edgeScrollRemainder=m===0||m===c?0:f-v,v!==0&&(h(this,D,ta).call(this,i),h(this,D,Rf).call(this,e))}h(this,D,$f).call(this,e)},Cf=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},Tf=function(e,r){const i=e.getBoundingClientRect();return r>=i.left&&r<i.left+vt?-Kc*(i.left+vt-r)/vt:r>i.right-vt&&r<=i.right?Kc*(r-(i.right-vt))/vt:0},Rf=function(e){var k;const r=a(this,st).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const s=i.nextElementSibling,o=e.tab.getBoundingClientRect(),l=o.left+o.width/2;let c=e.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const S=u.getBoundingClientRect();if(l>=S.left+S.width/2)break;c-=1,u=u.previousElementSibling}let f=s==null?void 0:s.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const S=f.getBoundingClientRect();if(l<=S.left+S.width/2)break;c+=1,f=f.nextElementSibling}if(c===e.slot)return;const m=h(this,D,H2).call(this,r),v=[...e.provisionalPages],[y]=v.splice(e.slot,1);y&&(v.splice(c,0,y),e.provisionalPages=v,e.slot=c,this.render(),(k=e.onReorderChange)==null||k.call(e,h(this,D,If).call(this,e)),queueMicrotask(()=>h(this,D,V2).call(this,e,m)))},If=function(e){return{channelId:e.channelId,pages:e.provisionalPages,carriedArtifactId:e.artifactId}},H2=function(e){return new Map([...e.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},V2=function(e,r){const i=a(this,st).value;if(i)for(const s of i.querySelectorAll(".tab:not([dragging])")){const o=r.get(s.dataset.artifactId??"");if(o===void 0)continue;const l=o-s.getBoundingClientRect().left;if(Math.abs(l)<=is)continue;const c=s.animate({translate:[`${l}px 0`,"0px 0"]},{duration:gs,easing:"ease"});e.displacementAnimations.add(c),c.finished.finally(()=>{e.displacementAnimations.delete(c)}).catch(()=>{})}},B2=function(e,r,i,s,o){var u;if(e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault();const l=Math.max(0,Math.min(s.length-1,o+(e.key==="ArrowLeft"?-1:1)));if(l===o||i===null)return;const c=(u=s[l])==null?void 0:u.artifactId;c&&(r.selectPage(i.id,c),queueMicrotask(()=>h(this,D,q2).call(this,c)))},q2=function(e){const r=a(this,st).value;if(!r)return;const i=[...r.querySelectorAll(".tab")].find(s=>s.dataset.artifactId===e);i==null||i.focus({preventScroll:!0})},hl=new WeakMap,j2=function(){a(this,ol)||typeof document>"u"||!document.fonts||(d(this,ol,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,dn,!0),h(this,D,Qo).call(this,!0))}))},Qo=function(e,r=!1,i=!1){a(this,qn)||d(this,qn,e),e&&r&&(d(this,jn,!0),d(this,Ar,i)),!(a(this,Oi)||a(this,Sr)!==0)&&(d(this,Oi,!0),queueMicrotask(()=>{if(d(this,Oi,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,D,xf).call(this);return}d(this,Sr,requestAnimationFrame(()=>{d(this,Sr,0),h(this,D,xf).call(this)}))}}))},xf=function(){var l;const e=a(this,st).value;if(!e)return;a(this,dn)&&(d(this,dn,!1),h(this,D,W2).call(this,e)),h(this,D,G2).call(this,e);const r=((l=a(this,De))==null?void 0:l.dragging)===!0,i=a(this,jn),s=i&&a(this,Ar),o=!r&&(i||a(this,qn)&&!a(this,Cr));r?d(this,qn,i):(d(this,qn,!1),d(this,jn,!1),d(this,Ar,!1),i&&d(this,Cr,!1)),o&&h(this,D,Y2).call(this,e,s),h(this,D,ta).call(this,e)},W2=function(e){var r;for(const i of e.querySelectorAll(".tab")){const s=i.querySelector(".tab-label");if(!s)continue;const o=document.createRange();o.selectNodeContents(s);const l=(r=o.getBoundingClientRect)==null?void 0:r.call(o);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=nc(c.paddingLeft)+nc(c.paddingRight)+nc(c.borderLeftWidth)+nc(c.borderRightWidth),m=Math.ceil(l.width)+u>cO+uO?"capped":"hugging";i.dataset.compression!==m&&(i.dataset.compression=m)}},G2=function(e){var r;typeof ResizeObserver>"u"||a(this,eo)===e||((r=a(this,$r))==null||r.disconnect(),a(this,$r)??d(this,$r,new ResizeObserver(()=>h(this,D,Qo).call(this,!0))),a(this,$r).observe(e),d(this,eo,e))},Y2=function(e,r){const i=e.querySelector('.tab[aria-selected="true"]');if(!i){h(this,D,ea).call(this);return}const s=e.getBoundingClientRect(),o=i.getBoundingClientRect(),l=Math.max(0,Math.min(e.scrollLeft+o.left+o.width/2-(s.left+s.width/2),e.scrollWidth-e.clientWidth));if(h(this,D,ea).call(this),!r||Math.abs(e.scrollLeft-l)<=is||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=l;return}const c=e.scrollLeft,u=e.animate([{},{}],{duration:a2,easing:"ease"});d(this,Er,u);const f=()=>{var v;if(u!==a(this,Er))return;const m=u.playState==="finished"?1:((v=u.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=c+(l-c)*m,u.playState==="finished"?(e.scrollLeft=l,d(this,Er,null),d(this,kr,0),h(this,D,ta).call(this,e)):d(this,kr,requestAnimationFrame(f))};d(this,kr,requestAnimationFrame(f))},ea=function(){var e;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(a(this,kr)),d(this,kr,0),(e=a(this,Er))==null||e.cancel(),d(this,Er,null)},ta=function(e=a(this,st).value){if(!e)return;const r=Math.max(0,e.scrollWidth-e.clientWidth);e.toggleAttribute("continues-start",e.scrollLeft>is),e.toggleAttribute("continues-end",e.scrollLeft<r-is)};const nN=kt(tN);function rN(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{var o;const s=r.artifactIds[0]??null;return{page:r,artifactId:s,label:s===null?"":((o=e.get(s))==null?void 0:o.title)??"",key:s??`empty-page-${i}`}})}function iN(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function nc(n){const t=Number.parseFloat(n);return Number.isFinite(t)?t:0}var zi;class sN extends At{constructor(){super(...arguments);g(this,zi,new qz(()=>this.render()))}connected(){a(this,zi).connect()}template(e,r,i={}){var s;return a(this,zi).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),V`
|
|
576
|
-
<header class="top-bar" ?electron-draggable=${i.electronMode??!1}>
|
|
577
|
-
${nN(e,r,null,i.onTabReorderChange)}
|
|
578
|
-
<div class="top-bar-controls">
|
|
579
|
-
${eN((s=i.connectionOwner)==null?void 0:s.connection)}
|
|
580
|
-
${a(this,zi).template()}
|
|
581
|
-
</div>
|
|
582
|
-
</header>
|
|
583
|
-
`}disconnected(){a(this,zi).disconnect()}}zi=new WeakMap;const oN=kt(sN);var fn,dl,fl,bu,Ni,_u,K2;class aN extends At{constructor(){super(...arguments);g(this,_u);g(this,fn,null);g(this,dl);g(this,fl,e=>{var r;Tb(e,navigator.platform)&&(e.preventDefault(),e.stopPropagation(),(r=a(this,fn))==null||r.handleNavigationKey(e.key))});g(this,bu,e=>{d(this,dl,e??void 0),this.render()});g(this,Ni,()=>{this.render()})}update(e,r){const i=r[0];return a(this,fn)!==i&&(a(this,fn)!==null&&this.isConnected&&(a(this,fn).removeEventListener("change",a(this,Ni)),i.addEventListener("change",a(this,Ni))),d(this,fn,i)),super.update(e,r)}connected(){var e;(e=a(this,fn))==null||e.addEventListener("change",a(this,Ni)),document.addEventListener("keydown",a(this,fl),{capture:!0})}disconnected(){var e;(e=a(this,fn))==null||e.removeEventListener("change",a(this,Ni)),document.removeEventListener("keydown",a(this,fl),{capture:!0})}template(e,r){const i=G5(e.snapshot,r.runtimeServerURL),s=e.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var o;this.isConnected&&((o=r.onRenderComplete)==null||o.call(r,i.kind))}),V`
|
|
584
|
-
<div id="app" data-app-state=${i.kind}>
|
|
585
|
-
${cN(i)?h(this,_u,K2).call(this,e,s,r):null}
|
|
586
|
-
${uN(i)?Dz(i,e):null}
|
|
587
|
-
</div>
|
|
588
|
-
`}}fn=new WeakMap,dl=new WeakMap,fl=new WeakMap,bu=new WeakMap,Ni=new WeakMap,_u=new WeakSet,K2=function(e,r,i){return V`
|
|
589
|
-
<aside class="app-sidebar">
|
|
590
|
-
${ZL(e,r,i.electronMode)}
|
|
591
|
-
</aside>
|
|
592
|
-
<main class="app-main">
|
|
593
|
-
${oN(e,r.focusedChannel,{electronMode:i.electronMode,connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,onTabReorderChange:a(this,bu)})}
|
|
594
|
-
${yO(e,r.focusedChannel,a(this,dl))}
|
|
595
|
-
</main>
|
|
596
|
-
`};const lN=kt(aN);function cN(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function uN(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const J2=new CSSStyleSheet;try{"adoptedStyleSheets"in document&&(document.adoptedStyleSheets=[...document.adoptedStyleSheets,J2])}catch{}function X2(n){J2.replaceSync(n)}function ma(){X2("")}let tr=null;async function hN(n,t){if(tr==null||tr.abort(),n===null){tr=null,ma();return}const e=new AbortController;tr=e;try{const r=t.token?{Authorization:`Bearer ${t.token}`}:void 0,i=new URL(`/themes/${n}/theme.css`,t.url).toString(),s=await fetch(i,{signal:e.signal,...r?{headers:r}:{}});if(!s.ok)throw new Error(`Theme fetch failed: ${s.status}`);const o=await s.text();if(tr!==e)return;X2(o)}catch(r){if(r.name==="AbortError")return;ma();const i=r instanceof Error?r.message:String(r);console.warn(`applyTheme: ${i}`)}finally{tr===e&&(tr=null)}}document.documentElement.dataset.tvBundleVersion=gp();Object.defineProperty(window,"__tvVersion",{value:gp(),writable:!1,configurable:!1});const Or=Gn(),Rp=KR(),Q2=JR(),dN=new XE(Or?"television-electron":"television-browser",JE()),s1=sw(),fN=s1?i3({storage:s1,clientApp:Or?"desktop":"browser",desktopAppVersion:Or?ay():null}):null,Ip=xr(Or?Rp:window.location.origin),eb=S5({search:window.location.search}),xp=vp(),tb=new C5,Pp=$5({detection:eb,primaryServerURL:Ip,navigationLatch:xp,presentation:tb}),qe=new a5({localStore:dN,serverURL:Rp,launchToken:Q2,telemetryMeta:fN,navigationPending:()=>xp.pending,...eb.electron?{decideBoot:n=>Pp.decideBoot(n)}:{}}),pN=n=>{ZE(vn,n)},vn=new IE({connectionOwner:qe,navigationKeyHandler:pN,retainedGateHalted:()=>Pp.gated}),o1=globalThis.__televisionNativeBridge;Or&&o1&&o1.onNavigationKey(n=>vn.handleNavigationKey(n));if(Q2){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`)}_5({owner:qe,primaryServerURL:Ip,navigationLatch:xp});Pp.attach(qe);const mN=()=>{const n=qe.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:t})=>{const e=new Set(t.map(r=>r.id));g5(e)}).catch(()=>{})},nb=()=>{if(qe.connection.status!=="connected"){ma();return}mN()};let rc;const rb=n=>{hN(n,qe.connection).catch(()=>{vn.snapshot.connection.status==="connected"&&ma()})},ib=()=>{const n=vn.snapshot;if(n.connection.status!=="connected"){rc=void 0,ma();return}!n.ready||n.display.activeThemeName===rc||(rc=n.display.activeThemeName,rb(rc))},gN=n=>{const t=vn.snapshot;t.connection.status!=="connected"||!t.ready||n.themeName!==t.display.activeThemeName||rb(n.themeName)};nb();ib();qe.addEventListener("change",nb);vn.addEventListener("change",ib);vn.addEventListener("theme-changed",gN);sv.register("ServerConnectionOwner",()=>qe);sv.register("ApplicationService",()=>vn);const aa=globalThis.__telepath??(globalThis.__telepath={});aa.applicationService=vn;aa.connectionOwner=qe;const vN=aa.renderCompleteCallbacks??(aa.renderCompleteCallbacks=new Set);Or&&document.body.classList.add("electron");let a1=!1;const sb=()=>{a1||(_c(lN(vn,{runtimeServerURL:Rp,electronMode:Or,connectionOwner:qe,primaryServerURL:Ip,updatePresentation:tb,onRenderComplete(n){for(const t of vN)t(n)}}),document.body),a1=!0)},ob=()=>{const n=qe.connection;n.bootState==="pending"&&!n.hasAuthRejected&&qe.connectError===null||(qe.removeEventListener("change",ob),sb())};Or?qe.addEventListener("change",ob):sb();qe.connect();
|