@agentsky/desktop-ui 0.4.142 → 0.4.143
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/app.js +23 -23
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -682,8 +682,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
682
682
|
${e}</tr>
|
|
683
683
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
684
684
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${js(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:s,autolink:a}){let r=a?js(n,!0):this.parser.parseInline(s),o=jv(e);if(o===null)return r;e=js(o,a);let l='<a href="'+e+'"';return t&&(l+=' title="'+js(t)+'"'),l+=">"+r+"</a>",l}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let a=jv(e);if(a===null)return js(n);e=a;let r=`<img src="${js(e)}" alt="${js(n)}"`;return t&&(r+=` title="${js(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:js(e.text)}},df=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Ca=class nf{options;renderer;textRenderer;constructor(t){this.options=t||Do,this.options.renderer=this.options.renderer||new hd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new df}static parse(t,n){return new nf(n).parse(t)}static parseInline(t,n){return new nf(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let o=a,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let r=a;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let s="";for(let a=0;a<t.length;a++){let r=t[a];if(this.options.extensions?.renderers?.[r.type]){let l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=l||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},Ll=class{options;block;constructor(e){this.options=e||Do}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Sa.lex:Sa.lexInline}provideParser(e=this.block){return e?Ca.parse:Ca.parseInline}},nT=class{defaults=sf();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ca;Renderer=hd;TextRenderer=df;Lexer=Sa;Tokenizer=pd;Hooks=Ll;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let r of a.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of a.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,t));break}case"list":{let a=s;n=n.concat(this.walkTokens(a.items,t));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(r=>{let o=a[r].flat(1/0);n=n.concat(this.walkTokens(o,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let r=t.renderers[a.name];r?t.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=r.apply(this,o)),l}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[a.level];r?r.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),s.extensions=t),n.renderer){let a=this.defaults.renderer||new hd(this.defaults);for(let r in n.renderer){if(!(r in a))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,l=n.renderer[o],c=a[o];a[o]=(...u)=>{let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d||""}}s.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new pd(this.defaults);for(let r in n.tokenizer){if(!(r in a))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,l=n.tokenizer[o],c=a[o];a[o]=(...u)=>{let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}s.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Ll;for(let r in n.hooks){if(!(r in a))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,l=n.hooks[o],c=a[o];Ll.passThroughHooks.has(r)?a[o]=u=>{if(this.defaults.async&&Ll.passThroughHooksRespectAsync.has(r))return(async()=>{let p=await l.call(a,u);return c.call(a,p)})();let d=l.call(a,u);return c.call(a,d)}:a[o]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(a,u);return p===!1&&(p=await c.apply(a,u)),p})();let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}s.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let l=[];return l.push(r.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Sa.lex(e,t??this.defaults)}parser(e,t){return Ca.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},a={...this.defaults,...s},r=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return r(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 r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let o=a.hooks?await a.hooks.preprocess(t):t,l=await(a.hooks?await a.hooks.provideLexer(e):e?Sa.lex:Sa.lexInline)(o,a),c=a.hooks?await a.hooks.processAllTokens(l):l;a.walkTokens&&await Promise.all(this.walkTokens(c,a.walkTokens));let u=await(a.hooks?await a.hooks.provideParser(e):e?Ca.parse:Ca.parseInline)(c,a);return a.hooks?await a.hooks.postprocess(u):u})().catch(r);try{a.hooks&&(t=a.hooks.preprocess(t));let o=(a.hooks?a.hooks.provideLexer(e):e?Sa.lex:Sa.lexInline)(t,a);a.hooks&&(o=a.hooks.processAllTokens(o)),a.walkTokens&&this.walkTokens(o,a.walkTokens);let l=(a.hooks?a.hooks.provideParser(e):e?Ca.parse:Ca.parseInline)(o,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(o){return r(o)}}}onError(e,t){return n=>{if(n.message+=`
|
|
685
|
-
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+js(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Oo=new nT;function
|
|
686
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lT(e,t){return rT(e)||oT(e,t)||cT(e,t)||iT()}function cT(e,t){if(e){if(typeof e=="string")return l2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l2(e,t):void 0}}function fd(e){var t,n;function s(r,o){try{var l=e[r](o),c=l.value,u=c instanceof aT;Promise.resolve(u?c.v:c).then(function(d){if(u){var p=r==="return"&&c.k?r:"next";if(!c.k||d.done)return s(p,d);d=e[p](d).value}a(!!l.done,d)},function(d){s("throw",d)})}catch(d){a(2,d)}}function a(r,o){r===2?t.reject(o):t.resolve({value:o,done:r}),(t=t.next)?s(t.key,t.arg):n=null}this._invoke=function(r,o){return new Promise(function(l,c){var u={key:r,arg:o,resolve:l,reject:c,next:null};n?n=n.next=u:(t=n=u,s(r,o))})},typeof e.return!="function"&&(this.return=void 0)}fd.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fd.prototype.next=function(e){return this._invoke("next",e)},fd.prototype.throw=function(e){return this._invoke("throw",e)},fd.prototype.return=function(e){return this._invoke("return",e)};var x2=Object.entries,c2=Object.setPrototypeOf,uT=Object.isFrozen,dT=Object.getPrototypeOf,pT=Object.getOwnPropertyDescriptor,zn=Object.freeze,jn=Object.seal,wi=Object.create,S2=typeof Reflect<"u"&&Reflect,bf=S2.apply,yf=S2.construct;zn||(zn=function(t){return t});jn||(jn=function(t){return t});bf||(bf=function(t,n){for(var s=arguments.length,a=new Array(s>2?s-2:0),r=2;r<s;r++)a[r-2]=arguments[r];return t.apply(n,a)});yf||(yf=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return new t(...s)});var No=Rn(Array.prototype.forEach);Array.prototype.indexOf;var hT=Rn(Array.prototype.lastIndexOf),u2=Rn(Array.prototype.pop),Pl=Rn(Array.prototype.push);Array.prototype.slice;var fT=Rn(Array.prototype.splice),ki=Array.isArray,Fl=Rn(String.prototype.toLowerCase),pf=Rn(String.prototype.toString),d2=Rn(String.prototype.match),Bl=Rn(String.prototype.replace),p2=Rn(String.prototype.indexOf),mT=Rn(String.prototype.trim),gT=Rn(Number.prototype.toString),$T=Rn(Boolean.prototype.toString),h2=typeof BigInt>"u"?null:Rn(BigInt.prototype.toString),f2=typeof Symbol>"u"?null:Rn(Symbol.prototype.toString),Es=Rn(Object.prototype.hasOwnProperty),zl=Rn(Object.prototype.toString),ds=Rn(RegExp.prototype.test),jr=bT(TypeError);function Rn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return bf(e,t,s)}}function bT(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return yf(e,n)}}function Ot(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fl;if(c2&&c2(e,null),!ki(t))return e;let s=t.length;for(;s--;){let a=t[s];if(typeof a=="string"){let r=n(a);r!==a&&(uT(t)||(t[s]=r),a=r)}e[a]=!0}return e}function yT(e){for(let t=0;t<e.length;t++)Es(e,t)||(e[t]=null);return e}function Ks(e){let t=wi(null);for(let s of x2(e)){var n=lT(s,2);let a=n[0],r=n[1];Es(e,a)&&(ki(r)?t[a]=yT(r):r&&typeof r=="object"&&r.constructor===Object?t[a]=Ks(r):t[a]=r)}return t}function vT(e){switch(typeof e){case"string":return e;case"number":return gT(e);case"boolean":return $T(e);case"bigint":return h2?h2(e):"0";case"symbol":return f2?f2(e):"Symbol()";case"undefined":return zl(e);case"function":case"object":{if(e===null)return zl(e);let t=e,n=fa(t,"toString");if(typeof n=="function"){let s=n(t);return typeof s=="string"?s:zl(s)}return zl(e)}default:return zl(e)}}function fa(e,t){for(;e!==null;){let s=pT(e,t);if(s){if(s.get)return Rn(s.get);if(typeof s.value=="function")return Rn(s.value)}e=dT(e)}function n(){return null}return n}function wT(e){try{return ds(e,""),!0}catch{return!1}}var m2=zn(["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"]),hf=zn(["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"]),ff=zn(["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"]),kT=zn(["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"]),mf=zn(["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"]),xT=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),g2=zn(["#text"]),$2=zn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),gf=zn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),b2=zn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),md=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ST=jn(/{{[\w\W]*|^[\w\W]*}}/g),CT=jn(/<%[\w\W]*|^[\w\W]*%>/g),AT=jn(/\${[\w\W]*/g),TT=jn(/^data-[\-\w.\u00B7-\uFFFF]+$/),MT=jn(/^aria-[\-\w]+$/),y2=jn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IT=jn(/^(?:\w+script|data):/i),ET=jn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_T=jn(/^html$/i),RT=jn(/^[a-z][.\w]*(-[.\w]+)+$/i),v2=jn(/<[/\w!]/g),w2=jn(/<[/\w]/g),LT=jn(/<\/no(script|embed|frames)/i),OT=jn(/\/>/i),Vs={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},C2=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],DT=zn(Ot({},C2)),NT=(function(){let e={};return No(C2,t=>{e[t]=jn(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),zn(e)})(),PT=function(){return typeof window>"u"?null:window},BT=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null,a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(s=n.getAttribute(a));let r="dompurify"+(s?"#"+s:"");try{return t.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},k2=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Vr=function(t,n,s,a){return Es(t,n)&&ki(t[n])?Ot(a.base?Ks(a.base):{},t[n],a.transform):s},$f=function(t,n,s){let a=Es(t,n)?t[n]:void 0;return a&&typeof a=="object"?Ks(a):s()};function A2(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PT(),t=xe=>A2(xe);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==Vs.document||!e.Element)return t.isSupported=!1,t;let n=e.document,s=n,a=s.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,o=e.Node,l=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,p=l.prototype,h=fa(p,"cloneNode"),f=fa(p,"remove"),m=fa(p,"removeAttributeNode"),b=fa(p,"nextSibling"),$=fa(p,"childNodes"),y=fa(p,"parentNode"),w=fa(p,"shadowRoot"),v=fa(p,"attributes"),k=o&&o.prototype?fa(o.prototype,"nodeType"):null,I=o&&o.prototype?fa(o.prototype,"nodeName"):null,C=o&&o.prototype?fa(o.prototype,"ownerDocument"):null,S=function(G){return k?k(G):G.nodeType},E=function(G){return I?I(G):G.nodeName};if(typeof r=="function"){let xe=n.createElement("template");xe.content&&xe.content.ownerDocument&&(n=xe.content.ownerDocument)}let A,_="",R,W=!1,O=0,L=function(){if(O>0)throw jr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Q=function(G){L(),O++;try{return A.createHTML(G)}finally{O--}},V=function(G){L(),O++;try{return A.createScriptURL(G)}finally{O--}},ee=function(){return W||(R=BT(d,a),W=!0),R},K=n,z=K.implementation,F=K.createNodeIterator,H=K.createDocumentFragment,ae=K.getElementsByTagName,j=s.importNode,U=k2();t.isSupported=typeof x2=="function"&&typeof y=="function"&&z&&z.createHTMLDocument!==void 0;let ie=ST,ce=CT,me=AT,qe=TT,re=MT,$e=IT,Me=ET,fe=RT,Ce=y2,pe=null,dt=Ot({},[...m2,...hf,...ff,...mf,...g2]),je=null,_e=Ot({},[...$2,...gf,...b2,...md]),Pe=Object.seal(wi(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}})),Ne=null,He=null,At=Object.seal(wi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),qt=!0,kt=!0,Rt=!1,ke=!0,Ge=!1,lt=!0,Ut=!1,mn=!1,wn=null,Yt=null,nn=!1,kn=!1,Hn=!1,gn=!1,Be=!0,Tt=!1,en="user-content-",$n=!0,ss=!1,bn={},Vt=null,In=Ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),ze=null,Le=Ot({},["audio","video","img","source","image","track"]),tt=null,Nt=Ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",sn="http://www.w3.org/2000/svg",ue="http://www.w3.org/1999/xhtml",mt=ue,gt=!1,ht=null,tr=Ot({},[Pt,sn,ue],pf),xr=zn(["mi","mo","mn","ms","mtext"]),It=Ot({},xr),ho=zn(["annotation-xml"]),fo=Ot({},ho),ei=Ot({},["title","style","font","a","script"]),as=null,zs=["application/xhtml+xml","text/html"],Re="text/html",rt=null,Kn=null,Sr=n.createElement("form"),Ea=function(G){return G instanceof RegExp||G instanceof Function},aa=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kn&&Kn===G)return;(!G||typeof G!="object")&&(G={}),G=Ks(G),as=zs.indexOf(G.PARSER_MEDIA_TYPE)===-1?Re:G.PARSER_MEDIA_TYPE,rt=as==="application/xhtml+xml"?pf:Fl,pe=Vr(G,"ALLOWED_TAGS",dt,{transform:rt}),je=Vr(G,"ALLOWED_ATTR",_e,{transform:rt}),ht=Vr(G,"ALLOWED_NAMESPACES",tr,{transform:pf}),tt=Vr(G,"ADD_URI_SAFE_ATTR",Nt,{transform:rt,base:Nt}),ze=Vr(G,"ADD_DATA_URI_TAGS",Le,{transform:rt,base:Le}),Vt=Vr(G,"FORBID_CONTENTS",In,{transform:rt}),Ne=Vr(G,"FORBID_TAGS",Ks({}),{transform:rt}),He=Vr(G,"FORBID_ATTR",Ks({}),{transform:rt}),bn=Es(G,"USE_PROFILES")?G.USE_PROFILES&&typeof G.USE_PROFILES=="object"?Ks(G.USE_PROFILES):G.USE_PROFILES:!1,qt=G.ALLOW_ARIA_ATTR!==!1,kt=G.ALLOW_DATA_ATTR!==!1,Rt=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=G.SAFE_FOR_TEMPLATES||!1,lt=G.SAFE_FOR_XML!==!1,Ut=G.WHOLE_DOCUMENT||!1,kn=G.RETURN_DOM||!1,Hn=G.RETURN_DOM_FRAGMENT||!1,gn=G.RETURN_TRUSTED_TYPE||!1,nn=G.FORCE_BODY||!1,Be=G.SANITIZE_DOM!==!1,Tt=G.SANITIZE_NAMED_PROPS||!1,$n=G.KEEP_CONTENT!==!1,ss=G.IN_PLACE||!1,Ce=wT(G.ALLOWED_URI_REGEXP)?G.ALLOWED_URI_REGEXP:y2,mt=typeof G.NAMESPACE=="string"?G.NAMESPACE:ue,It=$f(G,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ot({},xr)),fo=$f(G,"HTML_INTEGRATION_POINTS",()=>Ot({},ho));let oe=$f(G,"CUSTOM_ELEMENT_HANDLING",()=>wi(null));if(Pe=wi(null),Es(oe,"tagNameCheck")&&Ea(oe.tagNameCheck)&&(Pe.tagNameCheck=oe.tagNameCheck),Es(oe,"attributeNameCheck")&&Ea(oe.attributeNameCheck)&&(Pe.attributeNameCheck=oe.attributeNameCheck),Es(oe,"allowCustomizedBuiltInElements")&&typeof oe.allowCustomizedBuiltInElements=="boolean"&&(Pe.allowCustomizedBuiltInElements=oe.allowCustomizedBuiltInElements),jn(Pe),Ge&&(kt=!1),Hn&&(kn=!0),bn&&(pe=Ot({},g2),je=wi(null),bn.html===!0&&(Ot(pe,m2),Ot(je,$2)),bn.svg===!0&&(Ot(pe,hf),Ot(je,gf),Ot(je,md)),bn.svgFilters===!0&&(Ot(pe,ff),Ot(je,gf),Ot(je,md)),bn.mathMl===!0&&(Ot(pe,mf),Ot(je,b2),Ot(je,md))),At.tagCheck=null,At.attributeCheck=null,Es(G,"ADD_TAGS")&&(typeof G.ADD_TAGS=="function"?At.tagCheck=G.ADD_TAGS:ki(G.ADD_TAGS)&&(pe===dt&&(pe=Ks(pe)),Ot(pe,G.ADD_TAGS,rt))),Es(G,"ADD_ATTR")&&(typeof G.ADD_ATTR=="function"?At.attributeCheck=G.ADD_ATTR:ki(G.ADD_ATTR)&&(je===_e&&(je=Ks(je)),Ot(je,G.ADD_ATTR,rt))),Es(G,"ADD_FORBID_CONTENTS")&&ki(G.ADD_FORBID_CONTENTS)&&(Vt===In&&(Vt=Ks(Vt)),Ot(Vt,G.ADD_FORBID_CONTENTS,rt)),$n&&(pe["#text"]=!0),Ut&&Ot(pe,["html","head","body"]),pe.table&&(Ot(pe,["tbody"]),delete Ne.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let be=A;A=G.TRUSTED_TYPES_POLICY;try{_=Q("")}catch(Ie){throw A=be,Ie}}else G.TRUSTED_TYPES_POLICY===null?(A=void 0,_=""):(A===void 0&&(A=ee()),A&&typeof _=="string"&&(_=Q("")));zn&&zn(G),Kn=G},gs=Ot({},[...hf,...ff,...kT]),Xe=Ot({},[...mf,...xT]),ra=function(G,oe,be){return oe.namespaceURI===ue?G==="svg":oe.namespaceURI===Pt?G==="svg"&&(be==="annotation-xml"||It[be]):!!gs[G]},Nn=function(G,oe,be){return oe.namespaceURI===ue?G==="math":oe.namespaceURI===sn?G==="math"&&fo[be]:!!Xe[G]},ti=function(G,oe,be){return oe.namespaceURI===sn&&!fo[be]||oe.namespaceURI===Pt&&!It[be]?!1:!Xe[G]&&(ei[G]||!gs[G])},nu=function(G){let oe=y(G);(!oe||!oe.tagName)&&(oe={namespaceURI:mt,tagName:"template"});let be=Fl(G.tagName),Ie=Fl(oe.tagName);return ht[G.namespaceURI]?G.namespaceURI===sn?ra(be,oe,Ie):G.namespaceURI===Pt?Nn(be,oe,Ie):G.namespaceURI===ue?ti(be,oe,Ie):!!(as==="application/xhtml+xml"&&ht[G.namespaceURI]):!1},ya=function(G){Pl(t.removed,{element:G});try{y(G).removeChild(G)}catch{if(f(G),!y(G))throw jr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qi=function(G,oe,be){try{m(G,oe)}catch{try{G.removeAttribute(be)}catch{}}},mo=function(G){go(G);let oe=$(G);if(oe){let Ie=[];No(oe,Ze=>{Pl(Ie,Ze)}),No(Ie,Ze=>{try{f(Ze)}catch{}})}let be=v(G);if(be)for(let Ie=be.length-1;Ie>=0;--Ie){let Ze=be[Ie],xt=Ze&&Ze.name;typeof xt=="string"&&Qi(G,Ze,xt)}},nr=function(G,oe,be){if(!be)try{be=oe.getAttributeNode(G)}catch{be=null}Pl(t.removed,{attribute:be||null,from:oe});try{be?m(oe,be):oe.removeAttribute(G)}catch{try{oe.removeAttribute(G)}catch{}}if(G==="is")if(kn||Hn)try{ya(oe)}catch{}else try{oe.setAttribute(G,"")}catch{}},I0=function(G){let oe=v(G);if(oe)for(let be=oe.length-1;be>=0;--be){let Ie=oe[be],Ze=Ie&&Ie.name;typeof Ze!="string"||je[rt(Ze)]||Qi(G,Ie,Ze)}},go=function(G){let oe=[G];for(;oe.length>0;){let be=oe.pop();S(be)===Vs.element&&I0(be);let Ie=$(be);if(Ie)for(let Ze=Ie.length-1;Ze>=0;--Ze)oe.push(Ie[Ze])}},ni=function(G,oe){return lt?G==="patchsrc"?!0:G==="for"&&oe!=="label"&&oe!=="output":!1},su=function(G){if(!lt)return;let oe=[G];for(;oe.length>0;){let be=oe.pop(),Ie=S(be);if(Ie===Vs.processingInstruction||Ie===Vs.comment&&ds(w2,be.data)){try{f(be)}catch{}continue}if(Ie===Vs.element){let xt=be,P=rt(E(be));try{xt.hasAttribute&&xt.hasAttribute("patchsrc")&&xt.removeAttribute("patchsrc"),xt.hasAttribute&&xt.hasAttribute("for")&&ni("for",P)&&xt.removeAttribute("for")}catch{}}let Ze=$(be);if(Ze)for(let xt=Ze.length-1;xt>=0;--xt)oe.push(Ze[xt])}},au=function(G){let oe=null,be=null;if(nn)G="<remove></remove>"+G;else{let xt=d2(G,/^[\r\n\t ]+/);be=xt&&xt[0]}as==="application/xhtml+xml"&&mt===ue&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");let Ie=A?Q(G):G;if(mt===ue)try{oe=new u().parseFromString(Ie,as)}catch{}if(!oe||!oe.documentElement){oe=z.createDocument(mt,"template",null);try{oe.documentElement.innerHTML=gt?_:Ie}catch{}}let Ze=oe.body||oe.documentElement;return G&&be&&Ze.insertBefore(n.createTextNode(be),Ze.childNodes[0]||null),mt===ue?ae.call(oe,Ut?"html":"body")[0]:Ut?oe.documentElement:Ze},ru=function(G){let oe=C?C(G):G.ownerDocument;return F.call(oe||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Cr=function(G){return G=Bl(G,ie," "),G=Bl(G,ce," "),G=Bl(G,me," "),G},Ar=function(G){var oe;G.normalize();let be=C?C(G):G.ownerDocument,Ie=F.call(be||G,G,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Ze=Ie.nextNode();for(;Ze;)Ze.data=Cr(Ze.data),Ze=Ie.nextNode();let xt=(oe=G.querySelectorAll)===null||oe===void 0?void 0:oe.call(G,"template");xt&&No(xt,P=>{_a(P.content)&&Ar(P.content)})},Fs=function(G){let oe=I?I(G):null;return typeof oe!="string"||rt(oe)!=="form"?!1:typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||G.attributes!==v(G)||typeof G.removeAttribute!="function"||typeof G.removeAttributeNode!="function"||typeof G.getAttributeNode!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function"||G.nodeType!==k(G)||G.childNodes!==$(G)},_a=function(G){if(!k||typeof G!="object"||G===null)return!1;try{return k(G)===Vs.documentFragment}catch{return!1}},Tr=function(G){if(!k||typeof G!="object"||G===null)return!1;try{return typeof k(G)=="number"}catch{return!1}};function oa(xe,G,oe){xe.length!==0&&No(xe,be=>{be.call(t,G,oe,Kn)})}let E0=function(G,oe){return!!(lt&&G.hasChildNodes()&&!Tr(G.firstElementChild)&&ds(v2,G.textContent)&&ds(v2,G.innerHTML)||lt&&G.namespaceURI===ue&&DT[oe]&&(Tr(G.firstElementChild)||typeof G.textContent=="string"&&ds(NT[oe],G.textContent))||G.nodeType===Vs.processingInstruction||lt&&G.nodeType===Vs.comment&&ds(w2,G.data))},Mr=function(G,oe){if(G instanceof RegExp)return ds(G,oe);if(G instanceof Function){for(var be=arguments.length,Ie=new Array(be>2?be-2:0),Ze=2;Ze<be;Ze++)Ie[Ze-2]=arguments[Ze];return!!G(oe,...Ie)}return!1},_0=function(G,oe,be){if(!Ne[oe]&&si(oe)&&Mr(Pe.tagNameCheck,oe))return!1;if($n&&!Vt[oe]){let Ie=y(G),Ze=$(G);if(Ze&&Ie){let xt=Ze.length;for(let P=xt-1;P>=0;--P){let te=G===be?h(Ze[P],!0):Ze[P];Ie.insertBefore(te,b(G))}}}return ya(G),!0},ou=function(G,oe,be,Ie){return G.length===0?oe:oe===be||oe===Ie?Ks(oe):oe},$s=function(G,oe){return G===oe||y(G)!==null?!1:(ss&&go(G),!0)},el=function(G,oe){if(oa(U.beforeSanitizeElements,G,null),$s(G,oe))return!0;if(Fs(G))return ya(G),!0;let be=rt(E(G));if(pe=ou(U.uponSanitizeElement,pe,dt,wn),oa(U.uponSanitizeElement,G,{tagName:be,allowedTags:pe}),$s(G,oe))return!0;if(E0(G,be))return ya(G),!0;if(Ne[be]||!(At.tagCheck instanceof Function&&At.tagCheck(be))&&!pe[be]){let Ie=_0(G,be,oe);return Ie===!1&&(oa(U.afterSanitizeElements,G,null),$s(G,oe))?!0:Ie}if(S(G)===Vs.element&&!nu(G)||(be==="noscript"||be==="noembed"||be==="noframes")&&ds(LT,G.innerHTML))return ya(G),!0;if(Ge&&G.nodeType===Vs.text){let Ie=Cr(G.textContent);G.textContent!==Ie&&(Pl(t.removed,{element:G.cloneNode()}),G.textContent=Ie)}return oa(U.afterSanitizeElements,G,null),$s(G,oe)},iu=function(G,oe,be){if(He[oe]||ni(oe,G)||Be&&(oe==="id"||oe==="name")&&(be in n||be in Sr))return!1;let Ie=je[oe]||At.attributeCheck instanceof Function&&At.attributeCheck(oe,G);return kt&&ds(qe,oe)||qt&&ds(re,oe)?!0:Ie?tt[oe]||ds(Ce,Bl(be,Me,""))||(oe==="src"||oe==="xlink:href"||oe==="href")&&G!=="script"&&p2(be,"data:")===0&&ze[G]||Rt&&!ds($e,Bl(be,Me,""))?!0:!be:si(G)&&Mr(Pe.tagNameCheck,G)&&Mr(Pe.attributeNameCheck,oe,G)||oe==="is"&&Pe.allowCustomizedBuiltInElements&&Mr(Pe.tagNameCheck,be)},R0=Ot({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),si=function(G){return!R0[Fl(G)]&&ds(fe,G)},L0=function(G,oe,be,Ie){if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!be)switch(d.getAttributeType(G,oe)){case"TrustedHTML":return Q(Ie);case"TrustedScriptURL":return V(Ie)}return Ie},O0=function(G,oe,be,Ie){try{return be?G.setAttributeNS(be,oe,Ie):G.setAttribute(oe,Ie),Fs(G)?(ya(G),!1):!0}catch{return nr(oe,G),!1}},tl=function(G,oe){if(oa(U.beforeSanitizeAttributes,G,null),$s(G,oe))return;let be=G.attributes;if(!be||Fs(G))return;je=ou(U.uponSanitizeAttribute,je,_e,Yt);let Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je,forceKeepAttr:void 0},Ze=be.length,xt=rt(G.nodeName);for(;Ze--;){let P=be[Ze],te=P.name,le=P.namespaceURI,de=P.value,ye=rt(te),Se=de,Oe=te==="value"?Se:mT(Se),ft=!1;if(Ie.attrName=ye,Ie.attrValue=Oe,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,oa(U.uponSanitizeAttribute,G,Ie),Oe=Ie.attrValue,Tt&&(ye==="id"||ye==="name")&&p2(Oe,en)!==0&&(nr(te,G,P),Oe=en+Oe,ft=!0),lt&&ds(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){nr(te,G,P);continue}if(ye==="attributename"&&d2(Oe,"href")){nr(te,G,P);continue}if(!Ie.forceKeepAttr){if(!Ie.keepAttr){nr(te,G,P);continue}if(!ke&&ds(OT,Oe)){nr(te,G,P);continue}if(Ge&&(Oe=Cr(Oe)),!iu(xt,ye,Oe)){nr(te,G,P);continue}Oe=L0(xt,ye,le,Oe),Oe!==Se&&O0(G,te,le,Oe)&&ft&&u2(t.removed)}}oa(U.afterSanitizeAttributes,G,null),$s(G,oe)},ai=function(G){let oe=null,be=ru(G);for(oa(U.beforeSanitizeShadowDOM,G,null);oe=be.nextNode();)if(oa(U.uponSanitizeShadowNode,oe,null),el(oe,G),tl(oe,G),_a(oe.content)&&ai(oe.content),S(oe)===Vs.element){let Ie=w(oe);_a(Ie)&&(nl(Ie),ai(Ie))}oa(U.afterSanitizeShadowDOM,G,null)},nl=function(G){let oe=[{node:G,shadow:null}];for(;oe.length>0;){let be=oe.pop();if(be.shadow){ai(be.shadow);continue}let Ie=be.node,Ze=S(Ie)===Vs.element,xt=$(Ie);if(xt)for(let P=xt.length-1;P>=0;--P)oe.push({node:xt[P],shadow:null});if(Ze){let P=I?I(Ie):null;if(typeof P=="string"&&rt(P)==="template"){let te=Ie.content;_a(te)&&oe.push({node:te,shadow:null})}}if(Ze){let P=w(Ie);_a(P)&&oe.push({node:null,shadow:P},{node:P,shadow:null})}}};return t.sanitize=function(xe){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,be=null,Ie=null,Ze=null;if(gt=!xe,gt&&(xe="<!-->"),typeof xe!="string"&&!Tr(xe)&&(xe=vT(xe),typeof xe!="string"))throw jr("dirty is not a string, aborting");if(!t.isSupported)return xe;mn?(pe=wn,je=Yt):aa(G),(U.uponSanitizeElement.length>0||U.uponSanitizeAttribute.length>0)&&(pe=Ks(pe)),U.uponSanitizeAttribute.length>0&&(je=Ks(je)),t.removed=[];let xt=ss&&typeof xe!="string"&&Tr(xe);if(xt){su(xe);let le=E(xe);if(typeof le=="string"){let de=rt(le);if(!pe[de]||Ne[de])throw mo(xe),jr("root node is forbidden and cannot be sanitized in-place")}if(Fs(xe))throw mo(xe),jr("root node is clobbered and cannot be sanitized in-place");try{nl(xe)}catch(de){throw mo(xe),de}}else if(Tr(xe))oe=au("<!---->"),be=oe.ownerDocument.importNode(xe,!0),be.nodeType===Vs.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?oe=be:oe.appendChild(be),nl(oe);else{if(!kn&&!Ge&&!Ut&&xe.indexOf("<")===-1)return A&&gn?Q(xe):xe;if(oe=au(xe),!oe)return kn?null:gn?_:""}oe&&nn&&ya(oe.firstChild);let P=xt?xe:oe;try{let le=ru(P);for(;Ie=le.nextNode();)el(Ie,P),tl(Ie,P),_a(Ie.content)&&ai(Ie.content)}catch(le){throw xt&&(mo(xe),No(t.removed,de=>{de.element&&go(de.element)})),le}if(xt){let le=!1;if(No(t.removed,de=>{de.element&&(de.element===xe&&(le=!0),go(de.element))}),le)throw jr("a node selected for removal could not be safely returned; refusing to sanitize in place");return Ge&&Ar(xe),xe}if(kn){if(Ge&&Ar(oe),Hn)for(Ze=H.call(oe.ownerDocument);oe.firstChild;)Ze.appendChild(oe.firstChild);else Ze=oe;return(je.shadowroot||je.shadowrootmode)&&(Ze=j.call(s,Ze,!0)),Ze}let te=Ut?oe.outerHTML:oe.innerHTML;return Ut&&pe["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&ds(_T,oe.ownerDocument.doctype.name)&&(te="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
|
|
685
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+js(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Oo=new nT;function Ot(e,t){return Oo.parse(e,t)}Ot.options=Ot.setOptions=function(e){return Oo.setOptions(e),Ot.defaults=Oo.defaults,Qv(Ot.defaults),Ot};Ot.getDefaults=sf;Ot.defaults=Do;function sT(...e){return Oo.use(...e),Ot.defaults=Oo.defaults,Qv(Ot.defaults),Ot}Ot.use=sT;Ot.walkTokens=function(e,t){return Oo.walkTokens(e,t)};Ot.parseInline=Oo.parseInline;Ot.Parser=Ca;Ot.parser=Ca.parse;Ot.Renderer=hd;Ot.TextRenderer=df;Ot.Lexer=Sa;Ot.lexer=Sa.lex;Ot.Tokenizer=pd;Ot.Hooks=Ll;Ot.parse=Ot;var $U=Ot.options,bU=Ot.setOptions,yU=Ot.walkTokens,vU=Ot.parseInline;var wU=Ca.parse,kU=Sa.lex;function aT(e,t){this.v=e,this.k=t}function l2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function rT(e){if(Array.isArray(e))return e}function oT(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,a,r,o,l=[],c=!0,u=!1;try{if(r=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(s=r.call(n)).done)&&(l.push(s.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function iT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
686
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lT(e,t){return rT(e)||oT(e,t)||cT(e,t)||iT()}function cT(e,t){if(e){if(typeof e=="string")return l2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l2(e,t):void 0}}function fd(e){var t,n;function s(r,o){try{var l=e[r](o),c=l.value,u=c instanceof aT;Promise.resolve(u?c.v:c).then(function(d){if(u){var p=r==="return"&&c.k?r:"next";if(!c.k||d.done)return s(p,d);d=e[p](d).value}a(!!l.done,d)},function(d){s("throw",d)})}catch(d){a(2,d)}}function a(r,o){r===2?t.reject(o):t.resolve({value:o,done:r}),(t=t.next)?s(t.key,t.arg):n=null}this._invoke=function(r,o){return new Promise(function(l,c){var u={key:r,arg:o,resolve:l,reject:c,next:null};n?n=n.next=u:(t=n=u,s(r,o))})},typeof e.return!="function"&&(this.return=void 0)}fd.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},fd.prototype.next=function(e){return this._invoke("next",e)},fd.prototype.throw=function(e){return this._invoke("throw",e)},fd.prototype.return=function(e){return this._invoke("return",e)};var x2=Object.entries,c2=Object.setPrototypeOf,uT=Object.isFrozen,dT=Object.getPrototypeOf,pT=Object.getOwnPropertyDescriptor,zn=Object.freeze,jn=Object.seal,wi=Object.create,S2=typeof Reflect<"u"&&Reflect,bf=S2.apply,yf=S2.construct;zn||(zn=function(t){return t});jn||(jn=function(t){return t});bf||(bf=function(t,n){for(var s=arguments.length,a=new Array(s>2?s-2:0),r=2;r<s;r++)a[r-2]=arguments[r];return t.apply(n,a)});yf||(yf=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return new t(...s)});var No=Rn(Array.prototype.forEach);Array.prototype.indexOf;var hT=Rn(Array.prototype.lastIndexOf),u2=Rn(Array.prototype.pop),Pl=Rn(Array.prototype.push);Array.prototype.slice;var fT=Rn(Array.prototype.splice),ki=Array.isArray,Fl=Rn(String.prototype.toLowerCase),pf=Rn(String.prototype.toString),d2=Rn(String.prototype.match),Bl=Rn(String.prototype.replace),p2=Rn(String.prototype.indexOf),mT=Rn(String.prototype.trim),gT=Rn(Number.prototype.toString),$T=Rn(Boolean.prototype.toString),h2=typeof BigInt>"u"?null:Rn(BigInt.prototype.toString),f2=typeof Symbol>"u"?null:Rn(Symbol.prototype.toString),Es=Rn(Object.prototype.hasOwnProperty),zl=Rn(Object.prototype.toString),ds=Rn(RegExp.prototype.test),jr=bT(TypeError);function Rn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return bf(e,t,s)}}function bT(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return yf(e,n)}}function Dt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fl;if(c2&&c2(e,null),!ki(t))return e;let s=t.length;for(;s--;){let a=t[s];if(typeof a=="string"){let r=n(a);r!==a&&(uT(t)||(t[s]=r),a=r)}e[a]=!0}return e}function yT(e){for(let t=0;t<e.length;t++)Es(e,t)||(e[t]=null);return e}function Ks(e){let t=wi(null);for(let s of x2(e)){var n=lT(s,2);let a=n[0],r=n[1];Es(e,a)&&(ki(r)?t[a]=yT(r):r&&typeof r=="object"&&r.constructor===Object?t[a]=Ks(r):t[a]=r)}return t}function vT(e){switch(typeof e){case"string":return e;case"number":return gT(e);case"boolean":return $T(e);case"bigint":return h2?h2(e):"0";case"symbol":return f2?f2(e):"Symbol()";case"undefined":return zl(e);case"function":case"object":{if(e===null)return zl(e);let t=e,n=fa(t,"toString");if(typeof n=="function"){let s=n(t);return typeof s=="string"?s:zl(s)}return zl(e)}default:return zl(e)}}function fa(e,t){for(;e!==null;){let s=pT(e,t);if(s){if(s.get)return Rn(s.get);if(typeof s.value=="function")return Rn(s.value)}e=dT(e)}function n(){return null}return n}function wT(e){try{return ds(e,""),!0}catch{return!1}}var m2=zn(["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"]),hf=zn(["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"]),ff=zn(["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"]),kT=zn(["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"]),mf=zn(["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"]),xT=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),g2=zn(["#text"]),$2=zn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),gf=zn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),b2=zn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),md=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ST=jn(/{{[\w\W]*|^[\w\W]*}}/g),CT=jn(/<%[\w\W]*|^[\w\W]*%>/g),AT=jn(/\${[\w\W]*/g),TT=jn(/^data-[\-\w.\u00B7-\uFFFF]+$/),MT=jn(/^aria-[\-\w]+$/),y2=jn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IT=jn(/^(?:\w+script|data):/i),ET=jn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_T=jn(/^html$/i),RT=jn(/^[a-z][.\w]*(-[.\w]+)+$/i),v2=jn(/<[/\w!]/g),w2=jn(/<[/\w]/g),LT=jn(/<\/no(script|embed|frames)/i),OT=jn(/\/>/i),Vs={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},C2=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],DT=zn(Dt({},C2)),NT=(function(){let e={};return No(C2,t=>{e[t]=jn(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),zn(e)})(),PT=function(){return typeof window>"u"?null:window},BT=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null,a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(s=n.getAttribute(a));let r="dompurify"+(s?"#"+s:"");try{return t.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},k2=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Vr=function(t,n,s,a){return Es(t,n)&&ki(t[n])?Dt(a.base?Ks(a.base):{},t[n],a.transform):s},$f=function(t,n,s){let a=Es(t,n)?t[n]:void 0;return a&&typeof a=="object"?Ks(a):s()};function A2(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PT(),t=xe=>A2(xe);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==Vs.document||!e.Element)return t.isSupported=!1,t;let n=e.document,s=n,a=s.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,o=e.Node,l=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,d=e.trustedTypes,p=l.prototype,h=fa(p,"cloneNode"),f=fa(p,"remove"),m=fa(p,"removeAttributeNode"),b=fa(p,"nextSibling"),$=fa(p,"childNodes"),y=fa(p,"parentNode"),w=fa(p,"shadowRoot"),v=fa(p,"attributes"),k=o&&o.prototype?fa(o.prototype,"nodeType"):null,I=o&&o.prototype?fa(o.prototype,"nodeName"):null,C=o&&o.prototype?fa(o.prototype,"ownerDocument"):null,S=function(G){return k?k(G):G.nodeType},E=function(G){return I?I(G):G.nodeName};if(typeof r=="function"){let xe=n.createElement("template");xe.content&&xe.content.ownerDocument&&(n=xe.content.ownerDocument)}let A,_="",R,W=!1,O=0,L=function(){if(O>0)throw jr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Q=function(G){L(),O++;try{return A.createHTML(G)}finally{O--}},V=function(G){L(),O++;try{return A.createScriptURL(G)}finally{O--}},ee=function(){return W||(R=BT(d,a),W=!0),R},K=n,z=K.implementation,F=K.createNodeIterator,H=K.createDocumentFragment,ae=K.getElementsByTagName,j=s.importNode,U=k2();t.isSupported=typeof x2=="function"&&typeof y=="function"&&z&&z.createHTMLDocument!==void 0;let ie=ST,ce=CT,me=AT,qe=TT,re=MT,$e=IT,Me=ET,fe=RT,Ce=y2,pe=null,dt=Dt({},[...m2,...hf,...ff,...mf,...g2]),je=null,_e=Dt({},[...$2,...gf,...b2,...md]),Pe=Object.seal(wi(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}})),Ne=null,He=null,At=Object.seal(wi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),qt=!0,kt=!0,Rt=!1,ke=!0,Ge=!1,lt=!0,Ut=!1,mn=!1,wn=null,Yt=null,nn=!1,kn=!1,Hn=!1,gn=!1,Be=!0,Tt=!1,en="user-content-",$n=!0,ss=!1,bn={},Vt=null,In=Dt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),ze=null,Le=Dt({},["audio","video","img","source","image","track"]),tt=null,Nt=Dt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",sn="http://www.w3.org/2000/svg",ue="http://www.w3.org/1999/xhtml",mt=ue,gt=!1,ht=null,tr=Dt({},[Pt,sn,ue],pf),xr=zn(["mi","mo","mn","ms","mtext"]),It=Dt({},xr),ho=zn(["annotation-xml"]),fo=Dt({},ho),ei=Dt({},["title","style","font","a","script"]),as=null,zs=["application/xhtml+xml","text/html"],Re="text/html",rt=null,Kn=null,Sr=n.createElement("form"),Ea=function(G){return G instanceof RegExp||G instanceof Function},aa=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kn&&Kn===G)return;(!G||typeof G!="object")&&(G={}),G=Ks(G),as=zs.indexOf(G.PARSER_MEDIA_TYPE)===-1?Re:G.PARSER_MEDIA_TYPE,rt=as==="application/xhtml+xml"?pf:Fl,pe=Vr(G,"ALLOWED_TAGS",dt,{transform:rt}),je=Vr(G,"ALLOWED_ATTR",_e,{transform:rt}),ht=Vr(G,"ALLOWED_NAMESPACES",tr,{transform:pf}),tt=Vr(G,"ADD_URI_SAFE_ATTR",Nt,{transform:rt,base:Nt}),ze=Vr(G,"ADD_DATA_URI_TAGS",Le,{transform:rt,base:Le}),Vt=Vr(G,"FORBID_CONTENTS",In,{transform:rt}),Ne=Vr(G,"FORBID_TAGS",Ks({}),{transform:rt}),He=Vr(G,"FORBID_ATTR",Ks({}),{transform:rt}),bn=Es(G,"USE_PROFILES")?G.USE_PROFILES&&typeof G.USE_PROFILES=="object"?Ks(G.USE_PROFILES):G.USE_PROFILES:!1,qt=G.ALLOW_ARIA_ATTR!==!1,kt=G.ALLOW_DATA_ATTR!==!1,Rt=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ge=G.SAFE_FOR_TEMPLATES||!1,lt=G.SAFE_FOR_XML!==!1,Ut=G.WHOLE_DOCUMENT||!1,kn=G.RETURN_DOM||!1,Hn=G.RETURN_DOM_FRAGMENT||!1,gn=G.RETURN_TRUSTED_TYPE||!1,nn=G.FORCE_BODY||!1,Be=G.SANITIZE_DOM!==!1,Tt=G.SANITIZE_NAMED_PROPS||!1,$n=G.KEEP_CONTENT!==!1,ss=G.IN_PLACE||!1,Ce=wT(G.ALLOWED_URI_REGEXP)?G.ALLOWED_URI_REGEXP:y2,mt=typeof G.NAMESPACE=="string"?G.NAMESPACE:ue,It=$f(G,"MATHML_TEXT_INTEGRATION_POINTS",()=>Dt({},xr)),fo=$f(G,"HTML_INTEGRATION_POINTS",()=>Dt({},ho));let oe=$f(G,"CUSTOM_ELEMENT_HANDLING",()=>wi(null));if(Pe=wi(null),Es(oe,"tagNameCheck")&&Ea(oe.tagNameCheck)&&(Pe.tagNameCheck=oe.tagNameCheck),Es(oe,"attributeNameCheck")&&Ea(oe.attributeNameCheck)&&(Pe.attributeNameCheck=oe.attributeNameCheck),Es(oe,"allowCustomizedBuiltInElements")&&typeof oe.allowCustomizedBuiltInElements=="boolean"&&(Pe.allowCustomizedBuiltInElements=oe.allowCustomizedBuiltInElements),jn(Pe),Ge&&(kt=!1),Hn&&(kn=!0),bn&&(pe=Dt({},g2),je=wi(null),bn.html===!0&&(Dt(pe,m2),Dt(je,$2)),bn.svg===!0&&(Dt(pe,hf),Dt(je,gf),Dt(je,md)),bn.svgFilters===!0&&(Dt(pe,ff),Dt(je,gf),Dt(je,md)),bn.mathMl===!0&&(Dt(pe,mf),Dt(je,b2),Dt(je,md))),At.tagCheck=null,At.attributeCheck=null,Es(G,"ADD_TAGS")&&(typeof G.ADD_TAGS=="function"?At.tagCheck=G.ADD_TAGS:ki(G.ADD_TAGS)&&(pe===dt&&(pe=Ks(pe)),Dt(pe,G.ADD_TAGS,rt))),Es(G,"ADD_ATTR")&&(typeof G.ADD_ATTR=="function"?At.attributeCheck=G.ADD_ATTR:ki(G.ADD_ATTR)&&(je===_e&&(je=Ks(je)),Dt(je,G.ADD_ATTR,rt))),Es(G,"ADD_FORBID_CONTENTS")&&ki(G.ADD_FORBID_CONTENTS)&&(Vt===In&&(Vt=Ks(Vt)),Dt(Vt,G.ADD_FORBID_CONTENTS,rt)),$n&&(pe["#text"]=!0),Ut&&Dt(pe,["html","head","body"]),pe.table&&(Dt(pe,["tbody"]),delete Ne.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let be=A;A=G.TRUSTED_TYPES_POLICY;try{_=Q("")}catch(Ie){throw A=be,Ie}}else G.TRUSTED_TYPES_POLICY===null?(A=void 0,_=""):(A===void 0&&(A=ee()),A&&typeof _=="string"&&(_=Q("")));zn&&zn(G),Kn=G},gs=Dt({},[...hf,...ff,...kT]),Xe=Dt({},[...mf,...xT]),ra=function(G,oe,be){return oe.namespaceURI===ue?G==="svg":oe.namespaceURI===Pt?G==="svg"&&(be==="annotation-xml"||It[be]):!!gs[G]},Nn=function(G,oe,be){return oe.namespaceURI===ue?G==="math":oe.namespaceURI===sn?G==="math"&&fo[be]:!!Xe[G]},ti=function(G,oe,be){return oe.namespaceURI===sn&&!fo[be]||oe.namespaceURI===Pt&&!It[be]?!1:!Xe[G]&&(ei[G]||!gs[G])},nu=function(G){let oe=y(G);(!oe||!oe.tagName)&&(oe={namespaceURI:mt,tagName:"template"});let be=Fl(G.tagName),Ie=Fl(oe.tagName);return ht[G.namespaceURI]?G.namespaceURI===sn?ra(be,oe,Ie):G.namespaceURI===Pt?Nn(be,oe,Ie):G.namespaceURI===ue?ti(be,oe,Ie):!!(as==="application/xhtml+xml"&&ht[G.namespaceURI]):!1},ya=function(G){Pl(t.removed,{element:G});try{y(G).removeChild(G)}catch{if(f(G),!y(G))throw jr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qi=function(G,oe,be){try{m(G,oe)}catch{try{G.removeAttribute(be)}catch{}}},mo=function(G){go(G);let oe=$(G);if(oe){let Ie=[];No(oe,Ze=>{Pl(Ie,Ze)}),No(Ie,Ze=>{try{f(Ze)}catch{}})}let be=v(G);if(be)for(let Ie=be.length-1;Ie>=0;--Ie){let Ze=be[Ie],xt=Ze&&Ze.name;typeof xt=="string"&&Qi(G,Ze,xt)}},nr=function(G,oe,be){if(!be)try{be=oe.getAttributeNode(G)}catch{be=null}Pl(t.removed,{attribute:be||null,from:oe});try{be?m(oe,be):oe.removeAttribute(G)}catch{try{oe.removeAttribute(G)}catch{}}if(G==="is")if(kn||Hn)try{ya(oe)}catch{}else try{oe.setAttribute(G,"")}catch{}},I0=function(G){let oe=v(G);if(oe)for(let be=oe.length-1;be>=0;--be){let Ie=oe[be],Ze=Ie&&Ie.name;typeof Ze!="string"||je[rt(Ze)]||Qi(G,Ie,Ze)}},go=function(G){let oe=[G];for(;oe.length>0;){let be=oe.pop();S(be)===Vs.element&&I0(be);let Ie=$(be);if(Ie)for(let Ze=Ie.length-1;Ze>=0;--Ze)oe.push(Ie[Ze])}},ni=function(G,oe){return lt?G==="patchsrc"?!0:G==="for"&&oe!=="label"&&oe!=="output":!1},su=function(G){if(!lt)return;let oe=[G];for(;oe.length>0;){let be=oe.pop(),Ie=S(be);if(Ie===Vs.processingInstruction||Ie===Vs.comment&&ds(w2,be.data)){try{f(be)}catch{}continue}if(Ie===Vs.element){let xt=be,P=rt(E(be));try{xt.hasAttribute&&xt.hasAttribute("patchsrc")&&xt.removeAttribute("patchsrc"),xt.hasAttribute&&xt.hasAttribute("for")&&ni("for",P)&&xt.removeAttribute("for")}catch{}}let Ze=$(be);if(Ze)for(let xt=Ze.length-1;xt>=0;--xt)oe.push(Ze[xt])}},au=function(G){let oe=null,be=null;if(nn)G="<remove></remove>"+G;else{let xt=d2(G,/^[\r\n\t ]+/);be=xt&&xt[0]}as==="application/xhtml+xml"&&mt===ue&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");let Ie=A?Q(G):G;if(mt===ue)try{oe=new u().parseFromString(Ie,as)}catch{}if(!oe||!oe.documentElement){oe=z.createDocument(mt,"template",null);try{oe.documentElement.innerHTML=gt?_:Ie}catch{}}let Ze=oe.body||oe.documentElement;return G&&be&&Ze.insertBefore(n.createTextNode(be),Ze.childNodes[0]||null),mt===ue?ae.call(oe,Ut?"html":"body")[0]:Ut?oe.documentElement:Ze},ru=function(G){let oe=C?C(G):G.ownerDocument;return F.call(oe||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Cr=function(G){return G=Bl(G,ie," "),G=Bl(G,ce," "),G=Bl(G,me," "),G},Ar=function(G){var oe;G.normalize();let be=C?C(G):G.ownerDocument,Ie=F.call(be||G,G,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Ze=Ie.nextNode();for(;Ze;)Ze.data=Cr(Ze.data),Ze=Ie.nextNode();let xt=(oe=G.querySelectorAll)===null||oe===void 0?void 0:oe.call(G,"template");xt&&No(xt,P=>{_a(P.content)&&Ar(P.content)})},Fs=function(G){let oe=I?I(G):null;return typeof oe!="string"||rt(oe)!=="form"?!1:typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||G.attributes!==v(G)||typeof G.removeAttribute!="function"||typeof G.removeAttributeNode!="function"||typeof G.getAttributeNode!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function"||G.nodeType!==k(G)||G.childNodes!==$(G)},_a=function(G){if(!k||typeof G!="object"||G===null)return!1;try{return k(G)===Vs.documentFragment}catch{return!1}},Tr=function(G){if(!k||typeof G!="object"||G===null)return!1;try{return typeof k(G)=="number"}catch{return!1}};function oa(xe,G,oe){xe.length!==0&&No(xe,be=>{be.call(t,G,oe,Kn)})}let E0=function(G,oe){return!!(lt&&G.hasChildNodes()&&!Tr(G.firstElementChild)&&ds(v2,G.textContent)&&ds(v2,G.innerHTML)||lt&&G.namespaceURI===ue&&DT[oe]&&(Tr(G.firstElementChild)||typeof G.textContent=="string"&&ds(NT[oe],G.textContent))||G.nodeType===Vs.processingInstruction||lt&&G.nodeType===Vs.comment&&ds(w2,G.data))},Mr=function(G,oe){if(G instanceof RegExp)return ds(G,oe);if(G instanceof Function){for(var be=arguments.length,Ie=new Array(be>2?be-2:0),Ze=2;Ze<be;Ze++)Ie[Ze-2]=arguments[Ze];return!!G(oe,...Ie)}return!1},_0=function(G,oe,be){if(!Ne[oe]&&si(oe)&&Mr(Pe.tagNameCheck,oe))return!1;if($n&&!Vt[oe]){let Ie=y(G),Ze=$(G);if(Ze&&Ie){let xt=Ze.length;for(let P=xt-1;P>=0;--P){let te=G===be?h(Ze[P],!0):Ze[P];Ie.insertBefore(te,b(G))}}}return ya(G),!0},ou=function(G,oe,be,Ie){return G.length===0?oe:oe===be||oe===Ie?Ks(oe):oe},$s=function(G,oe){return G===oe||y(G)!==null?!1:(ss&&go(G),!0)},el=function(G,oe){if(oa(U.beforeSanitizeElements,G,null),$s(G,oe))return!0;if(Fs(G))return ya(G),!0;let be=rt(E(G));if(pe=ou(U.uponSanitizeElement,pe,dt,wn),oa(U.uponSanitizeElement,G,{tagName:be,allowedTags:pe}),$s(G,oe))return!0;if(E0(G,be))return ya(G),!0;if(Ne[be]||!(At.tagCheck instanceof Function&&At.tagCheck(be))&&!pe[be]){let Ie=_0(G,be,oe);return Ie===!1&&(oa(U.afterSanitizeElements,G,null),$s(G,oe))?!0:Ie}if(S(G)===Vs.element&&!nu(G)||(be==="noscript"||be==="noembed"||be==="noframes")&&ds(LT,G.innerHTML))return ya(G),!0;if(Ge&&G.nodeType===Vs.text){let Ie=Cr(G.textContent);G.textContent!==Ie&&(Pl(t.removed,{element:G.cloneNode()}),G.textContent=Ie)}return oa(U.afterSanitizeElements,G,null),$s(G,oe)},iu=function(G,oe,be){if(He[oe]||ni(oe,G)||Be&&(oe==="id"||oe==="name")&&(be in n||be in Sr))return!1;let Ie=je[oe]||At.attributeCheck instanceof Function&&At.attributeCheck(oe,G);return kt&&ds(qe,oe)||qt&&ds(re,oe)?!0:Ie?tt[oe]||ds(Ce,Bl(be,Me,""))||(oe==="src"||oe==="xlink:href"||oe==="href")&&G!=="script"&&p2(be,"data:")===0&&ze[G]||Rt&&!ds($e,Bl(be,Me,""))?!0:!be:si(G)&&Mr(Pe.tagNameCheck,G)&&Mr(Pe.attributeNameCheck,oe,G)||oe==="is"&&Pe.allowCustomizedBuiltInElements&&Mr(Pe.tagNameCheck,be)},R0=Dt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),si=function(G){return!R0[Fl(G)]&&ds(fe,G)},L0=function(G,oe,be,Ie){if(A&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!be)switch(d.getAttributeType(G,oe)){case"TrustedHTML":return Q(Ie);case"TrustedScriptURL":return V(Ie)}return Ie},O0=function(G,oe,be,Ie){try{return be?G.setAttributeNS(be,oe,Ie):G.setAttribute(oe,Ie),Fs(G)?(ya(G),!1):!0}catch{return nr(oe,G),!1}},tl=function(G,oe){if(oa(U.beforeSanitizeAttributes,G,null),$s(G,oe))return;let be=G.attributes;if(!be||Fs(G))return;je=ou(U.uponSanitizeAttribute,je,_e,Yt);let Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:je,forceKeepAttr:void 0},Ze=be.length,xt=rt(G.nodeName);for(;Ze--;){let P=be[Ze],te=P.name,le=P.namespaceURI,de=P.value,ye=rt(te),Se=de,Oe=te==="value"?Se:mT(Se),ft=!1;if(Ie.attrName=ye,Ie.attrValue=Oe,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,oa(U.uponSanitizeAttribute,G,Ie),Oe=Ie.attrValue,Tt&&(ye==="id"||ye==="name")&&p2(Oe,en)!==0&&(nr(te,G,P),Oe=en+Oe,ft=!0),lt&&ds(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){nr(te,G,P);continue}if(ye==="attributename"&&d2(Oe,"href")){nr(te,G,P);continue}if(!Ie.forceKeepAttr){if(!Ie.keepAttr){nr(te,G,P);continue}if(!ke&&ds(OT,Oe)){nr(te,G,P);continue}if(Ge&&(Oe=Cr(Oe)),!iu(xt,ye,Oe)){nr(te,G,P);continue}Oe=L0(xt,ye,le,Oe),Oe!==Se&&O0(G,te,le,Oe)&&ft&&u2(t.removed)}}oa(U.afterSanitizeAttributes,G,null),$s(G,oe)},ai=function(G){let oe=null,be=ru(G);for(oa(U.beforeSanitizeShadowDOM,G,null);oe=be.nextNode();)if(oa(U.uponSanitizeShadowNode,oe,null),el(oe,G),tl(oe,G),_a(oe.content)&&ai(oe.content),S(oe)===Vs.element){let Ie=w(oe);_a(Ie)&&(nl(Ie),ai(Ie))}oa(U.afterSanitizeShadowDOM,G,null)},nl=function(G){let oe=[{node:G,shadow:null}];for(;oe.length>0;){let be=oe.pop();if(be.shadow){ai(be.shadow);continue}let Ie=be.node,Ze=S(Ie)===Vs.element,xt=$(Ie);if(xt)for(let P=xt.length-1;P>=0;--P)oe.push({node:xt[P],shadow:null});if(Ze){let P=I?I(Ie):null;if(typeof P=="string"&&rt(P)==="template"){let te=Ie.content;_a(te)&&oe.push({node:te,shadow:null})}}if(Ze){let P=w(Ie);_a(P)&&oe.push({node:null,shadow:P},{node:P,shadow:null})}}};return t.sanitize=function(xe){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,be=null,Ie=null,Ze=null;if(gt=!xe,gt&&(xe="<!-->"),typeof xe!="string"&&!Tr(xe)&&(xe=vT(xe),typeof xe!="string"))throw jr("dirty is not a string, aborting");if(!t.isSupported)return xe;mn?(pe=wn,je=Yt):aa(G),(U.uponSanitizeElement.length>0||U.uponSanitizeAttribute.length>0)&&(pe=Ks(pe)),U.uponSanitizeAttribute.length>0&&(je=Ks(je)),t.removed=[];let xt=ss&&typeof xe!="string"&&Tr(xe);if(xt){su(xe);let le=E(xe);if(typeof le=="string"){let de=rt(le);if(!pe[de]||Ne[de])throw mo(xe),jr("root node is forbidden and cannot be sanitized in-place")}if(Fs(xe))throw mo(xe),jr("root node is clobbered and cannot be sanitized in-place");try{nl(xe)}catch(de){throw mo(xe),de}}else if(Tr(xe))oe=au("<!---->"),be=oe.ownerDocument.importNode(xe,!0),be.nodeType===Vs.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?oe=be:oe.appendChild(be),nl(oe);else{if(!kn&&!Ge&&!Ut&&xe.indexOf("<")===-1)return A&&gn?Q(xe):xe;if(oe=au(xe),!oe)return kn?null:gn?_:""}oe&&nn&&ya(oe.firstChild);let P=xt?xe:oe;try{let le=ru(P);for(;Ie=le.nextNode();)el(Ie,P),tl(Ie,P),_a(Ie.content)&&ai(Ie.content)}catch(le){throw xt&&(mo(xe),No(t.removed,de=>{de.element&&go(de.element)})),le}if(xt){let le=!1;if(No(t.removed,de=>{de.element&&(de.element===xe&&(le=!0),go(de.element))}),le)throw jr("a node selected for removal could not be safely returned; refusing to sanitize in place");return Ge&&Ar(xe),xe}if(kn){if(Ge&&Ar(oe),Hn)for(Ze=H.call(oe.ownerDocument);oe.firstChild;)Ze.appendChild(oe.firstChild);else Ze=oe;return(je.shadowroot||je.shadowrootmode)&&(Ze=j.call(s,Ze,!0)),Ze}let te=Ut?oe.outerHTML:oe.innerHTML;return Ut&&pe["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&ds(_T,oe.ownerDocument.doctype.name)&&(te="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
|
|
687
687
|
`+te),Ge&&(te=Cr(te)),A&&gn?Q(te):te},t.setConfig=function(){let xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};aa(xe),mn=!0,wn=pe,Yt=je},t.clearConfig=function(){Kn=null,mn=!1,wn=null,Yt=null,A=R,_=""},t.isValidAttribute=function(xe,G,oe){Kn||aa({});let be=rt(xe),Ie=rt(G);return iu(be,Ie,oe)},t.addHook=function(xe,G){typeof G=="function"&&Es(U,xe)&&Pl(U[xe],G)},t.removeHook=function(xe,G){if(Es(U,xe)){if(G!==void 0){let oe=hT(U[xe],G);return oe===-1?void 0:fT(U[xe],oe,1)[0]}return u2(U[xe])}},t.removeHooks=function(xe){Es(U,xe)&&(U[xe]=[])},t.removeAllHooks=function(){U=k2()},t}var gd=A2();var Te=class e extends Error{constructor(t,n){var s="KaTeX parse error: "+t,a,r,o=n&&n.loc;if(o&&o.start<=o.end){var l=o.lexer.input;a=o.start,r=o.end,a===l.length?s+=" at end of input: ":s+=" at position "+(a+1)+": ";var c=l.slice(a,r).replace(/[^]/g,"$&\u0332"),u;a>15?u="\u2026"+l.slice(a-15,a):u=l.slice(0,a);var d;r+15<l.length?d=l.slice(r,r+15)+"\u2026":d=l.slice(r),s+=u+c+d}super(s),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=a,a!=null&&r!=null&&(this.length=r-a),this.rawMessage=t}},zT=/([A-Z])/g,FT=e=>e.replace(zT,"-$1").toLowerCase(),qT={"&":"&",">":">","<":"<",'"':""","'":"'"},UT=/[&><"']/g,hs=e=>String(e).replace(UT,t=>qT[t]),Td=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?Td(e.body[0]):e:e.type==="font"?Td(e.body):e,WT=new Set(["mathord","textord","atom"]),hr=e=>WT.has(Td(e).type),HT=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Of={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function GT(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function YT(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return GT(t)}function jT(e,t,n,s){var a=n[t];e[t]=a!==void 0?s.processor?s.processor(a):a:YT(s)}var Gl=class{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Of)){var s=Of[n];s&&jT(this,n,t,s)}}reportNonstrict(t,n,s){var a=this.strict;if(typeof a=="function"&&(a=a(t,n,s)),!(!a||a==="ignore")){if(a===!0||a==="error")throw new Te("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),s);a==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,s){var a=this.strict;if(typeof a=="function")try{a=a(t,n,s)}catch{a="error"}return!a||a==="ignore"?!1:a===!0||a==="error"?!0:a==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=HT(t.url);if(n==null)return!1;t.protocol=n}var s=typeof this.trust=="function"?this.trust(t):this.trust;return!!s}},qa=class{constructor(t,n,s){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=s}sup(){return Ua[VT[this.id]]}sub(){return Ua[KT[this.id]]}fracNum(){return Ua[XT[this.id]]}fracDen(){return Ua[ZT[this.id]]}cramp(){return Ua[JT[this.id]]}text(){return Ua[QT[this.id]]}isTight(){return this.size>=2}},tm=0,Id=1,Si=2,pr=3,Yl=4,ma=5,Ci=6,ws=7,Ua=[new qa(tm,0,!1),new qa(Id,0,!0),new qa(Si,1,!1),new qa(pr,1,!0),new qa(Yl,2,!1),new qa(ma,2,!0),new qa(Ci,3,!1),new qa(ws,3,!0)],VT=[Yl,ma,Yl,ma,Ci,ws,Ci,ws],KT=[ma,ma,ma,ma,ws,ws,ws,ws],XT=[Si,pr,Yl,ma,Ci,ws,Ci,ws],ZT=[pr,pr,ma,ma,ws,ws,ws,ws],JT=[Id,Id,pr,pr,ma,ma,ws,ws],QT=[tm,Id,Si,pr,Si,pr,Si,pr],ut={DISPLAY:Ua[tm],TEXT:Ua[Si],SCRIPT:Ua[Yl],SCRIPTSCRIPT:Ua[Ci]},Df=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function eM(e){for(var t=0;t<Df.length;t++)for(var n=Df[t],s=0;s<n.blocks.length;s++){var a=n.blocks[s];if(e>=a[0]&&e<=a[1])return n.name}return null}var Md=[];Df.forEach(e=>e.blocks.forEach(t=>Md.push(...t)));function lw(e){for(var t=0;t<Md.length;t+=2)if(e>=Md[t]&&e<=Md[t+1])return!0;return!1}var Fn=e=>e+" "+e,xi=80,tM=function(t,n){return"M95,"+(622+t+n)+`
|
|
688
688
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
689
689
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
@@ -971,7 +971,7 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
971
971
|
</div>
|
|
972
972
|
`:null}var NI='-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',PI="14px",BI=["secure","securityLevel","startOnLoad","maxTextSize","maxEdges","suppressErrorRendering","htmlLabels","flowchart","theme","themeVariables","themeCSS","fontFamily"],zI=new Set(["bar","line","pie"]),Zd=new Map,vm=null,FI=0;function qI(){return vm??=new Promise((e,t)=>{let n=document.createElement("script");n.src="/vendor/mermaid.js",n.onload=()=>globalThis.mermaid?e(globalThis.mermaid):t(new Error("The diagram library did not load.")),n.onerror=()=>{vm=null,t(new Error("The diagram library did not load."))},document.head.append(n)}),vm}function UI(){let e=document.createElement("span");e.hidden=!0,document.body.append(e);let t=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),n=(s,a)=>{e.style.color=`var(${s})`;let r=getComputedStyle(e).color;t.clearRect(0,0,1,1),a&&(t.fillStyle=a,t.fillRect(0,0,1,1)),t.fillStyle=r,t.fillRect(0,0,1,1);let[o,l,c]=t.getImageData(0,0,1,1).data;return`#${[o,l,c].map(u=>u.toString(16).padStart(2,"0")).join("")}`};try{let s=n("--surface"),a=n("--panel",s),r=n("--ink",s),o=n("--muted-ink",s),l=n("--brand",s);return{background:s,primaryColor:a,primaryBorderColor:l,primaryTextColor:r,secondaryColor:s,secondaryBorderColor:o,secondaryTextColor:r,tertiaryColor:s,tertiaryBorderColor:o,tertiaryTextColor:r,lineColor:o,textColor:r,fontSize:PI}}finally{e.remove()}}function WI(){let e=document.querySelector(".diagram-measure");return e||(e=document.createElement("div"),e.className="diagram-measure",e.setAttribute("aria-hidden","true"),document.body.append(e)),e}function HI(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.nodeName!=="svg"||t.querySelector("parsererror"))return null;let n=(t.getAttribute("viewBox")??"").split(/[\s,]+/).map(Number);return n.length!==4||!(n[2]>0)||!(n[3]>0)?null:(t.setAttribute("width",String(Math.ceil(n[2]))),t.setAttribute("height",String(Math.ceil(n[3]))),t.removeAttribute("style"),{markup:new XMLSerializer().serializeToString(t),width:Math.ceil(n[2]),height:Math.ceil(n[3])})}var uk=()=>{let e=getComputedStyle(document.documentElement);return["--surface","--brand"].map(t=>e.getPropertyValue(t).trim()).join(" ")};function dk(e){return Zd.get(`${uk()}
|
|
973
973
|
${e.trim()}`)}async function pk(e){let t=e.trim(),n=`${uk()}
|
|
974
|
-
${t}`;if(Zd.has(n))return Zd.get(n);let s=null;try{let a=await qI();if(a.initialize({startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,flowchart:{htmlLabels:!1},secure:BI,theme:"base",themeVariables:UI(),fontFamily:NI,suppressErrorRendering:!0}),t&&await a.parse(t,{suppressErrors:!0})){let r=WI(),o=await a.render(`diagram-${FI+=1}`,t,r);r.replaceChildren();let l=HI(o.svg);l&&(s={url:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l.markup)}`,width:l.width,height:l.height})}}catch{s=null}return Zd.set(n,s),s}function wm(e){let t=document.createElement("figure");t.className="diagram";let n=document.createElement("img");return n.src=e.url,n.width=e.width,n.height=e.height,n.alt="Diagram",t.append(n),t}function hk(e){let t;try{t=JSON.parse(String(e??"").trim())}catch{return null}if(!t||typeof t!="object"||Array.isArray(t)||!zI.has(t.type)||!Array.isArray(t.data))return null;let n=t.data.filter(a=>a&&typeof a.label=="string"&&typeof a.value=="number"&&Number.isFinite(a.value));if(!n.length||n.some(a=>a.value<0))return null;let s=a=>a&&typeof a=="object"&&typeof a.label=="string"?a.label:null;return{type:t.type,title:typeof t.title=="string"?t.title:null,xLabel:s(t.x),yLabel:s(t.y),data:n}}var GI="http://www.w3.org/2000/svg";function Ss(e,t,n){let s=document.createElementNS(GI,e);for(let[a,r]of Object.entries(t))s.setAttribute(a,String(r));return n!==void 0&&(s.textContent=n),s}var YI=(e,t=14)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e,nc=e=>Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"");function jI(e){let l={width:504,height:246-(e.xLabel?50:34)},c=Math.max(...e.data.map(f=>f.value))||1,u=Ss("svg",{viewBox:"0 0 560 260",role:"img","aria-label":e.title??`${e.type} chart`,class:"chart-plot"});for(let f of[0,.5,1]){let m=14+l.height*(1-f);u.append(Ss("line",{x1:44,x2:548,y1:m,y2:m,class:"chart-grid"}),Ss("text",{x:38,y:m+4,"text-anchor":"end",class:"chart-tick"},nc(c*f)))}let d=l.width/e.data.length,p=Math.ceil(e.data.length/10),h=e.data.map((f,m)=>({...f,x:44+d*(m+.5),y:14+l.height*(1-f.value/c)}));return e.type==="line"&&u.append(Ss("polyline",{points:h.map(f=>`${f.x},${f.y}`).join(" "),class:"chart-line"})),h.forEach((f,m)=>{let b=e.type==="bar"?Ss("rect",{x:f.x-Math.min(d*.35,22),y:f.y,width:Math.min(d*.7,44),height:Math.max(14+l.height-f.y,0),rx:3,class:"chart-bar"}):Ss("circle",{cx:f.x,cy:f.y,r:4,class:"chart-dot"});b.append(Ss("title",{},`${f.label}: ${nc(f.value)}`)),u.append(b),e.data.length<=8&&u.append(Ss("text",{x:f.x,y:f.y-6,"text-anchor":"middle",class:"chart-value"},nc(f.value))),m%p===0&&u.append(Ss("text",{x:f.x,y:14+l.height+16,"text-anchor":"middle",class:"chart-tick"},YI(f.label)))}),e.xLabel&&u.append(Ss("text",{x:44+l.width/2,y:252,"text-anchor":"middle",class:"chart-axis"},e.xLabel)),e.yLabel&&u.append(Ss("text",{x:12,y:14+l.height/2,"text-anchor":"middle",transform:`rotate(-90 12 ${14+l.height/2})`,class:"chart-axis"},e.yLabel)),u}function VI(e){let t=e.data.reduce((c,u)=>c+u.value,0)||1,n=e.data.slice(0,6),s=e.data.slice(6).reduce((c,u)=>c+u.value,0);s>0&&n.push({label:"Other",value:s});let a=document.createElement("div");a.className="chart-pie";let r=Ss("svg",{viewBox:"0 0 200 200",role:"img","aria-label":e.title??"pie chart",class:"chart-plot"}),o=0,l=document.createElement("ul");return n.forEach((c,u)=>{let d=c.value/t,p=o*2*Math.PI-Math.PI/2;o+=d;let h=o*2*Math.PI-Math.PI/2,f=w=>`${100+90*Math.cos(w)} ${100+90*Math.sin(w)}`,m=d>=.9999?Ss("circle",{cx:100,cy:100,r:90,class:`chart-slice chart-shade-${u}`}):Ss("path",{d:`M100 100 L${f(p)} A90 90 0 ${d>.5?1:0} 1 ${f(h)} Z`,class:`chart-slice chart-shade-${u}`});m.append(Ss("title",{},`${c.label}: ${nc(c.value)} (${Math.round(d*100)}%)`)),r.append(m);let b=document.createElement("li"),$=document.createElement("span");$.className=`chart-key chart-shade-${u}`;let y=document.createElement("span");y.textContent=`${c.label} \u2014 ${nc(c.value)} (${Math.round(d*100)}%)`,b.append($,y),l.append(b)}),a.append(r,l),a}function fk(e){let t=document.createElement("figure");if(t.className="chart",t.dataset.chart=e.type,e.title){let n=document.createElement("figcaption");n.textContent=e.title,t.append(n)}return t.append(e.type==="pie"?VI(e):jI(e)),t}var Jd=[{value:"blue",label:"Blue",pantoneName:"Classic Blue",year:2020,pantone:"#0f4c81"},{value:"ultraviolet",label:"Violet",pantoneName:"Ultra Violet",year:2018,pantone:"#5f4b8b"},{value:"vivamagenta",label:"Magenta",pantoneName:"Viva Magenta",year:2023,pantone:"#bb2649"},{value:"peachfuzz",label:"Peach",pantoneName:"Peach Fuzz",year:2024,pantone:"#ffbe98"},{value:"mochamousse",label:"Mocha",pantoneName:"Mocha Mousse",year:2025,pantone:"#a47864"},{value:"greenery",label:"Greenery",pantoneName:"Greenery",year:2017,pantone:"#88b04b"},{value:"emerald",label:"Emerald",pantoneName:"Emerald",year:2013,pantone:"#009473"},{value:"clouddancer",label:"Cloud",pantoneName:"Cloud Dancer",year:2026,pantone:"#f0eee9"}],Ri="clouddancer";var KI="(prefers-color-scheme: dark)";function mk(e){let t=Jd.some(n=>n.value===e)?e:Ri;return t===Ri?delete document.documentElement.dataset.accent:document.documentElement.dataset.accent=t,t}function gk(e){let t=window.matchMedia(KI),n=new MutationObserver(()=>e());return t.addEventListener("change",e),n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-accent"]}),()=>{t.removeEventListener("change",e),n.disconnect()}}Lt.setOptions({gfm:!0,breaks:!1});var XI=new Set(["python","py","bash","sh","shell","zsh","yaml","yml","ruby","rb","toml","dockerfile","makefile","r","perl","ini"]),ZI=new Set(["","text","txt","plaintext","markdown","md","html","xml","svg","csv","mermaid","chart","table"]),JI=new Set("abstract and as async await break case catch class const continue def default defer del do elif else enum except export extends false False finally fn for from func function go if impl implements import in instanceof interface is lambda let match mod mut new nil None not null or package pass private protected pub public raise return self static struct super switch this throw trait true True try type typeof use var void while with yield then fi done esac echo".split(" ")),QI=/^\/api\/files\/(file_[A-Za-z0-9]+)\/content/;function eE(e,t){if(t==="diff"||t==="patch")return e.split(/(?<=\n)/).map(o=>({kind:o.startsWith("+")?"added":o.startsWith("-")?"removed":o.startsWith("@@")?"comment":null,text:o}));let n=XI.has(t)?"#[^\\n]*":t==="json"?"(?!)":t==="sql"?"--[^\\n]*|/\\*[\\s\\S]*?\\*/":t==="css"?"/\\*[\\s\\S]*?\\*/":"//[^\\n]*|/\\*[\\s\\S]*?\\*/",s=new RegExp(`(${n})|("(?:\\\\.|[^"\\\\\\n])*"|'(?:\\\\.|[^'\\\\\\n])*'|\`(?:\\\\.|[^\`\\\\])*\`)|(\\b\\d[\\d_]*(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b)|([A-Za-z_$][\\w$]*)`,"gi"),a=[],r=0;for(let o of e.matchAll(s)){let l=o[1]?"comment":o[2]?"string":o[3]?"number":JI.has(o[4])?"keyword":null;l&&(o.index>r&&a.push({kind:null,text:e.slice(r,o.index)}),a.push({kind:l,text:o[0]}),r=o.index+o[0].length)}return r<e.length&&a.push({kind:null,text:e.slice(r)}),a}function tE(e,t){if(ZI.has(t)||e.textContent.length>6e4)return;let n=eE(e.textContent,t);e.textContent="";for(let s of n)if(!s.kind)e.append(s.text);else{let a=document.createElement("span");a.className=`tok-${s.kind}`,a.textContent=s.text,e.append(a)}}function nE({source:e,display:t}){try{return sk.renderToString(e,{output:"mathml",displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"})}catch{return null}}function sE(e,t,n){let s=t.textContent;if(n==="mermaid"){let a=dk(s);return a?(e.replaceWith(wm(a)),!0):(a===void 0&&(e.dataset.diagram="pending"),!1)}if(n==="chart"){let a=hk(s);return a&&e.replaceWith(fk(a)),!!a}if(n==="table"){let a=document.createElement("template");return a.innerHTML=gd.sanitize(Lt.parse(s),bk),a.content.querySelector("table")?(e.replaceWith(a.content),!0):!1}return!1}function $k(e,t,n){t&&tE(t,n);let s=document.createElement("div");s.className="code-block";let a=document.createElement("div");a.className="code-head";let r=document.createElement("span");r.textContent=(n||"code").toUpperCase();let o=document.createElement("button");return o.type="button",o.className="code-copy",o.textContent="Copy",a.append(r,o),e.replaceWith(s),s.append(a,e),e.dataset.diagram&&(s.dataset.diagram=e.dataset.diagram,delete e.dataset.diagram),s}var bk={FORBID_TAGS:["style","form","input","button","iframe"],FORBID_ATTR:["style"]};function aE(e){let t=document.createElement("template"),{text:n,maths:s}=jb(e??"");t.innerHTML=gd.sanitize(Lt.parse(n),bk);let a=t.content;for(let r of a.querySelectorAll("span[data-math]")){let o=s[Number(r.dataset.math)],l=o?nE(o):null;if(!l){r.replaceWith(o?o.source:"");continue}r.className=o.display?"math math-display":"math",r.removeAttribute("data-display"),r.innerHTML=l}for(let r of a.querySelectorAll("pre")){let o=r.querySelector("code"),l=/language-([\w+-]+)/.exec(o?.className??"")?.[1]?.toLowerCase()??"";o&&sE(r,o,l)||$k(r,o,l)}for(let r of a.querySelectorAll("a[href]")){let o=r.children.length===0?Vb(r.getAttribute("href"),r.textContent):null;o&&(r.className="github-chip",r.dataset.github=o.kind,r.textContent=o.label)}for(let r of a.querySelectorAll("table")){let o=document.createElement("div");o.className="table-scroll",r.replaceWith(o),o.append(r)}for(let r of a.querySelectorAll("img")){let o=r.getAttribute("src")??"",l=QI.exec(o);if(!o.startsWith("data:image/"))if(l)r.removeAttribute("src"),r.dataset.fileId=l[1],r.classList.add("md-image");else if(km(o))r.replaceWith(yk(o,r.getAttribute("alt")||"Image","ask"));else{let c=document.createElement("a");c.href=o,c.textContent=r.getAttribute("alt")||"Image",r.replaceWith(c)}}return t.innerHTML}function km(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.hostname:null}catch{return null}}function yk(e,t,n){let s=document.createElement("span");s.className=`remote-media ${n==="failed"?"is-failed":""}`,s.dataset.remoteMedia="image",s.dataset.src=e;let a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","remote-media-glyph"),a.setAttribute("viewBox","0 0 24 24"),a.setAttribute("aria-hidden","true");for(let[u,d]of wu[n==="failed"?"lucide-triangle-alert":"lucide-image-off"]??[]){let p=document.createElementNS("http://www.w3.org/2000/svg",u);for(let[h,f]of Object.entries(d))p.setAttribute(h,f);a.append(p)}let r=document.createElement("span");r.className="remote-media-name",r.textContent=t;let o=document.createElement("span");o.className="remote-media-host",o.textContent=n==="failed"?`couldn\u2019t load from ${km(e)}`:km(e);let l=document.createElement("button");l.type="button",l.className="remote-media-load",l.textContent=n==="failed"?"Retry":"Load";let c=document.createElement("a");return c.href=e,c.className="remote-media-open",c.textContent="Open",s.append(a,r,o,l,c),s}function rE(e){let t=e.dataset.src,n=e.querySelector(".remote-media-name")?.textContent||"Image",s=document.createElement("img");s.className="md-image",s.alt=n,s.addEventListener("error",()=>s.replaceWith(yk(t,n,"failed")),{once:!0}),s.src=t,e.replaceWith(s)}function vk(e){let t=e.target.closest?.(".code-copy");if(t){let r=t.closest(".code-block")?.querySelector("pre")?.textContent??"";Qe.copy({text:r}).then(()=>{t.textContent="Copied",setTimeout(()=>{t.textContent="Copy"},1400)},()=>{});return}let n=e.target.closest?.(".remote-media-load");if(n){rE(n.closest(".remote-media"));return}let s=e.target.closest?.("img[data-file-id]");if(s){jt({fileId:s.dataset.fileId,name:s.getAttribute("alt")||"Image",mediaType:"image/*"});return}let a=e.target.closest?.("a[href]");a&&(e.preventDefault(),ct.openExternal({url:a.href}).catch(()=>{}))}function oE(e){let[t,n]=g(0);return D(()=>{if(!e)return;let s=()=>n(r=>r+1),a=[gk(s),ge("appearance:changed",s)];return()=>a.forEach(r=>r())},[e]),e?t:0}function gr({text:e,document:t=!1}){let n=oE(String(e??"").includes("mermaid")),s=Ve(()=>aE(e),[e,n]),a=Y(null);return D(()=>{let r=!0;for(let o of a.current?.querySelectorAll("img[data-file-id]:not([src])")??[])Ql({fileId:o.dataset.fileId}).then(l=>{r&&(o.src=l)},()=>{o.replaceWith(o.getAttribute("alt")||"Image")});for(let o of a.current?.querySelectorAll('.code-block[data-diagram="pending"]')??[])o.dataset.diagram="drawing",pk(o.querySelector("pre")?.textContent??"").then(l=>{!r||!o.isConnected||(l?o.replaceWith(wm(l)):o.dataset.diagram="source")});return()=>{r=!1}},[s,n]),i`<div key=${n} ref=${a} class=${`markdown ${t?"markdown-document":""}`} onClick=${vk} dangerouslySetInnerHTML=${{__html:s}} />`}function wk({text:e,language:t}){let n=Ve(()=>{let s=document.createElement("template"),a=document.createElement("pre"),r=document.createElement("code");return r.textContent=e??"",a.append(r),s.content.append(a),$k(a,r,String(t??"").toLowerCase()),s.innerHTML},[e,t]);return i`<div class="markdown markdown-code" onClick=${vk} dangerouslySetInnerHTML=${{__html:n}} />`}function kk({markup:e}){let t=Ve(()=>gd.sanitize(e??"",{FORBID_TAGS:["style","form","input","button","iframe","img","a"],FORBID_ATTR:["style"]}),[e]);return i`<div class="markdown markdown-document" dangerouslySetInnerHTML=${{__html:t}} />`}var xk=new Set(["text/html","application/xhtml+xml"]),Sk="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Ck={[Sk]:"word","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation":"slides"},iE=new Set(["text/markdown","text/plain"]),lE=new Set(["text/csv","text/tab-separated-values"]),cE=new Set(["application/json","application/x-ndjson","application/geo+json","application/yaml","application/x-yaml","application/toml","application/xml","application/sql","application/javascript","application/x-sh"]),Li=new Set(Object.values(Ck)),Fo=e=>String(e??"").split(";",1)[0].trim().toLowerCase();function uE(e){let t=Fo(e);return iE.has(t)||xk.has(t)||t.startsWith("image/")?!1:t.startsWith("text/")||cE.has(t)||t.endsWith("+json")||t.endsWith("+xml")}function sc(e){return!e?.artifactId||e.version!==e.currentVersion?!1:e.office!==void 0?!0:e.kind==="site"||e.kind==="code"||Qd(e)||e.kind==="markdown"&&(e.html===void 0||Fo(e.mediaType)===Sk)}function xm(e){return!!(e&&!e.sourceLine&&e.owned!==!1&&e.kind!=="site"&&!Qd(e)&&(!e.artifactId||e.version===e.currentVersion)&&(e.documentSource?e.documentSource.editable!==!1:sc(e)))}function Qd(e){return e?.kind==="sheet"&&e.office===void 0&&lE.has(Fo(e.mediaType))}function ep(e){let t=Ck[Fo(e.mediaType)];return t||(e.format!=="file"||xk.has(Fo(e.mediaType))?"page":uE(e.mediaType)?"code":"text")}function Ak(e){return e?.office!==void 0&&(e.kind==="sheet"||e.kind==="slides")}var dE={create:"Created",update:"Edited",delete:"Deleted"},Qn=class extends Error{constructor(t,n){super(n),this.code=t}};function Va(e){if(e?.isCurrent&&!e.isCurrent())throw new Qn("account_changed","The account changed. Open this document again.")}function Tk(e,t){return{key:`artifact:${t}`,read:()=>e.source({artifactId:t}),save:(n,s)=>(Va(s),e.saveSource({artifactId:t,...n}))}}function tp(e,{workspace:t,storeId:n,noteId:s,readOnly:a=!1}){let r="",o="",l=new Map,c=async(u,d,p)=>{Va(p);try{return o=(await e.saveNote({workspace:t,storeId:n,noteId:s,path:r,content:u,sha:d})).content_sha256,{revision:o}}catch(h){throw h?.code==="precondition_failed"?new Qn("revision_conflict","This note changed elsewhere."):h}};return{key:`memory:${t}:${n}:${s}`,async read(){let u=await e.note({workspace:t,storeId:n,noteId:s});return r=u.path,o=u.content_sha256,{format:"file",mediaType:"text/markdown",text:u.content??"",revision:u.content_sha256,editable:!a,maxBytes:102400}},async save(u,d){if(a)throw new Qn("artifact_unavailable","Archived stores are read-only.");return c(String(u.text??""),u.revision,d)},async history(){let u=await e.noteVersions({workspace:t,storeId:n,noteId:s});l.clear();for(let d of u.memory_versions)l.set(d.id,d);return u.memory_versions.map(d=>({id:d.id,label:dE[d.operation]??d.operation,at:d.created_at,restorable:d.content!==null}))},async restore(u,d){let p=l.get(u);if(!p||p.content===null)throw new Qn("not_found","That version cannot be restored.");return c(p.content,o,d)}}}var pE=1048576,Mk={md:"text/markdown",markdown:"text/markdown",json:"application/json",yaml:"text/yaml",yml:"text/yaml"};function np(e,{skillId:t,path:n}){let s=new Map,a=async l=>{Va(l);let c=await e.skill({id:t});if(Va(l),!c.revisionId)throw new Qn("not_found","This skill has no saved version.");return c},r=async(l,c,u)=>{let d=[];for(let p of c){Va(u);try{d.push({path:p.path,text:(await e.skillFile({id:t,revisionId:l,path:p.path})).content})}catch{throw new Qn("artifact_unavailable",`${p.path} could not be read as text, so this skill can only be changed by uploading a new version.`)}Va(u)}return d},o=async(l,c)=>(Va(c),{revision:(await e.saveSkill({id:t,files:l})).id});return{key:`skill:${t}:${n}`,async read(){let l=await a(),{content:c}=await e.skillFile({id:t,revisionId:l.revisionId,path:n}),u=n.split(".").pop()?.toLowerCase()??"";return{format:"file",mediaType:Mk[u]??"text/plain",text:c,revision:l.revisionId,editable:!0,maxBytes:pE}},async save(l,c){let u=await a(c);if(u.revisionId!==l.revision)throw new Qn("revision_conflict","This skill changed elsewhere.");let d=await r(u.revisionId,u.files,c);return o(d.map(p=>p.path===n?{path:n,text:String(l.text??"")}:p),c)},async history(){let l=[...await e.skillRevisions({id:t})].sort((c,u)=>String(u.createdAt??"").localeCompare(String(c.createdAt??"")));s.clear();for(let c of l)s.set(c.id,c);return l.map((c,u)=>({id:c.id,label:`Version ${l.length-u}`,at:c.createdAt,restorable:u>0}))},async restore(l,c){let u=s.get(l);if(!u)throw new Qn("not_found","That version could not be found.");return o(await r(u.id,u.files,c),c)}}}function sp(e,{agentId:t}){let n=null,s=new Map,a=async(r,o,l)=>{Va(l);try{return n=(await e.savePrompt({id:t,prompt:r,expectedVersion:o})).version,{revision:String(n)}}catch(c){throw c?.code==="version_conflict"?new Qn("revision_conflict",c.message):c}};return{key:`agent-prompt:${t}`,async read(){let r=await e.prompt({id:t});return n=r.promptVersion,{format:"file",mediaType:"text/markdown",text:r.prompt??"",revision:n===null?"none":String(n),editable:!r.archived,maxBytes:1e5}},async save(r,o){let l=r.revision==="none"?null:Number(r.revision);if(l!==null&&(!Number.isSafeInteger(l)||l<1))throw new Qn("revision_conflict","Reload these instructions before saving.");return a(String(r.text??""),l,o)},async history(){let r=await e.promptVersions({id:t});s.clear();for(let o of r)s.set(String(o.version),o);return r.map(o=>({id:String(o.version),label:`Version ${o.version}`,at:o.createdAt,restorable:!o.active}))},async restore(r,o){let l=s.get(r);if(!l)throw new Qn("not_found","That version could not be found.");return a(l.content,n,o)}}}var hE=2*1024*1024,fE={...Mk,css:"text/css",html:"text/html",htm:"text/html",svg:"image/svg+xml",js:"text/javascript",jsx:"text/javascript",csv:"text/csv",txt:"text/plain"};function Ik(e,{id:t,path:n}){let s=n??null,a=null,r=async(o,l,c)=>{Va(c);try{return a=(await e.saveDesignSystemFile({id:t,path:s,baseVersion:Number(l),...o})).version,{revision:String(a)}}catch(u){throw u?.code==="conflict"||u?.status===409?new Qn("revision_conflict","Someone saved a newer version of this design system."):u}};return{key:`design-system:${t}:${n??""}`,async read(){let o=await e.designSystemFile({id:t,path:s});s=o.path,a=o.version;let l=s.split(".").pop()?.toLowerCase()??"";return{format:"file",mediaType:fE[l]??"text/plain",text:o.text,revision:String(o.version),editable:o.editable,maxBytes:hE,libraryRef:o.libraryRef}},save:(o,l)=>r({content:String(o.text??"")},o.revision,l),async history(){return(await e.designSystemFile({id:t,path:s})).history.map((l,c)=>({id:String(l.version),label:`Version ${l.version}`,at:l.at,restorable:c>0}))},restore:(o,l)=>r({restoreVersion:Number(o)},a,l)}}var mE=1048576,gE=/^<!-- meeting-note:(?:begin|end) -->\n?/gm;function Ek(e,{file:t}){return{key:`meeting:${t}`,versioned:!1,async read(){let{content:n,sha:s}=await e.read({file:t});if(n==null)throw new Qn("not_found","This meeting note is not on this Mac any more.");return{format:"file",mediaType:"text/markdown",text:String(n).replace(gE,""),revision:s,editable:!0,maxBytes:mE}},async save(n,s){Va(s);try{return{revision:(await e.save({file:t,content:String(n.text??""),sha:n.revision})).sha}}catch(a){throw a?.code==="precondition_failed"?new Qn("revision_conflict","This note changed on this Mac."):a}},async history(){return[]},async restore(){throw new Qn("not_found","This note has no saved versions.")}}}var Rs="draft:";var so=(e,t)=>{try{return e()}catch{return t}},ac=e=>typeof e=="string"?{email:e}:e??{},oc=e=>e?.ownerId||e?.ownerEmail||e?.ownerLocalId?{userId:e.ownerId??null,email:e.ownerEmail??null,localCredentialId:e.ownerLocalId??null}:null;function fs(e){let{userId:t,email:n,localCredentialId:s}=ac(e);return[t?`user:${t}`:null,n||null,s?`credential:${s}`:null].filter(Boolean)}function Mn(e,t){let n=ac(e),s=ac(t);return n.userId&&s.userId?n.userId===s.userId:!!(n.localCredentialId&&n.localCredentialId===s.localCredentialId||n.email&&n.email===s.email)}function $E(e,t,n=Date.now(),s=null){return so(()=>{let a=e.getItem(`${Rs}${t}`);if(!a)return"";let r=JSON.parse(a),o=oc(r);if(o&&!Mn(o,s)||!o&&r?.machineLocal!==!0)return"";if(typeof r?.text!="string"||!Number.isFinite(r.expires)||n>r.expires)return r.legacyRecovery?e.setItem(`${Rs}${t}`,JSON.stringify({legacyRecovery:r.legacyRecovery})):e.removeItem(`${Rs}${t}`),"";let l=ac(s);return o&&!o.userId&&l.userId&&so(()=>e.setItem(`${Rs}${t}`,JSON.stringify({...r,ownerId:l.userId}))),r.text},"")}function Tm(e,t){return so(()=>oc(JSON.parse(e.getItem(`${Rs}${t}`))),null)}function Mm(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>!["experience","title","placeholder","examples","attempt"].includes(n))||typeof e.experience!="string"||!e.experience||e.experience.length>500||typeof e.title!="string"||e.title.length>2e3||e.placeholder!==void 0&&typeof e.placeholder!="string"||e.examples!==void 0&&(!Array.isArray(e.examples)||e.examples.some(n=>typeof n!="string")))return null;let t=e.attempt;return t!==void 0&&(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(n=>!["requestId","text","workspace","playgroundId","sessionId"].includes(n))||typeof t.requestId!="string"||!t.requestId||typeof t.text!="string"||!(t.workspace===null||typeof t.workspace=="string")||t.playgroundId!==void 0&&(typeof t.playgroundId!="string"||!t.playgroundId)||t.sessionId!==void 0&&(typeof t.sessionId!="string"||!t.sessionId))?null:e}function _k(e,t,n,s,a,r){return so(()=>{if(typeof n!="string")return!1;let o=e.getItem(`${Rs}${t}`),l=so(()=>JSON.parse(o),null),c=oc(l),u=ac(a);if(c&&fs(u).length&&!Mn(c,u))return!1;let d=l?.legacyRecovery??(o&&!c&&l?.machineLocal!==!0?{raw:o}:null),p={...d?{legacyRecovery:d}:{},...r.legacyAdoption??l?.legacyAdoption?{legacyAdoption:r.legacyAdoption??l.legacyAdoption}:{}},h=r.experience===void 0?n?Mm(l?.experience):null:r.experience;if(h?.attempt&&h.attempt.text!==n){let{attempt:f,...m}=h;h=m}if(!n&&!h)d?e.setItem(`${Rs}${t}`,JSON.stringify({legacyRecovery:d})):e.removeItem(`${Rs}${t}`);else{let f=c?{...u,...Object.fromEntries(Object.entries(c).filter(([,b])=>b))}:u,m=JSON.stringify({text:n,expires:s+864e5,...p,...h?{experience:h}:{},...f.userId?{ownerId:f.userId}:{},...f.email?{ownerEmail:f.email}:{},...f.localCredentialId?{ownerLocalId:f.localCredentialId}:{},...fs(f).length?{}:{machineLocal:!0}});return e.setItem(`${Rs}${t}`,m),e.getItem(`${Rs}${t}`)===m}return!0},!1)}function ic(e,t,n,s=Date.now(),a=null,r=null){return _k(e,t,n,s,a,{legacyAdoption:r})}function Rk(e,t,n=null,s=Date.now()){return so(()=>{let a=JSON.parse(e.getItem(`${Rs}${t}`)),r=oc(a);return(r?!Mn(r,n):a?.machineLocal!==!0||fs(n).length)||!Number.isFinite(a.expires)||s>a.expires?null:Mm(a.experience)},null)}function qo(e,t,n,s,a=Date.now(),r=null){let o=s===null?null:Mm(s);if(s!==null&&!o)return!1;let l=so(()=>JSON.parse(e.getItem(`${Rs}${t}`)),null),c=oc(l);return c&&!Mn(c,r)?!1:_k(e,t,n,a,r,{experience:o})}function Di(e,t=Date.now(),n=null){let s=so(()=>Array.from({length:e.length},(r,o)=>e.key(o)),[]),a={};for(let r of s){if(typeof r!="string"||!r.startsWith(Rs))continue;let o=r.slice(Rs.length),l=$E(e,o,t,n);l&&(a[o]=l)}return a}function Lk(e,t,n,s=Date.now(),a=null){for(let r of new Set([...Object.keys(t??{}),...Object.keys(n??{})]))(t?.[r]??"")!==(n?.[r]??"")&&ic(e,r,n?.[r]??"",s,typeof a=="function"?a(r):a)}function Ok(e,t){return Object.entries(e).filter(([n,s])=>n!==t&&/^new(?::[a-f0-9-]{36})?$/.test(n)&&s.trim()).map(([n,s])=>({key:n,text:s}))}var ap=null,Sm=0,rc=new Map,Cm=new Map,Oi=new Map,Am=new Set;function Im(){let e=[...rc.values()],t=Cm.values().next().value??e.find(n=>n.error)?.error??null;return{ready:!t&&Sm===0&&!e.some(n=>n.pending),error:t}}function Dk(){let e=Im();if(!(!e.ready&&!e.error)){for(let t of Am)t(e);Am.clear()}}function Nk(){let e=Symbol();return(t,n=null,s=null)=>{t||n?rc.set(e,{pending:t,error:n,scope:s}):rc.delete(e),Dk()}}function rp(){let e=Im();return e.ready||e.error?Promise.resolve(e):new Promise(t=>Am.add(t))}typeof window<"u"&&window.addEventListener("beforeunload",e=>{Im().ready||(e.preventDefault(),e.returnValue="Your latest edits are still being kept on this Mac.")});function bE(){return ap||(ap=new Promise((e,t)=>{let n=indexedDB.open("agentsky-document-drafts",1);n.onupgradeneeded=()=>n.result.createObjectStore("drafts"),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}).catch(e=>{throw ap=null,e})),ap}var op=(e,t)=>JSON.stringify([e,t]);async function lc(e,t,n){let s=t===void 0,a=!s&&t!==null;if(s&&Oi.has(e))return Oi.get(e).value;a&&(Sm+=1);let r=!1,o=n?.previous??null,l=Oi.get(e);try{let c=await bE(),u=await new Promise((d,p)=>{let h=c.transaction("drafts",s?"readonly":"readwrite",{durability:"strict"}),f=h.objectStore("drafts"),m=f.get(e);m.onsuccess=()=>{if(s)return;let b=m.result;if(o=b?.owner??null,b&&n&&b.owner!==n.owner&&b.owner!==n.previous){r=!0,h.abort();return}t===null?f.delete(e):f.put({...t,...n?{owner:n.owner}:{}},e)},h.oncomplete=()=>d(s?m.result??null:null),h.onabort=()=>p(h.error||m.error||new Error("A newer draft is open in another editor. Keep this editor open and copy your edits.")),h.onerror=()=>{}});if(!s&&Oi.get(e)===l&&Oi.delete(e),s||Cm.delete(e),!s)for(let[d,p]of rc)p.error&&p.scope?.key===e&&n&&(n.clearFailure===!0||p.scope.owner!==n.owner)&&rc.delete(d);return u}catch(c){throw a&&!r&&(Oi.set(e,{value:{...t,owner:o}}),Cm.set(e,"A document draft could not be kept on this Mac. Copy or save the draft, or retry saving before closing.")),c}finally{a&&(Sm-=1),Dk()}}function Pk(e,t){if(!e||typeof e.draft!="string"||!e.source||typeof e.source.content!="string"||!["number","string"].includes(typeof e.source.revision)||e.source.kind!==t.kind||e.draft===t.content)return null;let n=String(e.source.revision)!==String(t.revision);return{draft:e.draft,source:{...t,revision:e.source.revision,content:e.source.content},pending:n?null:e.pending??null,conflict:n,recovered:!n,error:n?"This document changed elsewhere. Your recovered draft is kept. Copy or save your draft before reloading the saved version.":null}}var yE=1200,vE={word:"Word document",sheet:"Spreadsheet",slides:"Presentation"},Bk=new Set(["text","code"]),Ni=[.25,.5,1,2,4],wE=8*1024*1024,kE=[{prop:"color",label:"Text color",color:!0},{prop:"background-color",label:"Background color",color:!0},{prop:"border-color",label:"Border color",color:!0},{prop:"font-family",label:"Font"},{prop:"font-size",label:"Font size"},{prop:"font-weight",label:"Font weight"},{prop:"border-radius",label:"Border radius"},{prop:"border-width",label:"Border width"},{prop:"width",label:"Width"},{prop:"height",label:"Height"},{prop:"opacity",label:"Opacity"},{prop:"padding",label:"Padding"},{prop:"margin",label:"Margin"},{prop:"flex-direction",label:"Direction",options:["row","column","row-reverse","column-reverse"]},{prop:"justify-content",label:"Justify",options:["flex-start","center","flex-end","space-between","space-around","space-evenly"]},{prop:"align-items",label:"Align",options:["stretch","flex-start","center","flex-end","baseline"]},{prop:"gap",label:"Gap"},{prop:"row-gap",label:"Row gap"},{prop:"column-gap",label:"Column gap"}],Fk=e=>new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),cc=null;function xE(){if(!cc){let e=document.createElement("link");e.rel="stylesheet",e.href="/editors/editors.css",document.head.append(e),cc=import("/editors/editors.mjs"),cc.catch(()=>{cc=null})}return cc}function qk(){let[e,t]=g(null),[n,s]=g(null);return D(()=>{let a=!0;return xE().then(r=>{a&&t(r)},()=>{a&&s("The editor could not load. Close it and try again.")}),()=>{a=!1}},[]),{module:e,error:n}}function Uo(e,t){return e.generation===t.generation&&!(e.userId&&t.userId&&!Mn(e,t))}function SE(e,t,n){let[s,a]=g({source:null,draft:"",pending:null,busy:!1,error:null,conflict:!1,recovered:!1,denied:!1,loading:!0,preparing:!1,loads:0}),r=Y(s),o=Y(null),l=Y([]),c=Y(void 0),u=Y(null),d=Y(null),p=Y(!1),h=Y(0),f=Y(0),m=Y(!1),b=Y(crypto.randomUUID()),$=Y(null),y=Y(Promise.resolve()),w=Y(0),v=Y(null),k=Y(null),I=Y(Nk()),C=()=>I.current(w.current>0||r.current.preparing,v.current||k.current,{key:o.current,owner:b.current}),[S,E]=g(null),A=(F,{clearFailure:H=!1}={})=>{if(!o.current)return Promise.resolve(!0);let ae=o.current,j=l.current.slice(),U=F!==null;U&&(w.current+=1),C();let ie=y.current.catch(()=>{}).then(async()=>{await lc(ae,F,{owner:b.current,previous:$.current,clearFailure:H});for(let ce of j)await lc(ce.key,null,{owner:b.current,previous:ce.owner,clearFailure:H});l.current=l.current.filter(ce=>!j.includes(ce))});return y.current=ie,ie.then(()=>($.current=b.current,k.current=null,E(null),!0),()=>(k.current="Your draft could not be kept on this Mac. Keep this editor open and copy or download your draft before leaving.",E(k.current),!1)).finally(()=>{U&&(w.current-=1),C()})},_=(F,H=!0)=>{r.current={...r.current,...F},p.current||a(r.current);let ae=r.current;C(),H&&ae.source&&!ae.loading&&A(ae.draft===ae.source.content&&!ae.preparing?null:{source:ae.source,draft:ae.draft,pending:ae.pending})},R=()=>{p.current=!0,h.current+=1,a({source:null,draft:"",pending:null,busy:!1,error:"The account changed. Open this document again.",conflict:!1,recovered:!1,denied:!0,loading:!1,preparing:!1,loads:0})},W=async({discard:F=!1}={})=>{if(p.current)return;let H=++h.current;m.current=!0,v.current=null;let ae=()=>H===h.current;_({loading:!0,error:null,conflict:!1,recovered:!1,pending:null,preparing:!1});try{if(F&&!await A(null,{clearFailure:!0})){m.current=!1,_({loading:!1});return}let j=await Xt.state(),{generation:U}=j;if(!ae())return;if(d.current&&!Uo(d.current,j)){R();return}let ie={...j,...Object.fromEntries(Object.entries(d.current??{}).filter(([,Ne])=>Ne!=null))};c.current=U,u.current=ie;let ce=fs(ie).map(Ne=>op(Ne,e.key)),[me,qe]=await Promise.all([e.read(),y.current.catch(()=>{}).then(()=>F?[]:Promise.all(ce.map(async Ne=>({key:Ne,saved:await lc(Ne)}))))]);if(!ae())return;let re=fs(u.current).map(Ne=>op(Ne,e.key)),$e=re.filter(Ne=>!ce.includes(Ne)),Me=!F&&$e.length?await Promise.all($e.map(async Ne=>({key:Ne,saved:await lc(Ne)}))):[];if(!ae())return;let fe=re.map(Ne=>[...qe,...Me].find(He=>He.key===Ne)).filter(Boolean),Ce=re[0]??null,pe=fe.find(Ne=>Ne.saved)?.saved??null,dt=ep(me),je=(dt==="word"?me.docx??me.office:dt==="sheet"||dt==="slides"?me.office:Bk.has(dt)?me.text:me.html)??"";o.current=Ce,$.current=fe.find(Ne=>Ne.key===Ce)?.saved?.owner??null,l.current=fe.filter(Ne=>Ne.key!==Ce&&Ne.saved).map(Ne=>({key:Ne.key,owner:Ne.saved.owner??null}));let _e={revision:me.revision,content:je,kind:dt,plain:Fo(me.mediaType)==="text/plain",editable:me.editable===!0,maxBytes:me.maxBytes},Pe=Pk(pe,_e);pe&&await A(Pe?{source:Pe.source,draft:Pe.draft,pending:Pe.pending}:null),ae()&&(m.current=!1,_({loading:!1,denied:!1,draft:je,loads:++f.current,source:_e,...Pe},!1))}catch(j){ae()&&_({loading:!1,error:j.message,denied:j.code==="artifact_unavailable"})}};D(()=>{W();let F=ge("auth:changed",H=>{if(d.current=H,c.current!==void 0){if(Uo(H,u.current)){u.current={...u.current,...Object.fromEntries(Object.entries(H).filter(([,U])=>U!=null))};let ae=fs(u.current)[0],j=ae?op(ae,e.key):null;if(j&&j!==o.current){o.current&&l.current.push({key:o.current,owner:b.current}),o.current=j,$.current=null;let U=r.current;U.source&&!U.loading&&A(U.draft===U.source.content&&!U.preparing?null:{source:U.source,draft:U.draft,pending:U.pending})}return}R()}});return()=>{h.current+=1,F()}},[e.key]);let O=Y(null);D(()=>{let F=O.current;if(!F||F.key!==e.key){O.current={key:e.key,revision:n};return}if(n===void 0||F.revision===n)return;let H=r.current;if(!(H.busy||H.preparing)){if(O.current={key:e.key,revision:n},!H.source){W();return}String(H.source.revision)!==String(n)&&(H.pending||H.draft!==H.source.content?_({conflict:!0,error:"This document changed elsewhere. Your draft is kept. Copy your draft before reloading the saved version."}):W())}},[e.key,n,s.busy,s.preparing]);let L=Li.has(s.source?.kind)?Math.floor(s.draft.length*3/4):new TextEncoder().encode(s.draft).length,Q=!!s.source&&L>s.source.maxBytes,V=!!s.source&&s.draft!==s.source.content,ee=async()=>{let F=r.current,H=h.current;if(p.current||!F.source||F.busy||F.denied||F.preparing||!F.source.editable)return!1;let ae={word:"docx",sheet:"office",slides:"office",text:"text",code:"text",page:"html"}[F.source.kind],j=F.pending??{requestId:crypto.randomUUID(),revision:F.source.revision,[ae]:F.draft};_({pending:j,busy:!0,error:null,conflict:!1,recovered:!1});try{let U=await e.save(j,{isCurrent:()=>!p.current&&H===h.current});return H!==h.current||(_({pending:null,busy:!1,source:{...r.current.source,revision:U.revision,content:j[ae]}}),t(Number(U.revision))),!0}catch(U){if(H!==h.current)return!1;let ie=U.code==="revision_conflict",ce=F.source.kind;return _({busy:!1,pending:U.code==="save_unfinished"?j:null,conflict:ie,denied:U.code==="artifact_unavailable",error:ie?Li.has(ce)?"This document changed elsewhere. Your draft is kept. Save a copy of your draft before reloading the saved version.":Bk.has(ce)?"This document changed elsewhere. Your draft is kept. Copy your draft before reloading the saved version.":"This artifact changed elsewhere. Your edits are kept. Copy the HTML before reloading.":U.message||"Changes could not be saved. Your edits are kept; try again."}),!1}},K=V&&!s.busy&&!s.pending&&!s.error&&!s.recovered&&!s.denied&&!s.preparing&&!Q&&s.source?.editable;D(()=>{if(!K)return;let F=setTimeout(()=>{ee()},yE);return()=>clearTimeout(F)},[K,s.draft]);let z=Y(()=>{});return z.current=()=>K?ee():Promise.resolve(!V&&!s.preparing),D(()=>{let F=()=>{z.current()};return window.addEventListener("blur",F),()=>{window.removeEventListener("blur",F),F()}},[]),{state:s,dirty:V,oversize:Q,size:L,save:ee,load:W,draftError:S,discard:async()=>{m.current=!0;let F=await A(null,{clearFailure:!0});return F?(v.current=null,r.current={...r.current,preparing:!1},C()):m.current=!1,F},flush:()=>z.current(),edit:(F,H)=>{!m.current&&!r.current.loading&&H===r.current.loads&&_({draft:F})},preparing:(F,H,ae=null)=>{!m.current&&!r.current.loading&&H===r.current.loads&&(v.current=ae,_({preparing:F}))}}}function Uk({view:e}){let{module:t,error:n}=qk();return n?i`<div class="panel-state"><p role="alert">${n}</p></div>`:t?i`<${ip} key=${`${e.artifactId??e.title}:${e.version??""}`} module=${t} mount="mountOfficeEditor" props=${{kind:e.kind,value:e.office,fileName:e.title,disabled:!0,onChange:()=>{},onPendingChange:()=>{}}} />`:i`<div class="panel-state"><${ne} /><p>Loading the editor…</p></div>`}function ip({module:e,mount:t,props:n}){let s=Y(null),a=Y(null);return Ct(()=>(a.current=e[t](s.current,n),()=>{a.current?.destroy(),a.current=null}),[e,t]),D(()=>{a.current?.update(n)}),i`<div class="editor-island" ref=${s}></div>`}var CE=e=>{let t=/^rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(String(e));return t?`#${t.slice(1,4).map(n=>Number(n).toString(16).padStart(2,"0")).join("")}`:/^#[0-9a-f]{6}$/i.test(e)?e:"#000000"},AE=["top","right","bottom","left"],TE=["top-left","top-right","bottom-right","bottom-left"],ME=e=>e.every(t=>t===e[0])?e[0]:e.join(" "),uc=(e,t)=>{let n=t.includes("{corner}")?TE.map(s=>e[t.replace("{corner}",s)]):AE.map(s=>e[t.replace("{side}",s)]);return n.every(s=>typeof s=="string"&&s)?ME(n):void 0};function zk(e){return{...e,padding:e.padding||uc(e,"padding-{side}"),margin:e.margin||uc(e,"margin-{side}"),"border-color":e["border-color"]||uc(e,"border-{side}-color"),"border-width":e["border-width"]||uc(e,"border-{side}-width"),"border-radius":e["border-radius"]||uc(e,"border-{corner}-radius")}}function IE({computed:e,onChange:t}){let[n,s]=g(()=>zk(e));D(()=>s(zk(e)),[e]);let a=(r,o)=>{s(l=>({...l,[r]:o})),t({[r]:o})};return i`
|
|
974
|
+
${t}`;if(Zd.has(n))return Zd.get(n);let s=null;try{let a=await qI();if(a.initialize({startOnLoad:!1,securityLevel:"strict",htmlLabels:!1,flowchart:{htmlLabels:!1},secure:BI,theme:"base",themeVariables:UI(),fontFamily:NI,suppressErrorRendering:!0}),t&&await a.parse(t,{suppressErrors:!0})){let r=WI(),o=await a.render(`diagram-${FI+=1}`,t,r);r.replaceChildren();let l=HI(o.svg);l&&(s={url:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l.markup)}`,width:l.width,height:l.height})}}catch{s=null}return Zd.set(n,s),s}function wm(e){let t=document.createElement("figure");t.className="diagram";let n=document.createElement("img");return n.src=e.url,n.width=e.width,n.height=e.height,n.alt="Diagram",t.append(n),t}function hk(e){let t;try{t=JSON.parse(String(e??"").trim())}catch{return null}if(!t||typeof t!="object"||Array.isArray(t)||!zI.has(t.type)||!Array.isArray(t.data))return null;let n=t.data.filter(a=>a&&typeof a.label=="string"&&typeof a.value=="number"&&Number.isFinite(a.value));if(!n.length||n.some(a=>a.value<0))return null;let s=a=>a&&typeof a=="object"&&typeof a.label=="string"?a.label:null;return{type:t.type,title:typeof t.title=="string"?t.title:null,xLabel:s(t.x),yLabel:s(t.y),data:n}}var GI="http://www.w3.org/2000/svg";function Ss(e,t,n){let s=document.createElementNS(GI,e);for(let[a,r]of Object.entries(t))s.setAttribute(a,String(r));return n!==void 0&&(s.textContent=n),s}var YI=(e,t=14)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e,nc=e=>Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"");function jI(e){let l={width:504,height:246-(e.xLabel?50:34)},c=Math.max(...e.data.map(f=>f.value))||1,u=Ss("svg",{viewBox:"0 0 560 260",role:"img","aria-label":e.title??`${e.type} chart`,class:"chart-plot"});for(let f of[0,.5,1]){let m=14+l.height*(1-f);u.append(Ss("line",{x1:44,x2:548,y1:m,y2:m,class:"chart-grid"}),Ss("text",{x:38,y:m+4,"text-anchor":"end",class:"chart-tick"},nc(c*f)))}let d=l.width/e.data.length,p=Math.ceil(e.data.length/10),h=e.data.map((f,m)=>({...f,x:44+d*(m+.5),y:14+l.height*(1-f.value/c)}));return e.type==="line"&&u.append(Ss("polyline",{points:h.map(f=>`${f.x},${f.y}`).join(" "),class:"chart-line"})),h.forEach((f,m)=>{let b=e.type==="bar"?Ss("rect",{x:f.x-Math.min(d*.35,22),y:f.y,width:Math.min(d*.7,44),height:Math.max(14+l.height-f.y,0),rx:3,class:"chart-bar"}):Ss("circle",{cx:f.x,cy:f.y,r:4,class:"chart-dot"});b.append(Ss("title",{},`${f.label}: ${nc(f.value)}`)),u.append(b),e.data.length<=8&&u.append(Ss("text",{x:f.x,y:f.y-6,"text-anchor":"middle",class:"chart-value"},nc(f.value))),m%p===0&&u.append(Ss("text",{x:f.x,y:14+l.height+16,"text-anchor":"middle",class:"chart-tick"},YI(f.label)))}),e.xLabel&&u.append(Ss("text",{x:44+l.width/2,y:252,"text-anchor":"middle",class:"chart-axis"},e.xLabel)),e.yLabel&&u.append(Ss("text",{x:12,y:14+l.height/2,"text-anchor":"middle",transform:`rotate(-90 12 ${14+l.height/2})`,class:"chart-axis"},e.yLabel)),u}function VI(e){let t=e.data.reduce((c,u)=>c+u.value,0)||1,n=e.data.slice(0,6),s=e.data.slice(6).reduce((c,u)=>c+u.value,0);s>0&&n.push({label:"Other",value:s});let a=document.createElement("div");a.className="chart-pie";let r=Ss("svg",{viewBox:"0 0 200 200",role:"img","aria-label":e.title??"pie chart",class:"chart-plot"}),o=0,l=document.createElement("ul");return n.forEach((c,u)=>{let d=c.value/t,p=o*2*Math.PI-Math.PI/2;o+=d;let h=o*2*Math.PI-Math.PI/2,f=w=>`${100+90*Math.cos(w)} ${100+90*Math.sin(w)}`,m=d>=.9999?Ss("circle",{cx:100,cy:100,r:90,class:`chart-slice chart-shade-${u}`}):Ss("path",{d:`M100 100 L${f(p)} A90 90 0 ${d>.5?1:0} 1 ${f(h)} Z`,class:`chart-slice chart-shade-${u}`});m.append(Ss("title",{},`${c.label}: ${nc(c.value)} (${Math.round(d*100)}%)`)),r.append(m);let b=document.createElement("li"),$=document.createElement("span");$.className=`chart-key chart-shade-${u}`;let y=document.createElement("span");y.textContent=`${c.label} \u2014 ${nc(c.value)} (${Math.round(d*100)}%)`,b.append($,y),l.append(b)}),a.append(r,l),a}function fk(e){let t=document.createElement("figure");if(t.className="chart",t.dataset.chart=e.type,e.title){let n=document.createElement("figcaption");n.textContent=e.title,t.append(n)}return t.append(e.type==="pie"?VI(e):jI(e)),t}var Jd=[{value:"blue",label:"Blue",pantoneName:"Classic Blue",year:2020,pantone:"#0f4c81"},{value:"ultraviolet",label:"Violet",pantoneName:"Ultra Violet",year:2018,pantone:"#5f4b8b"},{value:"vivamagenta",label:"Magenta",pantoneName:"Viva Magenta",year:2023,pantone:"#bb2649"},{value:"peachfuzz",label:"Peach",pantoneName:"Peach Fuzz",year:2024,pantone:"#ffbe98"},{value:"mochamousse",label:"Mocha",pantoneName:"Mocha Mousse",year:2025,pantone:"#a47864"},{value:"greenery",label:"Greenery",pantoneName:"Greenery",year:2017,pantone:"#88b04b"},{value:"emerald",label:"Emerald",pantoneName:"Emerald",year:2013,pantone:"#009473"},{value:"clouddancer",label:"Cloud",pantoneName:"Cloud Dancer",year:2026,pantone:"#f0eee9"}],Ri="clouddancer";var KI="(prefers-color-scheme: dark)";function mk(e){let t=Jd.some(n=>n.value===e)?e:Ri;return t===Ri?delete document.documentElement.dataset.accent:document.documentElement.dataset.accent=t,t}function gk(e){let t=window.matchMedia(KI),n=new MutationObserver(()=>e());return t.addEventListener("change",e),n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-accent"]}),()=>{t.removeEventListener("change",e),n.disconnect()}}Ot.setOptions({gfm:!0,breaks:!1});var XI=new Set(["python","py","bash","sh","shell","zsh","yaml","yml","ruby","rb","toml","dockerfile","makefile","r","perl","ini"]),ZI=new Set(["","text","txt","plaintext","markdown","md","html","xml","svg","csv","mermaid","chart","table"]),JI=new Set("abstract and as async await break case catch class const continue def default defer del do elif else enum except export extends false False finally fn for from func function go if impl implements import in instanceof interface is lambda let match mod mut new nil None not null or package pass private protected pub public raise return self static struct super switch this throw trait true True try type typeof use var void while with yield then fi done esac echo".split(" ")),QI=/^\/api\/files\/(file_[A-Za-z0-9]+)\/content/;function eE(e,t){if(t==="diff"||t==="patch")return e.split(/(?<=\n)/).map(o=>({kind:o.startsWith("+")?"added":o.startsWith("-")?"removed":o.startsWith("@@")?"comment":null,text:o}));let n=XI.has(t)?"#[^\\n]*":t==="json"?"(?!)":t==="sql"?"--[^\\n]*|/\\*[\\s\\S]*?\\*/":t==="css"?"/\\*[\\s\\S]*?\\*/":"//[^\\n]*|/\\*[\\s\\S]*?\\*/",s=new RegExp(`(${n})|("(?:\\\\.|[^"\\\\\\n])*"|'(?:\\\\.|[^'\\\\\\n])*'|\`(?:\\\\.|[^\`\\\\])*\`)|(\\b\\d[\\d_]*(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b)|([A-Za-z_$][\\w$]*)`,"gi"),a=[],r=0;for(let o of e.matchAll(s)){let l=o[1]?"comment":o[2]?"string":o[3]?"number":JI.has(o[4])?"keyword":null;l&&(o.index>r&&a.push({kind:null,text:e.slice(r,o.index)}),a.push({kind:l,text:o[0]}),r=o.index+o[0].length)}return r<e.length&&a.push({kind:null,text:e.slice(r)}),a}function tE(e,t){if(ZI.has(t)||e.textContent.length>6e4)return;let n=eE(e.textContent,t);e.textContent="";for(let s of n)if(!s.kind)e.append(s.text);else{let a=document.createElement("span");a.className=`tok-${s.kind}`,a.textContent=s.text,e.append(a)}}function nE({source:e,display:t}){try{return sk.renderToString(e,{output:"mathml",displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"})}catch{return null}}function sE(e,t,n){let s=t.textContent;if(n==="mermaid"){let a=dk(s);return a?(e.replaceWith(wm(a)),!0):(a===void 0&&(e.dataset.diagram="pending"),!1)}if(n==="chart"){let a=hk(s);return a&&e.replaceWith(fk(a)),!!a}if(n==="table"){let a=document.createElement("template");return a.innerHTML=gd.sanitize(Ot.parse(s),bk),a.content.querySelector("table")?(e.replaceWith(a.content),!0):!1}return!1}function $k(e,t,n){t&&tE(t,n);let s=document.createElement("div");s.className="code-block";let a=document.createElement("div");a.className="code-head";let r=document.createElement("span");r.textContent=(n||"code").toUpperCase();let o=document.createElement("button");return o.type="button",o.className="code-copy",o.textContent="Copy",a.append(r,o),e.replaceWith(s),s.append(a,e),e.dataset.diagram&&(s.dataset.diagram=e.dataset.diagram,delete e.dataset.diagram),s}var bk={FORBID_TAGS:["style","form","input","button","iframe"],FORBID_ATTR:["style"]};function aE(e){let t=document.createElement("template"),{text:n,maths:s}=jb(e??"");t.innerHTML=gd.sanitize(Ot.parse(n),bk);let a=t.content;for(let r of a.querySelectorAll("span[data-math]")){let o=s[Number(r.dataset.math)],l=o?nE(o):null;if(!l){r.replaceWith(o?o.source:"");continue}r.className=o.display?"math math-display":"math",r.removeAttribute("data-display"),r.innerHTML=l}for(let r of a.querySelectorAll("pre")){let o=r.querySelector("code"),l=/language-([\w+-]+)/.exec(o?.className??"")?.[1]?.toLowerCase()??"";o&&sE(r,o,l)||$k(r,o,l)}for(let r of a.querySelectorAll("a[href]")){let o=r.children.length===0?Vb(r.getAttribute("href"),r.textContent):null;o&&(r.className="github-chip",r.dataset.github=o.kind,r.textContent=o.label)}for(let r of a.querySelectorAll("table")){let o=document.createElement("div");o.className="table-scroll",r.replaceWith(o),o.append(r)}for(let r of a.querySelectorAll("img")){let o=r.getAttribute("src")??"",l=QI.exec(o);if(!o.startsWith("data:image/"))if(l)r.removeAttribute("src"),r.dataset.fileId=l[1],r.classList.add("md-image");else if(km(o))r.replaceWith(yk(o,r.getAttribute("alt")||"Image","ask"));else{let c=document.createElement("a");c.href=o,c.textContent=r.getAttribute("alt")||"Image",r.replaceWith(c)}}return t.innerHTML}function km(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"?t.hostname:null}catch{return null}}function yk(e,t,n){let s=document.createElement("span");s.className=`remote-media ${n==="failed"?"is-failed":""}`,s.dataset.remoteMedia="image",s.dataset.src=e;let a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("class","remote-media-glyph"),a.setAttribute("viewBox","0 0 24 24"),a.setAttribute("aria-hidden","true");for(let[u,d]of wu[n==="failed"?"lucide-triangle-alert":"lucide-image-off"]??[]){let p=document.createElementNS("http://www.w3.org/2000/svg",u);for(let[h,f]of Object.entries(d))p.setAttribute(h,f);a.append(p)}let r=document.createElement("span");r.className="remote-media-name",r.textContent=t;let o=document.createElement("span");o.className="remote-media-host",o.textContent=n==="failed"?`couldn\u2019t load from ${km(e)}`:km(e);let l=document.createElement("button");l.type="button",l.className="remote-media-load",l.textContent=n==="failed"?"Retry":"Load";let c=document.createElement("a");return c.href=e,c.className="remote-media-open",c.textContent="Open",s.append(a,r,o,l,c),s}function rE(e){let t=e.dataset.src,n=e.querySelector(".remote-media-name")?.textContent||"Image",s=document.createElement("img");s.className="md-image",s.alt=n,s.addEventListener("error",()=>s.replaceWith(yk(t,n,"failed")),{once:!0}),s.src=t,e.replaceWith(s)}function vk(e){let t=e.target.closest?.(".code-copy");if(t){let r=t.closest(".code-block")?.querySelector("pre")?.textContent??"";Qe.copy({text:r}).then(()=>{t.textContent="Copied",setTimeout(()=>{t.textContent="Copy"},1400)},()=>{});return}let n=e.target.closest?.(".remote-media-load");if(n){rE(n.closest(".remote-media"));return}let s=e.target.closest?.("img[data-file-id]");if(s){jt({fileId:s.dataset.fileId,name:s.getAttribute("alt")||"Image",mediaType:"image/*"});return}let a=e.target.closest?.("a[href]");a&&(e.preventDefault(),ct.openExternal({url:a.href}).catch(()=>{}))}function oE(e){let[t,n]=g(0);return D(()=>{if(!e)return;let s=()=>n(r=>r+1),a=[gk(s),ge("appearance:changed",s)];return()=>a.forEach(r=>r())},[e]),e?t:0}function gr({text:e,document:t=!1}){let n=oE(String(e??"").includes("mermaid")),s=Ve(()=>aE(e),[e,n]),a=Y(null);return D(()=>{let r=!0;for(let o of a.current?.querySelectorAll("img[data-file-id]:not([src])")??[])Ql({fileId:o.dataset.fileId}).then(l=>{r&&(o.src=l)},()=>{o.replaceWith(o.getAttribute("alt")||"Image")});for(let o of a.current?.querySelectorAll('.code-block[data-diagram="pending"]')??[])o.dataset.diagram="drawing",pk(o.querySelector("pre")?.textContent??"").then(l=>{!r||!o.isConnected||(l?o.replaceWith(wm(l)):o.dataset.diagram="source")});return()=>{r=!1}},[s,n]),i`<div key=${n} ref=${a} class=${`markdown ${t?"markdown-document":""}`} onClick=${vk} dangerouslySetInnerHTML=${{__html:s}} />`}function wk({text:e,language:t}){let n=Ve(()=>{let s=document.createElement("template"),a=document.createElement("pre"),r=document.createElement("code");return r.textContent=e??"",a.append(r),s.content.append(a),$k(a,r,String(t??"").toLowerCase()),s.innerHTML},[e,t]);return i`<div class="markdown markdown-code" onClick=${vk} dangerouslySetInnerHTML=${{__html:n}} />`}function kk({markup:e}){let t=Ve(()=>gd.sanitize(e??"",{FORBID_TAGS:["style","form","input","button","iframe","img","a"],FORBID_ATTR:["style"]}),[e]);return i`<div class="markdown markdown-document" dangerouslySetInnerHTML=${{__html:t}} />`}var xk=new Set(["text/html","application/xhtml+xml"]),Sk="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Ck={[Sk]:"word","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation":"slides"},iE=new Set(["text/markdown","text/plain"]),lE=new Set(["text/csv","text/tab-separated-values"]),cE=new Set(["application/json","application/x-ndjson","application/geo+json","application/yaml","application/x-yaml","application/toml","application/xml","application/sql","application/javascript","application/x-sh"]),Li=new Set(Object.values(Ck)),Fo=e=>String(e??"").split(";",1)[0].trim().toLowerCase();function uE(e){let t=Fo(e);return iE.has(t)||xk.has(t)||t.startsWith("image/")?!1:t.startsWith("text/")||cE.has(t)||t.endsWith("+json")||t.endsWith("+xml")}function sc(e){return!e?.artifactId||e.version!==e.currentVersion?!1:e.office!==void 0?!0:e.kind==="site"||e.kind==="code"||Qd(e)||e.kind==="markdown"&&(e.html===void 0||Fo(e.mediaType)===Sk)}function xm(e){return!!(e&&!e.sourceLine&&e.owned!==!1&&e.kind!=="site"&&!Qd(e)&&(!e.artifactId||e.version===e.currentVersion)&&(e.documentSource?e.documentSource.editable!==!1:sc(e)))}function Qd(e){return e?.kind==="sheet"&&e.office===void 0&&lE.has(Fo(e.mediaType))}function ep(e){let t=Ck[Fo(e.mediaType)];return t||(e.format!=="file"||xk.has(Fo(e.mediaType))?"page":uE(e.mediaType)?"code":"text")}function Ak(e){return e?.office!==void 0&&(e.kind==="sheet"||e.kind==="slides")}var dE={create:"Created",update:"Edited",delete:"Deleted"},Qn=class extends Error{constructor(t,n){super(n),this.code=t}};function Va(e){if(e?.isCurrent&&!e.isCurrent())throw new Qn("account_changed","The account changed. Open this document again.")}function Tk(e,t){return{key:`artifact:${t}`,read:()=>e.source({artifactId:t}),save:(n,s)=>(Va(s),e.saveSource({artifactId:t,...n}))}}function tp(e,{workspace:t,storeId:n,noteId:s,readOnly:a=!1}){let r="",o="",l=new Map,c=async(u,d,p)=>{Va(p);try{return o=(await e.saveNote({workspace:t,storeId:n,noteId:s,path:r,content:u,sha:d})).content_sha256,{revision:o}}catch(h){throw h?.code==="precondition_failed"?new Qn("revision_conflict","This note changed elsewhere."):h}};return{key:`memory:${t}:${n}:${s}`,async read(){let u=await e.note({workspace:t,storeId:n,noteId:s});return r=u.path,o=u.content_sha256,{format:"file",mediaType:"text/markdown",text:u.content??"",revision:u.content_sha256,editable:!a,maxBytes:102400}},async save(u,d){if(a)throw new Qn("artifact_unavailable","Archived stores are read-only.");return c(String(u.text??""),u.revision,d)},async history(){let u=await e.noteVersions({workspace:t,storeId:n,noteId:s});l.clear();for(let d of u.memory_versions)l.set(d.id,d);return u.memory_versions.map(d=>({id:d.id,label:dE[d.operation]??d.operation,at:d.created_at,restorable:d.content!==null}))},async restore(u,d){let p=l.get(u);if(!p||p.content===null)throw new Qn("not_found","That version cannot be restored.");return c(p.content,o,d)}}}var pE=1048576,Mk={md:"text/markdown",markdown:"text/markdown",json:"application/json",yaml:"text/yaml",yml:"text/yaml"};function np(e,{skillId:t,path:n}){let s=new Map,a=async l=>{Va(l);let c=await e.skill({id:t});if(Va(l),!c.revisionId)throw new Qn("not_found","This skill has no saved version.");return c},r=async(l,c,u)=>{let d=[];for(let p of c){Va(u);try{d.push({path:p.path,text:(await e.skillFile({id:t,revisionId:l,path:p.path})).content})}catch{throw new Qn("artifact_unavailable",`${p.path} could not be read as text, so this skill can only be changed by uploading a new version.`)}Va(u)}return d},o=async(l,c)=>(Va(c),{revision:(await e.saveSkill({id:t,files:l})).id});return{key:`skill:${t}:${n}`,async read(){let l=await a(),{content:c}=await e.skillFile({id:t,revisionId:l.revisionId,path:n}),u=n.split(".").pop()?.toLowerCase()??"";return{format:"file",mediaType:Mk[u]??"text/plain",text:c,revision:l.revisionId,editable:!0,maxBytes:pE}},async save(l,c){let u=await a(c);if(u.revisionId!==l.revision)throw new Qn("revision_conflict","This skill changed elsewhere.");let d=await r(u.revisionId,u.files,c);return o(d.map(p=>p.path===n?{path:n,text:String(l.text??"")}:p),c)},async history(){let l=[...await e.skillRevisions({id:t})].sort((c,u)=>String(u.createdAt??"").localeCompare(String(c.createdAt??"")));s.clear();for(let c of l)s.set(c.id,c);return l.map((c,u)=>({id:c.id,label:`Version ${l.length-u}`,at:c.createdAt,restorable:u>0}))},async restore(l,c){let u=s.get(l);if(!u)throw new Qn("not_found","That version could not be found.");return o(await r(u.id,u.files,c),c)}}}function sp(e,{agentId:t}){let n=null,s=new Map,a=async(r,o,l)=>{Va(l);try{return n=(await e.savePrompt({id:t,prompt:r,expectedVersion:o})).version,{revision:String(n)}}catch(c){throw c?.code==="version_conflict"?new Qn("revision_conflict",c.message):c}};return{key:`agent-prompt:${t}`,async read(){let r=await e.prompt({id:t});return n=r.promptVersion,{format:"file",mediaType:"text/markdown",text:r.prompt??"",revision:n===null?"none":String(n),editable:!r.archived,maxBytes:1e5}},async save(r,o){let l=r.revision==="none"?null:Number(r.revision);if(l!==null&&(!Number.isSafeInteger(l)||l<1))throw new Qn("revision_conflict","Reload these instructions before saving.");return a(String(r.text??""),l,o)},async history(){let r=await e.promptVersions({id:t});s.clear();for(let o of r)s.set(String(o.version),o);return r.map(o=>({id:String(o.version),label:`Version ${o.version}`,at:o.createdAt,restorable:!o.active}))},async restore(r,o){let l=s.get(r);if(!l)throw new Qn("not_found","That version could not be found.");return a(l.content,n,o)}}}var hE=2*1024*1024,fE={...Mk,css:"text/css",html:"text/html",htm:"text/html",svg:"image/svg+xml",js:"text/javascript",jsx:"text/javascript",csv:"text/csv",txt:"text/plain"};function Ik(e,{id:t,path:n}){let s=n??null,a=null,r=async(o,l,c)=>{Va(c);try{return a=(await e.saveDesignSystemFile({id:t,path:s,baseVersion:Number(l),...o})).version,{revision:String(a)}}catch(u){throw u?.code==="conflict"||u?.status===409?new Qn("revision_conflict","Someone saved a newer version of this design system."):u}};return{key:`design-system:${t}:${n??""}`,async read(){let o=await e.designSystemFile({id:t,path:s});s=o.path,a=o.version;let l=s.split(".").pop()?.toLowerCase()??"";return{format:"file",mediaType:fE[l]??"text/plain",text:o.text,revision:String(o.version),editable:o.editable,maxBytes:hE,libraryRef:o.libraryRef}},save:(o,l)=>r({content:String(o.text??"")},o.revision,l),async history(){return(await e.designSystemFile({id:t,path:s})).history.map((l,c)=>({id:String(l.version),label:`Version ${l.version}`,at:l.at,restorable:c>0}))},restore:(o,l)=>r({restoreVersion:Number(o)},a,l)}}var mE=1048576,gE=/^<!-- meeting-note:(?:begin|end) -->\n?/gm;function Ek(e,{file:t}){return{key:`meeting:${t}`,versioned:!1,async read(){let{content:n,sha:s}=await e.read({file:t});if(n==null)throw new Qn("not_found","This meeting note is not on this Mac any more.");return{format:"file",mediaType:"text/markdown",text:String(n).replace(gE,""),revision:s,editable:!0,maxBytes:mE}},async save(n,s){Va(s);try{return{revision:(await e.save({file:t,content:String(n.text??""),sha:n.revision})).sha}}catch(a){throw a?.code==="precondition_failed"?new Qn("revision_conflict","This note changed on this Mac."):a}},async history(){return[]},async restore(){throw new Qn("not_found","This note has no saved versions.")}}}var Rs="draft:";var so=(e,t)=>{try{return e()}catch{return t}},ac=e=>typeof e=="string"?{email:e}:e??{},oc=e=>e?.ownerId||e?.ownerEmail||e?.ownerLocalId?{userId:e.ownerId??null,email:e.ownerEmail??null,localCredentialId:e.ownerLocalId??null}:null;function fs(e){let{userId:t,email:n,localCredentialId:s}=ac(e);return[t?`user:${t}`:null,n||null,s?`credential:${s}`:null].filter(Boolean)}function Mn(e,t){let n=ac(e),s=ac(t);return n.userId&&s.userId?n.userId===s.userId:!!(n.localCredentialId&&n.localCredentialId===s.localCredentialId||n.email&&n.email===s.email)}function $E(e,t,n=Date.now(),s=null){return so(()=>{let a=e.getItem(`${Rs}${t}`);if(!a)return"";let r=JSON.parse(a),o=oc(r);if(o&&!Mn(o,s)||!o&&r?.machineLocal!==!0)return"";if(typeof r?.text!="string"||!Number.isFinite(r.expires)||n>r.expires)return r.legacyRecovery?e.setItem(`${Rs}${t}`,JSON.stringify({legacyRecovery:r.legacyRecovery})):e.removeItem(`${Rs}${t}`),"";let l=ac(s);return o&&!o.userId&&l.userId&&so(()=>e.setItem(`${Rs}${t}`,JSON.stringify({...r,ownerId:l.userId}))),r.text},"")}function Tm(e,t){return so(()=>oc(JSON.parse(e.getItem(`${Rs}${t}`))),null)}function Mm(e){if(!e||typeof e!="object"||Array.isArray(e)||Object.keys(e).some(n=>!["experience","title","placeholder","examples","attempt"].includes(n))||typeof e.experience!="string"||!e.experience||e.experience.length>500||typeof e.title!="string"||e.title.length>2e3||e.placeholder!==void 0&&typeof e.placeholder!="string"||e.examples!==void 0&&(!Array.isArray(e.examples)||e.examples.some(n=>typeof n!="string")))return null;let t=e.attempt;return t!==void 0&&(!t||typeof t!="object"||Array.isArray(t)||Object.keys(t).some(n=>!["requestId","text","workspace","playgroundId","sessionId"].includes(n))||typeof t.requestId!="string"||!t.requestId||typeof t.text!="string"||!(t.workspace===null||typeof t.workspace=="string")||t.playgroundId!==void 0&&(typeof t.playgroundId!="string"||!t.playgroundId)||t.sessionId!==void 0&&(typeof t.sessionId!="string"||!t.sessionId))?null:e}function _k(e,t,n,s,a,r){return so(()=>{if(typeof n!="string")return!1;let o=e.getItem(`${Rs}${t}`),l=so(()=>JSON.parse(o),null),c=oc(l),u=ac(a);if(c&&fs(u).length&&!Mn(c,u))return!1;let d=l?.legacyRecovery??(o&&!c&&l?.machineLocal!==!0?{raw:o}:null),p={...d?{legacyRecovery:d}:{},...r.legacyAdoption??l?.legacyAdoption?{legacyAdoption:r.legacyAdoption??l.legacyAdoption}:{}},h=r.experience===void 0?n?Mm(l?.experience):null:r.experience;if(h?.attempt&&h.attempt.text!==n){let{attempt:f,...m}=h;h=m}if(!n&&!h)d?e.setItem(`${Rs}${t}`,JSON.stringify({legacyRecovery:d})):e.removeItem(`${Rs}${t}`);else{let f=c?{...u,...Object.fromEntries(Object.entries(c).filter(([,b])=>b))}:u,m=JSON.stringify({text:n,expires:s+864e5,...p,...h?{experience:h}:{},...f.userId?{ownerId:f.userId}:{},...f.email?{ownerEmail:f.email}:{},...f.localCredentialId?{ownerLocalId:f.localCredentialId}:{},...fs(f).length?{}:{machineLocal:!0}});return e.setItem(`${Rs}${t}`,m),e.getItem(`${Rs}${t}`)===m}return!0},!1)}function ic(e,t,n,s=Date.now(),a=null,r=null){return _k(e,t,n,s,a,{legacyAdoption:r})}function Rk(e,t,n=null,s=Date.now()){return so(()=>{let a=JSON.parse(e.getItem(`${Rs}${t}`)),r=oc(a);return(r?!Mn(r,n):a?.machineLocal!==!0||fs(n).length)||!Number.isFinite(a.expires)||s>a.expires?null:Mm(a.experience)},null)}function qo(e,t,n,s,a=Date.now(),r=null){let o=s===null?null:Mm(s);if(s!==null&&!o)return!1;let l=so(()=>JSON.parse(e.getItem(`${Rs}${t}`)),null),c=oc(l);return c&&!Mn(c,r)?!1:_k(e,t,n,a,r,{experience:o})}function Di(e,t=Date.now(),n=null){let s=so(()=>Array.from({length:e.length},(r,o)=>e.key(o)),[]),a={};for(let r of s){if(typeof r!="string"||!r.startsWith(Rs))continue;let o=r.slice(Rs.length),l=$E(e,o,t,n);l&&(a[o]=l)}return a}function Lk(e,t,n,s=Date.now(),a=null){for(let r of new Set([...Object.keys(t??{}),...Object.keys(n??{})]))(t?.[r]??"")!==(n?.[r]??"")&&ic(e,r,n?.[r]??"",s,typeof a=="function"?a(r):a)}function Ok(e,t){return Object.entries(e).filter(([n,s])=>n!==t&&/^new(?::[a-f0-9-]{36})?$/.test(n)&&s.trim()).map(([n,s])=>({key:n,text:s}))}var ap=null,Sm=0,rc=new Map,Cm=new Map,Oi=new Map,Am=new Set;function Im(){let e=[...rc.values()],t=Cm.values().next().value??e.find(n=>n.error)?.error??null;return{ready:!t&&Sm===0&&!e.some(n=>n.pending),error:t}}function Dk(){let e=Im();if(!(!e.ready&&!e.error)){for(let t of Am)t(e);Am.clear()}}function Nk(){let e=Symbol();return(t,n=null,s=null)=>{t||n?rc.set(e,{pending:t,error:n,scope:s}):rc.delete(e),Dk()}}function rp(){let e=Im();return e.ready||e.error?Promise.resolve(e):new Promise(t=>Am.add(t))}typeof window<"u"&&window.addEventListener("beforeunload",e=>{Im().ready||(e.preventDefault(),e.returnValue="Your latest edits are still being kept on this Mac.")});function bE(){return ap||(ap=new Promise((e,t)=>{let n=indexedDB.open("agentsky-document-drafts",1);n.onupgradeneeded=()=>n.result.createObjectStore("drafts"),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}).catch(e=>{throw ap=null,e})),ap}var op=(e,t)=>JSON.stringify([e,t]);async function lc(e,t,n){let s=t===void 0,a=!s&&t!==null;if(s&&Oi.has(e))return Oi.get(e).value;a&&(Sm+=1);let r=!1,o=n?.previous??null,l=Oi.get(e);try{let c=await bE(),u=await new Promise((d,p)=>{let h=c.transaction("drafts",s?"readonly":"readwrite",{durability:"strict"}),f=h.objectStore("drafts"),m=f.get(e);m.onsuccess=()=>{if(s)return;let b=m.result;if(o=b?.owner??null,b&&n&&b.owner!==n.owner&&b.owner!==n.previous){r=!0,h.abort();return}t===null?f.delete(e):f.put({...t,...n?{owner:n.owner}:{}},e)},h.oncomplete=()=>d(s?m.result??null:null),h.onabort=()=>p(h.error||m.error||new Error("A newer draft is open in another editor. Keep this editor open and copy your edits.")),h.onerror=()=>{}});if(!s&&Oi.get(e)===l&&Oi.delete(e),s||Cm.delete(e),!s)for(let[d,p]of rc)p.error&&p.scope?.key===e&&n&&(n.clearFailure===!0||p.scope.owner!==n.owner)&&rc.delete(d);return u}catch(c){throw a&&!r&&(Oi.set(e,{value:{...t,owner:o}}),Cm.set(e,"A document draft could not be kept on this Mac. Copy or save the draft, or retry saving before closing.")),c}finally{a&&(Sm-=1),Dk()}}function Pk(e,t){if(!e||typeof e.draft!="string"||!e.source||typeof e.source.content!="string"||!["number","string"].includes(typeof e.source.revision)||e.source.kind!==t.kind||e.draft===t.content)return null;let n=String(e.source.revision)!==String(t.revision);return{draft:e.draft,source:{...t,revision:e.source.revision,content:e.source.content},pending:n?null:e.pending??null,conflict:n,recovered:!n,error:n?"This document changed elsewhere. Your recovered draft is kept. Copy or save your draft before reloading the saved version.":null}}var yE=1200,vE={word:"Word document",sheet:"Spreadsheet",slides:"Presentation"},Bk=new Set(["text","code"]),Ni=[.25,.5,1,2,4],wE=8*1024*1024,kE=[{prop:"color",label:"Text color",color:!0},{prop:"background-color",label:"Background color",color:!0},{prop:"border-color",label:"Border color",color:!0},{prop:"font-family",label:"Font"},{prop:"font-size",label:"Font size"},{prop:"font-weight",label:"Font weight"},{prop:"border-radius",label:"Border radius"},{prop:"border-width",label:"Border width"},{prop:"width",label:"Width"},{prop:"height",label:"Height"},{prop:"opacity",label:"Opacity"},{prop:"padding",label:"Padding"},{prop:"margin",label:"Margin"},{prop:"flex-direction",label:"Direction",options:["row","column","row-reverse","column-reverse"]},{prop:"justify-content",label:"Justify",options:["flex-start","center","flex-end","space-between","space-around","space-evenly"]},{prop:"align-items",label:"Align",options:["stretch","flex-start","center","flex-end","baseline"]},{prop:"gap",label:"Gap"},{prop:"row-gap",label:"Row gap"},{prop:"column-gap",label:"Column gap"}],Fk=e=>new Date(e).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),cc=null;function xE(){if(!cc){let e=document.createElement("link");e.rel="stylesheet",e.href="/editors/editors.css",document.head.append(e),cc=import("/editors/editors.mjs"),cc.catch(()=>{cc=null})}return cc}function qk(){let[e,t]=g(null),[n,s]=g(null);return D(()=>{let a=!0;return xE().then(r=>{a&&t(r)},()=>{a&&s("The editor could not load. Close it and try again.")}),()=>{a=!1}},[]),{module:e,error:n}}function Uo(e,t){return e.generation===t.generation&&!(e.userId&&t.userId&&!Mn(e,t))}function SE(e,t,n){let[s,a]=g({source:null,draft:"",pending:null,busy:!1,error:null,conflict:!1,recovered:!1,denied:!1,loading:!0,preparing:!1,loads:0}),r=Y(s),o=Y(null),l=Y([]),c=Y(void 0),u=Y(null),d=Y(null),p=Y(!1),h=Y(0),f=Y(0),m=Y(!1),b=Y(crypto.randomUUID()),$=Y(null),y=Y(Promise.resolve()),w=Y(0),v=Y(null),k=Y(null),I=Y(Nk()),C=()=>I.current(w.current>0||r.current.preparing,v.current||k.current,{key:o.current,owner:b.current}),[S,E]=g(null),A=(F,{clearFailure:H=!1}={})=>{if(!o.current)return Promise.resolve(!0);let ae=o.current,j=l.current.slice(),U=F!==null;U&&(w.current+=1),C();let ie=y.current.catch(()=>{}).then(async()=>{await lc(ae,F,{owner:b.current,previous:$.current,clearFailure:H});for(let ce of j)await lc(ce.key,null,{owner:b.current,previous:ce.owner,clearFailure:H});l.current=l.current.filter(ce=>!j.includes(ce))});return y.current=ie,ie.then(()=>($.current=b.current,k.current=null,E(null),!0),()=>(k.current="Your draft could not be kept on this Mac. Keep this editor open and copy or download your draft before leaving.",E(k.current),!1)).finally(()=>{U&&(w.current-=1),C()})},_=(F,H=!0)=>{r.current={...r.current,...F},p.current||a(r.current);let ae=r.current;C(),H&&ae.source&&!ae.loading&&A(ae.draft===ae.source.content&&!ae.preparing?null:{source:ae.source,draft:ae.draft,pending:ae.pending})},R=()=>{p.current=!0,h.current+=1,a({source:null,draft:"",pending:null,busy:!1,error:"The account changed. Open this document again.",conflict:!1,recovered:!1,denied:!0,loading:!1,preparing:!1,loads:0})},W=async({discard:F=!1}={})=>{if(p.current)return;let H=++h.current;m.current=!0,v.current=null;let ae=()=>H===h.current;_({loading:!0,error:null,conflict:!1,recovered:!1,pending:null,preparing:!1});try{if(F&&!await A(null,{clearFailure:!0})){m.current=!1,_({loading:!1});return}let j=await Xt.state(),{generation:U}=j;if(!ae())return;if(d.current&&!Uo(d.current,j)){R();return}let ie={...j,...Object.fromEntries(Object.entries(d.current??{}).filter(([,Ne])=>Ne!=null))};c.current=U,u.current=ie;let ce=fs(ie).map(Ne=>op(Ne,e.key)),[me,qe]=await Promise.all([e.read(),y.current.catch(()=>{}).then(()=>F?[]:Promise.all(ce.map(async Ne=>({key:Ne,saved:await lc(Ne)}))))]);if(!ae())return;let re=fs(u.current).map(Ne=>op(Ne,e.key)),$e=re.filter(Ne=>!ce.includes(Ne)),Me=!F&&$e.length?await Promise.all($e.map(async Ne=>({key:Ne,saved:await lc(Ne)}))):[];if(!ae())return;let fe=re.map(Ne=>[...qe,...Me].find(He=>He.key===Ne)).filter(Boolean),Ce=re[0]??null,pe=fe.find(Ne=>Ne.saved)?.saved??null,dt=ep(me),je=(dt==="word"?me.docx??me.office:dt==="sheet"||dt==="slides"?me.office:Bk.has(dt)?me.text:me.html)??"";o.current=Ce,$.current=fe.find(Ne=>Ne.key===Ce)?.saved?.owner??null,l.current=fe.filter(Ne=>Ne.key!==Ce&&Ne.saved).map(Ne=>({key:Ne.key,owner:Ne.saved.owner??null}));let _e={revision:me.revision,content:je,kind:dt,plain:Fo(me.mediaType)==="text/plain",editable:me.editable===!0,maxBytes:me.maxBytes},Pe=Pk(pe,_e);pe&&await A(Pe?{source:Pe.source,draft:Pe.draft,pending:Pe.pending}:null),ae()&&(m.current=!1,_({loading:!1,denied:!1,draft:je,loads:++f.current,source:_e,...Pe},!1))}catch(j){ae()&&_({loading:!1,error:j.message,denied:j.code==="artifact_unavailable"})}};D(()=>{W();let F=ge("auth:changed",H=>{if(d.current=H,c.current!==void 0){if(Uo(H,u.current)){u.current={...u.current,...Object.fromEntries(Object.entries(H).filter(([,U])=>U!=null))};let ae=fs(u.current)[0],j=ae?op(ae,e.key):null;if(j&&j!==o.current){o.current&&l.current.push({key:o.current,owner:b.current}),o.current=j,$.current=null;let U=r.current;U.source&&!U.loading&&A(U.draft===U.source.content&&!U.preparing?null:{source:U.source,draft:U.draft,pending:U.pending})}return}R()}});return()=>{h.current+=1,F()}},[e.key]);let O=Y(null);D(()=>{let F=O.current;if(!F||F.key!==e.key){O.current={key:e.key,revision:n};return}if(n===void 0||F.revision===n)return;let H=r.current;if(!(H.busy||H.preparing)){if(O.current={key:e.key,revision:n},!H.source){W();return}String(H.source.revision)!==String(n)&&(H.pending||H.draft!==H.source.content?_({conflict:!0,error:"This document changed elsewhere. Your draft is kept. Copy your draft before reloading the saved version."}):W())}},[e.key,n,s.busy,s.preparing]);let L=Li.has(s.source?.kind)?Math.floor(s.draft.length*3/4):new TextEncoder().encode(s.draft).length,Q=!!s.source&&L>s.source.maxBytes,V=!!s.source&&s.draft!==s.source.content,ee=async()=>{let F=r.current,H=h.current;if(p.current||!F.source||F.busy||F.denied||F.preparing||!F.source.editable)return!1;let ae={word:"docx",sheet:"office",slides:"office",text:"text",code:"text",page:"html"}[F.source.kind],j=F.pending??{requestId:crypto.randomUUID(),revision:F.source.revision,[ae]:F.draft};_({pending:j,busy:!0,error:null,conflict:!1,recovered:!1});try{let U=await e.save(j,{isCurrent:()=>!p.current&&H===h.current});return H!==h.current||(_({pending:null,busy:!1,source:{...r.current.source,revision:U.revision,content:j[ae]}}),t(Number(U.revision))),!0}catch(U){if(H!==h.current)return!1;let ie=U.code==="revision_conflict",ce=F.source.kind;return _({busy:!1,pending:U.code==="save_unfinished"?j:null,conflict:ie,denied:U.code==="artifact_unavailable",error:ie?Li.has(ce)?"This document changed elsewhere. Your draft is kept. Save a copy of your draft before reloading the saved version.":Bk.has(ce)?"This document changed elsewhere. Your draft is kept. Copy your draft before reloading the saved version.":"This artifact changed elsewhere. Your edits are kept. Copy the HTML before reloading.":U.message||"Changes could not be saved. Your edits are kept; try again."}),!1}},K=V&&!s.busy&&!s.pending&&!s.error&&!s.recovered&&!s.denied&&!s.preparing&&!Q&&s.source?.editable;D(()=>{if(!K)return;let F=setTimeout(()=>{ee()},yE);return()=>clearTimeout(F)},[K,s.draft]);let z=Y(()=>{});return z.current=()=>K?ee():Promise.resolve(!V&&!s.preparing),D(()=>{let F=()=>{z.current()};return window.addEventListener("blur",F),()=>{window.removeEventListener("blur",F),F()}},[]),{state:s,dirty:V,oversize:Q,size:L,save:ee,load:W,draftError:S,discard:async()=>{m.current=!0;let F=await A(null,{clearFailure:!0});return F?(v.current=null,r.current={...r.current,preparing:!1},C()):m.current=!1,F},flush:()=>z.current(),edit:(F,H)=>{!m.current&&!r.current.loading&&H===r.current.loads&&_({draft:F})},preparing:(F,H,ae=null)=>{!m.current&&!r.current.loading&&H===r.current.loads&&(v.current=ae,_({preparing:F}))}}}function Uk({view:e}){let{module:t,error:n}=qk();return n?i`<div class="panel-state"><p role="alert">${n}</p></div>`:t?i`<${ip} key=${`${e.artifactId??e.title}:${e.version??""}`} module=${t} mount="mountOfficeEditor" props=${{kind:e.kind,value:e.office,fileName:e.title,disabled:!0,onChange:()=>{},onPendingChange:()=>{}}} />`:i`<div class="panel-state"><${ne} /><p>Loading the editor…</p></div>`}function ip({module:e,mount:t,props:n}){let s=Y(null),a=Y(null);return Ct(()=>(a.current=e[t](s.current,n),()=>{a.current?.destroy(),a.current=null}),[e,t]),D(()=>{a.current?.update(n)}),i`<div class="editor-island" ref=${s}></div>`}var CE=e=>{let t=/^rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(String(e));return t?`#${t.slice(1,4).map(n=>Number(n).toString(16).padStart(2,"0")).join("")}`:/^#[0-9a-f]{6}$/i.test(e)?e:"#000000"},AE=["top","right","bottom","left"],TE=["top-left","top-right","bottom-right","bottom-left"],ME=e=>e.every(t=>t===e[0])?e[0]:e.join(" "),uc=(e,t)=>{let n=t.includes("{corner}")?TE.map(s=>e[t.replace("{corner}",s)]):AE.map(s=>e[t.replace("{side}",s)]);return n.every(s=>typeof s=="string"&&s)?ME(n):void 0};function zk(e){return{...e,padding:e.padding||uc(e,"padding-{side}"),margin:e.margin||uc(e,"margin-{side}"),"border-color":e["border-color"]||uc(e,"border-{side}-color"),"border-width":e["border-width"]||uc(e,"border-{side}-width"),"border-radius":e["border-radius"]||uc(e,"border-{corner}-radius")}}function IE({computed:e,onChange:t}){let[n,s]=g(()=>zk(e));D(()=>s(zk(e)),[e]);let a=(r,o)=>{s(l=>({...l,[r]:o})),t({[r]:o})};return i`
|
|
975
975
|
<div class="design-grid">
|
|
976
976
|
${kE.map(({prop:r,label:o,color:l,options:c})=>i`
|
|
977
977
|
<label key=${r} class="design-field">
|
|
@@ -2060,7 +2060,7 @@ ${t.slice(-fg)}`:t;return i`
|
|
|
2060
2060
|
onWhy=${H=>V({why:z(C,H)})} onFailure=${(H,ae)=>V({failures:{...S,[H]:z(S[H]??[],ae)}})}
|
|
2061
2061
|
onComment=${H=>V({comment:H})} onClose=${()=>V({reasonsOpen:!1})} />`:null}
|
|
2062
2062
|
</div>
|
|
2063
|
-
`}var u3={selection:null,ranking:[],why:[],failures:{},comment:"",reasonsOpen:!1},oR=(e,t)=>e.trim()?`${e.trimEnd()} ${t}`:t;var Wi={settings:"Settings",billing:"Billing and usage",invite:"Invite people",chatApps:"Message your agents",feedback:"Feedback",signOut:"Sign out"},Hi={planMode:{label:"Plan mode",icon:"lucide-list-todo"},planModeOff:{label:"Turn off Plan mode",icon:"lucide-list-todo"},attachFile:{label:"Attach file",icon:"lucide-paperclip"},chooseRepo:{label:"Choose repo",icon:"lucide-folder"},compareAgents:{label:"Compare agents",icon:"lucide-columns-2"}},Dt={connected:"Connected",accounts:"{count} accounts",addAccount:"+ Add another account",disconnect:"Disconnect {name}",disconnected:"{name} disconnected",apps:"Apps",search:"Search apps",categories:"App categories",all:"All",more:"More apps",manage:"Manage",addAnother:"Add another",useTitle:"Your agents use {name}",useBody:"Connect an account once and every agent you run can work in it.",chatBody:"Connect once and message every agent you run from {name}.",bothBody:"Connect once \u2014 every agent you run can work in {name}, and you can message them there.",workIn:"Work in {name}",postOn:"Post on {name}",messageFrom:"Message your agents from {name}",chatHere:"{name} now talks to this agent",otherChatAs:"In someone else's chat as {name}",unlink:"Unlink {name}",catalogUnavailable:"Your connected apps are available, but the catalog couldn't load.",searchFailed:"Couldn't search the app catalog.",moreFailed:"Couldn't load more apps.",noAppsCatalogDown:"No apps to show while the catalog is unavailable.",noMatches:"No connectable apps match that search.",noApps:"No connectable apps available.",notConnectable:"That app isn't connectable.",startFailed:"Couldn't start the connection.",stoppedWaiting:"Stopped waiting for the connection.",retry:"Try again",sharing:{title:"Shared with your team",body:"Agents in every thread of a workspace can use a connection you share with it. Teammates never see its sign-in, and you can stop at any time.",empty:"Connect an app, then share it here.",sharedWith:"Shared with {workspace}",notSharedWith:"Not shared with {workspace}",notUsed:"Not used yet.",usedOnce:"Used 1 time.",used:"Used {count} times."}},h3="Continue from where the imported record ends. Before acting on any path, file, or command result in it, verify it here first \u2014 this sandbox is not the machine it came from.",yg={line:"Turned off by its organization",detail:"This account belongs to a Claude organization that turned off Claude Code on its plan, so AgentSky stopped using it. Ask that organization's admin to allow Claude Code, then reconnect. Or remove it and connect another Claude account."},ea={usageUnshared:"Setup tokens don't report usage",usageFailed:"Couldn't read usage",retry:"Retry",moreActions:"More actions",copyCode:"Copy code",copied:"Copied",deviceCodeHint:"Code rejected?",deviceCodeSettings:"Allow device codes in ChatGPT",deviceCodeFirst:"before connecting."},jo={heading:"Show",scopes:[{id:"mine",label:"Mine"},{id:"everyone",label:"Everyone in the workspace"}],storageKey:"agentsky.rail-scope"},Ep={title:"Task emails",note:"Sent to your account email. At most one email each time a task starts waiting or finishes.",kinds:[{kind:"needs_you",title:"A task is waiting on you",detail:"An agent asked a question or needs your approval, and you have not seen it yet."},{kind:"done",title:"A task has a result",detail:"A longer task finished while you were away."}]},vg={needs_you:"Needs you",working:"Working",done:"New result",idle:"Idle"},Gi={filterTip:"Filter threads",filters:[{id:"active",label:"Active"},{id:"needs_you",label:"Needs you"},{id:"archived",label:"Archived"},{id:"all",label:"All"}],empty:"Your chats appear here.",emptyArchived:"No archived threads.",emptyNeedsYou:"Nothing needs you here."},Vo={levels:{private:"Private",workspace:"Everyone in {workspace}",link:"Anyone with the link"},roles:{workspace:"Can continue",view:"Can view",prompt:"Can edit"},linkRoles:[{value:"view",label:"Can view"},{value:"prompt",label:"Can edit"}],summaries:{private:"Only {owner} can use it.",workspace:"Everyone in {workspace} can find it and continue it.",view:"Anyone with the link can view this thread.",prompt:"Anyone with the link can send messages in this thread."},payer:{workspace:"Messages sent through the link are paid by {workspace}.",owner:"Messages sent through the link use your credits.",other:"Messages sent through the link use {owner}\u2019s credits."}};function f3(e,t,n=Date.now()){if(e>0)return`${e}% left`;let s=t?iR(t,n):null;return s?`Resets ${s}`:"Used up"}function Ko(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>s in t?String(t[s]):n)}function m3(e,t){if(t)return"Signed out";if(e==="needs_reconnect")return"Needs reconnecting";if(e==="org_disabled")return yg.line;let n=e.replace(/_/g," ");return n.charAt(0).toUpperCase()+n.slice(1)}function g3(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $3(e,t=Date.now()){let n=new Date(e),s=Math.floor((t-n.getTime())/6e4);if(s<1)return"Now";if(s<60)return`${s}m ago`;let a=Math.floor(s/60);if(a<24)return`${a}h ago`;let r=Math.floor(a/24);return r===1?"Yesterday":r<7?`${r}d ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function iR(e,t=Date.now()){let n=new Date(e).getTime()-t;if(!Number.isFinite(n)||n<=0)return null;let s=Math.round(n/6e4);if(s<60)return`in ${s}m`;let a=Math.round(s/60);return a<48?`in ${a}h`:`in ${Math.round(a/24)}d`}function b3(e,t){let n=e.agents??[],s=[];return n.length===1?s.push({kind:"agent",text:t(n[0]),icon:null}):n.length>1&&s.push({kind:"agents",text:`${n.length} agents`,icon:"users"}),e.mac&&s.push({kind:"mac",text:e.mac,icon:"laptop"}),e.statusLine&&s.push({kind:"status",text:e.statusLine,icon:"message-square"}),{meta:e.updatedLabel?e.updatedLabel.replace(/ ago$/,""):null,rows:s}}function y3(e,t){return t?"link":e==="workspace"?"workspace":"private"}function wg(e,t){let n=Vo.levels;return e==="link"?n.link:e==="workspace"?n.workspace.replace("{workspace}",t):n.private}function v3(e,t,n,s=e){let a=Vo.levels;return[...s==="private"?[{value:"private",label:a.private}]:[],{value:"workspace",label:a.workspace.replace("{workspace}",t)},...n?[{value:"link",label:a.link}]:[]]}function w3(e){let t=Vo.payer;return e.payer?.type==="workspace"&&e.payer.workspace?t.workspace.replace("{workspace}",e.payer.workspace.name):e.access==="owner"?t.owner:t.other.replace("{owner}",e.owner.name??"the owner")}function k3(e,t){let n=Vo.roles;return e==="link"?t==="prompt"?n.prompt:n.view:e==="workspace"?n.workspace:null}function x3(e,t,n){let s=Vo.summaries;return e==="link"?t==="prompt"?s.prompt:s.view:e==="workspace"?s.workspace.replace("{workspace}",n.workspace.name):s.private.replace("{owner}",n.access==="owner"?"you":n.owner.name??"its owner")}var S3=[{label:null,items:[{key:"account",label:"You",description:"Profile, appearance, notifications and privacy."}]},{label:"Agents and apps",items:[{key:"capabilities",label:"Capabilities",description:"Everything your agents can use, in one list."},{key:"connectors",label:"Connectors",description:"Connect your apps \u2014 every agent can use them."},{key:"browser-logins",label:"Browser logins",description:"Sites your agents' browsers stay signed in to."},{key:"model-subscriptions",label:"Bring your own subscription",description:"Run agents on a plan you already pay for."}]},{label:"Team",items:[{key:"members",label:"Members",description:"People in your workspace."},{key:"billing",label:"Billing",description:"Balance, usage and payment method."},{key:"api",label:"API",description:"Keys, usage and developer tools."}]},{label:"Advanced",items:[{key:"automations",label:"Automations",description:"Scheduled tasks and webhook triggers."},{key:"vaults",label:"Vaults",description:"Save and manage workspace credentials."},{key:"policies",label:"Policies",description:"Control the capabilities available in this workspace."},{key:"import",label:"Import",description:"Bring local sessions in and set up local agents."}]}],_p=[{key:"memory",label:"Memory",href:"/library/memory"},{key:"skills",label:"Skills",href:"/library/skills"},{key:"agents",label:"My agents",href:"/library/agents"},{key:"artifacts",label:"Artifacts",href:"/library/artifacts"},{key:"design-systems",label:"Design systems",href:"/library/design-systems"},{key:"files",label:"Files",href:"/library/files"},{key:"meetings",label:"Meeting notes",href:"/library/meetings"},{key:"todos",label:"Document tasks",href:"/library/todos"}],Cs=Object.fromEntries(_p.map(({key:e,label:t})=>[e,t])),kg={google_calendar:"Google Calendar",microsoft_outlook_calendar:"Outlook Calendar",recall:"your own recorder connection"};function Rp(e){return e?e.kind&&["file","task_file","memory_note","skill_file","artifact","platform_artifact","agent_prompt"].includes(e.kind)?e:e.libraryRef?e.libraryRef:e.agentPromptId?{kind:"agent_prompt",agentId:e.agentPromptId}:e.contextRef?.kind==="agent"?{kind:"agent_prompt",agentId:`agent_${e.contextRef.agentId.replace(/^agent_/,"")}`}:e.platformArtifactId?{kind:"platform_artifact",artifactId:e.platformArtifactId,...typeof e.path=="string"?{path:e.path}:{}}:e.artifactId?{kind:"artifact",artifactId:e.artifactId}:e.shared?.artifactId?{kind:"artifact",artifactId:e.shared.artifactId}:e.fileId||e.shared?.uploaded&&e.shared?.id?{kind:"file",fileId:e.fileId??e.shared.id,...e.sessionId?{sessionId:e.sessionId}:{}}:e.taskId&&e.path?{kind:"task_file",taskId:e.taskId,path:e.path}:e.storeId&&(e.memoryId||e.noteId)?{kind:"memory_note",storeId:e.storeId,memoryId:e.memoryId??e.noteId}:e.skillId&&e.path?{kind:"skill_file",skillId:e.skillId,path:e.path}:null:null}function xg(e){let t=e?.noteFile?{noteFile:e.noteFile}:e?.skillId?{skillId:e.skillId,path:e.path??null}:Rp(e);return JSON.stringify([t,t?.kind==="artifact"?null:e?.workspace??null])}function ro(e,{name:t="AGENTS.md",workspace:n=null,line:s=null}={}){let a=`agent_${e.replace(/^agent_/,"")}`;return Number.isSafeInteger(s)&&s>0&&t.endsWith(`:${s}`)&&(t=t.slice(0,-String(s).length-1)),{agentPromptId:a,libraryRef:{kind:"agent_prompt",agentId:a},name:t,workspace:n,url:`agentsky:agent-prompt/${encodeURIComponent(a)}`}}function C3({ref:e,workspace:t,link:n,artifact:s=null,change:a={},revoke:r=!1}){let o={ref:e,workspace:t,revision:n.revision,...s?{sharingRevision:s.sharingRevision}:{}};return r?o:{...o,workspaceAccess:n.workspaceAccess,members:n.members,publicEnabled:n.publicEnabled,...a}}var lR=0,cR=()=>`pa_${Date.now().toString(36)}_${lR+=1}`;function oo(e){return!!(e.text.trim()||e.images?.length)}function Lp(e){return e.kind==="region"?"Area":e.label||e.role||"element"}function A3(e,t,n,s,a){let r=t?e.find(d=>d.id===t):null;if(s&&r)return{list:e.map(d=>d.id===r.id?{...d,selections:[...d.selections,n]}:d),openId:r.id,dropped:[]};let o=r&&!oo(r)?r.selections.map(d=>d.id):[],l=e.filter(d=>!(r&&d.id===r.id&&!oo(d))).map(d=>r&&d.id===r.id?{...d,committed:!0}:d),c=cR(),u=Math.max(0,...l.map(d=>d.number))+1;return{list:[...l,{id:c,number:u,text:"",images:[],selections:[n],committed:!1,...a?{artifact:a}:{}}],openId:c,dropped:o}}function Op(e){return e.map((t,n)=>t.number===n+1?t:{...t,number:n+1})}var T3=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function uR(e){try{return decodeURIComponent(new URL(e.url).pathname.replace(/^\/+/,""))||e.title||"Preview"}catch{return e.title||"Preview"}}function M3({view:e,chat:t,active:n=!0}){let[s,a]=g(!1),[r,o]=g([]),[l,c]=g(null),[u,d]=g(!1),[p,h]=g(null),[f,m]=g(null),[b,$]=g(!1),[y,w]=g(null),v=Y({annotations:r,openId:l,active:s,artifact:null,doc:null,pageKey:null}),k=Y(!1);k.current=u;let I=e?.artifactId&&Number.isSafeInteger(e.version)?{id:e.artifactId,revision:e.version}:null,C=e?.kind==="site"&&t.sessionId&&!t.readOnly?e.url:null,S=!!C&&n;v.current={...v.current,annotations:r,openId:l,active:s,artifact:I,pageKey:C},D(()=>{a(!1),o([]),c(null),h(null),m(null),v.current.doc=null},[C]);let E=he(V=>C?Qe.annotatePost({url:C,message:V}).catch(()=>!1):Promise.resolve(!1),[C]);D(()=>{C&&E({type:s&&n?"enable":"disable"})},[s,n,C]);let A=he((V,ee)=>{let K=ee?V.find(z=>z.id===ee):null;if(!K)return V;if(!oo(K)){for(let z of K.selections)E({type:"remove",id:z.id});return Op(V.filter(z=>z.id!==K.id))}return V.map(z=>z.id===K.id?{...z,committed:!0}:z)},[E]),_=he(()=>{o(V=>A(V,v.current.openId)),c(null)},[A]);D(()=>ge("artifacts:annotation",V=>{let ee=v.current;if(V.page===ee.pageKey){if(V.type==="ready"){ee.active&&(V.doc&&ee.doc&&V.doc!==ee.doc&&ee.annotations.length&&E({type:"adopt",selections:ee.annotations.flatMap(K=>K.selections)}),V.doc&&(v.current.doc=V.doc));return}if(!(!ee.active||k.current))if(V.type==="select"){let K=A3(ee.annotations,ee.openId,V.selection,V.additive,ee.artifact);for(let z of K.dropped)E({type:"remove",id:z});o(Op(K.list)),c(K.openId),m(null)}else if(V.type==="reopen"){let K=ee.annotations.find(z=>z.selections.some(F=>F.id===V.id));if(!K)return;ee.openId&&ee.openId!==K.id&&o(z=>A(z,ee.openId)),c(K.id)}else V.type==="exit"&&(ee.openId?_():a(!1))}}),[A,_,E]),D(()=>{if(!C)return;for(let ee of r)for(let K of ee.selections)E({type:"number",id:K.id,number:oo(ee)?ee.number:null});let V=r.find(ee=>ee.id===l);E({type:"active-selections",ids:V?V.selections.map(ee=>ee.id):[]})},[r,l,C]),D(()=>{if(!S)return;let V=ee=>{(ee.metaKey||ee.ctrlKey)&&ee.key==="."&&!k.current&&(ee.preventDefault(),a(K=>!K))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[S]);let R=(V,ee)=>o(K=>K.map(z=>z.id===V?{...z,...ee(z)}:z)),W=V=>{let ee=v.current.annotations.find(K=>K.id===V);for(let K of ee?.selections??[])E({type:"remove",id:K.id});o(K=>Op(K.filter(z=>z.id!==V))),v.current.openId===V&&c(null),m(null)},O=()=>{E({type:"clear"}),o([]),c(null),m(null),h(null)},L=async()=>{$(!0),h(null),v.current.openId&&_();try{await E({type:"freeze",frozen:!0}),await new Promise(ee=>setTimeout(ee,80)),m((await Qe.annotateCapture({url:C})).dataUrl)}catch(ee){h(ee.message||"The page could not be captured.")}finally{await E({type:"freeze",frozen:!1}),$(!1)}},Q=async()=>{let V=A(v.current.annotations,v.current.openId);if(o(V),c(null),!(V.length===0||!V.every(oo))){d(!0),h(null);try{await E({type:"freeze",frozen:!0}),await new Promise(K=>setTimeout(K,80));let ee=f??await Qe.annotateCapture({url:C}).then(K=>K.dataUrl,()=>null);await Qe.annotateSend({sessionId:t.sessionId,annotations:V.map(K=>({text:K.text,selections:K.selections,...K.artifact?{artifact:K.artifact}:{},images:K.images.map(({name:z,mediaType:F,bytes:H})=>({name:z,mediaType:F,bytes:H}))})),request:"",screenshot:ee}),E({type:"clear"}),o([]),m(null),a(!1),w(V.length),setTimeout(()=>w(null),3e3)}catch(ee){h(ee.message||"The review couldn't be sent.")}finally{await E({type:"freeze",frozen:!1}),d(!1)}}};return{available:S,active:s,sending:u,count:r.length,sent:y,toggle:()=>{u||a(V=>!V)},bar:S&&s?i`<${hR}
|
|
2063
|
+
`}var u3={selection:null,ranking:[],why:[],failures:{},comment:"",reasonsOpen:!1},oR=(e,t)=>e.trim()?`${e.trimEnd()} ${t}`:t;var Wi={settings:"Settings",billing:"Billing and usage",invite:"Invite people",chatApps:"Message your agents",feedback:"Feedback",signOut:"Sign out"},Hi={planMode:{label:"Plan mode",icon:"lucide-list-todo"},planModeOff:{label:"Turn off Plan mode",icon:"lucide-list-todo"},attachFile:{label:"Attach file",icon:"lucide-paperclip"},chooseRepo:{label:"Choose repo",icon:"lucide-folder"},compareAgents:{label:"Compare agents",icon:"lucide-columns-2"}},Lt={connected:"Connected",accounts:"{count} accounts",addAccount:"+ Add another account",disconnect:"Disconnect {name}",disconnected:"{name} disconnected",apps:"Apps",search:"Search apps",categories:"App categories",all:"All",more:"More apps",manage:"Manage",addAnother:"Add another",useTitle:"Your agents use {name}",useBody:"Connect an account once and every agent you run can work in it.",chatBody:"Connect once and message every agent you run from {name}.",bothBody:"Connect once \u2014 every agent you run can work in {name}, and you can message them there.",workIn:"Work in {name}",postOn:"Post on {name}",messageFrom:"Message your agents from {name}",chatHere:"{name} now talks to this agent",otherChatAs:"In someone else's chat as {name}",unlink:"Unlink {name}",catalogUnavailable:"Your connected apps are available, but the catalog couldn't load.",searchFailed:"Couldn't search the app catalog.",moreFailed:"Couldn't load more apps.",noAppsCatalogDown:"No apps to show while the catalog is unavailable.",noMatches:"No connectable apps match that search.",noApps:"No connectable apps available.",notConnectable:"That app isn't connectable.",startFailed:"Couldn't start the connection.",stoppedWaiting:"Stopped waiting for the connection.",retry:"Try again",sharing:{title:"Shared with your team",body:"Agents in every thread of a workspace can use a connection you share with it. Teammates never see its sign-in, and you can stop at any time.",empty:"Connect an app, then share it here.",sharedWith:"Shared with {workspace}",sharedWithCount:"Shared with {count} workspaces",notShared:"Not shared with a workspace",notUsed:"Not used yet.",usedOnce:"Used 1 time.",used:"Used {count} times."}},h3="Continue from where the imported record ends. Before acting on any path, file, or command result in it, verify it here first \u2014 this sandbox is not the machine it came from.",yg={line:"Turned off by its organization",detail:"This account belongs to a Claude organization that turned off Claude Code on its plan, so AgentSky stopped using it. Ask that organization's admin to allow Claude Code, then reconnect. Or remove it and connect another Claude account."},ea={usageUnshared:"Setup tokens don't report usage",usageFailed:"Couldn't read usage",retry:"Retry",moreActions:"More actions",copyCode:"Copy code",copied:"Copied",deviceCodeHint:"Code rejected?",deviceCodeSettings:"Allow device codes in ChatGPT",deviceCodeFirst:"before connecting."},jo={heading:"Show",scopes:[{id:"mine",label:"Mine"},{id:"everyone",label:"Everyone in the workspace"}],storageKey:"agentsky.rail-scope"},Ep={title:"Task emails",note:"Sent to your account email. At most one email each time a task starts waiting or finishes.",kinds:[{kind:"needs_you",title:"A task is waiting on you",detail:"An agent asked a question or needs your approval, and you have not seen it yet."},{kind:"done",title:"A task has a result",detail:"A longer task finished while you were away."}]},vg={needs_you:"Needs you",working:"Working",done:"New result",idle:"Idle"},Gi={filterTip:"Filter threads",filters:[{id:"active",label:"Active"},{id:"needs_you",label:"Needs you"},{id:"archived",label:"Archived"},{id:"all",label:"All"}],empty:"Your chats appear here.",emptyArchived:"No archived threads.",emptyNeedsYou:"Nothing needs you here."},Vo={levels:{private:"Private",workspace:"Everyone in {workspace}",link:"Anyone with the link"},roles:{workspace:"Can continue",view:"Can view",prompt:"Can edit"},linkRoles:[{value:"view",label:"Can view"},{value:"prompt",label:"Can edit"}],summaries:{private:"Only {owner} can use it.",workspace:"Everyone in {workspace} can find it and continue it.",view:"Anyone with the link can view this thread.",prompt:"Anyone with the link can send messages in this thread."},payer:{workspace:"Messages sent through the link are paid by {workspace}.",owner:"Messages sent through the link use your credits.",other:"Messages sent through the link use {owner}\u2019s credits."}};function f3(e,t,n=Date.now()){if(e>0)return`${e}% left`;let s=t?iR(t,n):null;return s?`Resets ${s}`:"Used up"}function Ko(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>s in t?String(t[s]):n)}function m3(e,t){if(t)return"Signed out";if(e==="needs_reconnect")return"Needs reconnecting";if(e==="org_disabled")return yg.line;let n=e.replace(/_/g," ");return n.charAt(0).toUpperCase()+n.slice(1)}function g3(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $3(e,t=Date.now()){let n=new Date(e),s=Math.floor((t-n.getTime())/6e4);if(s<1)return"Now";if(s<60)return`${s}m ago`;let a=Math.floor(s/60);if(a<24)return`${a}h ago`;let r=Math.floor(a/24);return r===1?"Yesterday":r<7?`${r}d ago`:n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function iR(e,t=Date.now()){let n=new Date(e).getTime()-t;if(!Number.isFinite(n)||n<=0)return null;let s=Math.round(n/6e4);if(s<60)return`in ${s}m`;let a=Math.round(s/60);return a<48?`in ${a}h`:`in ${Math.round(a/24)}d`}function b3(e,t){let n=e.agents??[],s=[];return n.length===1?s.push({kind:"agent",text:t(n[0]),icon:null}):n.length>1&&s.push({kind:"agents",text:`${n.length} agents`,icon:"users"}),e.mac&&s.push({kind:"mac",text:e.mac,icon:"laptop"}),e.statusLine&&s.push({kind:"status",text:e.statusLine,icon:"message-square"}),{meta:e.updatedLabel?e.updatedLabel.replace(/ ago$/,""):null,rows:s}}function y3(e,t){return t?"link":e==="workspace"?"workspace":"private"}function wg(e,t){let n=Vo.levels;return e==="link"?n.link:e==="workspace"?n.workspace.replace("{workspace}",t):n.private}function v3(e,t,n,s=e){let a=Vo.levels;return[...s==="private"?[{value:"private",label:a.private}]:[],{value:"workspace",label:a.workspace.replace("{workspace}",t)},...n?[{value:"link",label:a.link}]:[]]}function w3(e){let t=Vo.payer;return e.payer?.type==="workspace"&&e.payer.workspace?t.workspace.replace("{workspace}",e.payer.workspace.name):e.access==="owner"?t.owner:t.other.replace("{owner}",e.owner.name??"the owner")}function k3(e,t){let n=Vo.roles;return e==="link"?t==="prompt"?n.prompt:n.view:e==="workspace"?n.workspace:null}function x3(e,t,n){let s=Vo.summaries;return e==="link"?t==="prompt"?s.prompt:s.view:e==="workspace"?s.workspace.replace("{workspace}",n.workspace.name):s.private.replace("{owner}",n.access==="owner"?"you":n.owner.name??"its owner")}var S3=[{label:null,items:[{key:"account",label:"You",description:"Profile, appearance, notifications and privacy."}]},{label:"Agents and apps",items:[{key:"capabilities",label:"Capabilities",description:"Everything your agents can use, in one list."},{key:"connectors",label:"Connectors",description:"Connect your apps \u2014 every agent can use them."},{key:"browser-logins",label:"Browser logins",description:"Sites your agents' browsers stay signed in to."},{key:"model-subscriptions",label:"Bring your own subscription",description:"Run agents on a plan you already pay for."}]},{label:"Team",items:[{key:"members",label:"Members",description:"People in your workspace."},{key:"billing",label:"Billing",description:"Balance, usage and payment method."},{key:"api",label:"API",description:"Keys, usage and developer tools."}]},{label:"Advanced",items:[{key:"automations",label:"Automations",description:"Scheduled tasks and webhook triggers."},{key:"vaults",label:"Vaults",description:"Save and manage workspace credentials."},{key:"policies",label:"Policies",description:"Control the capabilities available in this workspace."},{key:"import",label:"Import",description:"Bring local sessions in and set up local agents."}]}],_p=[{key:"memory",label:"Memory",href:"/library/memory"},{key:"skills",label:"Skills",href:"/library/skills"},{key:"agents",label:"My agents",href:"/library/agents"},{key:"artifacts",label:"Artifacts",href:"/library/artifacts"},{key:"design-systems",label:"Design systems",href:"/library/design-systems"},{key:"files",label:"Files",href:"/library/files"},{key:"meetings",label:"Meeting notes",href:"/library/meetings"},{key:"todos",label:"Document tasks",href:"/library/todos"}],Cs=Object.fromEntries(_p.map(({key:e,label:t})=>[e,t])),kg={google_calendar:"Google Calendar",microsoft_outlook_calendar:"Outlook Calendar",recall:"your own recorder connection"};function Rp(e){return e?e.kind&&["file","task_file","memory_note","skill_file","artifact","platform_artifact","agent_prompt"].includes(e.kind)?e:e.libraryRef?e.libraryRef:e.agentPromptId?{kind:"agent_prompt",agentId:e.agentPromptId}:e.contextRef?.kind==="agent"?{kind:"agent_prompt",agentId:`agent_${e.contextRef.agentId.replace(/^agent_/,"")}`}:e.platformArtifactId?{kind:"platform_artifact",artifactId:e.platformArtifactId,...typeof e.path=="string"?{path:e.path}:{}}:e.artifactId?{kind:"artifact",artifactId:e.artifactId}:e.shared?.artifactId?{kind:"artifact",artifactId:e.shared.artifactId}:e.fileId||e.shared?.uploaded&&e.shared?.id?{kind:"file",fileId:e.fileId??e.shared.id,...e.sessionId?{sessionId:e.sessionId}:{}}:e.taskId&&e.path?{kind:"task_file",taskId:e.taskId,path:e.path}:e.storeId&&(e.memoryId||e.noteId)?{kind:"memory_note",storeId:e.storeId,memoryId:e.memoryId??e.noteId}:e.skillId&&e.path?{kind:"skill_file",skillId:e.skillId,path:e.path}:null:null}function xg(e){let t=e?.noteFile?{noteFile:e.noteFile}:e?.skillId?{skillId:e.skillId,path:e.path??null}:Rp(e);return JSON.stringify([t,t?.kind==="artifact"?null:e?.workspace??null])}function ro(e,{name:t="AGENTS.md",workspace:n=null,line:s=null}={}){let a=`agent_${e.replace(/^agent_/,"")}`;return Number.isSafeInteger(s)&&s>0&&t.endsWith(`:${s}`)&&(t=t.slice(0,-String(s).length-1)),{agentPromptId:a,libraryRef:{kind:"agent_prompt",agentId:a},name:t,workspace:n,url:`agentsky:agent-prompt/${encodeURIComponent(a)}`}}function C3({ref:e,workspace:t,link:n,artifact:s=null,change:a={},revoke:r=!1}){let o={ref:e,workspace:t,revision:n.revision,...s?{sharingRevision:s.sharingRevision}:{}};return r?o:{...o,workspaceAccess:n.workspaceAccess,members:n.members,publicEnabled:n.publicEnabled,...a}}var lR=0,cR=()=>`pa_${Date.now().toString(36)}_${lR+=1}`;function oo(e){return!!(e.text.trim()||e.images?.length)}function Lp(e){return e.kind==="region"?"Area":e.label||e.role||"element"}function A3(e,t,n,s,a){let r=t?e.find(d=>d.id===t):null;if(s&&r)return{list:e.map(d=>d.id===r.id?{...d,selections:[...d.selections,n]}:d),openId:r.id,dropped:[]};let o=r&&!oo(r)?r.selections.map(d=>d.id):[],l=e.filter(d=>!(r&&d.id===r.id&&!oo(d))).map(d=>r&&d.id===r.id?{...d,committed:!0}:d),c=cR(),u=Math.max(0,...l.map(d=>d.number))+1;return{list:[...l,{id:c,number:u,text:"",images:[],selections:[n],committed:!1,...a?{artifact:a}:{}}],openId:c,dropped:o}}function Op(e){return e.map((t,n)=>t.number===n+1?t:{...t,number:n+1})}var T3=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function uR(e){try{return decodeURIComponent(new URL(e.url).pathname.replace(/^\/+/,""))||e.title||"Preview"}catch{return e.title||"Preview"}}function M3({view:e,chat:t,active:n=!0}){let[s,a]=g(!1),[r,o]=g([]),[l,c]=g(null),[u,d]=g(!1),[p,h]=g(null),[f,m]=g(null),[b,$]=g(!1),[y,w]=g(null),v=Y({annotations:r,openId:l,active:s,artifact:null,doc:null,pageKey:null}),k=Y(!1);k.current=u;let I=e?.artifactId&&Number.isSafeInteger(e.version)?{id:e.artifactId,revision:e.version}:null,C=e?.kind==="site"&&t.sessionId&&!t.readOnly?e.url:null,S=!!C&&n;v.current={...v.current,annotations:r,openId:l,active:s,artifact:I,pageKey:C},D(()=>{a(!1),o([]),c(null),h(null),m(null),v.current.doc=null},[C]);let E=he(V=>C?Qe.annotatePost({url:C,message:V}).catch(()=>!1):Promise.resolve(!1),[C]);D(()=>{C&&E({type:s&&n?"enable":"disable"})},[s,n,C]);let A=he((V,ee)=>{let K=ee?V.find(z=>z.id===ee):null;if(!K)return V;if(!oo(K)){for(let z of K.selections)E({type:"remove",id:z.id});return Op(V.filter(z=>z.id!==K.id))}return V.map(z=>z.id===K.id?{...z,committed:!0}:z)},[E]),_=he(()=>{o(V=>A(V,v.current.openId)),c(null)},[A]);D(()=>ge("artifacts:annotation",V=>{let ee=v.current;if(V.page===ee.pageKey){if(V.type==="ready"){ee.active&&(V.doc&&ee.doc&&V.doc!==ee.doc&&ee.annotations.length&&E({type:"adopt",selections:ee.annotations.flatMap(K=>K.selections)}),V.doc&&(v.current.doc=V.doc));return}if(!(!ee.active||k.current))if(V.type==="select"){let K=A3(ee.annotations,ee.openId,V.selection,V.additive,ee.artifact);for(let z of K.dropped)E({type:"remove",id:z});o(Op(K.list)),c(K.openId),m(null)}else if(V.type==="reopen"){let K=ee.annotations.find(z=>z.selections.some(F=>F.id===V.id));if(!K)return;ee.openId&&ee.openId!==K.id&&o(z=>A(z,ee.openId)),c(K.id)}else V.type==="exit"&&(ee.openId?_():a(!1))}}),[A,_,E]),D(()=>{if(!C)return;for(let ee of r)for(let K of ee.selections)E({type:"number",id:K.id,number:oo(ee)?ee.number:null});let V=r.find(ee=>ee.id===l);E({type:"active-selections",ids:V?V.selections.map(ee=>ee.id):[]})},[r,l,C]),D(()=>{if(!S)return;let V=ee=>{(ee.metaKey||ee.ctrlKey)&&ee.key==="."&&!k.current&&(ee.preventDefault(),a(K=>!K))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[S]);let R=(V,ee)=>o(K=>K.map(z=>z.id===V?{...z,...ee(z)}:z)),W=V=>{let ee=v.current.annotations.find(K=>K.id===V);for(let K of ee?.selections??[])E({type:"remove",id:K.id});o(K=>Op(K.filter(z=>z.id!==V))),v.current.openId===V&&c(null),m(null)},O=()=>{E({type:"clear"}),o([]),c(null),m(null),h(null)},L=async()=>{$(!0),h(null),v.current.openId&&_();try{await E({type:"freeze",frozen:!0}),await new Promise(ee=>setTimeout(ee,80)),m((await Qe.annotateCapture({url:C})).dataUrl)}catch(ee){h(ee.message||"The page could not be captured.")}finally{await E({type:"freeze",frozen:!1}),$(!1)}},Q=async()=>{let V=A(v.current.annotations,v.current.openId);if(o(V),c(null),!(V.length===0||!V.every(oo))){d(!0),h(null);try{await E({type:"freeze",frozen:!0}),await new Promise(K=>setTimeout(K,80));let ee=f??await Qe.annotateCapture({url:C}).then(K=>K.dataUrl,()=>null);await Qe.annotateSend({sessionId:t.sessionId,annotations:V.map(K=>({text:K.text,selections:K.selections,...K.artifact?{artifact:K.artifact}:{},images:K.images.map(({name:z,mediaType:F,bytes:H})=>({name:z,mediaType:F,bytes:H}))})),request:"",screenshot:ee}),E({type:"clear"}),o([]),m(null),a(!1),w(V.length),setTimeout(()=>w(null),3e3)}catch(ee){h(ee.message||"The review couldn't be sent.")}finally{await E({type:"freeze",frozen:!1}),d(!1)}}};return{available:S,active:s,sending:u,count:r.length,sent:y,toggle:()=>{u||a(V=>!V)},bar:S&&s?i`<${hR}
|
|
2064
2064
|
url=${uR(e)} annotations=${r} openId=${l} sending=${u} capturing=${b} captured=${f} error=${p}
|
|
2065
2065
|
onOpen=${V=>{v.current.openId&&v.current.openId!==V&&o(ee=>A(ee,v.current.openId)),c(V)}}
|
|
2066
2066
|
onText=${(V,ee)=>R(V,()=>({text:ee}))}
|
|
@@ -4894,20 +4894,20 @@ ${t.slice(-fg)}`:t;return i`
|
|
|
4894
4894
|
</div>
|
|
4895
4895
|
</${ci}>
|
|
4896
4896
|
`}function QN(e){let t=new Map;for(let s of e??[])t.has(s.appSlug)||t.set(s.appSlug,{appSlug:s.appSlug,appName:s.appName,accounts:[]}),t.get(s.appSlug).accounts.push(s);let n=s=>Number.isFinite(Date.parse(s.createdAt??""))?`Connected ${new Date(s.createdAt).toLocaleString()} \xB7 `:"";return[...t.values()].map(s=>({...s,accounts:s.accounts.map(a=>({...a,displayLabel:s.accounts.filter(r=>r.label===a.label).length>1?`${a.label} \xB7 ${n(a)}Connection ${a.id}`:a.label}))}))}var Q$=new Map,eP=new Set(["github","notion"]);function tP(e,t){let n=`${t??""}|${e??""}`;return Q$.has(n)||Q$.set(n,is.logo({src:e,slug:t}).then(s=>s.dataUrl,()=>null)),Q$.get(n)}function Kc({name:e,src:t=null,slug:n=null}){let[s,a]=g(null);D(()=>{if(a(null),!t&&!n)return;let o=!0;return tP(t,n).then(l=>{o&&a(l)}),()=>{o=!1}},[t,n]);let r=String(e??"?").slice(0,2).toUpperCase();return s?i`<span class=${`connector-logo has-mark ${eP.has(n)?"is-mono":""}`} aria-hidden="true" data-logo=${n??""}><img src=${s} alt="" onError=${()=>a(null)} /></span>`:i`<span class="connector-logo" aria-hidden="true">${r}</span>`}var nP=5;function sP(e){let t=e.key?`the workspace key "${e.key.name}"`:e.started_by?.name??"a teammate";return`${new Date(e.at).toLocaleString()} \xB7 a thread started by ${t} \xB7 ${e.method} ${e.host}`}function aP({revision:e,onNote:t,onError:n}){let[s,a]=g(null),[r,o]=g(!1),l=he(()=>is.sharing().then(h=>a(h.sharing??null),()=>a(null)),[]);if(D(()=>{l()},[l,e]),An(()=>{l()}),!s||s.connections.length===0&&s.fromTeammates.length===0)return null;let c=async(h,f,m)=>{o(!0),n(null);try{await is.share({workspace:h.slug,connectionId:f.id,shared:m}),t(m?`${h.name} can now use ${f.app_name}.`:`${h.name} can no longer use ${f.app_name}.`),await l()}catch(b){n(b.message||(m?"It could not be shared. Try again.":"Sharing could not be stopped. Try again."))}finally{o(!1)}},u=h=>s.workspaces.filter(f=>s.shared.some(m=>m.connection_id===h.id&&m.workspace.slug===f.slug)),d=async(h,f)=>{let m=u(f),b=[{heading:!0,label:`Share ${f.app_name} with`},...s.workspaces.map(w=>({label:w.name,glyph:m.includes(w)?i`<${q} name="lucide-check" size=${14} />`:i`<span></span>`}))],$=await Yn({anchor:h.currentTarget.getBoundingClientRect(),rows:b,align:"end"}),y=$===null?null:s.workspaces[$-1];y&&await c(y,f,!m.includes(y))},p=s.shared.length>0||s.fromTeammates.length>0;return i`
|
|
4897
|
-
<details class="connector-section connector-sharing" aria-label=${
|
|
4897
|
+
<details class="connector-section connector-sharing" aria-label=${Lt.sharing.title} data-shared-connections open=${p}>
|
|
4898
4898
|
<summary>
|
|
4899
4899
|
<${q} name="lucide-users" size=${16} />
|
|
4900
|
-
<h3 data-tooltip=${
|
|
4900
|
+
<h3 data-tooltip=${Lt.sharing.body}>${Lt.sharing.title}</h3>
|
|
4901
4901
|
<span class="quiet">${p?`${s.shared.length} shared`:"Nothing shared"}</span>
|
|
4902
4902
|
<${q} name="lucide-chevron-down" size=${14} />
|
|
4903
4903
|
</summary>
|
|
4904
|
-
${s.connections.length===0?i`<div class="group"><div class="setting"><p class="quiet">${
|
|
4904
|
+
${s.connections.length===0?i`<div class="group"><div class="setting"><p class="quiet">${Lt.sharing.empty}</p></div></div>`:i`
|
|
4905
4905
|
<div class="group">
|
|
4906
4906
|
${s.connections.map(h=>{let f=u(h),m=s.shared.filter($=>$.connection_id===h.id),b=m.reduce(($,y)=>$+y.use_count,0);return i`
|
|
4907
4907
|
<div class="setting connector-share" key=${h.id} data-share-row=${h.app_name} data-shared=${f.length?"true":"false"}>
|
|
4908
|
-
<div class="setting-text" data-share-uses=${f.length?b:void 0} data-tooltip=${f.length?[b===0?
|
|
4908
|
+
<div class="setting-text" data-share-uses=${f.length?b:void 0} data-tooltip=${f.length?[b===0?Lt.sharing.notUsed:b===1?Lt.sharing.usedOnce:Ko(Lt.sharing.used,{count:b}),...m.flatMap($=>$.uses).slice(0,nP).map(sP)].join("; "):null}>
|
|
4909
4909
|
<strong>${h.app_name}</strong>
|
|
4910
|
-
<span>${h.label} · ${Ko(f.length?
|
|
4910
|
+
<span>${h.label} · ${f.length===0?Lt.sharing.notShared:Ko(f.length===1?Lt.sharing.sharedWith:Lt.sharing.sharedWithCount,{workspace:f[0].name,count:f.length})}</span>
|
|
4911
4911
|
</div>
|
|
4912
4912
|
<button type="button" class="push push-small" aria-haspopup="menu" disabled=${r} onClick=${$=>{d($,h)}}>${f.length?"Change":"Share\u2026"}</button>
|
|
4913
4913
|
</div>
|
|
@@ -4920,33 +4920,33 @@ ${t.slice(-fg)}`:t;return i`
|
|
|
4920
4920
|
</div>
|
|
4921
4921
|
`:null}
|
|
4922
4922
|
</details>
|
|
4923
|
-
`}function rP(){let[e,t]=g(null),[n,s]=g(null),[a,r]=g([]),[o,l]=g(!1),[c,u]=g(""),[d,p]=g(null),[h,f]=g(!1),[m,b]=g(null),[$,y]=g(null),[w,v]=g(null),[k,I]=g(!1),[C,S]=g(null),E=Y(new Set),A=Y(null),_=he(()=>is.list({}).then(z=>(t(z.apps??[]),s(z.nextCursor??null),r(z.connections??[]),l(!!z.catalogError),b(null),z.connections??[]),z=>(b(z.message),null)),[]);D(()=>{_().then(z=>{E.current=new Set((z??[]).map(F=>F.id))})},[_]);let R=he(z=>{if(!z)return;let F=z.find(H=>!E.current.has(H.id));if(E.current=new Set(z.map(H=>H.id)),F){let H=F.appSlug==="social_publishing"?`${F.appName}: ${F.label}`:F.appName;us(`${H} connected`),y(null)}},[]);D(()=>{let z=()=>{_().then(R)};return window.addEventListener("focus",z),()=>window.removeEventListener("focus",z)},[_,R]),An(()=>{_().then(R)}),D(()=>{if(!$)return;let z=setInterval(()=>{_().then(R)},KN);return()=>clearInterval(z)},[$,_,R]),D(()=>{let z=c.trim();if(f(!1),!z){p(null);return}let F=!0,H=setTimeout(()=>{is.list({q:z}).then(ae=>{F&&p(ae.apps??[])},()=>{F&&f(!0)})},250);return()=>{F=!1,clearTimeout(H)}},[c]);let W=async z=>{b(null);let F=Date.now();y({slug:z.slug,name:z.name,imgSrc:z.imgSrc??null,since:F,opened:!1});try{await is.connect({app:z.slug}),y(H=>H?.since===F?{...H,opened:!0}:H)}catch(H){y(ae=>ae?.since===F?null:ae),b(H.code==="unknown_app"?
|
|
4923
|
+
`}function rP(){let[e,t]=g(null),[n,s]=g(null),[a,r]=g([]),[o,l]=g(!1),[c,u]=g(""),[d,p]=g(null),[h,f]=g(!1),[m,b]=g(null),[$,y]=g(null),[w,v]=g(null),[k,I]=g(!1),[C,S]=g(null),E=Y(new Set),A=Y(null),_=he(()=>is.list({}).then(z=>(t(z.apps??[]),s(z.nextCursor??null),r(z.connections??[]),l(!!z.catalogError),b(null),z.connections??[]),z=>(b(z.message),null)),[]);D(()=>{_().then(z=>{E.current=new Set((z??[]).map(F=>F.id))})},[_]);let R=he(z=>{if(!z)return;let F=z.find(H=>!E.current.has(H.id));if(E.current=new Set(z.map(H=>H.id)),F){let H=F.appSlug==="social_publishing"?`${F.appName}: ${F.label}`:F.appName;us(`${H} connected`),y(null)}},[]);D(()=>{let z=()=>{_().then(R)};return window.addEventListener("focus",z),()=>window.removeEventListener("focus",z)},[_,R]),An(()=>{_().then(R)}),D(()=>{if(!$)return;let z=setInterval(()=>{_().then(R)},KN);return()=>clearInterval(z)},[$,_,R]),D(()=>{let z=c.trim();if(f(!1),!z){p(null);return}let F=!0,H=setTimeout(()=>{is.list({q:z}).then(ae=>{F&&p(ae.apps??[])},()=>{F&&f(!0)})},250);return()=>{F=!1,clearTimeout(H)}},[c]);let W=async z=>{b(null);let F=Date.now();y({slug:z.slug,name:z.name,imgSrc:z.imgSrc??null,since:F,opened:!1});try{await is.connect({app:z.slug}),y(H=>H?.since===F?{...H,opened:!0}:H)}catch(H){y(ae=>ae?.since===F?null:ae),b(H.code==="unknown_app"?Lt.notConnectable:H.message||Lt.startFailed)}},O=async z=>{v(z.id),b(null);try{await is.disconnect({id:z.id}),us(Ko(Lt.disconnected,{name:z.displayLabel??z.label})),R(await _())}catch(F){b(F.message)}finally{v(null)}},L=he(async()=>{if(k||!n)return;let z=n;I(!0),S(null);try{let F=await is.list({after:z});t(H=>[...H??[],...(F.apps??[]).filter(ae=>!(H??[]).some(j=>j.slug===ae.slug))]),s(F.nextCursor??null)}catch{s(null),S(z)}finally{I(!1)}},[n,k]);D(()=>{let z=A.current;if(!z||!n||c.trim()||typeof IntersectionObserver>"u")return;let F=new IntersectionObserver(H=>{H.some(ae=>ae.isIntersecting)&&L()});return F.observe(z),()=>F.disconnect()},[n,c,L,e]);let Q=QN(a),V=new Set(a.map(z=>z.appSlug)),ee=c.trim().toLowerCase(),K=d??(ee?(e??[]).filter(z=>z.name.toLowerCase().includes(ee)||z.slug.toLowerCase().includes(ee)):e??[]);return i`
|
|
4924
4924
|
<div class="library-main-inner">
|
|
4925
|
-
${$?i`<${JN} waiting=${$} onReopen=${()=>{W($)}} onCancel=${()=>{y(null),us(
|
|
4926
|
-
${m?i`<p class="alert" role="alert">${m} ${e===null?i`<button type="button" class="link" onClick=${()=>_()}>${
|
|
4927
|
-
${o?i`<div class="connector-banner" role="alert"><p>${
|
|
4925
|
+
${$?i`<${JN} waiting=${$} onReopen=${()=>{W($)}} onCancel=${()=>{y(null),us(Lt.stoppedWaiting)}} />`:null}
|
|
4926
|
+
${m?i`<p class="alert" role="alert">${m} ${e===null?i`<button type="button" class="link" onClick=${()=>_()}>${Lt.retry}</button>`:null}</p>`:null}
|
|
4927
|
+
${o?i`<div class="connector-banner" role="alert"><p>${Lt.catalogUnavailable}</p><button type="button" class="link" onClick=${()=>_()}>${Lt.retry}</button></div>`:null}
|
|
4928
4928
|
${e===null&&!m?i`<p class="quiet"><${ne} /> Loading apps…</p>`:null}
|
|
4929
4929
|
|
|
4930
4930
|
${Q.length?i`
|
|
4931
|
-
<section class="connector-section" aria-label=${
|
|
4932
|
-
<h3>${
|
|
4931
|
+
<section class="connector-section" aria-label=${Lt.connected}>
|
|
4932
|
+
<h3>${Lt.connected}</h3>
|
|
4933
4933
|
<div class="connector-cards">
|
|
4934
4934
|
${Q.map(z=>i`
|
|
4935
4935
|
<div class="connector-card" key=${z.appSlug} data-connected-app=${z.appSlug}>
|
|
4936
4936
|
<div class="connector-card-head">
|
|
4937
4937
|
<${Kc} name=${z.appName} slug=${z.appSlug} src=${z.accounts.find(F=>F.imgSrc)?.imgSrc??null} />
|
|
4938
4938
|
<strong>${z.appName}</strong>
|
|
4939
|
-
<span class="connector-state"><${q} name="check" size=${13} /> ${z.accounts.length>1?Ko(
|
|
4939
|
+
<span class="connector-state"><${q} name="check" size=${13} /> ${z.accounts.length>1?Ko(Lt.accounts,{count:z.accounts.length}):Lt.connected}</span>
|
|
4940
4940
|
</div>
|
|
4941
4941
|
<ul>
|
|
4942
4942
|
${z.accounts.map(F=>i`
|
|
4943
4943
|
<li key=${F.id}>
|
|
4944
4944
|
<span title=${F.displayLabel??F.label}>${F.displayLabel??F.label}</span>
|
|
4945
|
-
<button type="button" class="tool-button" aria-label=${Ko(
|
|
4945
|
+
<button type="button" class="tool-button" aria-label=${Ko(Lt.disconnect,{name:F.displayLabel??F.label})} data-tooltip=${Ko(Lt.disconnect,{name:F.displayLabel??F.label})} disabled=${w!==null} onClick=${()=>O(F)}>${w===F.id?i`<${ne} />`:i`<${q} name="close" size=${13} />`}</button>
|
|
4946
4946
|
</li>
|
|
4947
4947
|
`)}
|
|
4948
4948
|
</ul>
|
|
4949
|
-
<button type="button" class="link connector-add" disabled=${$!==null} onClick=${()=>W({slug:z.appSlug,name:z.appName,imgSrc:z.accounts.find(F=>F.imgSrc)?.imgSrc??null})}>${
|
|
4949
|
+
<button type="button" class="link connector-add" disabled=${$!==null} onClick=${()=>W({slug:z.appSlug,name:z.appName,imgSrc:z.accounts.find(F=>F.imgSrc)?.imgSrc??null})}>${Lt.addAccount}</button>
|
|
4950
4950
|
</div>
|
|
4951
4951
|
`)}
|
|
4952
4952
|
</div>
|
|
@@ -4956,9 +4956,9 @@ ${t.slice(-fg)}`:t;return i`
|
|
|
4956
4956
|
${e!==null?i`<${aP} revision=${a.map(z=>z.id).join(",")} onNote=${us} onError=${b} />`:null}
|
|
4957
4957
|
|
|
4958
4958
|
${e!==null?i`
|
|
4959
|
-
<section class="connector-section" aria-label=${
|
|
4960
|
-
<div class="connector-section-head"><h3>${
|
|
4961
|
-
${h?i`<p class="alert" role="alert">${
|
|
4959
|
+
<section class="connector-section" aria-label=${Lt.apps}>
|
|
4960
|
+
<div class="connector-section-head"><h3>${Lt.apps}</h3><span class="toolbar-space"></span><${Bp} value=${c} onChange=${u} label=${Lt.search} /></div>
|
|
4961
|
+
${h?i`<p class="alert" role="alert">${Lt.searchFailed}</p>`:ee&&d===null&&K.length===0?i`<p class="quiet"><${ne} /> Searching…</p>`:K.length===0?i`<p class="quiet">${o?Lt.noAppsCatalogDown:ee?Lt.noMatches:Lt.noApps}</p>`:i`
|
|
4962
4962
|
<div class="connector-grid">
|
|
4963
4963
|
${K.map(z=>i`
|
|
4964
4964
|
<button type="button" key=${z.slug} class=${`connector-tile ${V.has(z.slug)?"is-connected":""}`} data-app=${z.slug} disabled=${$!==null}
|
|
@@ -4971,7 +4971,7 @@ ${t.slice(-fg)}`:t;return i`
|
|
|
4971
4971
|
</div>
|
|
4972
4972
|
`}
|
|
4973
4973
|
<div ref=${A} class="connector-sentinel" data-apps-sentinel>${k?i`<${ne} />`:null}</div>
|
|
4974
|
-
${C?i`<div class="connector-banner" role="alert"><p>${
|
|
4974
|
+
${C?i`<div class="connector-banner" role="alert"><p>${Lt.moreFailed}</p><button type="button" class="link" onClick=${()=>{let z=C;S(null),s(z)}}>${Lt.retry}</button></div>`:null}
|
|
4975
4975
|
</section>
|
|
4976
4976
|
`:null}
|
|
4977
4977
|
|
|
@@ -5397,7 +5397,7 @@ Tycoon`} value=${$} disabled=${!e} onInput=${v=>u(v.target.value)} onBlur=${()=>
|
|
|
5397
5397
|
<${nB} key=${`${$}:${s}`} section=${s} auth=${d} info=${h} settings=${w} context=${t} workspaceName=${m} onSection=${l} target=${r} request=${e} />
|
|
5398
5398
|
</${o1}>
|
|
5399
5399
|
${c?i`<${c$} onClose=${()=>u(!1)} />`:null}
|
|
5400
|
-
`}cs({id:"settings",title:"Settings",icon:"settings",nav:!1,render:e=>i`<${sB} payload=${e.payload} context=${e} />`});function J8(e={}){return["near","far"].map(t=>({side:t,text:e[t]??""})).filter(t=>t.text)}function Q8(e,t){if(!t)return e;if(t.type==="call-start"&&t.id)return{...e,[t.id]:{id:t.id,app:t.app,note:t.note,startedAt:t.startedAt,recording:!t.recordingFailed,sides:{},problem:null}};if(t.type==="transcript"&&t.callId&&e[t.callId]&&t.text){let n=e[t.callId];return{...e,[t.callId]:{...n,sides:{...n.sides,[t.side==="far"?"far":"near"]:t.text}}}}if(t.type==="error"&&t.callId&&e[t.callId])return{...e,[t.callId]:{...e[t.callId],problem:t.message}};if(t.type==="call-end"&&t.id){let{[t.id]:n,...s}=e;return s}return t.type==="stopped"?{}:e}function ex(e,t){let n={};for(let s of t?.calls??[])n[s.id]=e[s.id]??{id:s.id,app:s.app,note:s.note,startedAt:s.startedAt,recording:s.recording!==!1,sides:{},problem:null};return n}function tx(e){return e?.enabled?e.signedIn?"Calls this Mac noticed. Each note is also shared with your workspace as a document, and reaches the workspace's CRM when someone from outside was on the call.":"Calls this Mac noticed. Sign in and each new note is also shared with your workspace as a document.":"Off. Turn on the Meetings plugin in Plugins to note calls here."}function nx(e){return e.shared?.artifactId?e.shared.uploaded===!1?"Changed here and in the shared document":"Shared with your workspace":e.shared?.uploaded===!0?"In the workspace's files":e.shared?.uploaded===!1?"Not shared with your workspace yet":"On this Mac only"}function sx(e){let t=n=>n.map(s=>s.tokens?t(s.tokens):s.type==="space"||s.type==="br"?" ":s.text??s.raw??"").join("");return t(
|
|
5400
|
+
`}cs({id:"settings",title:"Settings",icon:"settings",nav:!1,render:e=>i`<${sB} payload=${e.payload} context=${e} />`});function J8(e={}){return["near","far"].map(t=>({side:t,text:e[t]??""})).filter(t=>t.text)}function Q8(e,t){if(!t)return e;if(t.type==="call-start"&&t.id)return{...e,[t.id]:{id:t.id,app:t.app,note:t.note,startedAt:t.startedAt,recording:!t.recordingFailed,sides:{},problem:null}};if(t.type==="transcript"&&t.callId&&e[t.callId]&&t.text){let n=e[t.callId];return{...e,[t.callId]:{...n,sides:{...n.sides,[t.side==="far"?"far":"near"]:t.text}}}}if(t.type==="error"&&t.callId&&e[t.callId])return{...e,[t.callId]:{...e[t.callId],problem:t.message}};if(t.type==="call-end"&&t.id){let{[t.id]:n,...s}=e;return s}return t.type==="stopped"?{}:e}function ex(e,t){let n={};for(let s of t?.calls??[])n[s.id]=e[s.id]??{id:s.id,app:s.app,note:s.note,startedAt:s.startedAt,recording:s.recording!==!1,sides:{},problem:null};return n}function tx(e){return e?.enabled?e.signedIn?"Calls this Mac noticed. Each note is also shared with your workspace as a document, and reaches the workspace's CRM when someone from outside was on the call.":"Calls this Mac noticed. Sign in and each new note is also shared with your workspace as a document.":"Off. Turn on the Meetings plugin in Plugins to note calls here."}function nx(e){return e.shared?.artifactId?e.shared.uploaded===!1?"Changed here and in the shared document":"Shared with your workspace":e.shared?.uploaded===!0?"In the workspace's files":e.shared?.uploaded===!1?"Not shared with your workspace yet":"On this Mac only"}function sx(e){let t=n=>n.map(s=>s.tokens?t(s.tokens):s.type==="space"||s.type==="br"?" ":s.text??s.raw??"").join("");return t(Ot.lexer(String(e??""))).replace(/\s+/g," ").trim()}function ax(){let[e,t]=g({}),[n,s]=g(!1),[a,r]=g(!1);D(()=>{let h=!0,f=ge("meeting-notes:event",m=>{!h||!m||(m.type==="call-start"&&s(!1),m.type==="error"&&m.callId&&s(!0),t(b=>Q8(b,m)))});return Ht.status().then(m=>{h&&(t(b=>ex(b,m)),m?.noticeDue&&r(!0))},()=>{}),()=>{h=!1,f?.()}},[]);let o=()=>{r(!1),Ht.set({noticeSeen:!0}).catch(()=>{})},l=()=>{o(),_t("plugins",{id:"meetings"})},c=Object.values(e);if(c.length===0)return a?i`
|
|
5401
5401
|
<div class="meeting-live" role="status" data-meeting-notice>
|
|
5402
5402
|
<div class="meeting-live-head is-static">
|
|
5403
5403
|
<${q} name="mic" size=${13} />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentsky/desktop-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.143",
|
|
4
4
|
"description": "The AgentSky for Mac interface, prebuilt: the pages the app's windows show, served by the app's shell from this package's dist/.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"private": false,
|