@weavy/uikit-react 30.3.1 → 30.3.2
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/changelog.md +6 -0
- package/dist/build/weavy.bundle.js +162 -162
- package/dist/build/weavy.cjs +8 -8
- package/dist/build/weavy.es5.esm.js +1 -1
- package/dist/build/weavy.es5.umd.js +1 -1
- package/dist/build/weavy.mjs +44 -2
- package/dist/build/weavy.umd.js +160 -160
- package/package.json +2 -2
package/dist/build/weavy.cjs
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
}`,{label:"class",detail:"definition",type:"keyword"}),Ci('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ci('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],wB=oE.concat([Ci("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ci("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ci("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),NQ=new OM,lE=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function jc(s){return(t,e)=>{let i=t.node.getChild("VariableDefinition");return i&&e(i,s),!0}}h(jc,"ar$1");m(jc,"defID");const vB=["FunctionDeclaration"],OB={FunctionDeclaration:jc("function"),ClassDeclaration:jc("class"),ClassExpression:m(()=>!0,"ClassExpression"),EnumDeclaration:jc("constant"),TypeAliasDeclaration:jc("type"),NamespaceDeclaration:jc("namespace"),VariableDefinition(s,t){s.matchContext(vB)||t(s,"variable")},TypeDefinition(s,t){t(s,"type")},__proto__:null};function wP(s,t){let e=NQ.get(t);if(e)return e;let i=[],r=!0;function n(a,o){let l=s.sliceString(a.from,a.to);i.push({label:l,type:o})}return h(n,"s"),m(n,"def"),t.cursor(Ht.IncludeAnonymous).iterate(a=>{if(r)r=!1;else if(a.name){let o=OB[a.name];if(o&&o(a,n)||lE.has(a.name))return!1}else if(a.to-a.from>8192){for(let o of wP(s,a.node))i.push(o);return!1}}),NQ.set(t,i),i}h(wP,"xm$1");m(wP,"getScope");const HO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,vP=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cE(s){let t=ue(s.state).resolveInner(s.pos,-1);if(vP.indexOf(t.name)>-1)return null;let e=t.name=="VariableName"||t.to-t.from<20&&HO.test(s.state.sliceDoc(t.from,t.to));if(!e&&!s.explicit)return null;let i=[];for(let r=t;r;r=r.parent)lE.has(r.name)&&(i=i.concat(wP(s.state.doc,r)));return{options:i,from:e?t.from:s.pos,validFor:HO}}h(cE,"km$1");m(cE,"localCompletionSource");function Fv(s,t,e){var i;let r=[];for(;;){let n=t.firstChild,a;if(n?.name=="VariableName")return r.push(s(n)),{path:r.reverse(),name:e};if(n?.name=="MemberExpression"&&((i=a=n.lastChild)===null||i===void 0?void 0:i.name)=="PropertyName")r.push(s(a)),t=n;else return null}}h(Fv,"Ko$1");m(Fv,"pathFor");function hE(s){let t=m(i=>s.state.doc.sliceString(i.from,i.to),"read"),e=ue(s.state).resolveInner(s.pos,-1);return e.name=="PropertyName"?Fv(t,e.parent,t(e)):(e.name=="."||e.name=="?.")&&e.parent.name=="MemberExpression"?Fv(t,e.parent,""):vP.indexOf(e.name)>-1?null:e.name=="VariableName"||e.to-e.from<20&&HO.test(t(e))?{path:[],name:t(e)}:e.name=="MemberExpression"?Fv(t,e,""):s.explicit?{path:[],name:""}:null}h(hE,"Pm$1");m(hE,"completionPath");function dE(s,t){let e=[],i=new Set;for(let r=0;;r++){for(let a of(Object.getOwnPropertyNames||Object.keys)(s)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(a)||i.has(a))continue;i.add(a);let o;try{o=s[a]}catch{continue}e.push({label:a,type:typeof o=="function"?/^[A-Z]/.test(a)?"class":t?"function":"method":t?"variable":"property",boost:-r})}let n=Object.getPrototypeOf(s);if(!n)return e;s=n}}h(dE,"wb$1");m(dE,"enumeratePropertyCompletions");function bB(s){let t=new Map;return e=>{let i=hE(e);if(!i)return null;let r=s;for(let a of i.path)if(r=r[a],!r)return null;let n=t.get(r);return n||t.set(r,n=dE(r,!i.path.length)),{from:e.pos-i.name.length,options:n,validFor:HO}}}h(bB,"xb$1");m(bB,"scopeCompletionSource");const Dr=zC.define({name:"javascript",parser:gB.configure({props:[Iy.add({IfStatement:bw({except:/^\s*({|else\b)/}),TryStatement:bw({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:aq,SwitchBody:m(s=>{let t=s.textAfter,e=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return s.baseIndent+(e?0:i?1:2)*s.unit},"SwitchBody"),Block:rA({closing:"}"}),ArrowFunction:m(s=>s.baseIndent+s.unit,"ArrowFunction"),"TemplateString BlockComment":m(()=>null,"TemplateString BlockComment"),"Statement Property":bw({except:/^\s*{/}),JSXElement(s){let t=/^\s*<\//.test(s.textAfter);return s.lineIndent(s.node.from)+(t?0:s.unit)},JSXEscape(s){let t=/\s*\}/.test(s.textAfter);return s.lineIndent(s.node.from)+(t?0:s.unit)},"JSXOpenTag JSXSelfClosingTag"(s){return s.column(s.node.from)+s.unit}}),$1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":WC,BlockComment(s){return{from:s.from+2,to:s.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),uE={test:m(s=>/^JSX/.test(s.name),"test"),facet:b1({commentTokens:{block:{open:"{/*",close:"*/}"}}})},pE=Dr.configure({dialect:"ts"},"typescript"),fE=Dr.configure({dialect:"jsx",props:[LC.add(s=>s.isTop?[uE]:void 0)]}),mE=Dr.configure({dialect:"jsx ts",props:[LC.add(s=>s.isTop?[uE]:void 0)]},"typescript");let yE=m(s=>({label:s,type:"keyword"}),"kwCompletion");const gE="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(yE),$B=gE.concat(["declare","implements","private","protected","public"].map(yE));function wE(s={}){let t=s.jsx?s.typescript?mE:fE:s.typescript?pE:Dr,e=s.typescript?wB.concat($B):oE.concat(gE);return new my(t,[Dr.data.of({autocomplete:xA(vP,XC(e))}),Dr.data.of({autocomplete:cE}),s.jsx?kB:[]])}h(wE,"Tm$1");m(wE,"javascript");function vE(s){for(;;){if(s.name=="JSXOpenTag"||s.name=="JSXSelfClosingTag"||s.name=="JSXFragmentTag")return s;if(s.name=="JSXEscape"||!s.parent)return null;s=s.parent}}h(vE,"Pb$1");m(vE,"findOpenTag");function U5(s,t,e=s.length){for(let i=t?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return s.sliceString(i.from,Math.min(i.to,e));return""}h(U5,"YO");m(U5,"elementName$1");const xB=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),kB=At.inputHandler.of((s,t,e,i,r)=>{if((xB?s.composing:s.compositionStarted)||s.state.readOnly||t!=e||i!=">"&&i!="/"||!Dr.isActiveAt(s.state,t,-1))return!1;let n=r(),{state:a}=n,o=a.changeByRange(l=>{var d;let{head:u}=l,p=ue(a).resolveInner(u-1,-1),f;if(p.name=="JSXStartTag"&&(p=p.parent),!(a.doc.sliceString(u-1,u)!=i||p.name=="JSXAttributeValue"&&p.to>u)){if(i==">"&&p.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(i=="/"&&p.name=="JSXStartCloseTag"){let y=p.parent,g=y.parent;if(g&&y.from==u-2&&((f=U5(a.doc,g.firstChild,u))||((d=g.firstChild)===null||d===void 0?void 0:d.name)=="JSXFragmentTag")){let O=`${f}>`;return{range:nt.cursor(u+O.length,-1),changes:{from:u,insert:O}}}}else if(i==">"){let y=vE(p);if(y&&y.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(u,u+2))&&(f=U5(a.doc,y,u)))return{range:l,changes:{from:u,insert:`</${f}>`}}}}return{range:l}});return o.changes.empty?!1:(s.dispatch([n,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function SB(s,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},s.getRules().forEach((e,i)=>{var r;!((r=e.meta.docs)===null||r===void 0)&&r.recommended&&(t.rules[i]=2)})),e=>{let{state:i}=e,r=[];for(let{from:n,to:a}of Dr.findRegions(i)){let o=i.doc.lineAt(n),l={line:o.number-1,col:n-o.from,pos:n};for(let d of s.verify(i.sliceDoc(n,a),t))r.push(OE(d,i.doc,l))}return r}}h(SB,"Rb$1");m(SB,"esLint");function H5(s,t,e,i){return e.line(s+i.line).from+t+(s==1?i.col-1:-1)}h(H5,"WO");m(H5,"mapPos");function OE(s,t,e){let i=H5(s.line,s.column,t,e),r={from:i,to:s.endLine!=null&&s.endColumn!=1?H5(s.endLine,s.endColumn,t,e):i,message:s.message,source:s.ruleId?"eslint:"+s.ruleId:"eslint",severity:s.severity==1?"warning":"error"};if(s.fix){let{range:n,text:a}=s.fix,o=n[0]+e.pos-i,l=n[1]+e.pos-i;r.actions=[{name:"fix",apply(d,u){d.dispatch({changes:{from:u+o,to:u+l,insert:a},scrollIntoView:!0})}}]}return r}h(OE,"vb$1");m(OE,"translateDiagnostic");const ng=["_blank","_self","_top","_parent"],D2=["ascii","utf-8","utf-16","latin1","latin1"],V2=["get","post","put","delete"],W2=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Ji=["true","false"],mt={},CB={a:{attrs:{href:null,ping:null,type:null,media:null,target:ng,hreflang:null}},abbr:mt,address:mt,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:mt,aside:mt,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:mt,base:{attrs:{href:null,target:ng}},bdi:mt,bdo:mt,blockquote:{attrs:{cite:null}},body:mt,br:mt,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:W2,formmethod:V2,formnovalidate:["novalidate"],formtarget:ng,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:mt,center:mt,cite:mt,code:mt,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:mt,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:mt,div:mt,dl:mt,dt:mt,em:mt,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:mt,figure:mt,footer:mt,form:{attrs:{action:null,name:null,"accept-charset":D2,autocomplete:["on","off"],enctype:W2,method:V2,novalidate:["novalidate"],target:ng}},h1:mt,h2:mt,h3:mt,h4:mt,h5:mt,h6:mt,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:mt,hgroup:mt,hr:mt,html:{attrs:{manifest:null}},i:mt,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:W2,formmethod:V2,formnovalidate:["novalidate"],formtarget:ng,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:mt,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:mt,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:mt,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:D2,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:mt,noscript:mt,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:mt,param:{attrs:{name:null,value:null}},pre:mt,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:mt,rt:mt,ruby:mt,samp:mt,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:D2}},section:mt,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:mt,source:{attrs:{src:null,type:null,media:null}},span:mt,strong:mt,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:mt,summary:mt,sup:mt,table:mt,tbody:mt,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:mt,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:mt,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:mt,time:{attrs:{datetime:null}},title:mt,tr:mt,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:mt,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:mt},bE={accesskey:null,class:null,contenteditable:Ji,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Ji,autocorrect:Ji,autocapitalize:Ji,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Ji,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Ji,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Ji,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Ji,"aria-hidden":Ji,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Ji,"aria-multiselectable":Ji,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Ji,"aria-relevant":null,"aria-required":Ji,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},$E="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(s=>"on"+s);for(let s of $E)bE[s]=null;var Vu;const xE=(Vu=class{constructor(t,e){this.tags={...CB,...t},this.globalAttrs={...bE,...e},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}},h(Vu,"Nc"),Vu);m(xE,"Schema");let Zw=xE;Zw.default=new Zw;function ul(s,t,e=s.length){if(!t)return"";let i=t.firstChild,r=i&&i.getChild("TagName");return r?s.sliceString(r.from,Math.min(r.to,e)):""}h(ul,"Ki$1");m(ul,"elementName");function pl(s,t=!1){for(;s;s=s.parent)if(s.name=="Element")if(t)t=!1;else return s;return null}h(pl,"Ji$1");m(pl,"findParentElement");function OP(s,t,e){return e.tags[ul(s,pl(t))]?.children||e.allTags}h(OP,"Mm$1");m(OP,"allowedChildren");function ub(s,t){let e=[];for(let i=pl(t);i&&!i.type.isTop;i=pl(i.parent)){let r=ul(s,i);if(r&&i.lastChild.name=="CloseTag")break;r&&e.indexOf(r)<0&&(t.name=="EndTag"||t.from>=i.firstChild.to)&&e.push(r)}return e}h(ub,"Ih$1");m(ub,"openTags");const kE=/^[:\-\.\w\u00b7-\uffff]*$/;function Y5(s,t,e,i,r){let n=/\s*>/.test(s.sliceDoc(r,r+5))?"":">",a=pl(e,e.name=="StartTag"||e.name=="TagName");return{from:i,to:r,options:OP(s.doc,a,t).map(o=>({label:o,type:"type"})).concat(ub(s.doc,e).map((o,l)=>({label:"/"+o,apply:"/"+o+n,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}h(Y5,"VO");m(Y5,"completeTag");function G5(s,t,e,i){let r=/\s*>/.test(s.sliceDoc(i,i+5))?"":">";return{from:e,to:i,options:ub(s.doc,t).map((n,a)=>({label:n,apply:n+r,type:"type",boost:99-a})),validFor:kE}}h(G5,"UO");m(G5,"completeCloseTag");function SE(s,t,e,i){let r=[],n=0;for(let a of OP(s.doc,e,t))r.push({label:"<"+a,type:"type"});for(let a of ub(s.doc,e))r.push({label:"</"+a+">",type:"type",boost:99-n++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}h(SE,"Ab$1");m(SE,"completeStartTag");function CE(s,t,e,i,r){let n=pl(e),a=n?t.tags[ul(s.doc,n)]:null,o=a&&a.attrs?Object.keys(a.attrs):[],l=a&&a.globalAttrs===!1?o:o.length?o.concat(t.globalAttrNames):t.globalAttrNames;return{from:i,to:r,options:l.map(d=>({label:d,type:"property"})),validFor:kE}}h(CE,"Lb$1");m(CE,"completeAttrName");function PE(s,t,e,i,r){var n;let a=(n=e.parent)===null||n===void 0?void 0:n.getChild("AttributeName"),o=[],l;if(a){let d=s.sliceDoc(a.from,a.to),u=t.globalAttrs[d];if(!u){let p=pl(e),f=p?t.tags[ul(s.doc,p)]:null;u=f?.attrs&&f.attrs[d]}if(u){let p=s.sliceDoc(i,r).toLowerCase(),f='"',y='"';/^['"]/.test(p)?(l=p[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",y=s.sliceDoc(r,r+1)==p[0]?"":p[0],p=p.slice(1),i++):l=/^[^\s<>='"]*$/;for(let g of u)o.push({label:g,apply:f+g+y,type:"constant"})}}return{from:i,to:r,options:o,validFor:l}}h(PE,"_b$1");m(PE,"completeAttrValue");function bP(s,t){let{state:e,pos:i}=t,r=ue(e).resolveInner(i,-1),n=r.resolve(i);for(let a=i,o;n==r&&(o=r.childBefore(a));){let l=o.lastChild;if(!l||!l.type.isError||l.from<l.to)break;n=r=o,a=l.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?G5(e,r,r.from,i):Y5(e,s,r,r.from,i):r.name=="StartTag"||r.name=="IncompleteTag"?Y5(e,s,r,i,i):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?G5(e,r,i,i):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?CE(e,s,r,r.name=="AttributeName"?r.from:i,i):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?PE(e,s,r,r.name=="Is"?i:r.from,i):t.explicit&&(n.name=="Element"||n.name=="Text"||n.name=="Document")?SE(e,s,r,i):null}h(bP,"Cm$1");m(bP,"htmlCompletionFor");function QE(s){return bP(Zw.default,s)}h(QE,"Xm$1");m(QE,"htmlCompletionSource");function TE(s){let{extraTags:t,extraGlobalAttributes:e}=s,i=e||t?new Zw(t,e):Zw.default;return r=>bP(i,r)}h(TE,"Em$1");m(TE,"htmlCompletionSourceWith");const PB=Dr.parser.configure({top:"SingleExpression"}),ME=[{tag:"script",attrs:m(s=>s.type=="text/typescript"||s.lang=="ts","attrs"),parser:pE.parser},{tag:"script",attrs:m(s=>s.type=="text/babel"||s.type=="text/jsx","attrs"),parser:fE.parser},{tag:"script",attrs:m(s=>s.type=="text/typescript-jsx","attrs"),parser:mE.parser},{tag:"script",attrs(s){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(s.type)},parser:PB},{tag:"script",attrs(s){return!s.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(s.type)},parser:Dr.parser},{tag:"style",attrs(s){return(!s.lang||s.lang=="css")&&(!s.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(s.type))},parser:UO.parser}],AE=[{name:"style",parser:UO.parser.configure({top:"Styles"})}].concat($E.map(s=>({name:s,parser:Dr.parser}))),RE=zC.define({name:"html",parser:oN.configure({props:[Iy.add({Element(s){let t=/^(\s*)(<\/)?/.exec(s.textAfter);return s.node.to<=s.pos+t[0].length?s.continue():s.lineIndent(s.node.from)+(t[2]?0:s.unit)},"OpenTag CloseTag SelfClosingTag"(s){return s.column(s.node.from)+s.unit},Document(s){if(s.pos+/\s*/.exec(s.textAfter)[0].length<s.node.to)return s.continue();let t=null,e;for(let i=s.node;;){let r=i.lastChild;if(!r||r.name!="Element"||r.to!=i.to)break;t=i=r}return t&&!((e=t.lastChild)&&(e.name=="CloseTag"||e.name=="SelfClosingTag"))?s.lineIndent(t.from)+s.unit:null}}),$1.add({Element(s){let t=s.firstChild,e=s.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:e.name=="CloseTag"?e.from:s.to}}}),lA.add({"OpenTag CloseTag":m(s=>s.getChild("TagName"),"OpenTag CloseTag")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),qv=RE.configure({wrap:yP(ME,AE)});function EE(s={}){let t="",e;s.matchClosingTags===!1&&(t="noMatch"),s.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(s.nestedLanguages&&s.nestedLanguages.length||s.nestedAttributes&&s.nestedAttributes.length)&&(e=yP((s.nestedLanguages||[]).concat(ME),(s.nestedAttributes||[]).concat(AE)));let i=e?RE.configure({wrap:e,dialect:t}):t?qv.configure({dialect:t}):qv;return new my(i,[qv.data.of({autocomplete:TE(s)}),s.autoCloseTags!==!1?QB:[],wE().support,nE().support])}h(EE,"Um$1");m(EE,"html");const BQ=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),QB=At.inputHandler.of((s,t,e,i,r)=>{if(s.composing||s.state.readOnly||t!=e||i!=">"&&i!="/"||!qv.isActiveAt(s.state,t,-1))return!1;let n=r(),{state:a}=n,o=a.changeByRange(l=>{var d,u,p;let f=a.doc.sliceString(l.from-1,l.to)==i,{head:y}=l,g=ue(a).resolveInner(y,-1),O;if(f&&i==">"&&g.name=="EndTag"){let k=g.parent;if(((u=(d=k.parent)===null||d===void 0?void 0:d.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(O=ul(a.doc,k.parent,y))&&!BQ.has(O)){let $=y+(a.doc.sliceString(y,y+1)===">"?1:0),T=`</${O}>`;return{range:l,changes:{from:y,to:$,insert:T}}}}else if(f&&i=="/"&&g.name=="IncompleteCloseTag"){let k=g.parent;if(g.from==y-2&&((p=k.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(O=ul(a.doc,k,y))&&!BQ.has(O)){let $=y+(a.doc.sliceString(y,y+1)===">"?1:0),T=`${O}>`;return{range:nt.cursor(y+T.length,-1),changes:{from:y,to:$,insert:T}}}}return{range:l}});return o.changes.empty?!1:(s.dispatch([n,a.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),_E=b1({commentTokens:{block:{open:"<!--",close:"-->"}}}),LE=new _t,zE=aZ.configure({props:[$1.add(s=>!s.is("Block")||s.is("Document")||YO(s)!=null||IE(s)?void 0:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})),LE.add(YO),Iy.add({Document:m(()=>null,"Document")}),Wn.add({Document:_E})]});function YO(s){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(s.name);return t?+t[1]:void 0}h(YO,"ih$1");m(YO,"isHeading");function IE(s){return s.name=="OrderedList"||s.name=="BulletList"}h(IE,"Cb$1");m(IE,"isList");function DE(s,t){let e=s;for(;;){let i=e.nextSibling,r;if(!i||(r=YO(i.type))!=null&&r<=t)break;e=i}return e.to}h(DE,"Xb$1");m(DE,"findSectionEnd");const TB=oq.of((s,t,e)=>{for(let i=ue(s).resolveInner(e,-1);i&&!(i.from<t);i=i.parent){let r=i.type.prop(LE);if(r==null)continue;let n=DE(i,r);if(n>e)return{from:e,to:n}}return null});function pb(s){return new or(_E,s,[],"markdown")}h(pb,"zh$1");m(pb,"mkLang");const MB=pb(zE),AB=zE.configure([fZ,yZ,mZ,gZ,{props:[$1.add({Table:m((s,t)=>({from:t.doc.lineAt(s.from).to,to:s.to}),"Table")})]}]),GO=pb(AB);function VE(s,t){return e=>{if(e&&s){let i=null;if(e=/\S*/.exec(e)[0],typeof s=="function"?i=s(e):i=gQ.matchLanguageName(s,e,!0),i instanceof gQ)return i.support?i.support.language.parser:DO.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}h(VE,"Wb$1");m(VE,"getCodeParser");var Wu;const WE=(Wu=class{constructor(t,e,i,r,n,a,o){this.node=t,this.from=e,this.to=i,this.spaceBefore=r,this.spaceAfter=n,this.type=a,this.item=o}blank(t,e=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;i.length<t;)i+=" ";return i}else{for(let r=this.to-this.from-i.length-this.spaceAfter.length;r>0;r--)i+=" ";return i+(e?this.spaceAfter:"")}}marker(t,e){let i=this.node.name=="OrderedList"?String(+xP(this.item,t)[2]+e):"";return this.spaceBefore+i+this.type+this.spaceAfter}},h(Wu,"Gc"),Wu);m(WE,"Context");let F2=WE;function $P(s,t){let e=[],i=[];for(let r=s;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&e.push(r)}for(let r=e.length-1;r>=0;r--){let n=e[r],a,o=t.lineAt(n.from),l=n.from-o.from;if(n.name=="Blockquote"&&(a=/^ *>( ?)/.exec(o.text.slice(l))))i.push(new F2(n,l,l+a[0].length,"",a[1],">",null));else if(n.name=="ListItem"&&n.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(l)))){let d=a[3],u=a[0].length;d.length>=4&&(d=d.slice(0,d.length-4),u-=4),i.push(new F2(n.parent,l,l+u,a[1],d,a[2],n))}else if(n.name=="ListItem"&&n.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(l)))){let d=a[4],u=a[0].length;d.length>4&&(d=d.slice(0,d.length-4),u-=4);let p=a[2];a[3]&&(p+=a[3].replace(/[xX]/," ")),i.push(new F2(n.parent,l,l+u,a[1],d,p,n))}}return i}h($P,"Dm$1");m($P,"getContext");function xP(s,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(s.from,s.from+10))}h(xP,"Nm$1");m(xP,"itemNumber");function Zv(s,t,e,i=0){for(let r=-1,n=s;;){if(n.name=="ListItem"){let o=xP(n,t),l=+o[2];if(r>=0){if(l!=r+1)return;e.push({from:n.from+o[1].length,to:n.from+o[0].length,insert:String(r+2+i)})}r=l}let a=n.nextSibling;if(!a)break;n=a}}h(Zv,"il$1");m(Zv,"renumberList");function fb(s,t){let e=/^[ \t]*/.exec(s)[0].length;if(!e||t.facet(ib)!=" ")return s;let i=pa(s,4,e),r="";for(let n=i;n>0;)n>=4?(r+=" ",n-=4):(r+=" ",n--);return r+s.slice(e)}h(fb,"jh$1");m(fb,"normalizeIndent");const RB=m((s={})=>({state:t,dispatch:e})=>{let i=ue(t),{doc:r}=t,n=null,a=t.changeByRange(o=>{if(!o.empty||!GO.isActiveAt(t,o.from,-1)&&!GO.isActiveAt(t,o.from,1))return n={range:o};let l=o.from,d=r.lineAt(l),u=$P(i.resolveInner(l,-1),r);for(;u.length&&u[u.length-1].from>l-d.from;)u.pop();if(!u.length)return n={range:o};let p=u[u.length-1];if(p.to-p.spaceAfter.length>l-d.from)return n={range:o};let f=l>=p.to-p.spaceAfter.length&&!/\S/.test(d.text.slice(p.to));if(p.item&&f){let $=p.node.firstChild,T=p.node.getChild("ListItem","ListItem");if($.to>=l||T&&T.to<l||d.from>0&&!/[^\s>]/.test(r.lineAt(d.from-1).text)||s.nonTightLists===!1){let _=u.length>1?u[u.length-2]:null,D,A="";_&&_.item?(D=d.from+_.from,A=_.marker(r,1)):D=d.from+(_?_.to:0);let z=[{from:D,to:l,insert:A}];return p.node.name=="OrderedList"&&Zv(p.item,r,z,-2),_&&_.node.name=="OrderedList"&&Zv(_.item,r,z),{range:nt.cursor(D+A.length),changes:z}}else{let _=J5(u,t,d);return{range:nt.cursor(l+_.length+1),changes:{from:d.from,insert:_+t.lineBreak}}}}if(p.node.name=="Blockquote"&&f&&d.from){let $=r.lineAt(d.from-1),T=/>\s*$/.exec($.text);if(T&&T.index==p.from){let _=t.changes([{from:$.from+T.index,to:$.to},{from:d.from+p.from,to:d.to}]);return{range:o.map(_),changes:_}}}let y=[];p.node.name=="OrderedList"&&Zv(p.item,r,y);let g=p.item&&p.item.from<d.from,O="";if(!g||/^[\s\d.)\-+*>]*/.exec(d.text)[0].length>=p.to)for(let $=0,T=u.length-1;$<=T;$++)O+=$==T&&!g?u[$].marker(r,1):u[$].blank($<T?pa(d.text,4,u[$+1].from)-O.length:null);let k=l;for(;k>d.from&&/\s/.test(d.text.charAt(k-d.from-1));)k--;return O=fb(O,t),FE(p.node,t.doc)&&(O=J5(u,t,d)+t.lineBreak+O),y.push({from:k,to:l,insert:t.lineBreak+O}),{range:nt.cursor(k+O.length+1),changes:y}});return n?!1:(e(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},"insertNewlineContinueMarkupCommand"),EB=RB();function K5(s){return s.name=="QuoteMark"||s.name=="ListMark"}h(K5,"zO");m(K5,"isMark");function FE(s,t){if(s.name!="OrderedList"&&s.name!="BulletList")return!1;let e=s.firstChild,i=s.getChild("ListItem","ListItem");if(!i)return!1;let r=t.lineAt(e.to),n=t.lineAt(i.from),a=/^[\s>]*$/.test(r.text);return r.number+(a?0:1)<n.number}h(FE,"Vb$1");m(FE,"nonTightList");function J5(s,t,e){let i="";for(let r=0,n=s.length-2;r<=n;r++)i+=s[r].blank(r<n?pa(e.text,4,s[r+1].from)-i.length:null,r<n);return fb(i,t)}h(J5,"jO");m(J5,"blankLine");function qE(s,t){let e=s.resolveInner(t,-1),i=t;K5(e)&&(i=e.from,e=e.parent);for(let r;r=e.childBefore(i);)if(K5(r))i=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")e=r.lastChild,i=e.to;else break;return e}h(qE,"Ub$1");m(qE,"contextNodeForDelete");const _B=m(({state:s,dispatch:t})=>{let e=ue(s),i=null,r=s.changeByRange(n=>{let a=n.from,{doc:o}=s;if(n.empty&&GO.isActiveAt(s,n.from)){let l=o.lineAt(a),d=$P(qE(e,a),o);if(d.length){let u=d[d.length-1],p=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(a-l.from>p&&!/\S/.test(l.text.slice(p,a-l.from)))return{range:nt.cursor(l.from+p),changes:{from:l.from+p,to:a}};if(a-l.from==p&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let y=u.blank(pa(l.text,4,u.to)-pa(l.text,4,u.from));return f==l.from&&(y=fb(y,s)),{range:nt.cursor(f+y.length),changes:{from:f,to:l.from+u.to,insert:y}}}if(f<a)return{range:nt.cursor(f),changes:{from:f,to:a}}}}}return i={range:n}});return i?!1:(t(s.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},"deleteMarkupBackward"),LB=[{key:"Enter",run:EB},{key:"Backspace",run:_B}],ZE=EE({matchClosingTags:!1});function zB(s={}){let{codeLanguages:t,defaultCodeLanguage:e,addKeymap:i=!0,base:{parser:r}=MB,completeHTMLTags:n=!0,pasteURLAsLink:a=!0,htmlTagLanguage:o=ZE}=s;if(!(r instanceof lR))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=s.extensions?[s.extensions]:[],d=[o.support,TB],u;a&&d.push(DB),e instanceof my?(d.push(e.support),u=e.language):e&&(u=e);let p=t||u?VE(t,u):void 0;l.push(OR({codeParser:p,htmlParser:o.language.parser})),i&&d.push(zl.high(G0.of(LB)));let f=pb(r.configure(l));return n&&d.push(f.data.of({autocomplete:NE})),new my(f,d)}h(zB,"eg$1");m(zB,"markdown");function NE(s){let{state:t,pos:e}=s,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(e-25,e));if(!i)return null;let r=ue(t).resolveInner(e,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:e-i[0].length,to:e,options:BE(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}h(NE,"Ib$1");m(NE,"htmlTagCompletion");let q2=null;function BE(){if(q2)return q2;let s=QE(new BC(Be.create({extensions:ZE}),0,!0));return q2=s?s.options:[]}h(BE,"zb$1");m(BE,"htmlTagCompletions");const IB=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,DB=At.domEventHandlers({paste:m((s,t)=>{var e;let{main:i}=t.state.selection;if(i.empty)return!1;let r=(e=s.clipboardData)===null||e===void 0?void 0:e.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!GO.isActiveAt(t.state,i.from,1)))return!1;let n=ue(t.state),a=!1;return n.iterate({from:i.from,to:i.to,enter:m(o=>{(o.from>i.from||IB.test(o.name))&&(a=!0)},"enter"),leave:m(o=>{o.to<i.to&&(a=!0)},"leave")}),a?!1:(t.dispatch({changes:[{from:i.from,insert:"["},{from:i.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)},"paste")});function VB(s){return new my(pq.define(s))}h(VB,"b$1");m(VB,"legacy");function WB(s){return import(new URL("./@codemirror/lang-sql/dist/index-HIuthktG.js",typeof WEAVY_IMPORT_URL=="string"&&(!(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href)||!new URL(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href.startsWith(WEAVY_IMPORT_URL))?WEAVY_IMPORT_URL:typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href).then(t=>t.sql({dialect:t[s]}))}h(WB,"mt$2");m(WB,"sql");function FB(s){const t=new CustomEvent("wy-submit",{bubbles:!0});return s.dom.dispatchEvent(t)}h(FB,"ig$1");m(FB,"softSubmit");const XQ=new DF({regexp:/(\[(.+?)\])(\(@u(\d+)\))/g,decoration:m(s=>ne.replace({inclusive:!0,widget:new qB(s)}),"decoration")});var Fu;const XE=(Fu=class extends Il{constructor(t){super(),this.match=t}eq(t){return t.match[1]===this.match[1]}toDOM(){Pe();const t=document.createElement("span");return t.className="wy-mention",t.part="wy-mention",t.innerHTML="@"+(typeof this.match[5]<"u"?this.match[5]:this.match[2]),t}ignoreEvent(){return!1}},h(Fu,"Fc"),Fu);m(XE,"MentionWidget");let qB=XE;sn.fromClass(class{constructor(s){this.mentions=XQ.createDeco(s)}update(s){this.mentions=XQ.updateDeco(s,this.mentions)}},{decorations:m(s=>s.mentions,"decorations"),provide:m(s=>At.atomicRanges.of(t=>t.plugin(s)?.mentions||ne.none),"provide")});function ZB(s,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let r=s(t,e);return r?(i(e.update(r)),!0):!1}}h(ZB,"qh$1");m(ZB,"command");function kP(s,t){let e=s.languageDataAt("commentTokens",t,1);return e.length?e[0]:{}}h(kP,"Bh$1");m(kP,"getConfig");const ag=50;function jE(s,{open:t,close:e},i,r){let n=s.sliceDoc(i-ag,i),a=s.sliceDoc(r,r+ag),o=/\s*$/.exec(n)[0].length,l=/^\s*/.exec(a)[0].length,d=n.length-o;if(n.slice(d-t.length,d)==t&&a.slice(l,l+e.length)==e)return{open:{pos:i-o,margin:o&&1},close:{pos:r+l,margin:l&&1}};let u,p;r-i<=2*ag?u=p=s.sliceDoc(i,r):(u=s.sliceDoc(i,i+ag),p=s.sliceDoc(r-ag,r));let f=/^\s*/.exec(u)[0].length,y=/\s*$/.exec(p)[0].length,g=p.length-y-e.length;return u.slice(f,f+t.length)==t&&p.slice(g,g+e.length)==e?{open:{pos:i+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:r-y-e.length,margin:/\s/.test(p.charAt(g-1))?1:0}}:null}h(jE,"tw$1");m(jE,"findBlockComment");function NB(s){let t=[];for(let e of s.selection.ranges){let i=s.doc.lineAt(e.from),r=e.to<=i.to?i:s.doc.lineAt(e.to);r.from>i.from&&r.from==e.to&&(r=e.to==i.to+1?i:s.doc.lineAt(e.to-1));let n=t.length-1;n>=0&&t[n].to>i.from?t[n].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}h(NB,"iw$1");m(NB,"selectedLineRanges");function BB(s,t,e=t.selection.ranges){let i=e.map(n=>kP(t,n.from).block);if(!i.every(n=>n))return null;let r=e.map((n,a)=>jE(t,i[a],n.from,n.to));if(s!=2&&!r.every(n=>n))return{changes:t.changes(e.map((n,a)=>r[a]?[]:[{from:n.from,insert:i[a].open+" "},{from:n.to,insert:" "+i[a].close}]))};if(s!=1&&r.some(n=>n)){let n=[];for(let a=0,o;a<r.length;a++)if(o=r[a]){let l=i[a],{open:d,close:u}=o;n.push({from:d.pos-l.open.length,to:d.pos+d.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:n}}return null}h(BB,"rg$1");m(BB,"changeBlockComment");function XB(s,t,e=t.selection.ranges){let i=[],r=-1;for(let{from:n,to:a}of e){let o=i.length,l=1e9,d=kP(t,n).line;if(d){for(let u=n;u<=a;){let p=t.doc.lineAt(u);if(p.from>r&&(n==a||a>p.from)){r=p.from;let f=/^\s*/.exec(p.text)[0].length,y=f==p.length,g=p.text.slice(f,f+d.length)==d?f:-1;f<p.text.length&&f<l&&(l=f),i.push({line:p,comment:g,token:d,indent:f,empty:y,single:!1})}u=p.to+1}if(l<1e9)for(let u=o;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=l);i.length==o+1&&(i[o].single=!0)}}if(s!=2&&i.some(n=>n.comment<0&&(!n.empty||n.single))){let n=[];for(let{line:o,token:l,indent:d,empty:u,single:p}of i)(p||!u)&&n.push({from:o.from+d,insert:l+" "});let a=t.changes(n);return{changes:a,selection:t.selection.map(a,1)}}else if(s!=1&&i.some(n=>n.comment>=0)){let n=[];for(let{line:a,comment:o,token:l}of i)if(o>=0){let d=a.from+o,u=d+l.length;a.text[u-a.from]==" "&&u++,n.push({from:d,to:u})}return{changes:n}}return null}h(XB,"rw$1");m(XB,"changeLineComment");const tS=gn.define(),jB=gn.define(),UB=Pt.define(),UE=Pt.define({combine(s){return iC(s,{minDepth:100,newGroupDelay:500,joinToEvent:m((t,e)=>e,"joinToEvent")},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:m((t,e)=>(i,r)=>t(i,r)||e(i,r),"joinToEvent")})}}),HE=yn.define({create(){return $w.empty},update(s,t){let e=t.state.facet(UE),i=t.annotation(tS);if(i){let l=Bs.fromTransaction(t,i.selection),d=i.side,u=d==0?s.undone:s.done;return l?u=Nw(u,u.length,e.minDepth,l):u=PP(u,t.startState.selection),new $w(d==0?i.rest:u,d==0?u:i.rest)}let r=t.annotation(jB);if((r=="full"||r=="before")&&(s=s.isolate()),t.annotation(Ri.addToHistory)===!1)return t.changes.empty?s:s.addMapping(t.changes.desc);let n=Bs.fromTransaction(t),a=t.annotation(Ri.time),o=t.annotation(Ri.userEvent);return n?s=s.addChanges(n,a,o,e,t):t.selection&&(s=s.addSelection(t.startState.selection,a,o,e.newGroupDelay)),(r=="full"||r=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(t=>t.toJSON()),undone:s.undone.map(t=>t.toJSON())}},fromJSON(s){return new $w(s.done.map(Bs.fromJSON),s.undone.map(Bs.fromJSON))}});function HB(s={}){return[HE,UE.of(s),At.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?YB:t.inputType=="historyRedo"?GB:null;return i?(t.preventDefault(),i(e)):!1}})]}h(HB,"ow$1");m(HB,"history");function SP(s,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let r=e.field(HE,!1);if(!r)return!1;let n=r.pop(s,e,t);return n?(i(n),!0):!1}}h(SP,"xo$1");m(SP,"cmd");const YB=SP(0,!1),GB=SP(1,!1);var hs;const YE=(hs=class{constructor(t,e,i,r,n){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=r,this.selectionsAfter=n}setSelAfter(t){return new hs(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(t){return new hs(t.changes&&Vr.fromJSON(t.changes),[],t.mapped&&mh.fromJSON(t.mapped),t.startSelection&&nt.fromJSON(t.startSelection),t.selectionsAfter.map(nt.fromJSON))}static fromTransaction(t,e){let i=vr;for(let r of t.startState.facet(UB)){let n=r(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new hs(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,vr)}static selection(t){return new hs(void 0,vr,void 0,void 0,t)}},h(hs,"Gt"),hs);m(YE,"HistEvent");let Bs=YE;function Nw(s,t,e,i){let r=t+1>e+20?t-e-1:0,n=s.slice(r,t);return n.push(i),n}h(Nw,"Cs$1");m(Nw,"updateBranch");function GE(s,t){let e=[],i=!1;return s.iterChangedRanges((r,n)=>e.push(r,n)),t.iterChangedRanges((r,n,a,o)=>{for(let l=0;l<e.length;){let d=e[l++],u=e[l++];o>=d&&a<=u&&(i=!0)}}),i}h(GE,"hw$1");m(GE,"isAdjacent");function KE(s,t){return s.ranges.length==t.ranges.length&&s.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}h(KE,"fw$1");m(KE,"eqSelectionShape");function CP(s,t){return s.length?t.length?s.concat(t):s:t}h(CP,"lg$1");m(CP,"conc");const vr=[],KB=200;function PP(s,t){if(s.length){let e=s[s.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-KB));return i.length&&i[i.length-1].eq(t)?s:(i.push(t),Nw(s,s.length-1,1e9,e.setSelAfter(i)))}else return[Bs.selection([t])]}h(PP,"ag$1");m(PP,"addSelection");function JE(s){let t=s[s.length-1],e=s.slice();return e[s.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}h(JE,"uw$1");m(JE,"popSelection");function Nv(s,t){if(!s.length)return s;let e=s.length,i=vr;for(;e;){let r=t_(s[e-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let n=s.slice(0,e);return n[e-1]=r,n}else t=r.mapped,e--,i=r.selectionsAfter}return i.length?[Bs.selection(i)]:vr}h(Nv,"nl$1");m(Nv,"addMappingToBranch");function t_(s,t,e){let i=CP(s.selectionsAfter.length?s.selectionsAfter.map(o=>o.map(t)):vr,e);if(!s.changes)return Bs.selection(i);let r=s.changes.map(t),n=t.mapDesc(s.changes,!0),a=s.mapped?s.mapped.composeDesc(n):n;return new Bs(r,ee.mapEffects(s.effects,t),a,s.startSelection.map(n),i)}h(t_,"Ow$1");m(t_,"mapEvent");const JB=/^(input\.type|delete)($|\.)/;var ds;const e_=(ds=class{constructor(t,e,i=0,r=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new ds(this.done,this.undone):this}addChanges(t,e,i,r,n){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&t.changes&&(!i||JB.test(i))&&(!o.selectionsAfter.length&&e-this.prevTime<r.newGroupDelay&&r.joinToEvent(n,GE(o.changes,t.changes))||i=="input.type.compose")?a=Nw(a,a.length-1,r.minDepth,new Bs(t.changes.compose(o.changes),CP(ee.mapEffects(t.effects,o.changes),o.effects),o.mapped,o.startSelection,vr)):a=Nw(a,a.length,r.minDepth,t),new ds(a,vr,e,i)}addSelection(t,e,i,r){let n=this.done.length?this.done[this.done.length-1].selectionsAfter:vr;return n.length>0&&e-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&KE(n[n.length-1],t)?this:new ds(PP(this.done,t),this.undone,e,i)}addMapping(t){return new ds(Nv(this.done,t),Nv(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let r=t==0?this.done:this.undone;if(r.length==0)return null;let n=r[r.length-1],a=n.selectionsAfter[0]||e.selection;if(i&&n.selectionsAfter.length)return e.update({selection:n.selectionsAfter[n.selectionsAfter.length-1],annotations:tS.of({side:t,rest:JE(r),selection:a}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(n.changes){let o=r.length==1?vr:r.slice(0,r.length-1);return n.mapped&&(o=Nv(o,n.mapped)),e.update({changes:n.changes,selection:n.startSelection,effects:n.effects,annotations:tS.of({side:t,rest:o,selection:a}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}},h(ds,"Ft"),ds);m(e_,"HistoryState");let $w=e_;$w.empty=new $w(vr,vr);function k1(s,t){return nt.create(s.ranges.map(t),s.mainIndex)}h(k1,"ir$1");m(k1,"updateSel");function Dy(s,t){return s.update({selection:t,scrollIntoView:!0,userEvent:"select"})}h(Dy,"Ge$2");m(Dy,"setSel");function mb({state:s,dispatch:t},e){let i=k1(s.selection,e);return i.eq(s.selection,!0)?!1:(t(Dy(s,i)),!0)}h(mb,"Fe$2");m(mb,"moveSel");function S1(s,t){return nt.cursor(t?s.to:s.from)}h(S1,"ko$1");m(S1,"rangeEnd");function tX(s,t){return mb(s,e=>e.empty?s.moveByChar(e,t):S1(e,t))}h(tX,"hg$1");m(tX,"cursorByChar");function eX(s){return s.textDirectionAt(s.state.selection.main.head)==ye.LTR}h(eX,"he$2");m(eX,"ltrAtCursor");function iX(s,t){return mb(s,e=>e.empty?s.moveByGroup(e,t):S1(e,t))}h(iX,"ug$1");m(iX,"cursorByGroup");function i_(s,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(t.from,t.to)))||t.firstChild}h(i_,"Qw$1");m(i_,"interestingNode");function rX(s,t,e){let i=ue(s).resolveInner(t.head),r=e?_t.closedBy:_t.openedBy;for(let l=t.head;;){let d=e?i.childAfter(l):i.childBefore(l);if(!d)break;i_(s,d,r)?i=d:l=e?d.to:d.from}let n=i.type.prop(r),a,o;return n&&(a=e?uo(s,i.from,1):uo(s,i.to,-1))&&a.matched?o=e?a.end.to:a.end.from:o=e?i.to:i.from,nt.cursor(o,e?-1:1)}h(rX,"Po$1");m(rX,"moveBySyntax");function sX(s,t){return mb(s,e=>{if(!e.empty)return S1(e,t);let i=s.moveVertically(e,t);return i.head!=e.head?i:s.moveToLineBoundary(e,t)})}h(sX,"Og$1");m(sX,"cursorByLine");function QP(s){let t=s.scrollDOM.clientHeight<s.scrollDOM.scrollHeight-2,e=0,i=0,r;if(t){for(let n of s.state.facet(At.scrollMargins)){let a=n(s);a?.top&&(e=Math.max(a?.top,e)),a?.bottom&&(i=Math.max(a?.bottom,i))}r=s.scrollDOM.clientHeight-e-i}else r=(s.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:e,marginBottom:i,selfScroll:t,height:Math.max(s.defaultLineHeight,r-5)}}h(QP,"mg$1");m(QP,"pageInfo");function nX(s,t){let e=QP(s),{state:i}=s,r=k1(i.selection,a=>a.empty?s.moveVertically(a,t,e.height):S1(a,t));if(r.eq(i.selection))return!1;let n;if(e.selfScroll){let a=s.coordsAtPos(i.selection.main.head),o=s.scrollDOM.getBoundingClientRect(),l=o.top+e.marginTop,d=o.bottom-e.marginBottom;a&&a.top>l&&a.bottom<d&&(n=At.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-l}))}return s.dispatch(Dy(i,r),{effects:n}),!0}h(nX,"gg$1");m(nX,"cursorByPage");function aX(s,t,e){let i=s.lineBlockAt(t.head),r=s.moveToLineBoundary(t,e);if(r.head==t.head&&r.head!=(e?i.to:i.from)&&(r=s.moveToLineBoundary(t,e,!1)),!e&&r.head==i.from&&i.length){let n=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=nt.cursor(i.from+n))}return r}h(aX,"Ct$1");m(aX,"moveByLineBoundary");function oX(s,t,e){let i=!1,r=k1(s.selection,n=>{let a=uo(s,n.head,-1)||uo(s,n.head,1)||n.head>0&&uo(s,n.head-1,1)||n.head<s.doc.length&&uo(s,n.head+1,-1);if(!a||!a.end)return n;i=!0;let o=a.start.from==n.head?a.end.to:a.end.from;return nt.cursor(o)});return i?(t(Dy(s,r)),!0):!1}h(oX,"Rw$1");m(oX,"toMatchingBracket");function C1(s,t){let e=k1(s.state.selection,i=>{let r=t(i);return nt.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return e.eq(s.state.selection)?!1:(s.dispatch(Dy(s.state,e)),!0)}h(C1,"We$2");m(C1,"extendSel");function lX(s,t){return C1(s,e=>s.moveByChar(e,t))}h(lX,"Qg$1");m(lX,"selectByChar");function cX(s,t){return C1(s,e=>s.moveByGroup(e,t))}h(cX,"bg$1");m(cX,"selectByGroup");function hX(s,t){return C1(s,e=>s.moveVertically(e,t))}h(hX,"wg$1");m(hX,"selectByLine");function dX(s,t){return C1(s,e=>s.moveVertically(e,t,QP(s).height))}h(dX,"Pg$1");m(dX,"selectByPage");function uX(s,t){let{state:e}=s,i=e.selection,r=e.selection.ranges.slice();for(let n of e.selection.ranges){let a=e.doc.lineAt(n.head);if(t?a.to<s.state.doc.length:a.from>0)for(let o=n;;){let l=s.moveVertically(o,t);if(l.head<a.from||l.head>a.to){r.some(d=>d.head==l.head)||r.push(l);break}else{if(l.head==o.head)break;o=l}}}return r.length==i.ranges.length?!1:(s.dispatch(Dy(e,nt.create(r,r.length-1))),!0)}h(uX,"$g$1");m(uX,"addCursorVertically");function pX(s,t){if(s.state.readOnly)return!1;let e="delete.selection",{state:i}=s,r=i.changeByRange(n=>{let{from:a,to:o}=n;if(a==o){let l=t(n);l<a?(e="delete.backward",l=Vg(s,l,!1)):l>a&&(e="delete.forward",l=Vg(s,l,!0)),a=Math.min(a,l),o=Math.max(o,l)}else a=Vg(s,a,!1),o=Vg(s,o,!0);return a==o?{range:n}:{changes:{from:a,to:o},range:nt.cursor(a,a<n.head?-1:1)}});return r.changes.empty?!1:(s.dispatch(i.update(r,{scrollIntoView:!0,userEvent:e,effects:e=="delete.selection"?At.announce.of(i.phrase("Selection deleted")):void 0})),!0)}h(pX,"wn$1");m(pX,"deleteBy");function Vg(s,t,e){if(s instanceof At)for(let i of s.state.facet(At.atomicRanges).map(r=>r(s)))i.between(t,t,(r,n)=>{r<t&&n>t&&(t=e?n:r)});return t}h(Vg,"jn$1");m(Vg,"skipAtomic");function TP(s){let t=[],e=-1;for(let i of s.selection.ranges){let r=s.doc.lineAt(i.from),n=s.doc.lineAt(i.to);if(!i.empty&&i.to==n.from&&(n=s.doc.lineAt(i.to-1)),e>=r.number){let a=t[t.length-1];a.to=n.to,a.ranges.push(i)}else t.push({from:r.from,to:n.to,ranges:[i]});e=n.number+1}return t}h(TP,"$o$1");m(TP,"selectedLineBlocks");function fX(s,t,e){if(s.readOnly)return!1;let i=[],r=[];for(let n of TP(s)){if(e?n.to==s.doc.length:n.from==0)continue;let a=s.doc.lineAt(e?n.to+1:n.from-1),o=a.length+1;if(e){i.push({from:n.to,to:a.to},{from:n.from,insert:a.text+s.lineBreak});for(let l of n.ranges)r.push(nt.range(Math.min(s.doc.length,l.anchor+o),Math.min(s.doc.length,l.head+o)))}else{i.push({from:a.from,to:n.from},{from:n.to,insert:s.lineBreak+a.text});for(let l of n.ranges)r.push(nt.range(l.anchor-o,l.head-o))}}return i.length?(t(s.update({changes:i,scrollIntoView:!0,selection:nt.create(r,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}h(fX,"Lg$1");m(fX,"moveLine");function mX(s,t,e){if(s.readOnly)return!1;let i=[];for(let n of TP(s))e?i.push({from:n.from,insert:s.doc.slice(n.from,n.to)+s.lineBreak}):i.push({from:n.to,insert:s.lineBreak+s.doc.slice(n.from,n.to)});let r=s.changes(i);return t(s.update({changes:r,selection:s.selection.map(r,e?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}h(mX,"_g$1");m(mX,"copyLine");function r_(s,t){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=ue(s).resolveInner(t),i=e.childBefore(t),r=e.childAfter(t),n;return i&&r&&i.to<=t&&r.from>=t&&(n=i.type.prop(_t.closedBy))&&n.indexOf(r.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(r.from).from&&!/\S/.test(s.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}h(r_,"ix$1");m(r_,"isBetweenBrackets");function yX(s){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(r=>{let{from:n,to:a}=r,o=t.doc.lineAt(n),l=!s&&n==a&&r_(t,n);s&&(n=a=(a<=o.to?o:t.doc.lineAt(a)).to);let d=new IC(t,{simulateBreak:n,simulateDoubleBreak:!!l}),u=UM(d,n);for(u==null&&(u=pa(/^\s*/.exec(t.doc.lineAt(n).text)[0],t.tabSize));a<o.to&&/\s/.test(o.text[a-o.from]);)a++;l?{from:n,to:a}=l:n>o.from&&n<o.from+100&&!/\S/.test(o.text.slice(0,n))&&(n=o.from);let p=["",x5(t,u)];return l&&p.push(x5(t,d.lineIndent(o.from,-1))),{changes:{from:n,to:a,insert:Yt.of(p)},range:nt.cursor(n+1+p[1].length)}});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}h(yX,"Mg$1");m(yX,"newlineAndIndent");function gX(s,t){let e=-1;return s.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let o=s.doc.lineAt(a);o.number>e&&(i.empty||i.to>o.from)&&(t(o,r,i),e=o.number),a=o.to+1}let n=s.changes(r);return{changes:r,range:nt.range(n.mapPos(i.anchor,1),n.mapPos(i.head,1))}})}h(gX,"Dh$1");m(gX,"changeBySelectedLine");nA.define([{tag:Q.meta,class:"code"},{tag:Q.link,class:"wy-link"},{tag:Q.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Q.emphasis,fontStyle:"italic"},{tag:Q.strong,fontWeight:"bold"},{tag:Q.strikethrough,textDecoration:"line-through"},{tag:Q.keyword,class:"code token keyword"},{tag:[Q.atom,Q.bool],class:"code token builtin"},{tag:[Q.url,Q.contentSeparator,Q.labelName],class:"code token prolog"},{tag:Q.literal,class:"code token char"},{tag:Q.inserted,class:"code token inserted"},{tag:Q.deleted,class:"code token deleted"},{tag:Q.string,class:"code token string"},{tag:[Q.regexp,Q.escape,Q.special(Q.string)],class:"code token regex"},{tag:Q.definition(Q.variableName),class:"code token constant"},{tag:Q.local(Q.variableName),class:"code token variable"},{tag:[Q.typeName,Q.namespace],class:"code token keyword"},{tag:Q.className,class:"code token class-name"},{tag:[Q.special(Q.variableName),Q.macroName],class:"code token function"},{tag:Q.propertyName,class:"code token property"},{tag:Q.comment,class:"code token comment"},{tag:Q.invalid,color:"#f00",class:"code token"}]);function wX(s){MP(s,"start");var t={},e=s.languageData||{},i=!1;for(var r in s)if(r!=e&&s.hasOwnProperty(r))for(var n=t[r]=[],a=s[r],o=0;o<a.length;o++){var l=a[o];n.push(new a_(l,s)),(l.indent||l.dedent)&&(i=!0)}return{name:e.name,startState:m(function(){return{state:"start",pending:null,indent:i?[]:null}},"startState"),copyState:m(function(d){var u={state:d.state,pending:d.pending,indent:d.indent&&d.indent.slice(0)};return d.stack&&(u.stack=d.stack.slice(0)),u},"copyState"),token:o_(t),indent:l_(t,e),mergeTokens:e.mergeTokens,languageData:e}}h(wX,"Tx$1");m(wX,"simpleMode");function MP(s,t){if(!s.hasOwnProperty(t))throw new Error("Undefined state "+t+" in simple mode")}h(MP,"Zg$1");m(MP,"ensureState");function s_(s,t){if(!s)return/(?:)/;var e="";return s instanceof RegExp?(s.ignoreCase&&(e="i"),s.unicode&&(e+="u"),s=s.source):s=String(s),new RegExp("^(?:"+s+")",e)}h(s_,"ux$1");m(s_,"toRegex");function n_(s){if(!s)return null;if(s.apply)return s;if(typeof s=="string")return s.replace(/\./g," ");for(var t=[],e=0;e<s.length;e++)t.push(s[e]&&s[e].replace(/\./g," "));return t}h(n_,"Ox$1");m(n_,"asToken");function a_(s,t){(s.next||s.push)&&MP(t,s.next||s.push),this.regex=s_(s.regex),this.token=n_(s.token),this.data=s}h(a_,"dx$1");m(a_,"Rule");function o_(s){return function(t,e){if(e.pending){var i=e.pending.shift();return e.pending.length==0&&(e.pending=null),t.pos+=i.text.length,i.token}for(var r=s[e.state],n=0;n<r.length;n++){var a=r[n],o=(!a.data.sol||t.sol())&&t.match(a.regex);if(o){a.data.next?e.state=a.data.next:a.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=a.data.push):a.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),a.data.indent&&e.indent.push(t.indentation()+t.indentUnit),a.data.dedent&&e.indent.pop();var l=a.token;if(l&&l.apply&&(l=l(o)),o.length>2&&a.token&&typeof a.token!="string"){e.pending=[];for(var d=2;d<o.length;d++)o[d]&&e.pending.push({text:o[d],token:a.token[d-1]});return t.backUp(o[0].length-(o[1]?o[1].length:0)),l[0]}else return l&&l.join?l[0]:l}}return t.next(),null}}h(o_,"px$1");m(o_,"tokenFunction");function l_(s,t){return function(e,i){if(e.indent==null||t.dontIndentStates&&t.dontIndentStates.indexOf(e.state)>-1)return null;var r=e.indent.length-1,n=s[e.state];t:for(;;){for(var a=0;a<n.length;a++){var o=n[a];if(o.data.dedent&&o.data.dedentIfLineStart!==!1){var l=o.regex.exec(i);if(l&&l[0]){r--,(o.next||o.push)&&(n=s[o.next||o.push]),i=i.slice(l[0].length);continue t}}}break}return r<0?0:e.indent[r]}}h(l_,"mx$1");m(l_,"indentFunction");var vX=Object.defineProperty,yt=h((s,t)=>vX(s,"name",{value:t,configurable:!0}),"o$1");const eS="lit-localize-status",OX=yt((s,...t)=>({strTag:!0,strings:s,values:t}),"_str"),lt=OX,bX=yt(s=>typeof s!="string"&&"strTag"in s,"isStrTagged"),c_=yt((s,t,e)=>{let i=s[0];for(let r=1;r<s.length;r++)i+=t[e?e[r-1]:r-1],i+=s[r];return i},"joinStringsAndValues"),h_=yt((s=>bX(s)?c_(s.strings,s.values):s),"defaultMsg");let P=h_,jQ=!1;function d_(s){if(jQ)throw new Error("lit-localize can only be configured once");P=s,jQ=!0}h(d_,"xt");yt(d_,"_installMsgImplementation");var qu;const u_=(qu=class{constructor(t){this.__litLocalizeEventHandler=e=>{e.detail.status==="ready"&&this.host.requestUpdate()},this.host=t}hostConnected(){window.addEventListener(eS,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(eS,this.__litLocalizeEventHandler)}},h(qu,"Be"),qu);yt(u_,"LocalizeController");let $X=u_;const xX=yt(s=>s.addController(new $X(s)),"_updateWhenLocaleChanges"),kX=xX,Rt=yt(()=>(s,t)=>(s.addInitializer(kX),s),"localized");var Zu;const p_=(Zu=class{constructor(){this.settled=!1,this.promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}resolve(t){this.settled=!0,this._resolve(t)}reject(t){this.settled=!0,this._reject(t)}},h(Zu,"Ve"),Zu);yt(p_,"Deferred");let f_=p_;const _s=[];for(let s=0;s<256;s++)_s[s]=(s>>4&15).toString(16)+(s&15).toString(16);function m_(s){let t=0,e=8997,i=0,r=33826,n=0,a=40164,o=0,l=52210;for(let d=0;d<s.length;d++)e^=s.charCodeAt(d),t=e*435,i=r*435,n=a*435,o=l*435,n+=e<<8,o+=r<<8,i+=t>>>16,e=t&65535,n+=i>>>16,r=i&65535,l=o+(n>>>16)&65535,a=n&65535;return _s[l>>8]+_s[l&255]+_s[a>>8]+_s[a&255]+_s[r>>8]+_s[r&255]+_s[e>>8]+_s[e&255]}h(m_,"Ut$1");yt(m_,"fnv1a64");const SX="",CX="h",PX="s";function y_(s,t){return(t?CX:PX)+m_(typeof s=="string"?s:s.join(SX))}h(y_,"jt$1");yt(y_,"generateMsgId");const UQ=new WeakMap,HQ=new Map;function g_(s,t,e){if(s){const i=e?.id??w_(t),r=s[i];if(r){if(typeof r=="string")return r;if("strTag"in r)return c_(r.strings,t.values,r.values);{let n=UQ.get(r);return n===void 0&&(n=r.values,UQ.set(r,n)),{...r,values:n.map(a=>t.values[a])}}}}return h_(t)}h(g_,"Wt$1");yt(g_,"runtimeMsg");function w_(s){const t=typeof s=="string"?s:s.strings;let e=HQ.get(t);return e===void 0&&(e=y_(t,typeof s!="string"&&!("strTag"in s)),HQ.set(t,e)),e}h(w_,"Bt");yt(w_,"generateId");function Bv(s){window.dispatchEvent(new CustomEvent(eS,{detail:s}))}h(Bv,"ve$1");yt(Bv,"dispatchStatusEvent");let KO="",Z2,v_,JO,iS,O_,ro=new f_;ro.resolve();let dv=0;const QX=yt(s=>(d_(((t,e)=>g_(O_,t,e))),KO=v_=s.sourceLocale,JO=new Set(s.targetLocales),JO.add(s.sourceLocale),iS=s.loadLocale,{getLocale:TX,setLocale:MX}),"configureLocalization"),TX=yt(()=>KO,"getLocale"),MX=yt(s=>{if(s===(Z2??KO))return ro.promise;if(!JO||!iS)throw new Error("Internal error");if(!JO.has(s))throw new Error("Invalid locale code");dv++;const t=dv;return Z2=s,ro.settled&&(ro=new f_),Bv({status:"loading",loadingLocale:s}),(s===v_?Promise.resolve({templates:void 0}):iS(s)).then(e=>{dv===t&&(KO=s,Z2=void 0,O_=e.templates,Bv({status:"ready",readyLocale:s}),ro.resolve())},e=>{dv===t&&(Bv({status:"error",errorLocale:s,errorMessage:e.toString()}),ro.reject(e))}),ro.promise},"setLocale");var N2,Nu;const AX=(N2=(Nu=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}},h(Nu,"O$1"),Nu),yt(N2,"ElementInternals"),N2);var ts=h(function(s,t,e,i,r){if(typeof t=="function"?s!==t||!0:!t.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(s,e),e},"E$1"),ai=h(function(s,t,e,i){if(typeof t=="function"?s!==t||!i:!t.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(s):i?i.value:t.get(s)},"_$1"),Lc,uv,pv,og,B2,lg,fv,Za,cg,xn,mv,YQ;const GQ=yt(s=>typeof s=="boolean"?s:s?.capture??!1,"isCaptureEventListener"),t0=0,rS=1,e0=2,sS=3;var Bu;const b_=(Bu=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(t,e,i){if(e==null)return;const r=GQ(i)?this.__captureEventListeners:this.__eventListeners;let n=r.get(t);if(n===void 0)n=new Map,r.set(t,n);else if(n.has(e))return;const a=typeof i=="object"&&i?i:{};a.signal?.addEventListener("abort",()=>this.removeEventListener(t,e,i)),n.set(e,a??{})}removeEventListener(t,e,i){if(e==null)return;const r=GQ(i)?this.__captureEventListeners:this.__eventListeners,n=r.get(t);n!==void 0&&(n.delete(e),n.size||r.delete(t))}dispatchEvent(t){const e=[this];let i=this.__eventTargetParent;if(t.composed)for(;i;)e.push(i),i=i.__eventTargetParent;else for(;i&&i!==this.__host;)e.push(i),i=i.__eventTargetParent;let r=!1,n=!1,a=t0,o=null,l=null,d=null;const u=t.stopPropagation,p=t.stopImmediatePropagation;Object.defineProperties(t,{target:{get(){return o??l},...Jt},srcElement:{get(){return t.target},...Jt},currentTarget:{get(){return d},...Jt},eventPhase:{get(){return a},...Jt},composedPath:{value:yt(()=>e,"value"),...Jt},stopPropagation:{value:yt(()=>{r=!0,u.call(t)},"value"),...Jt},stopImmediatePropagation:{value:yt(()=>{n=!0,p.call(t)},"value"),...Jt}});const f=yt(($,T,_)=>{typeof $=="function"?$(t):typeof $?.handleEvent=="function"&&$.handleEvent(t),T.once&&_.delete($)},"invokeEventListener"),y=yt(()=>(d=null,a=t0,!t.defaultPrevented),"finishDispatch"),g=e.slice().reverse();o=!this.__host||!t.composed?this:null;const O=yt($=>{for(l=this;l.__host&&$.includes(l.__host);)l=l.__host},"retarget");for(const $ of g){!o&&(!l||l===$.__host)&&O(g.slice(g.indexOf($))),d=$,a=$===t.target?e0:rS;const T=$.__captureEventListeners.get(t.type);if(T){for(const[_,D]of T)if(f(_,D,T),n)return y()}if(r)return y()}const k=t.bubbles?e:[this];l=null;for(const $ of k){!o&&(!l||$===l.__host)&&O(k.slice(0,k.indexOf($)+1)),d=$,a=$===t.target?e0:sS;const T=$.__eventListeners.get(t.type);if(T){for(const[_,D]of T)if(f(_,D,T),n)return y()}if(r)return y()}return y()}},h(Bu,"ze"),Bu);yt(b_,"EventTarget");let RX=b_;const EX=RX,Jt={__proto__:null};Jt.enumerable=!0;Object.freeze(Jt);var X2,Xu;const AP=(xn=(X2=(Xu=class{constructor(t,e={}){if(Lc.set(this,!1),uv.set(this,!1),pv.set(this,!1),og.set(this,!1),B2.set(this,Date.now()),lg.set(this,!1),fv.set(this,void 0),Za.set(this,void 0),cg.set(this,void 0),this.NONE=t0,this.CAPTURING_PHASE=rS,this.AT_TARGET=e0,this.BUBBLING_PHASE=sS,arguments.length===0)throw new Error("The type argument must be specified");if(typeof e!="object"||!e)throw new Error('The "options" argument must be an object');const{bubbles:i,cancelable:r,composed:n}=e;ts(this,Lc,!!r),ts(this,uv,!!i),ts(this,pv,!!n),ts(this,fv,`${t}`),ts(this,Za,null),ts(this,cg,!1)}initEvent(t,e,i){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){ts(this,og,!0)}get target(){return ai(this,Za,"f")}get currentTarget(){return ai(this,Za,"f")}get srcElement(){return ai(this,Za,"f")}get type(){return ai(this,fv,"f")}get cancelable(){return ai(this,Lc,"f")}get defaultPrevented(){return ai(this,Lc,"f")&&ai(this,og,"f")}get timeStamp(){return ai(this,B2,"f")}composedPath(){return ai(this,cg,"f")?[ai(this,Za,"f")]:[]}get returnValue(){return!ai(this,Lc,"f")||!ai(this,og,"f")}get bubbles(){return ai(this,uv,"f")}get composed(){return ai(this,pv,"f")}get eventPhase(){return ai(this,cg,"f")?xn.AT_TARGET:xn.NONE}get cancelBubble(){return ai(this,lg,"f")}set cancelBubble(t){t&&ts(this,lg,!0)}stopPropagation(){ts(this,lg,!0)}get isTrusted(){return!1}},h(Xu,"U$1"),Xu),yt(X2,"Event"),X2),Lc=new WeakMap,uv=new WeakMap,pv=new WeakMap,og=new WeakMap,B2=new WeakMap,lg=new WeakMap,fv=new WeakMap,Za=new WeakMap,cg=new WeakMap,xn.NONE=t0,xn.CAPTURING_PHASE=rS,xn.AT_TARGET=e0,xn.BUBBLING_PHASE=sS,xn);Object.defineProperties(AP.prototype,{initEvent:Jt,stopImmediatePropagation:Jt,preventDefault:Jt,target:Jt,currentTarget:Jt,srcElement:Jt,type:Jt,cancelable:Jt,defaultPrevented:Jt,timeStamp:Jt,composedPath:Jt,returnValue:Jt,bubbles:Jt,composed:Jt,eventPhase:Jt,cancelBubble:Jt,stopPropagation:Jt,isTrusted:Jt});var j2,ju;const $_=(YQ=(j2=(ju=class extends AP{constructor(t,e={}){super(t,e),mv.set(this,void 0),ts(this,mv,e?.detail??null)}initCustomEvent(t,e,i,r){throw new Error("Method not implemented.")}get detail(){return ai(this,mv,"f")}},h(ju,"H"),ju),yt(j2,"CustomEvent"),j2),mv=new WeakMap,YQ);Object.defineProperties($_.prototype,{detail:Jt});const _X=AP,LX=$_;globalThis.Event??=_X;globalThis.CustomEvent??=LX;const KQ=new WeakMap,hg=yt(s=>{let t=KQ.get(s);return t===void 0&&KQ.set(s,t=new Map),t},"attributesForElement");var U2,Uu;const zX=(U2=(Uu=class extends EX{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(hg(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(t,e){hg(this).set(t,String(e))}removeAttribute(t){hg(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return hg(this).has(t)}attachShadow(t){const e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");const t=new AX(this);return this.__internals=t,t}getAttribute(t){return hg(this).get(t)??null}},h(Uu,"I$1"),Uu),yt(U2,"Element"),U2);var H2,Hu;const IX=(H2=(Hu=class extends zX{},h(Hu,"D$1"),Hu),yt(H2,"HTMLElement"),H2),x_=IX;globalThis.litServerRoot??=Object.defineProperty(new x_,"localName",{get(){return"lit-server-root"}});function k_(){let s,t;return{promise:new Promise((e,i)=>{s=e,t=i}),resolve:s,reject:t}}h(k_,"Xt$1");yt(k_,"promiseWithResolvers");var Yu;const S_=(Yu=class{constructor(){this.__definitions=new Map,this.__reverseDefinitions=new Map,this.__pendingWhenDefineds=new Map}define(t,e){if(this.__definitions.has(t))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(this.__reverseDefinitions.has(e))throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(e)}`);e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:e.observedAttributes??[]}),this.__reverseDefinitions.set(e,t),this.__pendingWhenDefineds.get(t)?.resolve(e),this.__pendingWhenDefineds.delete(t)}get(t){return this.__definitions.get(t)?.ctor}getName(t){return this.__reverseDefinitions.get(t)??null}upgrade(t){throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.")}async whenDefined(t){const e=this.__definitions.get(t);if(e)return e.ctor;let i=this.__pendingWhenDefineds.get(t);return i||(i=k_(),this.__pendingWhenDefineds.set(t,i)),i.promise}},h(Yu,"Fe"),Yu);yt(S_,"CustomElementRegistry");let DX=S_;const VX=DX,WX=new VX,xw=globalThis,yb=xw.ShadowRoot&&(xw.ShadyCSS===void 0||xw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,RP=Symbol(),JQ=new WeakMap;var Y2,Gu;let C_=(Y2=(Gu=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==RP)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(yb&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=JQ.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&JQ.set(e,t))}return t}toString(){return this.cssText}},h(Gu,"j$1"),Gu),yt(Y2,"n"),Y2);const P_=yt(s=>new C_(typeof s=="string"?s:s+"",void 0,RP),"r$2"),it=yt((s,...t)=>{const e=s.length===1?s[0]:t.reduce(((i,r,n)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1]),s[0]);return new C_(e,s,RP)},"i$2"),Q_=yt((s,t)=>{if(yb)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const i=document.createElement("style"),r=xw.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},"S$1"),t9=yb||xw.CSSStyleSheet===void 0?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return P_(e)})(s):s,{is:FX,defineProperty:qX,getOwnPropertyDescriptor:ZX,getOwnPropertyNames:NX,getOwnPropertySymbols:BX,getPrototypeOf:XX}=Object,P1=globalThis;P1.customElements??=WX;const e9=P1.trustedTypes,jX=e9?e9.emptyScript:"",UX=P1.reactiveElementPolyfillSupport,kw=yt((s,t)=>s,"f$1"),i0={toAttribute(s,t){switch(t){case Boolean:s=s?jX:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},EP=yt((s,t)=>!FX(s,t),"m$1"),i9={attribute:!0,type:String,converter:i0,reflect:!1,useDefault:!1,hasChanged:EP};Symbol.metadata??=Symbol("metadata"),P1.litPropertyMetadata??=new WeakMap;var G2,Ku;let Uc=(G2=(Ku=class extends(globalThis.HTMLElement??x_){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=i9){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&qX(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ZX(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:r,set(a){const o=r?.call(this);n?.call(this,a),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??i9}static _$Ei(){if(this.hasOwnProperty(kw("elementProperties")))return;const t=XX(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(kw("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(kw("properties"))){const e=this.properties,i=[...NX(e),...BX(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(t9(r))}else t!==void 0&&e.push(t9(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Q_(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const n=(i.converter?.toAttribute!==void 0?i.converter:i0).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=i.getPropertyOptions(r),a=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:i0;this._$Em=r;const o=a.fromAttribute(e,n.type);this[r]=o??this._$Ej?.get(r)??o,this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){const r=this.constructor,n=this[t];if(i??=r.getPropertyOptions(t),!((i.hasChanged??EP)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:n},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),n!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,n]of i){const{wrapped:a}=n,o=this[r];a!==!0||this._$AL.has(r)||o===void 0||this.C(r,void 0,n,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((i=>i.hostUpdate?.())),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}},h(Ku,"W"),Ku),yt(G2,"g"),G2);Uc.elementStyles=[],Uc.shadowRootOptions={mode:"open"},Uc[kw("elementProperties")]=new Map,Uc[kw("finalized")]=new Map,UX?.({ReactiveElement:Uc}),(P1.reactiveElementVersions??=[]).push("2.1.1");const gb=globalThis,r0=gb.trustedTypes,r9=r0?r0.createPolicy("lit-html",{createHTML:yt(s=>s,"createHTML")}):void 0,T_="$lit$",Dn=`lit$${Math.random().toFixed(9).slice(2)}$`,M_="?"+Dn,HX=`<${M_}>`,fl=gb.document===void 0?{createTreeWalker:yt(()=>({}),"createTreeWalker")}:document,Bw=yt(()=>fl.createComment(""),"l"),Xw=yt(s=>s===null||typeof s!="object"&&typeof s!="function","c"),_P=Array.isArray,YX=yt(s=>_P(s)||typeof s?.[Symbol.iterator]=="function","u"),K2=`[
|
|
30
30
|
\f\r]`,dg=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,s9=/-->/g,n9=/>/g,Na=RegExp(`>|${K2}(?:([^\\s"'>=/]+)(${K2}*=${K2}*(?:[^
|
|
31
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),a9=/'/g,o9=/"/g,A_=/^(?:script|style|textarea|title)$/i,R_=yt(s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),"y"),v=R_(1),s0=R_(2),ys=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),l9=new WeakMap,fo=fl.createTreeWalker(fl,129);function LP(s,t){if(!_P(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return r9!==void 0?r9.createHTML(t):t}h(LP,"Mt$1");yt(LP,"P");const GX=yt((s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":t===3?"<math>":"",a=dg;for(let o=0;o<e;o++){const l=s[o];let d,u,p=-1,f=0;for(;f<l.length&&(a.lastIndex=f,u=a.exec(l),u!==null);)f=a.lastIndex,a===dg?u[1]==="!--"?a=s9:u[1]!==void 0?a=n9:u[2]!==void 0?(A_.test(u[2])&&(r=RegExp("</"+u[2],"g")),a=Na):u[3]!==void 0&&(a=Na):a===Na?u[0]===">"?(a=r??dg,p=-1):u[1]===void 0?p=-2:(p=a.lastIndex-u[2].length,d=u[1],a=u[3]===void 0?Na:u[3]==='"'?o9:a9):a===o9||a===a9?a=Na:a===s9||a===n9?a=dg:(a=Na,r=void 0);const y=a===Na&&s[o+1].startsWith("/>")?" ":"";n+=a===dg?l+HX:p>=0?(i.push(d),l.slice(0,p)+T_+l.slice(p)+Dn+y):l+Dn+(p===-2?o:y)}return[LP(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},"V");var sl;const E_=(sl=class{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,a=0;const o=t.length-1,l=this.parts,[d,u]=GX(t,e);if(this.el=sl.createElement(d,i),fo.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=fo.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(T_)){const f=u[a++],y=r.getAttribute(p).split(Dn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:n,name:g[2],strings:y,ctor:g[1]==="."?JX:g[1]==="?"?tj:g[1]==="@"?ej:vb}),r.removeAttribute(p)}else p.startsWith(Dn)&&(l.push({type:6,index:n}),r.removeAttribute(p));if(A_.test(r.tagName)){const p=r.textContent.split(Dn),f=p.length-1;if(f>0){r.textContent=r0?r0.emptyScript:"";for(let y=0;y<f;y++)r.append(p[y],Bw()),fo.nextNode(),l.push({type:2,index:++n});r.append(p[f],Bw())}}}else if(r.nodeType===8)if(r.data===M_)l.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(Dn,p+1))!==-1;)l.push({type:7,index:n}),p+=Dn.length-1}n++}}static createElement(t,e){const i=fl.createElement("template");return i.innerHTML=t,i}},h(sl,"ge"),sl);yt(E_,"N");let nS=E_;function ml(s,t,e=s,i){if(t===ys)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl;const n=Xw(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=ml(s,r._$AS(s,t.values),r,i)),t}h(ml,"V");yt(ml,"S");var Ju;const __=(Ju=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??fl).importNode(e,!0);fo.currentNode=r;let n=fo.nextNode(),a=0,o=0,l=i[0];for(;l!==void 0;){if(a===l.index){let d;l.type===2?d=new wb(n,n.nextSibling,this,t):l.type===1?d=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(d=new ij(n,this,t)),this._$AV.push(d),l=i[++o]}a!==l?.index&&(n=fo.nextNode(),a++)}return fo.currentNode=fl,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},h(Ju,"Ge"),Ju);yt(__,"M");let KX=__;var nl;const L_=(nl=class{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ml(this,t,e),Xw(t)?t===C||t==null||t===""?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==ys&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):YX(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&Xw(this._$AH)?this._$AA.nextSibling.data=t:this.T(fl.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nS.createElement(LP(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const n=new KX(r,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=l9.get(t.strings);return e===void 0&&l9.set(t.strings,e=new nS(t)),e}k(t){_P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new nl(this.O(Bw()),this.O(Bw()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},h(nl,"me"),nl);yt(L_,"k");let wb=L_;var tp;const z_=(tp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=C}_$AI(t,e=this,i,r){const n=this.strings;let a=!1;if(n===void 0)t=ml(this,t,e,0),a=!Xw(t)||t!==this._$AH&&t!==ys,a&&(this._$AH=t);else{const o=t;let l,d;for(t=n[0],l=0;l<n.length-1;l++)d=ml(this,o[i+l],e,l),d===ys&&(d=this._$AH[l]),a||=!Xw(d)||d!==this._$AH[l],d===C?t=C:t!==C&&(t+=(d??"")+n[l+1]),this._$AH[l]=d}a&&!r&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},h(tp,"qe"),tp);yt(z_,"R");let vb=z_;var ep;const I_=(ep=class extends vb{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}},h(ep,"Ke"),ep);yt(I_,"H");let JX=I_;var ip;const D_=(ip=class extends vb{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}},h(ip,"Ze"),ip);yt(D_,"I");let tj=D_;var rp;const V_=(rp=class extends vb{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=ml(this,t,e,0)??C)===ys)return;const i=this._$AH,r=t===C&&i!==C||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==C&&(i===C||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},h(rp,"Je"),rp);yt(V_,"L");let ej=V_;var sp;const W_=(sp=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ml(this,t)}},h(sp,"Xe"),sp);yt(W_,"z");let ij=W_;const rj={I:wb},sj=gb.litHtmlPolyfillSupport;sj?.(nS,wb),(gb.litHtmlVersions??=[]).push("3.3.1");const nj=yt((s,t,e)=>{const i=e?.renderBefore??t;let r=i._$litPart$;if(r===void 0){const n=e?.renderBefore??null;i._$litPart$=r=new wb(t.insertBefore(Bw(),n),n,void 0,e??{})}return r._$AI(s),r},"j"),zP=globalThis;var np;const F_=(np=class extends Uc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nj(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ys}},h(np,"Qe"),np);yt(F_,"i");let wt=F_;wt._$litElement$=!0,wt.finalized=!0,zP.litElementHydrateSupport?.({LitElement:wt});const aj=zP.litElementPolyfillSupport;aj?.({LitElement:wt});(zP.litElementVersions??=[]).push("4.2.1");v`<strong>${0}</strong> redigerade <em>${1}</em>`,v`<strong>${0}</strong> nämnde dig i ett inlägg`,v`<strong>${0}</strong> kommenterade på <strong>${1}</strong>`,v`<strong>${0}</strong> reagerade med ${1} på <em>${2}</em>`,v`<strong>${0}</strong> svarade på ett inlägg`,v`<strong>${0}</strong> redigerade ett inlägg`,v`<strong>${0}</strong> nämnde dig i ett meddelande`,v`<strong>${0}</strong> nämnde dig i en kommentar`,v`<strong>${0}</strong> och <strong>${1}</strong> röstade i din omröstning`,v`<strong>${0}</strong> reagerade med ${1} på ditt inlägg`,v`<strong>${0}</strong> reagerade med ${1} på din kommentar`,v`Nytt meddelande från <strong>${0}</strong>`,v`<strong>${0}</strong> svarade på ditt inlägg`,v`<strong>${0}</strong> röstade i din omröstning`,v`<strong>${0}</strong> publicerade ett inlägg i <strong>${1}</strong>`,v`<strong>${0}</strong> gillade ditt meddelande`,v`<strong>${0}</strong>, <strong>${1}</strong> och <strong>${2}</strong> röstade i din omröstning`,v`<strong>${0}</strong> lade till <em>${1}</em> till <strong>${2}</strong>`,v`<strong>${0}</strong> skickade ett meddelande i <strong>${1}</strong>`,v`<strong>${0}</strong> reagerade med ${1} på ditt meddelande`,v`<strong>${0}</strong> gillade <em>${1}</em>`,v`<strong>${0}</strong> gillade ditt inlägg`,v`<strong>${0}</strong> gillade din kommentar`,v`<strong>${0}</strong> och ${1} andra röstade i din omröstning`,v`<strong>${0}</strong> kommenterade på <em>${1}</em>`,lt`${0} svarade på ditt inlägg`,lt`${0} röstade i din omröstning`,lt`${0} skriver${1}`,lt`${0} och ${1} röstade i din omröstning`,lt`${0} kommenterade på ${1}`,lt`${0} gillade ${1}`,lt`${0} skickade ett meddelande i ${1}`,lt`${0} redigerade ett inlägg`,lt`Röster på ${0}`,lt`${0} kommentarer`,lt`Sedd av ${0} vid ${1}`,lt`${0} och ${1} andra röstade i din omröstning`,lt`Nytt meddelande från ${0}`,lt`${0} reagerade med ${1} på ditt inlägg`,lt`${0} nämnde dig i ett inlägg`,lt`${0} nämnde dig i en kommentar`,lt`${0} publicerade ett inlägg i ${1}`,lt`${0} gillade ditt inlägg`,lt`${0} nämnde dig i ett meddelande`,lt`${0} reagerade med ${1} på din kommentar`,lt`Öppna i ${0}`,lt`${0} svarade på ett inlägg`,lt`${0} lade till ${1} till ${2}`,lt`${0} redigerade ${1}`,lt`${0} gillade ditt meddelande`,lt`${0}, ${1} och ${2} röstade i din omröstning`,lt`Alternativ ${0}`,lt`${0} reagerade med ${1} på ${2}`,lt`${0} reagerade med ${1} på ditt meddelande`,lt`${0} gillade din kommentar`,lt`${0} skriver${1}`;var oj=Object.defineProperty,q_=h(s=>{throw TypeError(s)},"Hw"),c=h((s,t)=>oj(s,"name",{value:t,configurable:!0}),"a"),IP=h((s,t,e)=>t.has(s)||q_("Cannot "+e),"Ou"),x=h((s,t,e)=>(IP(s,t,"read from private field"),e?e.call(s):t.get(s)),"y"),q=h((s,t,e)=>t.has(s)?q_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),"O"),E=h((s,t,e,i)=>(IP(s,t,"write to private field"),t.set(s,e),e),"_"),St=h((s,t,e)=>(IP(s,t,"access private method"),e),"lt"),aS=h((s,t,e,i)=>({set _(r){E(s,t,r)},get _(){return x(s,t,i)}}),"Rd");function jw(s){return Object.prototype.toString.call(s)==="[object Object]"}h(jw,"Ud");c(jw,"isObject");function nn(s){if(jw(s)===!1)return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(jw(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}h(nn,"Dr");c(nn,"isPlainObject$1");function n0(s){return typeof s.toJSON=="function"}h(n0,"Yu");c(n0,"hasToJSON");function Z_(s){return typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s===null||nn(s)||Array.isArray(s)}h(Z_,"A1");c(Z_,"isJSONSerializable");function wo(s,t,e=!1){s=s||{},t=t||{};const i={};for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r]);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e&&i[r]&&nn(i[r])&&nn(t[r])?i[r]=wo(i[r],t[r],e):i[r]=t[r]);return i}h(wo,"Pa");c(wo,"assign");function N_(s){return s?Array.isArray(s)?s:[s]:[]}h(N_,"E1");c(N_,"asArray");async function B_(s,t){for(const e of s)if(await t(e))return e}h(B_,"R1");c(B_,"findAsyncSequential");function vo(s,t,e=!1,i=!1){if(!i&&(!nn(s)||!nn(t))||i&&(!jw(s)||!jw(t)))return!1;const r=Object.getOwnPropertyNames(s),n=Object.getOwnPropertyNames(t);if(!e&&r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const o=r[a],l=s[o],d=t[o];if(l!==d&&!vo(l,d,e))return!1}return!0}h(vo,"_a");c(vo,"eqObjects");function DP(s){return Object.entries(s)}h(DP,"am");c(DP,"objectAsIterable");function VP(s){return s.charAt(0).toUpperCase()+s.substring(1).toLowerCase()}h(VP,"sm");c(VP,"toUpperCaseFirst");const lj='\\s,.:;"',cj=new RegExp(`^|[${lj}]|$`,"g"),hj=".!?",dj=new RegExp(`^|(?<=[${hj}])|$`);function WP(s){return s.length>0?s.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").replace(/_|\s+/g,"-").toLowerCase():s}h(WP,"om");c(WP,"toKebabCase");function X_(s,t=2){if(!s)return null;let e="";const i=s.split(cj).filter(r=>r);return i.length==1?e=i[0]:i.forEach(r=>{e+=r.charAt(0)}),e.substring(0,t).toUpperCase()}h(X_,"I1");c(X_,"getInitials");function FP(s){let t;const e=s.split(dj).filter(i=>i);return e.length?t=e[0]:t=s,t}h(FP,"cm");c(FP,"getTitleFromText");function qP(s,t=256){return s.length>t&&(s=s.substring(0,t-1)+"…"),s}h(qP,"lm");c(qP,"truncateText");const uj=/^[\p{Extended_Pictographic}\p{Emoji_Presentation}]+$/u;function j_(s){return!!s?.match(uj)?.length}h(j_,"D1");c(j_,"checkOnlyEmojis");const pj={credentials:"omit",headers:{"X-Requested-With":"XMLHttpRequest"},redirect:"manual"};function U_(){const s=new WeakSet,t=c(function(e,i){if(n0(i)&&(i=i.toJSON()),!(i!==null&&typeof i=="object"))return i;if(s.has(i))return"[Circular]";let r;if(s.add(i),nn(i)){const n={};Object.keys(i).forEach(a=>{n[a]=t(a,i[a])}),r=n}else Array.isArray(i)&&(r=i.map((n,a)=>t(a,n)));return s.delete(i),r},"replacer");return t}h(U_,"H1");c(U_,"getCircularReferenceReplacer");function wy(){return((1+Math.random())*65536|0).toString(16).substring(1)}h(wy,"fl");c(wy,"S4");function H_(s){if(s&&s.ok&&s.body){const t=s.body.getReader();return new ReadableStream({start(e){const i=c(()=>t.read().then(({done:r,value:n})=>{if(r){e.close();return}return e.enqueue(n),i()}),"pump");return i()}})}else throw new Error("Could not parse text stream")}h(H_,"B1");c(H_,"getTextStreamFromResponse");function ZP(s){let t;try{if(t=window[s],t){const e="__storage_test__";t.setItem(e,e),t.removeItem(e)}}catch(e){e instanceof DOMException&&e.name==="QuotaExceededError"&&t&&t.length!==0&&console.error("Storage not available:",s)}return t}h(ZP,"dm");c(ZP,"getStorage");var ap;const Y_=(ap=class extends Error{constructor(){super("Instance destroyed"),this.name="DestroyError"}},h(ap,"Wy"),ap);c(Y_,"DestroyError");let _e=Y_;const fj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._whenTokenFactory=new Promise(n=>{this._resolveTokenFactory=n}),this._whenUrlAndTokenFactory=new Promise(n=>{this._resolveUrlAndTokenFactory=a=>{n(a),this.configurationState="configured"}}),this._whenTokenIsValid=new Promise(n=>{this._resolveTokenIsValid=n}),this._tokenPromise=null,this._token="",this._validTokenFromFactory=async(n=!1)=>{const a=[this.whenTokenFactory()];this.tokenFactoryRetryDelay>=0&&this.tokenFactoryRetryDelay<1/0&&a.push(new Promise(l=>setTimeout(l,this.tokenFactoryRetryDelay))),await Promise.race(a);const o=await this.tokenFactory?.(n)??"";if(this._validateToken(o)){if(n&&o===this._token&&this.tokenFactoryRetryDelay>=0&&this.tokenFactoryRetryDelay<1/0)return await new Promise(l=>setTimeout(l,this.tokenFactoryRetryDelay)),await this._validTokenFromFactory(!0)}else if(this._whenTokenFactory=new Promise(l=>{this._resolveTokenFactory=l}),!n)return await this._validTokenFromFactory(!1);if(!o)throw new TypeError("Could not get a valid token from tokenFactory.");return this._resolveTokenFactory?.(!0),this.whenUrl().then(this._resolveUrlAndTokenFactory),o},Promise.all([this.whenUrl(),this.whenTokenFactory()]).then(()=>{this.url&&this.tokenFactory&&this._resolveUrlAndTokenFactory?.(!0)})}async whenTokenFactory(){await this._whenTokenFactory}async whenUrlAndTokenFactory(){await this._whenUrlAndTokenFactory}async whenTokenIsValid(){await this._whenTokenIsValid}get tokenFactory(){return this._tokenFactory}set tokenFactory(r){if(this.isDestroyed)throw new _e;this._tokenFactory&&this._tokenFactory!==r&&this.whenTokenFactory().then(()=>{this.queryClient.refetchQueries({stale:!0})}),this._tokenFactory=r??void 0,this._tokenFactory&&queueMicrotask(()=>{this._resolveTokenFactory?.(!0)})}get tokenUrl(){return this._tokenUrl}set tokenUrl(r){if(this.isDestroyed)throw new _e;try{if(typeof r=="string")r&&(this._tokenUrl=new URL(r,window.location.toString()));else if(r instanceof URL)this._tokenUrl=r;else if(r==null)this._tokenUrl=void 0;else throw new Error}catch(n){throw new Error("Invalid url",n)}this._tokenUrl&&!this.tokenFactory&&(this.tokenFactory=async n=>{if(!this.tokenUrl)throw new Error("tokenURL property is not valid");const a=new URL(this.tokenUrl);n?a.searchParams.set("refresh","true"):a.searchParams.delete("refresh");const o=await fetch(a);if(o.ok){const l=await o.json();if(l.access_token===void 0)throw new Error("Token response does not contain required property: access_token");return l.access_token}else throw new Error("Could not get access token from server!")})}_validateToken(r){if(!r)return!1;if(typeof r!="string")throw new TypeError(`You have provided an invalid string access token of type ${typeof r}.`);if(typeof r=="string"&&!r.startsWith("wyu_"))throw r.startsWith("wys_")?new TypeError("You have provided an API key for authentication. Provide a user access token instead."):new TypeError("You have provided an invalid string as access token.");return this._resolveTokenIsValid?.(r),!0}async getToken(r=!1){if(this.isDestroyed)throw new _e;if(this._token&&!r)return this._token;if(this._tokenPromise)return await this._tokenPromise;this._tokenPromise=new Promise((n,a)=>{this._validTokenFromFactory(r).then(n).catch(a),this.tokenFactoryTimeout>=0&&this.tokenFactoryTimeout<1/0&&setTimeout(()=>a(new Error("Token factory timeout.")),this.tokenFactoryTimeout),window.addEventListener("offline",()=>a(new Error("Network changed.")),{once:!0}),window.addEventListener("online",()=>a(new Error("Network changed.")),{once:!0})});try{const n=await this._tokenPromise;return this._tokenPromise=null,this._token=n,this._token}catch(n){throw this._tokenPromise=null,n}}},h(e,"t"),e),c(t,"WeavyAuthentication"),t},"WeavyAuthenticationMixin");var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G_(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}h(G_,"U1");c(G_,"getDefaultExportFromCjs");function Xv(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}h(Xv,"zu");c(Xv,"commonjsRequire");var c9={exports:{}},h9;function K_(){return h9||(h9=1,(function(s,t){var e;e=c(()=>(()=>{var ic,rc,sc,nc,ac,oc,lc,cc,hc,dc,uc,pc,Ps,fc,mc,yc,gc,wc,Qs,vc,Oc,bc,$c,Wa,xc,kc,Sc,Cc,Pc,Qc,Tc,Mc,Fa,Ac,Rc,Ec;var i={d:c((H,w)=>{for(var S in w)i.o(w,S)&&!i.o(H,S)&&Object.defineProperty(H,S,{enumerable:!0,get:w[S]})},"d")};i.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),i.o=(H,w)=>Object.prototype.hasOwnProperty.call(H,w),i.r=H=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"t",{value:!0})};var r,n={};i.r(n),i.d(n,{AbortError:c(()=>p,"AbortError"),DefaultHttpClient:c(()=>y3,"DefaultHttpClient"),HttpClient:c(()=>tt,"HttpClient"),HttpError:c(()=>o,"HttpError"),HttpResponse:c(()=>V,"HttpResponse"),HttpTransportType:c(()=>Ee,"HttpTransportType"),HubConnection:c(()=>k3,"HubConnection"),HubConnectionBuilder:c(()=>VW,"HubConnectionBuilder"),HubConnectionState:c(()=>ae,"HubConnectionState"),JsonHubProtocol:c(()=>D3,"JsonHubProtocol"),LogLevel:c(()=>r,"LogLevel"),MessageType:c(()=>It,"MessageType"),NullLogger:c(()=>dt,"NullLogger"),Subject:c(()=>O3,"Subject"),TimeoutError:c(()=>d,"TimeoutError"),TransferFormat:c(()=>si,"TransferFormat"),VERSION:c(()=>st,"VERSION")});const a=(ic=class extends Error{constructor(w,S){const M=new.target.prototype;super(`${w}: Status code '${S}'`),this.statusCode=S,this.__proto__=M}},h(ic,"iu"),ic);c(a,"i");let o=a;const l=(rc=class extends Error{constructor(w="A timeout occurred."){const S=new.target.prototype;super(w),this.__proto__=S}},h(rc,"ru"),rc);c(l,"n");let d=l;const u=(sc=class extends Error{constructor(w="An abort occurred."){const S=new.target.prototype;super(w),this.__proto__=S}},h(sc,"nu"),sc);c(u,"r");let p=u;const f=(nc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="UnsupportedTransportError",this.__proto__=M}},h(nc,"au"),nc);c(f,"o");let y=f;const g=(ac=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="DisabledTransportError",this.__proto__=M}},h(ac,"su"),ac);c(g,"h");let O=g;const k=(oc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="FailedToStartTransportError",this.__proto__=M}},h(oc,"ou"),oc);c(k,"c");let $=k;const T=(lc=class extends Error{constructor(w){const S=new.target.prototype;super(w),this.errorType="FailedToNegotiateWithServerError",this.__proto__=S}},h(lc,"cu"),lc);c(T,"a");let _=T;const D=(cc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.innerErrors=S,this.__proto__=M}},h(cc,"lu"),cc);c(D,"l");let A=D;const z=(hc=class{constructor(w,S,M){this.statusCode=w,this.statusText=S,this.content=M}},h(hc,"du"),hc);c(z,"u");let V=z;const j=(dc=class{get(w,S){return this.send({...S,method:"GET",url:w})}post(w,S){return this.send({...S,method:"POST",url:w})}delete(w,S){return this.send({...S,method:"DELETE",url:w})}getCookieString(w){return""}},h(dc,"hu"),dc);c(j,"d");let tt=j;(function(H){H[H.Trace=0]="Trace",H[H.Debug=1]="Debug",H[H.Information=2]="Information",H[H.Warning=3]="Warning",H[H.Error=4]="Error",H[H.Critical=5]="Critical",H[H.None=6]="None"})(r||(r={}));const vt=(uc=class{constructor(){}log(w,S){}},h(uc,"uu"),uc);c(vt,"f");let dt=vt;dt.instance=new dt;const st="9.0.6",Qt=(pc=class{static isRequired(w,S){if(w==null)throw new Error(`The '${S}' argument is required.`)}static isNotEmpty(w,S){if(!w||w.match(/^\s*$/))throw new Error(`The '${S}' argument should not be empty.`)}static isIn(w,S,M){if(!(w in S))throw new Error(`Unknown ${M} value: ${w}.`)}},h(pc,"pu"),pc);c(Qt,"w");let ct=Qt;const Wt=(Ps=class{static get isBrowser(){return!Ps.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Ps.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Ps.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}},h(Ps,"sa"),Ps);c(Wt,"g");let Lt=Wt;function Nt(H,w){let S="";return Xt(H)?(S=`Binary data of length ${H.byteLength}`,w&&(S+=`. Content: '${(function(M){const R=new Uint8Array(M);let W="";return R.forEach((Z=>{W+=`0x${Z<16?"0":""}${Z.toString(16)} `})),W.substr(0,W.length-1)})(H)}'`)):typeof H=="string"&&(S=`String data of length ${H.length}`,w&&(S+=`. Content: '${H}'`)),S}h(Nt,"q"),c(Nt,"m");function Xt(H){return H&&typeof ArrayBuffer<"u"&&(H instanceof ArrayBuffer||H.constructor&&H.constructor.name==="ArrayBuffer")}h(Xt,"F"),c(Xt,"y");async function jt(H,w,S,M,R,W){const Z={},[ut,pt]=$e();Z[ut]=pt,H.log(r.Trace,`(${w} transport) sending data. ${Nt(R,W.logMessageContent)}.`);const Dt=Xt(R)?"arraybuffer":"text",re=await S.post(M,{content:R,headers:{...Z,...W.headers},responseType:Dt,timeout:W.timeout,withCredentials:W.withCredentials});H.log(r.Trace,`(${w} transport) request complete. Response status: ${re.statusCode}.`)}h(jt,"H"),c(jt,"b");const Ii=(fc=class{constructor(w,S){this.i=w,this.h=S}dispose(){const w=this.i.observers.indexOf(this.h);w>-1&&this.i.observers.splice(w,1),this.i.observers.length===0&&this.i.cancelCallback&&this.i.cancelCallback().catch((S=>{}))}},h(fc,"yu"),fc);c(Ii,"v");let Ze=Ii;const me=(mc=class{constructor(w){this.l=w,this.out=console}log(w,S){if(w>=this.l){const M=`[${new Date().toISOString()}] ${r[w]}: ${S}`;switch(w){case r.Critical:case r.Error:this.out.error(M);break;case r.Warning:this.out.warn(M);break;case r.Information:this.out.info(M);break;default:this.out.log(M)}}}},h(mc,"wu"),mc);c(me,"E");let le=me;function $e(){let H="X-SignalR-User-Agent";return Lt.isNode&&(H="User-Agent"),[H,Di(st,Gi(),Lt.isNode?"NodeJS":"Browser",fr())]}h($e,"ot"),c($e,"$");function Di(H,w,S,M){let R="Microsoft SignalR/";const W=H.split(".");return R+=`${W[0]}.${W[1]}`,R+=` (${H}; `,R+=w&&w!==""?`${w}; `:"Unknown OS; ",R+=`${S}`,R+=M?`; ${M}`:"; Unknown Runtime Version",R+=")",R}h(Di,"rt"),c(Di,"C");function Gi(){if(!Lt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}h(Gi,"Lt"),c(Gi,"S");function fr(){if(Lt.isNode)return process.versions.node}h(fr,"Ot"),c(fr,"k");function ie(H){return H.stack?H.stack:H.message?H.message:`${H}`}h(ie,"At"),c(ie,"P");const Mr=(yc=class extends tt{constructor(w){if(super(),this.u=w,typeof fetch>"u"||Lt.isNode){const S=Xv;this.p=new(S("tough-cookie")).CookieJar,typeof fetch>"u"?this.m=S("node-fetch"):this.m=fetch,this.m=S("fetch-cookie")(this.m,this.p)}else this.m=fetch.bind((function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(i.g!==void 0)return i.g;throw new Error("could not find global")})());if(typeof AbortController>"u"){const S=Xv;this.v=S("abort-controller")}else this.v=AbortController}async send(w){if(w.abortSignal&&w.abortSignal.aborted)throw new p;if(!w.method)throw new Error("No method defined.");if(!w.url)throw new Error("No url defined.");const S=new this.v;let M;w.abortSignal&&(w.abortSignal.onabort=()=>{S.abort(),M=new p});let R,W=null;if(w.timeout){const pt=w.timeout;W=setTimeout((()=>{S.abort(),this.u.log(r.Warning,"Timeout from HTTP request."),M=new d}),pt)}w.content===""&&(w.content=void 0),w.content&&(w.headers=w.headers||{},Xt(w.content)?w.headers["Content-Type"]="application/octet-stream":w.headers["Content-Type"]="text/plain;charset=UTF-8");try{R=await this.m(w.url,{body:w.content,cache:"no-cache",credentials:w.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...w.headers},method:w.method,mode:"cors",redirect:"follow",signal:S.signal})}catch(pt){throw M||(this.u.log(r.Warning,`Error from HTTP request. ${pt}.`),pt)}finally{W&&clearTimeout(W),w.abortSignal&&(w.abortSignal.onabort=null)}if(!R.ok){const pt=await ec(R,"text");throw new o(pt||R.statusText,R.status)}const Z=ec(R,w.responseType),ut=await Z;return new V(R.status,R.statusText,ut)}getCookieString(w){let S="";return Lt.isNode&&this.p&&this.p.getCookies(w,((M,R)=>S=R.join("; "))),S}},h(yc,"fu"),yc);c(Mr,"T");let Da=Mr;function ec(H,w){let S;switch(w){case"arraybuffer":S=H.arrayBuffer();break;case"text":default:S=H.text();break;case"blob":case"document":case"json":throw new Error(`${w} is not supported.`)}return S}h(ec,"Bt"),c(ec,"I");const f3=(gc=class extends tt{constructor(w){super(),this.u=w}send(w){return w.abortSignal&&w.abortSignal.aborted?Promise.reject(new p):w.method?w.url?new Promise(((S,M)=>{const R=new XMLHttpRequest;R.open(w.method,w.url,!0),R.withCredentials=w.withCredentials===void 0||w.withCredentials,R.setRequestHeader("X-Requested-With","XMLHttpRequest"),w.content===""&&(w.content=void 0),w.content&&(Xt(w.content)?R.setRequestHeader("Content-Type","application/octet-stream"):R.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const W=w.headers;W&&Object.keys(W).forEach((Z=>{R.setRequestHeader(Z,W[Z])})),w.responseType&&(R.responseType=w.responseType),w.abortSignal&&(w.abortSignal.onabort=()=>{R.abort(),M(new p)}),w.timeout&&(R.timeout=w.timeout),R.onload=()=>{w.abortSignal&&(w.abortSignal.onabort=null),R.status>=200&&R.status<300?S(new V(R.status,R.statusText,R.response||R.responseText)):M(new o(R.response||R.responseText||R.statusText,R.status))},R.onerror=()=>{this.u.log(r.Warning,`Error from HTTP request. ${R.status}: ${R.statusText}.`),M(new o(R.statusText,R.status))},R.ontimeout=()=>{this.u.log(r.Warning,"Timeout from HTTP request."),M(new d)},R.send(w.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}},h(gc,"mu"),gc);c(f3,"_");let PW=f3;const m3=(wc=class extends tt{constructor(w){if(super(),typeof fetch<"u"||Lt.isNode)this.$=new Da(w);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this.$=new PW(w)}}send(w){return w.abortSignal&&w.abortSignal.aborted?Promise.reject(new p):w.method?w.url?this.$.send(w):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(w){return this.$.getCookieString(w)}},h(wc,"vu"),wc);c(m3,"H");let y3=m3;const g3=(Qs=class{static write(w){return`${w}${Qs.RecordSeparator}`}static parse(w){if(w[w.length-1]!==Qs.RecordSeparator)throw new Error("Message is incomplete.");const S=w.split(Qs.RecordSeparator);return S.pop(),S}},h(Qs,"oa"),Qs);c(g3,"D");let Cs=g3;Cs.RecordSeparatorCode=30,Cs.RecordSeparator=String.fromCharCode(Cs.RecordSeparatorCode);const w3=(vc=class{writeHandshakeRequest(w){return Cs.write(JSON.stringify(w))}parseHandshakeResponse(w){let S,M;if(Xt(w)){const Z=new Uint8Array(w),ut=Z.indexOf(Cs.RecordSeparatorCode);if(ut===-1)throw new Error("Message is incomplete.");const pt=ut+1;S=String.fromCharCode.apply(null,Array.prototype.slice.call(Z.slice(0,pt))),M=Z.byteLength>pt?Z.slice(pt).buffer:null}else{const Z=w,ut=Z.indexOf(Cs.RecordSeparator);if(ut===-1)throw new Error("Message is incomplete.");const pt=ut+1;S=Z.substring(0,pt),M=Z.length>pt?Z.substring(pt):null}const R=Cs.parse(S),W=JSON.parse(R[0]);if(W.type)throw new Error("Expected a handshake response from the server.");return[M,W]}},h(vc,"gu"),vc);c(w3,"R");let QW=w3;var It,ae;(function(H){H[H.Invocation=1]="Invocation",H[H.StreamItem=2]="StreamItem",H[H.Completion=3]="Completion",H[H.StreamInvocation=4]="StreamInvocation",H[H.CancelInvocation=5]="CancelInvocation",H[H.Ping=6]="Ping",H[H.Close=7]="Close",H[H.Ack=8]="Ack",H[H.Sequence=9]="Sequence"})(It||(It={}));const v3=(Oc=class{constructor(){this.observers=[]}next(w){for(const S of this.observers)S.next(w)}error(w){for(const S of this.observers)S.error&&S.error(w)}complete(){for(const w of this.observers)w.complete&&w.complete()}subscribe(w){return this.observers.push(w),new Ze(this,w)}},h(Oc,"bu"),Oc);c(v3,"U");let O3=v3;const b3=(bc=class{constructor(w,S,M){this.C=1e5,this.S=[],this.k=0,this.P=!1,this.T=1,this.I=0,this._=0,this.H=!1,this.D=w,this.R=S,this.C=M}async A(w){const S=this.D.writeMessage(w);let M=Promise.resolve();if(this.U(w)){this.k++;let R=c(()=>{},"t"),W=c(()=>{},"i");Xt(S)?this._+=S.byteLength:this._+=S.length,this._>=this.C&&(M=new Promise(((Z,ut)=>{R=Z,W=ut}))),this.S.push(new MW(S,this.k,R,W))}try{this.H||await this.R.send(S)}catch{this.L()}await M}N(w){let S=-1;for(let M=0;M<this.S.length;M++){const R=this.S[M];if(R.q<=w.sequenceId)S=M,Xt(R.M)?this._-=R.M.byteLength:this._-=R.M.length,R.j();else{if(!(this._<this.C))break;R.j()}}S!==-1&&(this.S=this.S.slice(S+1))}W(w){if(this.P)return w.type===It.Sequence&&(this.P=!1,!0);if(!this.U(w))return!0;const S=this.T;return this.T++,S<=this.I?(S===this.I&&this.O(),!1):(this.I=S,this.O(),!0)}F(w){w.sequenceId>this.T?this.R.stop(new Error("Sequence ID greater than amount of messages we've received.")):this.T=w.sequenceId}L(){this.H=!0,this.P=!0}async B(){const w=this.S.length!==0?this.S[0].q:this.k+1;await this.R.send(this.D.writeMessage({type:It.Sequence,sequenceId:w}));const S=this.S;for(const M of S)await this.R.send(M.M);this.H=!1}X(w){w!=null||(w=new Error("Unable to reconnect to server."));for(const S of this.S)S.J(w)}U(w){switch(w.type){case It.Invocation:case It.StreamItem:case It.Completion:case It.StreamInvocation:case It.CancelInvocation:return!0;case It.Close:case It.Sequence:case It.Ping:case It.Ack:return!1}}O(){this.V===void 0&&(this.V=setTimeout((async()=>{try{this.H||await this.R.send(this.D.writeMessage({type:It.Ack,sequenceId:this.I}))}catch{}clearTimeout(this.V),this.V=void 0}),1e3))}},h(bc,"xu"),bc);c(b3,"L");let TW=b3;const $3=($c=class{constructor(w,S,M,R){this.M=w,this.q=S,this.j=M,this.J=R}},h($c,"Cu"),$c);c($3,"N");let MW=$3;(function(H){H.Disconnected="Disconnected",H.Connecting="Connecting",H.Connected="Connected",H.Disconnecting="Disconnecting",H.Reconnecting="Reconnecting"})(ae||(ae={}));const x3=(Wa=class{static create(w,S,M,R,W,Z,ut){return new Wa(w,S,M,R,W,Z,ut)}constructor(w,S,M,R,W,Z,ut){this.K=0,this.G=()=>{this.u.log(r.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ct.isRequired(w,"connection"),ct.isRequired(S,"logger"),ct.isRequired(M,"protocol"),this.serverTimeoutInMilliseconds=W??3e4,this.keepAliveIntervalInMilliseconds=Z??15e3,this.Y=ut??1e5,this.u=S,this.D=M,this.connection=w,this.Z=R,this.tt=new QW,this.connection.onreceive=pt=>this.et(pt),this.connection.onclose=pt=>this.st(pt),this.it={},this.nt={},this.rt=[],this.ot=[],this.ht=[],this.ct=0,this.lt=!1,this.ut=ae.Disconnected,this.dt=!1,this.ft=this.D.writeMessage({type:It.Ping})}get state(){return this.ut}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(w){if(this.ut!==ae.Disconnected&&this.ut!==ae.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!w)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=w}start(){return this.wt=this.gt(),this.wt}async gt(){if(this.ut!==ae.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this.ut=ae.Connecting,this.u.log(r.Debug,"Starting HubConnection.");try{await this.yt(),Lt.isBrowser&&window.document.addEventListener("freeze",this.G),this.ut=ae.Connected,this.dt=!0,this.u.log(r.Debug,"HubConnection connected successfully.")}catch(w){return this.ut=ae.Disconnected,this.u.log(r.Debug,`HubConnection failed to start successfully because of error '${w}'.`),Promise.reject(w)}}async yt(){this.bt=void 0,this.lt=!1;const w=new Promise(((S,M)=>{this.vt=S,this.Et=M}));await this.connection.start(this.D.transferFormat);try{let S=this.D.version;this.connection.features.reconnect||(S=1);const M={protocol:this.D.name,version:S};if(this.u.log(r.Debug,"Sending handshake request."),await this.$t(this.tt.writeHandshakeRequest(M)),this.u.log(r.Information,`Using HubProtocol '${this.D.name}'.`),this.Ct(),this.St(),this.kt(),await w,this.bt)throw this.bt;this.connection.features.reconnect&&(this.Pt=new TW(this.D,this.connection,this.Y),this.connection.features.disconnected=this.Pt.L.bind(this.Pt),this.connection.features.resend=()=>{if(this.Pt)return this.Pt.B()}),this.connection.features.inherentKeepAlive||await this.$t(this.ft)}catch(S){throw this.u.log(r.Debug,`Hub handshake failed with error '${S}' during start(). Stopping HubConnection.`),this.Ct(),this.Tt(),await this.connection.stop(S),S}}async stop(){const w=this.wt;this.connection.features.reconnect=!1,this.It=this._t(),await this.It;try{await w}catch{}}_t(w){if(this.ut===ae.Disconnected)return this.u.log(r.Debug,`Call to HubConnection.stop(${w}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this.ut===ae.Disconnecting)return this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnecting state.`),this.It;const S=this.ut;return this.ut=ae.Disconnecting,this.u.log(r.Debug,"Stopping HubConnection."),this.Ht?(this.u.log(r.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.Ht),this.Ht=void 0,this.Dt(),Promise.resolve()):(S===ae.Connected&&this.Rt(),this.Ct(),this.Tt(),this.bt=w||new p("The connection was stopped before the hub handshake could complete."),this.connection.stop(w))}async Rt(){try{await this.xt(this.At())}catch{}}stream(w,...S){const[M,R]=this.Ut(S),W=this.Lt(w,S,R);let Z;const ut=new O3;return ut.cancelCallback=()=>{const pt=this.Nt(W.invocationId);return delete this.it[W.invocationId],Z.then((()=>this.xt(pt)))},this.it[W.invocationId]=(pt,Dt)=>{Dt?ut.error(Dt):pt&&(pt.type===It.Completion?pt.error?ut.error(new Error(pt.error)):ut.complete():ut.next(pt.item))},Z=this.xt(W).catch((pt=>{ut.error(pt),delete this.it[W.invocationId]})),this.qt(M,Z),ut}$t(w){return this.kt(),this.connection.send(w)}xt(w){return this.Pt?this.Pt.A(w):this.$t(this.D.writeMessage(w))}send(w,...S){const[M,R]=this.Ut(S),W=this.xt(this.Mt(w,S,!0,R));return this.qt(M,W),W}invoke(w,...S){const[M,R]=this.Ut(S),W=this.Mt(w,S,!1,R);return new Promise(((Z,ut)=>{this.it[W.invocationId]=(Dt,re)=>{re?ut(re):Dt&&(Dt.type===It.Completion?Dt.error?ut(new Error(Dt.error)):Z(Dt.result):ut(new Error(`Unexpected message type: ${Dt.type}`)))};const pt=this.xt(W).catch((Dt=>{ut(Dt),delete this.it[W.invocationId]}));this.qt(M,pt)}))}on(w,S){w&&S&&(w=w.toLowerCase(),this.nt[w]||(this.nt[w]=[]),this.nt[w].indexOf(S)===-1&&this.nt[w].push(S))}off(w,S){if(!w)return;w=w.toLowerCase();const M=this.nt[w];if(M)if(S){const R=M.indexOf(S);R!==-1&&(M.splice(R,1),M.length===0&&delete this.nt[w])}else delete this.nt[w]}onclose(w){w&&this.rt.push(w)}onreconnecting(w){w&&this.ot.push(w)}onreconnected(w){w&&this.ht.push(w)}et(w){if(this.Ct(),this.lt||(w=this.jt(w),this.lt=!0),w){const S=this.D.parseMessages(w,this.u);for(const M of S)if(!this.Pt||this.Pt.W(M))switch(M.type){case It.Invocation:this.Wt(M).catch((R=>{this.u.log(r.Error,`Invoke client method threw error: ${ie(R)}`)}));break;case It.StreamItem:case It.Completion:{const R=this.it[M.invocationId];if(R){M.type===It.Completion&&delete this.it[M.invocationId];try{R(M)}catch(W){this.u.log(r.Error,`Stream callback threw error: ${ie(W)}`)}}break}case It.Ping:break;case It.Close:{this.u.log(r.Information,"Close message received from server.");const R=M.error?new Error("Server returned an error on close: "+M.error):void 0;M.allowReconnect===!0?this.connection.stop(R):this.It=this._t(R);break}case It.Ack:this.Pt&&this.Pt.N(M);break;case It.Sequence:this.Pt&&this.Pt.F(M);break;default:this.u.log(r.Warning,`Invalid message type: ${M.type}.`)}}this.St()}jt(w){let S,M;try{[M,S]=this.tt.parseHandshakeResponse(w)}catch(R){const W="Error parsing handshake response: "+R;this.u.log(r.Error,W);const Z=new Error(W);throw this.Et(Z),Z}if(S.error){const R="Server returned handshake error: "+S.error;this.u.log(r.Error,R);const W=new Error(R);throw this.Et(W),W}return this.u.log(r.Debug,"Server handshake complete."),this.vt(),M}kt(){this.connection.features.inherentKeepAlive||(this.K=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this.Tt())}St(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this.Ot=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),this.Ft!==void 0))){let w=this.K-new Date().getTime();w<0&&(w=0),this.Ft=setTimeout((async()=>{if(this.ut===ae.Connected)try{await this.$t(this.ft)}catch{this.Tt()}}),w)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async Wt(w){const S=w.target.toLowerCase(),M=this.nt[S];if(!M)return this.u.log(r.Warning,`No client method with the name '${S}' found.`),void(w.invocationId&&(this.u.log(r.Warning,`No result given for '${S}' method and invocation ID '${w.invocationId}'.`),await this.xt(this.Bt(w.invocationId,"Client didn't provide a result.",null))));const R=M.slice(),W=!!w.invocationId;let Z,ut,pt;for(const Dt of R)try{const re=Z;Z=await Dt.apply(this,w.arguments),W&&Z&&re&&(this.u.log(r.Error,`Multiple results provided for '${S}'. Sending error to server.`),pt=this.Bt(w.invocationId,"Client provided multiple results.",null)),ut=void 0}catch(re){ut=re,this.u.log(r.Error,`A callback for the method '${S}' threw error '${re}'.`)}pt?await this.xt(pt):W?(ut?pt=this.Bt(w.invocationId,`${ut}`,null):Z!==void 0?pt=this.Bt(w.invocationId,null,Z):(this.u.log(r.Warning,`No result given for '${S}' method and invocation ID '${w.invocationId}'.`),pt=this.Bt(w.invocationId,"Client didn't provide a result.",null)),await this.xt(pt)):Z&&this.u.log(r.Error,`Result given for '${S}' method but server is not expecting a result.`)}st(w){this.u.log(r.Debug,`HubConnection.connectionClosed(${w}) called while in state ${this.ut}.`),this.bt=this.bt||w||new p("The underlying connection was closed before the hub handshake could complete."),this.vt&&this.vt(),this.Xt(w||new Error("Invocation canceled due to the underlying connection being closed.")),this.Ct(),this.Tt(),this.ut===ae.Disconnecting?this.Dt(w):this.ut===ae.Connected&&this.Z?this.Jt(w):this.ut===ae.Connected&&this.Dt(w)}Dt(w){if(this.dt){this.ut=ae.Disconnected,this.dt=!1,this.Pt&&(this.Pt.X(w??new Error("Connection closed.")),this.Pt=void 0),Lt.isBrowser&&window.document.removeEventListener("freeze",this.G);try{this.rt.forEach((S=>S.apply(this,[w])))}catch(S){this.u.log(r.Error,`An onclose callback called with error '${w}' threw error '${S}'.`)}}}async Jt(w){const S=Date.now();let M=0,R=w!==void 0?w:new Error("Attempting to reconnect due to a unknown error."),W=this.zt(M++,0,R);if(W===null)return this.u.log(r.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this.Dt(w);if(this.ut=ae.Reconnecting,w?this.u.log(r.Information,`Connection reconnecting because of error '${w}'.`):this.u.log(r.Information,"Connection reconnecting."),this.ot.length!==0){try{this.ot.forEach((Z=>Z.apply(this,[w])))}catch(Z){this.u.log(r.Error,`An onreconnecting callback called with error '${w}' threw error '${Z}'.`)}if(this.ut!==ae.Reconnecting)return void this.u.log(r.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;W!==null;){if(this.u.log(r.Information,`Reconnect attempt number ${M} will start in ${W} ms.`),await new Promise((Z=>{this.Ht=setTimeout(Z,W)})),this.Ht=void 0,this.ut!==ae.Reconnecting)return void this.u.log(r.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this.yt(),this.ut=ae.Connected,this.u.log(r.Information,"HubConnection reconnected successfully."),this.ht.length!==0)try{this.ht.forEach((Z=>Z.apply(this,[this.connection.connectionId])))}catch(Z){this.u.log(r.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${Z}'.`)}return}catch(Z){if(this.u.log(r.Information,`Reconnect attempt failed because of error '${Z}'.`),this.ut!==ae.Reconnecting)return this.u.log(r.Debug,`Connection moved to the '${this.ut}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this.ut===ae.Disconnecting&&this.Dt());R=Z instanceof Error?Z:new Error(Z.toString()),W=this.zt(M++,Date.now()-S,R)}}this.u.log(r.Information,`Reconnect retries have been exhausted after ${Date.now()-S} ms and ${M} failed attempts. Connection disconnecting.`),this.Dt()}zt(w,S,M){try{return this.Z.nextRetryDelayInMilliseconds({elapsedMilliseconds:S,previousRetryCount:w,retryReason:M})}catch(R){return this.u.log(r.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${w}, ${S}) threw error '${R}'.`),null}}Xt(w){const S=this.it;this.it={},Object.keys(S).forEach((M=>{const R=S[M];try{R(null,w)}catch(W){this.u.log(r.Error,`Stream 'error' callback called with '${w}' threw error: ${ie(W)}`)}}))}Tt(){this.Ft&&(clearTimeout(this.Ft),this.Ft=void 0)}Ct(){this.Ot&&clearTimeout(this.Ot)}Mt(w,S,M,R){if(M)return R.length!==0?{target:w,arguments:S,streamIds:R,type:It.Invocation}:{target:w,arguments:S,type:It.Invocation};{const W=this.ct;return this.ct++,R.length!==0?{target:w,arguments:S,invocationId:W.toString(),streamIds:R,type:It.Invocation}:{target:w,arguments:S,invocationId:W.toString(),type:It.Invocation}}}qt(w,S){if(w.length!==0){S||(S=Promise.resolve());for(const M in w)w[M].subscribe({complete:c(()=>{S=S.then((()=>this.xt(this.Bt(M))))},"complete"),error:c(R=>{let W;W=R instanceof Error?R.message:R&&R.toString?R.toString():"Unknown error",S=S.then((()=>this.xt(this.Bt(M,W))))},"error"),next:c(R=>{S=S.then((()=>this.xt(this.Vt(M,R))))},"next")})}}Ut(w){const S=[],M=[];for(let R=0;R<w.length;R++){const W=w[R];if(this.Kt(W)){const Z=this.ct;this.ct++,S[Z]=W,M.push(Z.toString()),w.splice(R,1)}}return[S,M]}Kt(w){return w&&w.subscribe&&typeof w.subscribe=="function"}Lt(w,S,M){const R=this.ct;return this.ct++,M.length!==0?{target:w,arguments:S,invocationId:R.toString(),streamIds:M,type:It.StreamInvocation}:{target:w,arguments:S,invocationId:R.toString(),type:It.StreamInvocation}}Nt(w){return{invocationId:w,type:It.CancelInvocation}}Vt(w,S){return{invocationId:w,item:S,type:It.StreamItem}}Bt(w,S,M){return S?{error:S,invocationId:w,type:It.Completion}:{invocationId:w,result:M,type:It.Completion}}At(){return{type:It.Close}}},h(Wa,"Ad"),Wa);c(x3,"q");let k3=x3;const AW=[0,2e3,1e4,3e4,null],S3=(xc=class{constructor(w){this.Gt=w!==void 0?[...w,null]:AW}nextRetryDelayInMilliseconds(w){return this.Gt[w.previousRetryCount]}},h(xc,"$u"),xc);c(S3,"j");let C3=S3;const P3=(kc=class{},h(kc,"ku"),kc);c(P3,"W");let Va=P3;Va.Authorization="Authorization",Va.Cookie="Cookie";const Q3=(Sc=class extends tt{constructor(w,S){super(),this.Qt=w,this.Yt=S}async send(w){let S=!0;this.Yt&&(!this.Zt||w.url&&w.url.indexOf("/negotiate?")>0)&&(S=!1,this.Zt=await this.Yt()),this.te(w);const M=await this.Qt.send(w);return S&&M.statusCode===401&&this.Yt?(this.Zt=await this.Yt(),this.te(w),await this.Qt.send(w)):M}te(w){w.headers||(w.headers={}),this.Zt?w.headers[Va.Authorization]=`Bearer ${this.Zt}`:this.Yt&&w.headers[Va.Authorization]&&delete w.headers[Va.Authorization]}getCookieString(w){return this.Qt.getCookieString(w)}},h(Sc,"Pu"),Sc);c(Q3,"O");let RW=Q3;var Ee,si;(function(H){H[H.None=0]="None",H[H.WebSockets=1]="WebSockets",H[H.ServerSentEvents=2]="ServerSentEvents",H[H.LongPolling=4]="LongPolling"})(Ee||(Ee={})),(function(H){H[H.Text=1]="Text",H[H.Binary=2]="Binary"})(si||(si={}));const T3=(Cc=class{constructor(){this.ee=!1,this.onabort=null}abort(){this.ee||(this.ee=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this.ee}},h(Cc,"_u"),Cc);c(T3,"X");let EW=T3;const M3=(Pc=class{get pollAborted(){return this.se.aborted}constructor(w,S,M){this.$=w,this.u=S,this.se=new EW,this.ie=M,this.ne=!1,this.onreceive=null,this.onclose=null}async connect(w,S){if(ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.re=w,this.u.log(r.Trace,"(LongPolling transport) Connecting."),S===si.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[M,R]=$e(),W={[M]:R,...this.ie.headers},Z={abortSignal:this.se.signal,headers:W,timeout:1e5,withCredentials:this.ie.withCredentials};S===si.Binary&&(Z.responseType="arraybuffer");const ut=`${w}&_=${Date.now()}`;this.u.log(r.Trace,`(LongPolling transport) polling: ${ut}.`);const pt=await this.$.get(ut,Z);pt.statusCode!==200?(this.u.log(r.Error,`(LongPolling transport) Unexpected response code: ${pt.statusCode}.`),this.oe=new o(pt.statusText||"",pt.statusCode),this.ne=!1):this.ne=!0,this.he=this.ce(this.re,Z)}async ce(w,S){try{for(;this.ne;)try{const M=`${w}&_=${Date.now()}`;this.u.log(r.Trace,`(LongPolling transport) polling: ${M}.`);const R=await this.$.get(M,S);R.statusCode===204?(this.u.log(r.Information,"(LongPolling transport) Poll terminated by server."),this.ne=!1):R.statusCode!==200?(this.u.log(r.Error,`(LongPolling transport) Unexpected response code: ${R.statusCode}.`),this.oe=new o(R.statusText||"",R.statusCode),this.ne=!1):R.content?(this.u.log(r.Trace,`(LongPolling transport) data received. ${Nt(R.content,this.ie.logMessageContent)}.`),this.onreceive&&this.onreceive(R.content)):this.u.log(r.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(M){this.ne?M instanceof d?this.u.log(r.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.oe=M,this.ne=!1):this.u.log(r.Trace,`(LongPolling transport) Poll errored after shutdown: ${M.message}`)}}finally{this.u.log(r.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.ae()}}async send(w){return this.ne?jt(this.u,"LongPolling",this.$,this.re,w,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this.u.log(r.Trace,"(LongPolling transport) Stopping polling."),this.ne=!1,this.se.abort();try{await this.he,this.u.log(r.Trace,`(LongPolling transport) sending DELETE request to ${this.re}.`);const w={},[S,M]=$e();w[S]=M;const R={headers:{...w,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials};let W;try{await this.$.delete(this.re,R)}catch(Z){W=Z}W?W instanceof o&&(W.statusCode===404?this.u.log(r.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this.u.log(r.Trace,`(LongPolling transport) Error sending a DELETE request: ${W}`)):this.u.log(r.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this.u.log(r.Trace,"(LongPolling transport) Stop finished."),this.ae()}}ae(){if(this.onclose){let w="(LongPolling transport) Firing onclose event.";this.oe&&(w+=" Error: "+this.oe),this.u.log(r.Trace,w),this.onclose(this.oe)}}},h(Pc,"Su"),Pc);c(M3,"J");let A3=M3;const R3=(Qc=class{constructor(w,S,M,R){this.$=w,this.Zt=S,this.u=M,this.ie=R,this.onreceive=null,this.onclose=null}async connect(w,S){return ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.u.log(r.Trace,"(SSE transport) Connecting."),this.re=w,this.Zt&&(w+=(w.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this.Zt)}`),new Promise(((M,R)=>{let W,Z=!1;if(S===si.Text){if(Lt.isBrowser||Lt.isWebWorker)W=new this.ie.EventSource(w,{withCredentials:this.ie.withCredentials});else{const ut=this.$.getCookieString(w),pt={};pt.Cookie=ut;const[Dt,re]=$e();pt[Dt]=re,W=new this.ie.EventSource(w,{withCredentials:this.ie.withCredentials,headers:{...pt,...this.ie.headers}})}try{W.onmessage=ut=>{if(this.onreceive)try{this.u.log(r.Trace,`(SSE transport) data received. ${Nt(ut.data,this.ie.logMessageContent)}.`),this.onreceive(ut.data)}catch(pt){return void this.le(pt)}},W.onerror=ut=>{Z?this.le():R(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},W.onopen=()=>{this.u.log(r.Information,`SSE connected to ${this.re}`),this.ue=W,Z=!0,M()}}catch(ut){return void R(ut)}}else R(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(w){return this.ue?jt(this.u,"SSE",this.$,this.re,w,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this.le(),Promise.resolve()}le(w){this.ue&&(this.ue.close(),this.ue=void 0,this.onclose&&this.onclose(w))}},h(Qc,"Mu"),Qc);c(R3,"z");let _W=R3;const E3=(Tc=class{constructor(w,S,M,R,W,Z){this.u=M,this.Yt=S,this.de=R,this.fe=W,this.$=w,this.onreceive=null,this.onclose=null,this.pe=Z}async connect(w,S){let M;return ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.u.log(r.Trace,"(WebSockets transport) Connecting."),this.Yt&&(M=await this.Yt()),new Promise(((R,W)=>{let Z;w=w.replace(/^http/,"ws");const ut=this.$.getCookieString(w);let pt=!1;if(Lt.isNode||Lt.isReactNative){const Dt={},[re,_c]=$e();Dt[re]=_c,M&&(Dt[Va.Authorization]=`Bearer ${M}`),ut&&(Dt[Va.Cookie]=ut),Z=new this.fe(w,void 0,{headers:{...Dt,...this.pe}})}else M&&(w+=(w.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(M)}`);Z||(Z=new this.fe(w)),S===si.Binary&&(Z.binaryType="arraybuffer"),Z.onopen=Dt=>{this.u.log(r.Information,`WebSocket connected to ${w}.`),this.we=Z,pt=!0,R()},Z.onerror=Dt=>{let re=null;re=typeof ErrorEvent<"u"&&Dt instanceof ErrorEvent?Dt.error:"There was an error with the transport",this.u.log(r.Information,`(WebSockets transport) ${re}.`)},Z.onmessage=Dt=>{if(this.u.log(r.Trace,`(WebSockets transport) data received. ${Nt(Dt.data,this.de)}.`),this.onreceive)try{this.onreceive(Dt.data)}catch(re){return void this.le(re)}},Z.onclose=Dt=>{if(pt)this.le(Dt);else{let re=null;re=typeof ErrorEvent<"u"&&Dt instanceof ErrorEvent?Dt.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",W(new Error(re))}}}))}send(w){return this.we&&this.we.readyState===this.fe.OPEN?(this.u.log(r.Trace,`(WebSockets transport) sending data. ${Nt(w,this.de)}.`),this.we.send(w),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this.we&&this.le(void 0),Promise.resolve()}le(w){this.we&&(this.we.onclose=()=>{},this.we.onmessage=()=>{},this.we.onerror=()=>{},this.we.close(),this.we=void 0),this.u.log(r.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.ge(w)||w.wasClean!==!1&&w.code===1e3?w instanceof Error?this.onclose(w):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${w.code} (${w.reason||"no reason given"}).`)))}ge(w){return w&&typeof w.wasClean=="boolean"&&typeof w.code=="number"}},h(Tc,"Au"),Tc);c(E3,"V");let LW=E3;const _3=(Mc=class{constructor(w,S={}){var M;if(this.me=()=>{},this.features={},this.ye=1,ct.isRequired(w,"url"),this.u=(M=S.logger)===void 0?new le(r.Information):M===null?dt.instance:M.log!==void 0?M:new le(M),this.baseUrl=this.be(w),(S=S||{}).logMessageContent=S.logMessageContent!==void 0&&S.logMessageContent,typeof S.withCredentials!="boolean"&&S.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");S.withCredentials=S.withCredentials===void 0||S.withCredentials,S.timeout=S.timeout===void 0?1e5:S.timeout;let R=null,W=null;if(Lt.isNode){const Z=Xv;R=Z("ws"),W=Z("eventsource")}Lt.isNode||typeof WebSocket>"u"||S.WebSocket?Lt.isNode&&!S.WebSocket&&R&&(S.WebSocket=R):S.WebSocket=WebSocket,Lt.isNode||typeof EventSource>"u"||S.EventSource?Lt.isNode&&!S.EventSource&&W!==void 0&&(S.EventSource=W):S.EventSource=EventSource,this.$=new RW(S.httpClient||new y3(this.u),S.accessTokenFactory),this.ut="Disconnected",this.dt=!1,this.ie=S,this.onreceive=null,this.onclose=null}async start(w){if(w=w||si.Binary,ct.isIn(w,si,"transferFormat"),this.u.log(r.Debug,`Starting connection with transfer format '${si[w]}'.`),this.ut!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this.ut="Connecting",this.ve=this.yt(w),await this.ve,this.ut==="Disconnecting"){const S="Failed to start the HttpConnection before stop() was called.";return this.u.log(r.Error,S),await this.It,Promise.reject(new p(S))}if(this.ut!=="Connected"){const S="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this.u.log(r.Error,S),Promise.reject(new p(S))}this.dt=!0}send(w){return this.ut!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.Ee||(this.Ee=new IW(this.transport)),this.Ee.send(w))}async stop(w){return this.ut==="Disconnected"?(this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this.ut==="Disconnecting"?(this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnecting state.`),this.It):(this.ut="Disconnecting",this.It=new Promise((S=>{this.me=S})),await this._t(w),void await this.It)}async _t(w){this.$e=w;try{await this.ve}catch{}if(this.transport){try{await this.transport.stop()}catch(S){this.u.log(r.Error,`HttpConnection.transport.stop() threw error '${S}'.`),this.Ce()}this.transport=void 0}else this.u.log(r.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async yt(w){let S=this.baseUrl;this.Yt=this.ie.accessTokenFactory,this.$.Yt=this.Yt;try{if(this.ie.skipNegotiation){if(this.ie.transport!==Ee.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this.Se(Ee.WebSockets),await this.ke(S,w)}else{let M=null,R=0;do{if(M=await this.Pe(S),this.ut==="Disconnecting"||this.ut==="Disconnected")throw new p("The connection was stopped during negotiation.");if(M.error)throw new Error(M.error);if(M.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(M.url&&(S=M.url),M.accessToken){const W=M.accessToken;this.Yt=()=>W,this.$.Zt=W,this.$.Yt=void 0}R++}while(M.url&&R<100);if(R===100&&M.url)throw new Error("Negotiate redirection limit exceeded.");await this.Te(S,this.ie.transport,M,w)}this.transport instanceof A3&&(this.features.inherentKeepAlive=!0),this.ut==="Connecting"&&(this.u.log(r.Debug,"The HttpConnection connected successfully."),this.ut="Connected")}catch(M){return this.u.log(r.Error,"Failed to start the connection: "+M),this.ut="Disconnected",this.transport=void 0,this.me(),Promise.reject(M)}}async Pe(w){const S={},[M,R]=$e();S[M]=R;const W=this.Ie(w);this.u.log(r.Debug,`Sending negotiation request: ${W}.`);try{const Z=await this.$.post(W,{content:"",headers:{...S,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials});if(Z.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${Z.statusCode}'`));const ut=JSON.parse(Z.content);return(!ut.negotiateVersion||ut.negotiateVersion<1)&&(ut.connectionToken=ut.connectionId),ut.useStatefulReconnect&&this.ie._e!==!0?Promise.reject(new _("Client didn't negotiate Stateful Reconnect but the server did.")):ut}catch(Z){let ut="Failed to complete negotiation with the server: "+Z;return Z instanceof o&&Z.statusCode===404&&(ut+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this.u.log(r.Error,ut),Promise.reject(new _(ut))}}He(w,S){return S?w+(w.indexOf("?")===-1?"?":"&")+`id=${S}`:w}async Te(w,S,M,R){let W=this.He(w,M.connectionToken);if(this.De(S))return this.u.log(r.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=S,await this.ke(W,R),void(this.connectionId=M.connectionId);const Z=[],ut=M.availableTransports||[];let pt=M;for(const Dt of ut){const re=this.Re(Dt,S,R,pt?.useStatefulReconnect===!0);if(re instanceof Error)Z.push(`${Dt.transport} failed:`),Z.push(re);else if(this.De(re)){if(this.transport=re,!pt){try{pt=await this.Pe(w)}catch(_c){return Promise.reject(_c)}W=this.He(w,pt.connectionToken)}try{return await this.ke(W,R),void(this.connectionId=pt.connectionId)}catch(_c){if(this.u.log(r.Error,`Failed to start the transport '${Dt.transport}': ${_c}`),pt=void 0,Z.push(new $(`${Dt.transport} failed: ${_c}`,Ee[Dt.transport])),this.ut!=="Connecting"){const W3="Failed to select transport before stop() was called.";return this.u.log(r.Debug,W3),Promise.reject(new p(W3))}}}}return Z.length>0?Promise.reject(new A(`Unable to connect to the server with any of the available transports. ${Z.join(" ")}`,Z)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}Se(w){switch(w){case Ee.WebSockets:if(!this.ie.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new LW(this.$,this.Yt,this.u,this.ie.logMessageContent,this.ie.WebSocket,this.ie.headers||{});case Ee.ServerSentEvents:if(!this.ie.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new _W(this.$,this.$.Zt,this.u,this.ie);case Ee.LongPolling:return new A3(this.$,this.u,this.ie);default:throw new Error(`Unknown transport: ${w}.`)}}ke(w,S){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async M=>{let R=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(w,S),await this.features.resend()}catch{R=!0}R&&this.Ce(M)}else this.Ce(M)}:this.transport.onclose=M=>this.Ce(M),this.transport.connect(w,S)}Re(w,S,M,R){const W=Ee[w.transport];if(W==null)return this.u.log(r.Debug,`Skipping transport '${w.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${w.transport}' because it is not supported by this client.`);if(!(function(Z,ut){return!Z||!!(ut&Z)})(S,W))return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it was disabled by the client.`),new O(`'${Ee[W]}' is disabled by the client.`,W);if(!(w.transferFormats.map((Z=>si[Z])).indexOf(M)>=0))return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it does not support the requested transfer format '${si[M]}'.`),new Error(`'${Ee[W]}' does not support ${si[M]}.`);if(W===Ee.WebSockets&&!this.ie.WebSocket||W===Ee.ServerSentEvents&&!this.ie.EventSource)return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it is not supported in your environment.'`),new y(`'${Ee[W]}' is not supported in your environment.`,W);this.u.log(r.Debug,`Selecting transport '${Ee[W]}'.`);try{return this.features.reconnect=W===Ee.WebSockets?R:void 0,this.Se(W)}catch(Z){return Z}}De(w){return w&&typeof w=="object"&&"connect"in w}Ce(w){if(this.u.log(r.Debug,`HttpConnection.stopConnection(${w}) called while in state ${this.ut}.`),this.transport=void 0,w=this.$e||w,this.$e=void 0,this.ut!=="Disconnected"){if(this.ut==="Connecting")throw this.u.log(r.Warning,`Call to HttpConnection.stopConnection(${w}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${w}) was called while the connection is still in the connecting state.`);if(this.ut==="Disconnecting"&&this.me(),w?this.u.log(r.Error,`Connection disconnected with error '${w}'.`):this.u.log(r.Information,"Connection disconnected."),this.Ee&&(this.Ee.stop().catch((S=>{this.u.log(r.Error,`TransportSendQueue.stop() threw error '${S}'.`)})),this.Ee=void 0),this.connectionId=void 0,this.ut="Disconnected",this.dt){this.dt=!1;try{this.onclose&&this.onclose(w)}catch(S){this.u.log(r.Error,`HttpConnection.onclose(${w}) threw error '${S}'.`)}}}else this.u.log(r.Debug,`Call to HttpConnection.stopConnection(${w}) was ignored because the connection is already in the disconnected state.`)}be(w){if(w.lastIndexOf("https://",0)===0||w.lastIndexOf("http://",0)===0)return w;if(!Lt.isBrowser)throw new Error(`Cannot resolve '${w}'.`);const S=window.document.createElement("a");return S.href=w,this.u.log(r.Information,`Normalizing '${w}' to '${S.href}'.`),S.href}Ie(w){const S=new URL(w);S.pathname.endsWith("/")?S.pathname+="negotiate":S.pathname+="/negotiate";const M=new URLSearchParams(S.searchParams);return M.has("negotiateVersion")||M.append("negotiateVersion",this.ye.toString()),M.has("useStatefulReconnect")?M.get("useStatefulReconnect")==="true"&&(this.ie._e=!0):this.ie._e===!0&&M.append("useStatefulReconnect","true"),S.search=M.toString(),S.toString()}},h(Mc,"Eu"),Mc);c(_3,"K");let zW=_3;const L3=(Fa=class{constructor(w){this.xe=w,this.Ae=[],this.Ue=!0,this.Le=new G1,this.Ne=new G1,this.qe=this.Me()}send(w){return this.je(w),this.Ne||(this.Ne=new G1),this.Ne.promise}stop(){return this.Ue=!1,this.Le.resolve(),this.qe}je(w){if(this.Ae.length&&typeof this.Ae[0]!=typeof w)throw new Error(`Expected data to be of type ${typeof this.Ae} but was of type ${typeof w}`);this.Ae.push(w),this.Le.resolve()}async Me(){for(;;){if(await this.Le.promise,!this.Ue){this.Ne&&this.Ne.reject("Connection stopped.");break}this.Le=new G1;const w=this.Ne;this.Ne=void 0;const S=typeof this.Ae[0]=="string"?this.Ae.join(""):Fa.We(this.Ae);this.Ae.length=0;try{await this.xe.send(S),w.resolve()}catch(M){w.reject(M)}}}static We(w){const S=w.map((W=>W.byteLength)).reduce(((W,Z)=>W+Z)),M=new Uint8Array(S);let R=0;for(const W of w)M.set(new Uint8Array(W),R),R+=W.byteLength;return M.buffer}},h(Fa,"Ed"),Fa);c(L3,"G");let IW=L3;const z3=(Ac=class{constructor(){this.promise=new Promise(((w,S)=>[this.j,this.Oe]=[w,S]))}resolve(){this.j()}reject(w){this.Oe(w)}},h(Ac,"Ru"),Ac);c(z3,"Q");let G1=z3;const I3=(Rc=class{constructor(){this.name="json",this.version=2,this.transferFormat=si.Text}parseMessages(w,S){if(typeof w!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!w)return[];S===null&&(S=dt.instance);const M=Cs.parse(w),R=[];for(const W of M){const Z=JSON.parse(W);if(typeof Z.type!="number")throw new Error("Invalid payload.");switch(Z.type){case It.Invocation:this.U(Z);break;case It.StreamItem:this.Fe(Z);break;case It.Completion:this.Be(Z);break;case It.Ping:case It.Close:break;case It.Ack:this.Xe(Z);break;case It.Sequence:this.Je(Z);break;default:S.log(r.Information,"Unknown message type '"+Z.type+"' ignored.");continue}R.push(Z)}return R}writeMessage(w){return Cs.write(JSON.stringify(w))}U(w){this.ze(w.target,"Invalid payload for Invocation message."),w.invocationId!==void 0&&this.ze(w.invocationId,"Invalid payload for Invocation message.")}Fe(w){if(this.ze(w.invocationId,"Invalid payload for StreamItem message."),w.item===void 0)throw new Error("Invalid payload for StreamItem message.")}Be(w){if(w.result&&w.error)throw new Error("Invalid payload for Completion message.");!w.result&&w.error&&this.ze(w.error,"Invalid payload for Completion message."),this.ze(w.invocationId,"Invalid payload for Completion message.")}Xe(w){if(typeof w.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}Je(w){if(typeof w.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}ze(w,S){if(typeof w!="string"||w==="")throw new Error(S)}},h(Rc,"Tu"),Rc);c(I3,"Y");let D3=I3;const DW={trace:r.Trace,debug:r.Debug,info:r.Information,information:r.Information,warn:r.Warning,warning:r.Warning,error:r.Error,critical:r.Critical,none:r.None},V3=(Ec=class{configureLogging(w){if(ct.isRequired(w,"logging"),w.log!==void 0)this.logger=w;else if(typeof w=="string"){const S=(function(M){const R=DW[M.toLowerCase()];if(R!==void 0)return R;throw new Error(`Unknown log level: ${M}`)})(w);this.logger=new le(S)}else this.logger=new le(w);return this}withUrl(w,S){return ct.isRequired(w,"url"),ct.isNotEmpty(w,"url"),this.url=w,this.httpConnectionOptions=typeof S=="object"?{...this.httpConnectionOptions,...S}:{...this.httpConnectionOptions,transport:S},this}withHubProtocol(w){return ct.isRequired(w,"protocol"),this.protocol=w,this}withAutomaticReconnect(w){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return w?Array.isArray(w)?this.reconnectPolicy=new C3(w):this.reconnectPolicy=w:this.reconnectPolicy=new C3,this}withServerTimeout(w){return ct.isRequired(w,"milliseconds"),this.Ve=w,this}withKeepAliveInterval(w){return ct.isRequired(w,"milliseconds"),this.Ke=w,this}withStatefulReconnect(w){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._e=!0,this.Y=w?.bufferSize,this}build(){const w=this.httpConnectionOptions||{};if(w.logger===void 0&&(w.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const S=new zW(this.url,w);return k3.create(S,this.logger||dt.instance,this.protocol||new D3,this.reconnectPolicy,this.Ve,this.Ke,this.Y)}},h(Ec,"Lu"),Ec);c(V3,"tt");let VW=V3;return Uint8Array.prototype.indexOf||Object.defineProperty(Uint8Array.prototype,"indexOf",{value:Array.prototype.indexOf,writable:!0}),Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:c(function(H,w){return new Uint8Array(Array.prototype.slice.call(this,H,w))},"value"),writable:!0}),Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach,writable:!0}),n})(),"e"),s.exports=e()})(c9)),c9.exports}h(K_,"q1");c(K_,"requireSignalr_min");var d9=K_();const mj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._whenConnectionRequested=new Promise(n=>{this._resolveConnectionRequested=n}),this._whenConnectionCreated=new Promise(n=>{this._resolveConnectionCreated=n}),this._connectionEventListeners=[],this.signalRAccessTokenRefresh=!1,this._whenConnectionStarted=new Promise((n,a)=>{this._whenConnectionStartedResolve=n,this._whenConnectionStartedReject=a}),this.whenConnectionRequested().then(()=>{this.isDestroyed||this.createConnection()})}async whenConnectionRequested(){await this._whenConnectionRequested}async whenConnectionCreated(){return await this._whenConnectionCreated}get rtmConnection(){return this._connection}async whenConnectionStarted(){return await this._whenConnectionStarted}async createConnection(){if(this.isDestroyed)throw new _e;if(this.networkStateIsPending=!0,await this.whenUrlAndTokenFactory(),this._connection){const r=new URL("/hubs/rtm",this.url);this._connection.baseUrl!==r.toString()&&(this.connectionState="reconnecting",console.info(this.weavyId,"Reconnecting due to changed url.",this._connection.baseUrl,"=>",r.toString()),await this.disconnect(),this._connection.baseUrl=r.toString(),this.connect())}else{this.connectionState="connecting";const r=new URL("/hubs/rtm",this.url);this._connection=new d9.HubConnectionBuilder().configureLogging(d9.LogLevel.None).withUrl(r.toString(),{accessTokenFactory:c(async()=>{try{if(this.signalRAccessTokenRefresh){const n=await this.getToken(!0);return this.signalRAccessTokenRefresh=!1,n}else return await this.getToken()}catch(n){throw console.error(n),n}},"accessTokenFactory")}).withAutomaticReconnect({nextRetryDelayInMilliseconds:c(n=>!this.isDestroyed&&window.navigator.onLine&&document?.visibilityState!=="hidden"&&n.elapsedMilliseconds<6e4?[0,2e3,1e4][n.previousRetryCount]||1e4:null,"nextRetryDelayInMilliseconds")}).build(),this._connection.onclose(()=>{console.info(this.weavyId,"SignalR closed."),this.connectionState="disconnected",!this.isDestroyed&&(this.networkStateIsPending=!0,this._whenConnectionStarted=new Promise((n,a)=>{this._whenConnectionStartedResolve=n,this._whenConnectionStartedReject=a}),this.connect())}),this._connection.onreconnecting(()=>{console.info(this.weavyId,"SignalR reconnecting..."),this.connectionState="reconnecting"}),this._connection.onreconnected(n=>{console.info(this.weavyId,`SignalR reconnected ${n}`),this.connectionState="connected",this.networkStateIsPending=!1;for(let a=0;a<this._connectionEventListeners.length;a++)this._connection?.invoke("Subscribe",this._connectionEventListeners[a].name)}),this._resolveConnectionCreated?.(this._connection),this.connect()}return this._connection}async disconnect(){this._connection&&(await this._connection.stop(),this.connectionState="disconnected")}async connect(){if(this.isDestroyed)throw new _e;let r;this._connection?r=this._connection:r=await this.whenConnectionCreated(),console.info(this.weavyId,"Connecting SignalR...");try{if(!window.navigator.onLine)throw new Error;await Promise.race([r.start(),this.whenConnectionStarted()]),this.signalRAccessTokenRefresh=!1,this.networkStateIsPending=!1,this.connectionState="connected",this._whenConnectionStartedResolve?.(r),console.info(this.weavyId,`SignalR connected ${r.connectionId}`)}catch(n){if(n instanceof _e)return console.warn(this.weavyId,"SignalR connection aborted."),r;window.navigator.onLine?!this.signalRAccessTokenRefresh&&window.document.visibilityState!=="hidden"&&n.toString().includes("Unauthorized")?(console.info(this.weavyId,"Retrying SignalR connect with fresh token."),this.signalRAccessTokenRefresh=!0):(console.info(this.weavyId,"Server is probably down, retrying SignalR connect after a delay or when window regains focus."),this.connectionState="reconnecting",await new Promise(a=>{setTimeout(a,5e3),window.addEventListener("visibilitychange",a,{once:!0}),window.addEventListener("offline",a,{once:!0}),window.addEventListener("online",a,{once:!0})})):(this.networkStateIsPending=!1,console.info(this.weavyId,"Offline, reconnecting SignalR when online."),await new Promise(a=>{window.addEventListener("online",a,{once:!0})})),window.navigator.onLine&&document?.visibilityState!=="hidden"&&await new Promise(a=>setTimeout(a,1e3)),this.checkVersion(),this.networkStateIsPending=!0,await this.connect()}return r}async subscribe(r,n,a){if(this.isDestroyed)throw new _e;this._resolveConnectionRequested?.(!0);const o=r?r+":"+n:n;try{if(this._connectionEventListeners||await new Promise(l=>queueMicrotask(()=>l(!0))),this._connectionEventListeners.some(l=>l.name===o&&l.callback===a))throw new Error("Duplicate subscribe: "+o);if(this._connectionEventListeners.push({name:o,callback:a}),await this.whenConnectionStarted(),!this._connection)throw new Error("Connection not created");if(this._connection.on(o,a),await this._connection.invoke("Subscribe",o)===!1)throw new Error("Could not subscribe to "+o);return!0}catch(l){l instanceof _e||console.error(this.weavyId,"Error in Subscribe:",l);const d=this._connectionEventListeners.findIndex(u=>u.name===o&&u.callback===a);return d!==-1&&(this._connectionEventListeners.splice(d,1),this._connection?.off(o,a)),!1}}async unsubscribe(r,n,a){if(this.isDestroyed)throw new _e;try{const o=r?r+":"+n:n,l=this._connectionEventListeners.findIndex(d=>d.name===o&&d.callback===a);if(l!==-1){if(this._connectionEventListeners.splice(l,1),await this.whenConnectionStarted(),!this._connection)throw new Error("Connection not created");this._connection?.off(o,a),this._connectionEventListeners.some(d=>d.name===o)||await this._connection.invoke("Unsubscribe",o)}}catch(o){o instanceof _e||console.error(this.weavyId,"Error in Unsubscribe:",o)}}destroy(){super.destroy(),this.disconnect(),this._whenConnectionStartedReject&&(this._whenConnectionStarted.catch(()=>{}),this._whenConnectionStartedReject(new _e))}},h(e,"t"),e),c(t,"WeavyConnection"),t},"WeavyConnectionMixin");var a0=(s=>(s.JSON="application/json;charset=utf-8",s.FormData="multipart/form-data;charset=utf-8",s.URLEncoded="application/x-www-form-urlencoded;charset=utf-8",s.Text="text/plain;charset=utf-8",s.Auto="",s))(a0||{});const yj=c(s=>{var e;var t;return t=(e=class extends s{async fetchOptions(r={},n=!0){if(this.isDestroyed)throw new _e;const a={headers:{"X-Weavy-Source":`${Le.sourceName}@${Le.version}`,"Content-Type":a0.JSON},method:"GET"},o=wo(wo(pj,a,!0),r,!0);return n?wo(o,{headers:{Authorization:"Bearer "+await this.getToken()}},!0):o}async fetch(r,n,a=!0){if(this.isDestroyed)throw new _e;const o=await this.fetchOptions(n);this.networkStateIsPending=!0;const l=await fetch(new URL(r,this.url),o);if(l.ok)this.networkStateIsPending=!1,this.serverState="ok";else if(l.status===401||l.status===403){if(a)return await this.getToken(!0),await this.fetch(r,n,!1);this.networkStateIsPending=!1,this.serverState="unauthorized"}else this.networkStateIsPending=!1;return l}async upload(r,n,a,o=a0.JSON,l,d,u=!0){if(this.isDestroyed)throw new _e;const p=await this.getToken();return await new Promise((f,y)=>{const g=new XMLHttpRequest;g.open(n,new URL(r,this.url),!0),g.setRequestHeader("Authorization","Bearer "+p),g.setRequestHeader("X-Weavy-Source",`${Le.sourceName}@${Le.version}`),o&&g.setRequestHeader("Content-Type",o),l&&g.upload.addEventListener("progress",O=>{l(O.loaded/O.total*100||100)}),g.onload=O=>{u&&(g.status===401||g.status===401)?this.getToken(!0).then(()=>this.upload(r,n,a,o,l,d,!1)).then(f).catch(y):f(new Response(g.response,{status:g.status,statusText:g.statusText}))},g.onerror=y,g.onabort=y,d?.addEventListener("abort",()=>{g.abort()}),g.send(a)})}async get(r){return console.warn(`weavy.get() is deprecated, use weavy.fetch("${r}") instead.`),this.fetch(r)}async post(r,n,a,o){console.warn(`weavy.post() is deprecated, use weavy.fetch("${r}", { method: "${n}"}) instead.`);const l=o?{"Content-Type":o}:void 0;return this.fetch(r,{method:n,body:a,headers:l})}},h(e,"t"),e),c(t,"WeavyFetch"),t},"WeavyFetchMixin"),J_="en",gj=c(s=>{var e;var t;return t=(e=class extends s{constructor(){super(...arguments),this._locales=new Map([["sv-SE",()=>import(new URL("./es/locales/sv-SE-DNn-JJCG.js",typeof WEAVY_IMPORT_URL=="string"&&(!(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href)||!new URL(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href.startsWith(WEAVY_IMPORT_URL))?WEAVY_IMPORT_URL:typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href).then(r=>r.svSE)]]),this._locale=t.sourceLocale}static get sourceLocale(){try{return J_}catch{return""}}get locales(){return Array.from(this._locales.entries())}set locales(r){if(this.isDestroyed)throw new _e;if(this.localization)throw new Error("Locales may only be configured once");if(r){if(!Array.isArray(r))throw new TypeError("Provided locales have invalid format.");r.forEach(n=>{if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string")throw new TypeError("Invalid locale provided: "+n[0]);this._locales.set(...n)}),this.configureLocalization()}}get localization(){return this._localization}get locale(){return this._locale}set locale(r){if(this.isDestroyed)throw new _e;!this._locale&&!r||(r||=t.sourceLocale,this._locale=r,this.localization?this.localization.setLocale(this._locale):queueMicrotask(()=>{this.localization?this.localization.setLocale(this._locale):this._locale!==t.sourceLocale&&(this._locales.has(this._locale)&&this.configureLocalization(),this.localization?this.localization.setLocale(this._locale):console.error(this.weavyId,`You need to configure additional languages in config to use '${r}'.`))}))}async loadLocale(r){if(this.isDestroyed)throw new _e;if(this._locales?.has(r)){const n=this._locales.get(r);return console.info(this.weavyId,typeof n=="function"?"loading locale":"preloaded locale",r),await(typeof n=="function"?n():n)}else throw new Error("The requested locale is not configured")}configureLocalization(){if(this.isDestroyed)throw new _e;if(this._locales?.size&&!this.localization){const r=this._locales.keys();console.info(this.weavyId,"Configuring locales",r);const{getLocale:n,setLocale:a}=QX({sourceLocale:t.sourceLocale,targetLocales:r,loadLocale:c(o=>this.loadLocale(o),"loadLocale")});this._localization={getLocale:n,setLocale:a}}}},h(e,"t"),e),c(t,"WeavyLocalization"),t},"WeavyLocalizationMixin"),wj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._configurationState="pending",this._networkEvents=new Set,this._connectionState="connecting",this._serverState="ok",this._networkState=window.navigator.onLine?"online":"offline",this._networkStateIsPending=!1,window.addEventListener("online",()=>{this.networkState="online"}),window.addEventListener("offline",()=>{this.networkState="offline",this.networkStateIsPending=!1}),queueMicrotask(()=>this.requestConfigurationCheck())}get configurationState(){return this._configurationState}set configurationState(r){this._configurationState=r,this._configurationTimer&&r==="configured"&&(window.clearTimeout(this._configurationTimer),this._configurationTimer=null),this.triggerNetworkChange()}get networkState(){return this._networkState}set networkState(r){this._networkState=r,this.triggerNetworkChange()}get serverState(){return this._serverState}set serverState(r){this._serverState=r,this.triggerNetworkChange()}get connectionState(){return this._connectionState}set connectionState(r){this._connectionState=r,this.triggerNetworkChange()}get networkStateIsPending(){return this._networkStateIsPending}set networkStateIsPending(r){this._networkStateIsPending=r,this.triggerNetworkChange()}get network(){return{state:this._networkState==="online"?(this._connectionState==="connected"||this._serverState==="ok")&&this.configurationState!=="uninitialized"?"online":"unreachable":"offline",isPending:this._networkStateIsPending}}requestConfigurationCheck(){!this._configurationTimer&&this.configurationTimeout>=0&&this.configurationTimeout<1/0&&(this._configurationTimer=window.setTimeout(()=>{this.configurationState==="pending"&&(this.configurationState="uninitialized",console.error("Weavy was not configured with required url and tokenFactory/tokenUrl within a reasonable time. Please check your configuration!")),this._configurationTimer=null},this.configurationTimeout))}triggerNetworkChange(){const r=this.network;this._networkEvents.forEach(n=>{n(r)})}addNetworkListener(r){this._networkEvents.add(r)}removeNetworkListener(r){this._networkEvents.delete(r)}},h(e,"t"),e),c(t,"WeavyNetwork"),t},"WeavyNetworkMixin");var J2,op,Vy=(J2=(op=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},h(op,"Ma"),op),c(J2,"Subscribable"),J2),vj={setTimeout:c((s,t)=>setTimeout(s,t),"setTimeout"),clearTimeout:c(s=>clearTimeout(s),"clearTimeout"),setInterval:c((s,t)=>setInterval(s,t),"setInterval"),clearInterval:c(s=>clearInterval(s),"clearInterval")},Ba,u9,t$,lp,Oj=(t$=(lp=class{constructor(){q(this,Ba,vj),q(this,u9,!1)}setTimeoutProvider(t){E(this,Ba,t)}setTimeout(t,e){return x(this,Ba).setTimeout(t,e)}clearTimeout(t){x(this,Ba).clearTimeout(t)}setInterval(t,e){return x(this,Ba).setInterval(t,e)}clearInterval(t){x(this,Ba).clearInterval(t)}},h(lp,"Aa"),lp),Ba=new WeakMap,u9=new WeakMap,c(t$,"TimeoutManager"),t$),Fn=new Oj;function tL(s){setTimeout(s,0)}h(tL,"Y1");c(tL,"systemSetTimeoutZero");var vy=typeof window>"u"||"Deno"in globalThis;function li(){}h(li,"Ae");c(li,"noop$1");function eL(s,t){return typeof s=="function"?s(t):s}h(eL,"X1");c(eL,"functionalUpdate");function o0(s){return typeof s=="number"&&s>=0&&s!==1/0}h(o0,"Xu");c(o0,"isValidTimeout");function NP(s,t){return Math.max(s+(t||0)-Date.now(),0)}h(NP,"um");c(NP,"timeUntilStale");function en(s,t){return typeof s=="function"?s(t):s}h(en,"Ir");c(en,"resolveStaleTime");function nr(s,t){return typeof s=="function"?s(t):s}h(nr,"ai");c(nr,"resolveEnabled");function oS(s,t){const{type:e="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:o}=s;if(a){if(i){if(t.queryHash!==Ob(a,t.options))return!1}else if(!Oy(t.queryKey,a))return!1}if(e!=="all"){const l=t.isActive();if(e==="active"&&!l||e==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||r&&r!==t.state.fetchStatus||n&&!n(t))}h(oS,"qw");c(oS,"matchQuery");function lS(s,t){const{exact:e,status:i,predicate:r,mutationKey:n}=s;if(n){if(!t.options.mutationKey)return!1;if(e){if(ya(t.options.mutationKey)!==ya(n))return!1}else if(!Oy(t.options.mutationKey,n))return!1}return!(i&&t.state.status!==i||r&&!r(t))}h(lS,"jw");c(lS,"matchMutation");function Ob(s,t){return(t?.queryKeyHashFn||ya)(s)}h(Ob,"ty");c(Ob,"hashQueryKeyByOptions");function ya(s){return JSON.stringify(s,(t,e)=>l0(e)?Object.keys(e).sort().reduce((i,r)=>(i[r]=e[r],i),{}):e)}h(ya,"Pn");c(ya,"hashKey");function Oy(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?Object.keys(t).every(e=>Oy(s[e],t[e])):!1}h(Oy,"ml");c(Oy,"partialMatchKey");var bj=Object.prototype.hasOwnProperty;function Wy(s,t,e=0){if(s===t)return s;if(e>500)return t;const i=cS(s)&&cS(t);if(!i&&!(l0(s)&&l0(t)))return t;const r=(i?s:Object.keys(s)).length,n=i?t:Object.keys(t),a=n.length,o=i?new Array(a):{};let l=0;for(let d=0;d<a;d++){const u=i?d:n[d],p=s[u],f=t[u];if(p===f){o[u]=p,(i?d<r:bj.call(s,u))&&l++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){o[u]=f;continue}const y=Wy(p,f,e+1);o[u]=y,y===p&&l++}return r===a&&l===r?s:o}h(Wy,"dd");c(Wy,"replaceEqualDeep");function Uw(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}h(Uw,"jd");c(Uw,"shallowEqualObjects");function cS(s){return Array.isArray(s)&&s.length===Object.keys(s).length}h(cS,"Ww");c(cS,"isPlainArray");function l0(s){if(!hS(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!hS(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}h(l0,"Ju");c(l0,"isPlainObject");function hS(s){return Object.prototype.toString.call(s)==="[object Object]"}h(hS,"Kw");c(hS,"hasObjectPrototype");function iL(s){return new Promise(t=>{Fn.setTimeout(t,s)})}h(iL,"tg");c(iL,"sleep");function c0(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?Wy(s,t):t}h(c0,"tp");c(c0,"replaceData");function rL(s,t,e=0){const i=[...s,t];return e&&i.length>e?i.slice(1):i}h(rL,"eg");c(rL,"addToEnd");function sL(s,t,e=0){const i=[t,...s];return e&&i.length>e?i.slice(0,-1):i}h(sL,"ig");c(sL,"addToStart");var BP=Symbol();function XP(s,t){return!s.queryFn&&t?.initialPromise?()=>t.initialPromise:!s.queryFn||s.queryFn===BP?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}h(XP,"pm");c(XP,"ensureQueryFn");function nL(s,t,e){let i=!1,r;return Object.defineProperty(s,"signal",{enumerable:!0,get:c(()=>(r??=t(),i||(i=!0,r.aborted?e():r.addEventListener("abort",e,{once:!0})),r),"get")}),s}h(nL,"rg");c(nL,"addConsumeAwareSignal");var zc,Xa,ug,e$,cp,$j=(e$=(cp=class extends Vy{constructor(){super(),q(this,zc),q(this,Xa),q(this,ug),E(this,ug,t=>{if(!vy&&window.addEventListener){const e=c(()=>t(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){x(this,Xa)||this.setEventListener(x(this,ug))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,Xa))==null||t.call(this),E(this,Xa,void 0))}setEventListener(t){var e;E(this,ug,t),(e=x(this,Xa))==null||e.call(this),E(this,Xa,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){x(this,zc)!==t&&(E(this,zc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof x(this,zc)=="boolean"?x(this,zc):globalThis.document?.visibilityState!=="hidden"}},h(cp,"Ra"),cp),zc=new WeakMap,Xa=new WeakMap,ug=new WeakMap,c(e$,"FocusManager"),e$),jP=new $j;function h0(){let s,t;const e=new Promise((r,n)=>{s=r,t=n});e.status="pending",e.catch(()=>{});function i(r){Object.assign(e,r),delete e.resolve,delete e.reject}return h(i,"i"),c(i,"finalize"),e.resolve=r=>{i({status:"fulfilled",value:r}),s(r)},e.reject=r=>{i({status:"rejected",reason:r}),t(r)},e}h(h0,"ep");c(h0,"pendingThenable");function aL(s){let t;if(s.then(e=>(t=e,e),li)?.catch(li),t!==void 0)return{data:t}}h(aL,"ag");c(aL,"tryResolveSync");function UP(s){return s}h(UP,"ym");c(UP,"defaultTransformerFn");function oL(s){return{mutationKey:s.options.mutationKey,state:s.state,...s.options.scope&&{scope:s.options.scope},...s.meta&&{meta:s.meta}}}h(oL,"sg");c(oL,"dehydrateMutation");function lL(s,t,e){const i=c(()=>{const r=s.promise?.then(t).catch(n=>e(n)?Promise.reject(new Error("redacted")):Promise.reject(n));return r?.catch(li),r},"dehydratePromise");return{dehydratedAt:Date.now(),state:{...s.state,...s.state.data!==void 0&&{data:t(s.state.data)}},queryKey:s.queryKey,queryHash:s.queryHash,...s.state.status==="pending"&&{promise:i()},...s.meta&&{meta:s.meta}}}h(lL,"og");c(lL,"dehydrateQuery");function cL(s){return s.state.isPaused}h(cL,"cg");c(cL,"defaultShouldDehydrateMutation");function hL(s){return s.state.status==="success"}h(hL,"lg");c(hL,"defaultShouldDehydrateQuery");function dL(s){return!0}h(dL,"dg");c(dL,"defaultShouldRedactErrors");function uL(s,t={}){const e=t.shouldDehydrateMutation??s.getDefaultOptions().dehydrate?.shouldDehydrateMutation??cL,i=s.getMutationCache().getAll().flatMap(l=>e(l)?[oL(l)]:[]),r=t.shouldDehydrateQuery??s.getDefaultOptions().dehydrate?.shouldDehydrateQuery??hL,n=t.shouldRedactErrors??s.getDefaultOptions().dehydrate?.shouldRedactErrors??dL,a=t.serializeData??s.getDefaultOptions().dehydrate?.serializeData??UP,o=s.getQueryCache().getAll().flatMap(l=>r(l)?[lL(l,a,n)]:[]);return{mutations:i,queries:o}}h(uL,"hg");c(uL,"dehydrate");function pL(s,t,e){if(typeof t!="object"||t===null)return;const i=s.getMutationCache(),r=s.getQueryCache(),n=s.getDefaultOptions().hydrate?.deserializeData??UP,a=t.mutations||[],o=t.queries||[];a.forEach(({state:l,...d})=>{i.build(s,{...s.getDefaultOptions().hydrate?.mutations,...e?.defaultOptions?.mutations,...d},l)}),o.forEach(({queryKey:l,state:d,queryHash:u,meta:p,promise:f,dehydratedAt:y})=>{const g=f?aL(f):void 0,O=d.data===void 0?g?.data:d.data,k=O===void 0?O:n(O);let $=r.get(u);const T=$?.state.status==="pending",_=$?.state.fetchStatus==="fetching";if($){const D=g&&y!==void 0&&y>$.state.dataUpdatedAt;if(d.dataUpdatedAt>$.state.dataUpdatedAt||D){const{fetchStatus:A,...z}=d;$.setState({...z,data:k})}}else $=r.build(s,{...s.getDefaultOptions().hydrate?.queries,...e?.defaultOptions?.queries,queryKey:l,queryHash:u,meta:p},{...d,data:k,fetchStatus:"idle",status:k!==void 0?"success":d.status});f&&!T&&!_&&(y===void 0||y>$.state.dataUpdatedAt)&&$.fetch(void 0,{initialPromise:Promise.resolve(f).then(n)}).catch(li)})}h(pL,"ug");c(pL,"hydrate");var xj=tL;function fL(){let s=[],t=0,e=c(o=>{o()},"notifyFn"),i=c(o=>{o()},"batchNotifyFn"),r=xj;const n=c(o=>{t?s.push(o):r(()=>{e(o)})},"schedule"),a=c(()=>{const o=s;s=[],o.length&&r(()=>{i(()=>{o.forEach(l=>{e(l)})})})},"flush");return{batch:c(o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},"batch"),batchCalls:c(o=>(...l)=>{n(()=>{o(...l)})},"batchCalls"),schedule:n,setNotifyFunction:c(o=>{e=o},"setNotifyFunction"),setBatchNotifyFunction:c(o=>{i=o},"setBatchNotifyFunction"),setScheduler:c(o=>{r=o},"setScheduler")}}h(fL,"yg");c(fL,"createNotifyManager");var di=fL(),pg,ja,fg,i$,hp,kj=(i$=(hp=class extends Vy{constructor(){super(),q(this,pg,!0),q(this,ja),q(this,fg),E(this,fg,t=>{if(!vy&&window.addEventListener){const e=c(()=>t(!0),"onlineListener"),i=c(()=>t(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}})}onSubscribe(){x(this,ja)||this.setEventListener(x(this,fg))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,ja))==null||t.call(this),E(this,ja,void 0))}setEventListener(t){var e;E(this,fg,t),(e=x(this,ja))==null||e.call(this),E(this,ja,t(this.setOnline.bind(this)))}setOnline(t){x(this,pg)!==t&&(E(this,pg,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return x(this,pg)}},h(hp,"Oa"),hp),pg=new WeakMap,ja=new WeakMap,fg=new WeakMap,c(i$,"OnlineManager"),i$),d0=new kj;function mL(s){return Math.min(1e3*2**s,3e4)}h(mL,"fg");c(mL,"defaultRetryDelay");function HP(s){return(s??"online")==="online"?d0.isOnline():!0}h(HP,"wm");c(HP,"canFetch");var r$,dp,dS=(r$=(dp=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}},h(dp,"za"),dp),c(r$,"CancelledError"),r$);function YP(s){let t=!1,e=0,i;const r=h0(),n=c(()=>r.status!=="pending","isResolved"),a=c(O=>{if(!n()){const k=new dS(O);f(k),s.onCancel?.(k)}},"cancel"),o=c(()=>{t=!0},"cancelRetry"),l=c(()=>{t=!1},"continueRetry"),d=c(()=>jP.isFocused()&&(s.networkMode==="always"||d0.isOnline())&&s.canRun(),"canContinue"),u=c(()=>HP(s.networkMode)&&s.canRun(),"canStart"),p=c(O=>{n()||(i?.(),r.resolve(O))},"resolve"),f=c(O=>{n()||(i?.(),r.reject(O))},"reject"),y=c(()=>new Promise(O=>{i=c(k=>{(n()||d())&&O(k)},"continueFn"),s.onPause?.()}).then(()=>{i=void 0,n()||s.onContinue?.()}),"pause"),g=c(()=>{if(n())return;let O;const k=e===0?s.initialPromise:void 0;try{O=k??s.fn()}catch($){O=Promise.reject($)}Promise.resolve(O).then(p).catch($=>{if(n())return;const T=s.retry??(vy?0:3),_=s.retryDelay??mL,D=typeof _=="function"?_(e,$):_,A=T===!0||typeof T=="number"&&e<T||typeof T=="function"&&T(e,$);if(t||!A){f($);return}e++,s.onFail?.(e,$),iL(D).then(()=>d()?void 0:y()).then(()=>{t?f($):g()})})},"run");return{promise:r,status:c(()=>r.status,"status"),cancel:a,continue:c(()=>(i?.(),r),"continue"),cancelRetry:o,continueRetry:l,canStart:u,start:c(()=>(u()?g():y().then(g),r),"start")}}h(YP,"fm");c(YP,"createRetryer");var Ic,s$,up,yL=(s$=(up=class{constructor(){q(this,Ic)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o0(this.gcTime)&&E(this,Ic,Fn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(vy?1/0:300*1e3))}clearGcTimeout(){x(this,Ic)&&(Fn.clearTimeout(x(this,Ic)),E(this,Ic,void 0))}},h(up,"Ia"),up),Ic=new WeakMap,c(s$,"Removable"),s$),Dc,mg,Ar,Vc,ni,gv,Wc,Gr,Ms,n$,pp,Sj=(n$=(pp=class extends yL{constructor(t){super(),q(this,Gr),q(this,Dc),q(this,mg),q(this,Ar),q(this,Vc),q(this,ni),q(this,gv),q(this,Wc),E(this,Wc,!1),E(this,gv,t.defaultOptions),this.setOptions(t.options),this.observers=[],E(this,Vc,t.client),E(this,Ar,x(this,Vc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,E(this,Dc,pS(this.options)),this.state=t.state??x(this,Dc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return x(this,ni)?.promise}setOptions(t){if(this.options={...x(this,gv),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=pS(this.options);e.data!==void 0&&(this.setState(uS(e.data,e.dataUpdatedAt)),E(this,Dc,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,Ar).remove(this)}setData(t,e){const i=c0(this.state.data,t,this.options);return St(this,Gr,Ms).call(this,{data:i,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),i}setState(t,e){St(this,Gr,Ms).call(this,{type:"setState",state:t,setStateOptions:e})}cancel(t){const e=x(this,ni)?.promise;return x(this,ni)?.cancel(t),e?e.then(li).catch(li):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(x(this,Dc))}isActive(){return this.observers.some(t=>nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BP||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>en(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!NP(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),x(this,ni)?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),x(this,ni)?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),x(this,Ar).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(x(this,ni)&&(x(this,Wc)?x(this,ni).cancel({revert:!0}):x(this,ni).cancelRetry()),this.scheduleGc()),x(this,Ar).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||St(this,Gr,Ms).call(this,{type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&x(this,ni)?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(x(this,ni))return x(this,ni).continueRetry(),x(this,ni).promise}if(t&&this.setOptions(t),!this.options.queryFn){const o=this.observers.find(l=>l.options.queryFn);o&&this.setOptions(o.options)}const i=new AbortController,r=c(o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:c(()=>(E(this,Wc,!0),i.signal),"get")})},"addSignalProperty"),n=c(()=>{const o=XP(this.options,e),l=c(()=>{const d={client:x(this,Vc),queryKey:this.queryKey,meta:this.meta};return r(d),d},"createQueryFnContext")();return E(this,Wc,!1),this.options.persister?this.options.persister(o,l,this):o(l)},"fetchFn"),a=c(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:x(this,Vc),state:this.state,fetchFn:n};return r(o),o},"createFetchContext")();this.options.behavior?.onFetch(a,this),E(this,mg,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&St(this,Gr,Ms).call(this,{type:"fetch",meta:a.fetchOptions?.meta}),E(this,ni,YP({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:c(o=>{o instanceof dS&&o.revert&&this.setState({...x(this,mg),fetchStatus:"idle"}),i.abort()},"onCancel"),onFail:c((o,l)=>{St(this,Gr,Ms).call(this,{type:"failed",failureCount:o,error:l})},"onFail"),onPause:c(()=>{St(this,Gr,Ms).call(this,{type:"pause"})},"onPause"),onContinue:c(()=>{St(this,Gr,Ms).call(this,{type:"continue"})},"onContinue"),retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:c(()=>!0,"canRun")}));try{const o=await x(this,ni).start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),x(this,Ar).config.onSuccess?.(o,this),x(this,Ar).config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof dS){if(o.silent)return x(this,ni).promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw St(this,Gr,Ms).call(this,{type:"error",error:o}),x(this,Ar).config.onError?.(o,this),x(this,Ar).config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}},h(pp,"Da"),pp),Dc=new WeakMap,mg=new WeakMap,Ar=new WeakMap,Vc=new WeakMap,ni=new WeakMap,gv=new WeakMap,Wc=new WeakMap,Gr=new WeakSet,Ms=c(function(s){const t=c(e=>{switch(s.type){case"failed":return{...e,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...GP(e.data,this.options),fetchMeta:s.meta??null};case"success":const i={...e,...uS(s.data,s.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return E(this,mg,s.manual?i:void 0),i;case"error":const r=s.error;return{...e,error:r,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...s.state}}},"reducer");this.state=t(this.state),di.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),x(this,Ar).notify({query:this,type:"updated",action:s})})},"#dispatch"),c(n$,"Query"),n$);function GP(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HP(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}h(GP,"vm");c(GP,"fetchState");function uS(s,t){return{data:s,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}h(uS,"Qw");c(uS,"successState");function pS(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,i=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}h(pS,"Gw");c(pS,"getDefaultState$1");var tr,Zt,wv,Vi,Fc,yg,kn,Ua,vv,gg,wg,qc,Zc,Ha,vg,xe,Og,a$,o$,l$,c$,h$,d$,u$,p9,p$,fp,gL=(p$=(fp=class extends Vy{constructor(t,e){super(),q(this,xe),q(this,tr),q(this,Zt),q(this,wv),q(this,Vi),q(this,Fc),q(this,yg),q(this,kn),q(this,Ua),q(this,vv),q(this,gg),q(this,wg),q(this,qc),q(this,Zc),q(this,Ha),q(this,vg,new Set),this.options=e,E(this,tr,t),E(this,Ua,null),E(this,kn,h0()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(x(this,Zt).addObserver(this),fS(x(this,Zt),this.options)?St(this,xe,Og).call(this):this.updateResult(),St(this,xe,c$).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return u0(x(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return u0(x(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,St(this,xe,h$).call(this),St(this,xe,d$).call(this),x(this,Zt).removeObserver(this)}setOptions(t){const e=this.options,i=x(this,Zt);if(this.options=x(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nr(this.options.enabled,x(this,Zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");St(this,xe,u$).call(this),x(this,Zt).setOptions(this.options),e._defaulted&&!Uw(this.options,e)&&x(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:x(this,Zt),observer:this});const r=this.hasListeners();r&&mS(x(this,Zt),i,this.options,e)&&St(this,xe,Og).call(this),this.updateResult(),r&&(x(this,Zt)!==i||nr(this.options.enabled,x(this,Zt))!==nr(e.enabled,x(this,Zt))||en(this.options.staleTime,x(this,Zt))!==en(e.staleTime,x(this,Zt)))&&St(this,xe,a$).call(this);const n=St(this,xe,o$).call(this);r&&(x(this,Zt)!==i||nr(this.options.enabled,x(this,Zt))!==nr(e.enabled,x(this,Zt))||n!==x(this,Ha))&&St(this,xe,l$).call(this,n)}getOptimisticResult(t){const e=x(this,tr).getQueryCache().build(x(this,tr),t),i=this.createResult(e,t);return vL(this,i)&&(E(this,Vi,i),E(this,yg,this.options),E(this,Fc,x(this,Zt).state)),i}getCurrentResult(){return x(this,Vi)}trackResult(t,e){return new Proxy(t,{get:c((i,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&x(this,kn).status==="pending"&&x(this,kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r)),"get")})}trackProp(t){x(this,vg).add(t)}getCurrentQuery(){return x(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=x(this,tr).defaultQueryOptions(t),i=x(this,tr).getQueryCache().build(x(this,tr),e);return i.fetch().then(()=>this.createResult(i,e))}fetch(t){return St(this,xe,Og).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),x(this,Vi)))}createResult(t,e){const i=x(this,Zt),r=this.options,n=x(this,Vi),a=x(this,Fc),o=x(this,yg),l=t!==i?t.state:x(this,wv),{state:d}=t;let u={...d},p=!1,f;if(e._optimisticResults){const V=this.hasListeners(),j=!V&&fS(t,e),tt=V&&mS(t,i,e,r);(j||tt)&&(u={...u,...GP(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:O}=u;f=u.data;let k=!1;if(e.placeholderData!==void 0&&f===void 0&&O==="pending"){let V;n?.isPlaceholderData&&e.placeholderData===o?.placeholderData?(V=n.data,k=!0):V=typeof e.placeholderData=="function"?e.placeholderData(x(this,wg)?.state.data,x(this,wg)):e.placeholderData,V!==void 0&&(O="success",f=c0(n?.data,V,e),p=!0)}if(e.select&&f!==void 0&&!k)if(n&&f===a?.data&&e.select===x(this,vv))f=x(this,gg);else try{E(this,vv,e.select),f=e.select(f),f=c0(n?.data,f,e),E(this,gg,f),E(this,Ua,null)}catch(V){E(this,Ua,V)}x(this,Ua)&&(y=x(this,Ua),f=x(this,gg),g=Date.now(),O="error");const $=u.fetchStatus==="fetching",T=O==="pending",_=O==="error",D=T&&$,A=f!==void 0,z={status:O,fetchStatus:u.fetchStatus,isPending:T,isSuccess:O==="success",isError:_,isInitialLoading:D,isLoading:D,data:f,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:$,isRefetching:$&&!T,isLoadingError:_&&!A,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&A,isStale:bb(t,e),refetch:this.refetch,promise:x(this,kn),isEnabled:nr(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=z.data!==void 0,j=z.status==="error"&&!V,tt=c(st=>{j?st.reject(z.error):V&&st.resolve(z.data)},"finalizeThenableIfPossible"),vt=c(()=>{const st=E(this,kn,z.promise=h0());tt(st)},"recreateThenable"),dt=x(this,kn);switch(dt.status){case"pending":t.queryHash===i.queryHash&&tt(dt);break;case"fulfilled":(j||z.data!==dt.value)&&vt();break;case"rejected":(!j||z.error!==dt.reason)&&vt();break}}return z}updateResult(){const t=x(this,Vi),e=this.createResult(x(this,Zt),this.options);if(E(this,Fc,x(this,Zt).state),E(this,yg,this.options),x(this,Fc).data!==void 0&&E(this,wg,x(this,Zt)),Uw(e,t))return;E(this,Vi,e);const i=c(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!x(this,vg).size)return!0;const a=new Set(n??x(this,vg));return this.options.throwOnError&&a.add("error"),Object.keys(x(this,Vi)).some(o=>{const l=o;return x(this,Vi)[l]!==t[l]&&a.has(l)})},"shouldNotifyListeners");St(this,xe,p9).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&St(this,xe,c$).call(this)}},h(fp,"Ua"),fp),tr=new WeakMap,Zt=new WeakMap,wv=new WeakMap,Vi=new WeakMap,Fc=new WeakMap,yg=new WeakMap,kn=new WeakMap,Ua=new WeakMap,vv=new WeakMap,gg=new WeakMap,wg=new WeakMap,qc=new WeakMap,Zc=new WeakMap,Ha=new WeakMap,vg=new WeakMap,xe=new WeakSet,Og=c(function(s){St(this,xe,u$).call(this);let t=x(this,Zt).fetch(this.options,s);return s?.throwOnError||(t=t.catch(li)),t},"#executeFetch"),a$=c(function(){St(this,xe,h$).call(this);const s=en(this.options.staleTime,x(this,Zt));if(vy||x(this,Vi).isStale||!o0(s))return;const t=NP(x(this,Vi).dataUpdatedAt,s)+1;E(this,qc,Fn.setTimeout(()=>{x(this,Vi).isStale||this.updateResult()},t))},"#updateStaleTimeout"),o$=c(function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(x(this,Zt)):this.options.refetchInterval)??!1},"#computeRefetchInterval"),l$=c(function(s){St(this,xe,d$).call(this),E(this,Ha,s),!(vy||nr(this.options.enabled,x(this,Zt))===!1||!o0(x(this,Ha))||x(this,Ha)===0)&&E(this,Zc,Fn.setInterval(()=>{(this.options.refetchIntervalInBackground||jP.isFocused())&&St(this,xe,Og).call(this)},x(this,Ha)))},"#updateRefetchInterval"),c$=c(function(){St(this,xe,a$).call(this),St(this,xe,l$).call(this,St(this,xe,o$).call(this))},"#updateTimers"),h$=c(function(){x(this,qc)&&(Fn.clearTimeout(x(this,qc)),E(this,qc,void 0))},"#clearStaleTimeout"),d$=c(function(){x(this,Zc)&&(Fn.clearInterval(x(this,Zc)),E(this,Zc,void 0))},"#clearRefetchInterval"),u$=c(function(){const s=x(this,tr).getQueryCache().build(x(this,tr),this.options);if(s===x(this,Zt))return;const t=x(this,Zt);E(this,Zt,s),E(this,wv,s.state),this.hasListeners()&&(t?.removeObserver(this),s.addObserver(this))},"#updateQuery"),p9=c(function(s){di.batch(()=>{s.listeners&&this.listeners.forEach(t=>{t(x(this,Vi))}),x(this,tr).getQueryCache().notify({query:x(this,Zt),type:"observerResultsUpdated"})})},"#notify"),c(p$,"QueryObserver"),p$);function wL(s,t){return nr(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&t.retryOnMount===!1)}h(wL,"vg");c(wL,"shouldLoadOnMount");function fS(s,t){return wL(s,t)||s.state.data!==void 0&&u0(s,t,t.refetchOnMount)}h(fS,"Zw");c(fS,"shouldFetchOnMount");function u0(s,t,e){if(nr(t.enabled,s)!==!1&&en(t.staleTime,s)!=="static"){const i=typeof e=="function"?e(s):e;return i==="always"||i!==!1&&bb(s,t)}return!1}h(u0,"dp");c(u0,"shouldFetchOn");function mS(s,t,e,i){return(s!==t||nr(i.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&bb(s,e)}h(mS,"Yw");c(mS,"shouldFetchOptionally");function bb(s,t){return nr(t.enabled,s)!==!1&&s.isStaleByTime(en(t.staleTime,s))}h(bb,"ry");c(bb,"isStale");function vL(s,t){return!Uw(s.getCurrentResult(),t)}h(vL,"gg");c(vL,"shouldAssignObserverCurrentProperties");function Hw(s){return{onFetch:c((t,e)=>{const i=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},l=0;const d=c(async()=>{let u=!1;const p=c(g=>{nL(g,()=>t.signal,()=>u=!0)},"addSignalProperty"),f=XP(t.options,t.fetchOptions),y=c(async(g,O,k)=>{if(u)return Promise.reject();if(O==null&&g.pages.length)return Promise.resolve(g);const $=c(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:O,direction:k?"backward":"forward",meta:t.options.meta};return p(A),A},"createQueryFnContext")(),T=await f($),{maxPages:_}=t.options,D=k?sL:rL;return{pages:D(g.pages,T,_),pageParams:D(g.pageParams,O,_)}},"fetchPage");if(r&&n.length){const g=r==="backward",O=g?KP:p0,k={pages:n,pageParams:a},$=O(i,k);o=await y(k,$,g)}else{const g=s??n.length;do{const O=l===0?a[0]??i.initialPageParam:p0(i,o);if(l>0&&O==null)break;o=await y(o,O),l++}while(l<g)}return o},"fetchFn");t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e):t.fetchFn=d},"onFetch")}}h(Hw,"Kd");c(Hw,"infiniteQueryBehavior");function p0(s,{pages:t,pageParams:e}){const i=t.length-1;return t.length>0?s.getNextPageParam(t[i],t,e[i],e):void 0}h(p0,"hp");c(p0,"getNextPageParam");function KP(s,{pages:t,pageParams:e}){return t.length>0?s.getPreviousPageParam?.(t[0],t,e[0],e):void 0}h(KP,"xm");c(KP,"getPreviousPageParam");function OL(s,t){return t?p0(s,t)!=null:!1}h(OL,"bg");c(OL,"hasNextPage");function bL(s,t){return!t||!s.getPreviousPageParam?!1:KP(s,t)!=null}h(bL,"xg");c(bL,"hasPreviousPage");var f$,mp,Cj=(f$=(mp=class extends gL{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Hw()})}getOptimisticResult(t){return t.behavior=Hw(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:i}=t,r=super.createResult(t,e),{isFetching:n,isRefetching:a,isError:o,isRefetchError:l}=r,d=i.fetchMeta?.fetchMore?.direction,u=o&&d==="forward",p=n&&d==="forward",f=o&&d==="backward",y=n&&d==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:OL(e,i.data),hasPreviousPage:bL(e,i.data),isFetchNextPageError:u,isFetchingNextPage:p,isFetchPreviousPageError:f,isFetchingPreviousPage:y,isRefetchError:l&&!u&&!f,isRefetching:a&&!p&&!y}}},h(mp,"qa"),mp),c(f$,"InfiniteQueryObserver"),f$),Ov,As,ki,Nc,Rs,Sn,m$,yp,Pj=(m$=(yp=class extends yL{constructor(t){super(),q(this,Rs),q(this,Ov),q(this,As),q(this,ki),q(this,Nc),E(this,Ov,t.client),this.mutationId=t.mutationId,E(this,ki,t.mutationCache),E(this,As,[]),this.state=t.state||JP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){x(this,As).includes(t)||(x(this,As).push(t),this.clearGcTimeout(),x(this,ki).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){E(this,As,x(this,As).filter(e=>e!==t)),this.scheduleGc(),x(this,ki).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){x(this,As).length||(this.state.status==="pending"?this.scheduleGc():x(this,ki).remove(this))}continue(){return x(this,Nc)?.continue()??this.execute(this.state.variables)}async execute(t){const e=c(()=>{St(this,Rs,Sn).call(this,{type:"continue"})},"onContinue"),i={client:x(this,Ov),meta:this.options.meta,mutationKey:this.options.mutationKey};E(this,Nc,YP({fn:c(()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:c((a,o)=>{St(this,Rs,Sn).call(this,{type:"failed",failureCount:a,error:o})},"onFail"),onPause:c(()=>{St(this,Rs,Sn).call(this,{type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:c(()=>x(this,ki).canRun(this),"canRun")}));const r=this.state.status==="pending",n=!x(this,Nc).canStart();try{if(r)e();else{St(this,Rs,Sn).call(this,{type:"pending",variables:t,isPaused:n}),x(this,ki).config.onMutate&&await x(this,ki).config.onMutate(t,this,i);const o=await this.options.onMutate?.(t,i);o!==this.state.context&&St(this,Rs,Sn).call(this,{type:"pending",context:o,variables:t,isPaused:n})}const a=await x(this,Nc).start();return await x(this,ki).config.onSuccess?.(a,t,this.state.context,this,i),await this.options.onSuccess?.(a,t,this.state.context,i),await x(this,ki).config.onSettled?.(a,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(a,null,t,this.state.context,i),St(this,Rs,Sn).call(this,{type:"success",data:a}),a}catch(a){try{await x(this,ki).config.onError?.(a,t,this.state.context,this,i)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,t,this.state.context,i)}catch(o){Promise.reject(o)}try{await x(this,ki).config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,i)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,t,this.state.context,i)}catch(o){Promise.reject(o)}throw St(this,Rs,Sn).call(this,{type:"error",error:a}),a}finally{x(this,ki).runNext(this)}}},h(yp,"ja"),yp),Ov=new WeakMap,As=new WeakMap,ki=new WeakMap,Nc=new WeakMap,Rs=new WeakSet,Sn=c(function(s){const t=c(e=>{switch(s.type){case"failed":return{...e,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...e,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:s.error,failureCount:e.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}},"reducer");this.state=t(this.state),di.batch(()=>{x(this,As).forEach(e=>{e.onMutationUpdate(s)}),x(this,ki).notify({mutation:this,type:"updated",action:s})})},"#dispatch"),c(m$,"Mutation"),m$);function JP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}h(JP,"Cm");c(JP,"getDefaultState");var Cn,Kr,bv,y$,gp,Qj=(y$=(gp=class extends Vy{constructor(t={}){super(),q(this,Cn),q(this,Kr),q(this,bv),this.config=t,E(this,Cn,new Set),E(this,Kr,new Map),E(this,bv,0)}build(t,e,i){const r=new Pj({client:t,mutationCache:this,mutationId:++aS(this,bv)._,options:t.defaultMutationOptions(e),state:i});return this.add(r),r}add(t){x(this,Cn).add(t);const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e);i?i.push(t):x(this,Kr).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(x(this,Cn).delete(t)){const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e);if(i)if(i.length>1){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}else i[0]===t&&x(this,Kr).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Wg(t);return typeof e=="string"?x(this,Kr).get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){di.batch(()=>{x(this,Cn).forEach(t=>{this.notify({type:"removed",mutation:t})}),x(this,Cn).clear(),x(this,Kr).clear()})}getAll(){return Array.from(x(this,Cn))}find(t){const e={exact:!0,...t};return this.getAll().find(i=>lS(e,i))}findAll(t={}){return this.getAll().filter(e=>lS(t,e))}notify(t){di.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return di.batch(()=>Promise.all(t.map(e=>e.continue().catch(li))))}},h(gp,"Wa"),gp),Cn=new WeakMap,Kr=new WeakMap,bv=new WeakMap,c(y$,"MutationCache"),y$);function Wg(s){return s.options.scope?.id}h(Wg,"Ld");c(Wg,"scopeFor");var Pn,Ya,er,Qn,Ga,$v,g$,w$,wp,Gt=(w$=(wp=class extends Vy{constructor(t,e){super(),q(this,Ga),q(this,Pn),q(this,Ya),q(this,er),q(this,Qn),E(this,Pn,t),this.setOptions(e),this.bindMethods(),St(this,Ga,$v).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=x(this,Pn).defaultMutationOptions(t),Uw(this.options,e)||x(this,Pn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:x(this,er),observer:this}),e?.mutationKey&&this.options.mutationKey&&ya(e.mutationKey)!==ya(this.options.mutationKey)?this.reset():x(this,er)?.state.status==="pending"&&x(this,er).setOptions(this.options)}onUnsubscribe(){this.hasListeners()||x(this,er)?.removeObserver(this)}onMutationUpdate(t){St(this,Ga,$v).call(this),St(this,Ga,g$).call(this,t)}getCurrentResult(){return x(this,Ya)}reset(){x(this,er)?.removeObserver(this),E(this,er,void 0),St(this,Ga,$v).call(this),St(this,Ga,g$).call(this)}mutate(t,e){return E(this,Qn,e),x(this,er)?.removeObserver(this),E(this,er,x(this,Pn).getMutationCache().build(x(this,Pn),this.options)),x(this,er).addObserver(this),x(this,er).execute(t)}},h(wp,"Ka"),wp),Pn=new WeakMap,Ya=new WeakMap,er=new WeakMap,Qn=new WeakMap,Ga=new WeakSet,$v=c(function(){const s=x(this,er)?.state??JP();E(this,Ya,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},"#updateResult"),g$=c(function(s){di.batch(()=>{if(x(this,Qn)&&this.hasListeners()){const t=x(this,Ya).variables,e=x(this,Ya).context,i={client:x(this,Pn),meta:this.options.meta,mutationKey:this.options.mutationKey};if(s?.type==="success"){try{x(this,Qn).onSuccess?.(s.data,t,e,i)}catch(r){Promise.reject(r)}try{x(this,Qn).onSettled?.(s.data,null,t,e,i)}catch(r){Promise.reject(r)}}else if(s?.type==="error"){try{x(this,Qn).onError?.(s.error,t,e,i)}catch(r){Promise.reject(r)}try{x(this,Qn).onSettled?.(void 0,s.error,t,e,i)}catch(r){Promise.reject(r)}}}this.listeners.forEach(t=>{t(x(this,Ya))})})},"#notify"),c(w$,"MutationObserver"),w$),Es,v$,vp,Tj=(v$=(vp=class extends Vy{constructor(t={}){super(),q(this,Es),this.config=t,E(this,Es,new Map)}build(t,e,i){const r=e.queryKey,n=e.queryHash??Ob(r,e);let a=this.get(n);return a||(a=new Sj({client:t,queryKey:r,queryHash:n,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){x(this,Es).has(t.queryHash)||(x(this,Es).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=x(this,Es).get(t.queryHash);e&&(t.destroy(),e===t&&x(this,Es).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){di.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return x(this,Es).get(t)}getAll(){return[...x(this,Es).values()]}find(t){const e={exact:!0,...t};return this.getAll().find(i=>oS(e,i))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(i=>oS(t,i)):e}notify(t){di.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){di.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){di.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},h(vp,"Qa"),vp),Es=new WeakMap,c(v$,"QueryCache"),v$),ke,Ka,Ja,bg,$g,to,xg,kg,O$,Op,Mj=(O$=(Op=class{constructor(t={}){q(this,ke),q(this,Ka),q(this,Ja),q(this,bg),q(this,$g),q(this,to),q(this,xg),q(this,kg),E(this,ke,t.queryCache||new Tj),E(this,Ka,t.mutationCache||new Qj),E(this,Ja,t.defaultOptions||{}),E(this,bg,new Map),E(this,$g,new Map),E(this,to,0)}mount(){aS(this,to)._++,x(this,to)===1&&(E(this,xg,jP.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,ke).onFocus())})),E(this,kg,d0.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,ke).onOnline())})))}unmount(){var t,e;aS(this,to)._--,x(this,to)===0&&((t=x(this,xg))==null||t.call(this),E(this,xg,void 0),(e=x(this,kg))==null||e.call(this),E(this,kg,void 0))}isFetching(t){return x(this,ke).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return x(this,Ka).findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return x(this,ke).get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),i=x(this,ke).build(this,e),r=i.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(en(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return x(this,ke).findAll(t).map(({queryKey:e,state:i})=>{const r=i.data;return[e,r]})}setQueryData(t,e,i){const r=this.defaultQueryOptions({queryKey:t}),n=x(this,ke).get(r.queryHash)?.state.data,a=eL(e,n);if(a!==void 0)return x(this,ke).build(this,r).setData(a,{...i,manual:!0})}setQueriesData(t,e,i){return di.batch(()=>x(this,ke).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return x(this,ke).get(e.queryHash)?.state}removeQueries(t){const e=x(this,ke);di.batch(()=>{e.findAll(t).forEach(i=>{e.remove(i)})})}resetQueries(t,e){const i=x(this,ke);return di.batch(()=>(i.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=di.batch(()=>x(this,ke).findAll(t).map(n=>n.cancel(i)));return Promise.all(r).then(li).catch(li)}invalidateQueries(t,e={}){return di.batch(()=>(x(this,ke).findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=di.batch(()=>x(this,ke).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,i);return i.throwOnError||(a=a.catch(li)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(li)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const i=x(this,ke).build(this,e);return i.isStaleByTime(en(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(li).catch(li)}fetchInfiniteQuery(t){return t.behavior=Hw(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(li).catch(li)}ensureInfiniteQueryData(t){return t.behavior=Hw(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d0.isOnline()?x(this,Ka).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,ke)}getMutationCache(){return x(this,Ka)}getDefaultOptions(){return x(this,Ja)}setDefaultOptions(t){E(this,Ja,t)}setQueryDefaults(t,e){x(this,bg).set(ya(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...x(this,bg).values()],i={};return e.forEach(r=>{Oy(t,r.queryKey)&&Object.assign(i,r.defaultOptions)}),i}setMutationDefaults(t,e){x(this,$g).set(ya(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...x(this,$g).values()],i={};return e.forEach(r=>{Oy(t,r.mutationKey)&&Object.assign(i,r.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const e={...x(this,Ja).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ob(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===BP&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...x(this,Ja).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){x(this,ke).clear(),x(this,Ka).clear()}},h(Op,"Ja"),Op),ke=new WeakMap,Ka=new WeakMap,Ja=new WeakMap,bg=new WeakMap,$g=new WeakMap,to=new WeakMap,xg=new WeakMap,kg=new WeakMap,c(O$,"QueryClient"),O$);function jv(){}h(jv,"Fu");c(jv,"noop");function $L({storage:s,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:e=1e3,serialize:i=JSON.stringify,deserialize:r=JSON.parse,retry:n}){if(s){const a=c(o=>{try{s.setItem(t,i(o));return}catch(l){return l}},"trySave");return{persistClient:xL(o=>{let l=o,d=a(l),u=0;for(;d&&l;)u++,l=n?.({persistedClient:l,error:d,errorCount:u}),l&&(d=a(l))},e),restoreClient:c(()=>{const o=s.getItem(t);if(o)return r(o)},"restoreClient"),removeClient:c(()=>{s.removeItem(t)},"removeClient")}}return{persistClient:jv,restoreClient:jv,removeClient:jv}}h($L,"Sg");c($L,"createSyncStoragePersister");function xL(s,t=100){let e=null,i;return function(...r){i=r,e===null&&(e=Fn.setTimeout(()=>{s(...i),e=null},t))}}h(xL,"Mg");c(xL,"throttle$1");var Aj=["added","removed","updated"];function yS(s){return Aj.includes(s)}h(yS,"Xw");c(yS,"isCacheEventType");async function kL({queryClient:s,persister:t,maxAge:e=1e3*60*60*24,buster:i="",hydrateOptions:r}){try{const n=await t.restoreClient();if(n)if(n.timestamp){const a=Date.now()-n.timestamp>e,o=n.buster!==i;if(a||o)return t.removeClient();pL(s,n.clientState,r)}else return t.removeClient()}catch(n){throw await t.removeClient(),n}}h(kL,"Eg");c(kL,"persistQueryClientRestore");async function gS({queryClient:s,persister:t,buster:e="",dehydrateOptions:i}){const r={buster:e,timestamp:Date.now(),clientState:uL(s,i)};await t.persistClient(r)}h(gS,"Jw");c(gS,"persistQueryClientSave");function SL(s){const t=s.queryClient.getQueryCache().subscribe(i=>{yS(i.type)&&gS(s)}),e=s.queryClient.getMutationCache().subscribe(i=>{yS(i.type)&&gS(s)});return()=>{t(),e()}}h(SL,"Rg");c(SL,"persistQueryClientSubscribe");const Rj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._queryClient=new Mj({defaultOptions:{queries:{staleTime:this.staleTime,gcTime:this.gcTime}}}),this.initQueryClient()}get queryClient(){return this._queryClient}async initQueryClient(){if(this.isDestroyed)throw new _e;await this.whenUrl();try{this._sessionStoragePersister=$L({key:"WEAVY_QUERY_OFFLINE_CACHE",storage:window.sessionStorage,throttleTime:this.staleTime});const r={queryClient:this._queryClient,persister:this._sessionStoragePersister,maxAge:this.gcTime,buster:this.cachePrefix,hydrateOptions:void 0,dehydrateOptions:{shouldDehydrateMutation:c(n=>{const a=n.state.context?.status?.state==="pending";return!!(n.state.context&&!a||n.state.isPaused)},"shouldDehydrateMutation")}};await kL(r),this._unsubscribeQueryClient=SL(r)}catch{console.warn(this.weavyId,"Query cache persister not available.")}this.host.isConnected&&this._queryClient.mount(),this._hostIsConnectedObserver=tT(this.host,r=>{this.isDestroyed||(r?(console.info(this.weavyId,"Query client mounted"),this._queryClient.mount()):(console.info(this.weavyId,"Query client unmounted"),this._queryClient.unmount()))})}async reset(){await super.reset(),await this._queryClient.cancelQueries(),await this._sessionStoragePersister?.removeClient(),await this.queryClient.resetQueries()}async disconnectQueryClient(){console.info(this.weavyId,"Query client disconnected"),await this._queryClient.cancelQueries(),await this._sessionStoragePersister?.removeClient(),this._unsubscribeQueryClient?.(),this._queryClient.unmount(),this._queryClient.clear()}destroy(){super.destroy(),this._hostIsConnectedObserver?.disconnect(),this.disconnectQueryClient()}},h(e,"t"),e),c(t,"WeavyQuery"),t},"WeavyQueryMixin"),Ej=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r)}set annotations(r){this._annotations=r,this.updateContext()}get annotations(){return this._annotations??Le.defaults.annotations}set enterToSend(r){this._enterToSend=r,this.updateContext()}get enterToSend(){return this._enterToSend??Le.defaults.enterToSend}set reactions(r){this._reactions=r,this.updateContext()}get reactions(){return this._reactions??Le.defaults.reactions}},h(e,"t"),e),c(t,"WeavySettings"),t},"WeavySettingsMixin");function Si(s){return s<0?-1:s===0?0:1}h(Si,"He");c(Si,"signum");function Qh(s,t,e){return(1-e)*s+e*t}h(Qh,"hl");c(Qh,"lerp");function CL(s,t,e){return e<s?s:e>t?t:e}h(CL,"Og");c(CL,"clampInt");function Je(s,t,e){return e<s?s:e>t?t:e}h(Je,"$e");c(Je,"clampDouble");function wS(s){return s=s%360,s<0&&(s=s+360),s}h(wS,"tf");c(wS,"sanitizeDegreesInt");function Mi(s){return s=s%360,s<0&&(s=s+360),s}h(Mi,"Ue");c(Mi,"sanitizeDegreesDouble");function f0(s,t){const e=s[0]*t[0][0]+s[1]*t[0][1]+s[2]*t[0][2],i=s[0]*t[1][0]+s[1]*t[1][1]+s[2]*t[1][2],r=s[0]*t[2][0]+s[1]*t[2][1]+s[2]*t[2][2];return[e,i,r]}h(f0,"pp");c(f0,"matrixMultiply");const PL=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],_j=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],QL=[95.047,100,108.883];function $b(s,t,e){return(255<<24|(s&255)<<16|(t&255)<<8|e&255)>>>0}h($b,"ny");c($b,"argbFromRgb");function vS(s){const t=Bn(s[0]),e=Bn(s[1]),i=Bn(s[2]);return $b(t,e,i)}h(vS,"ef");c(vS,"argbFromLinrgb");function TL(s){return s>>24&255}h(TL,"Ig");c(TL,"alphaFromArgb");function xb(s){return s>>16&255}h(xb,"ay");c(xb,"redFromArgb");function kb(s){return s>>8&255}h(kb,"sy");c(kb,"greenFromArgb");function Sb(s){return s&255}h(Sb,"oy");c(Sb,"blueFromArgb");function ML(s,t,e){const i=_j,r=i[0][0]*s+i[0][1]*t+i[0][2]*e,n=i[1][0]*s+i[1][1]*t+i[1][2]*e,a=i[2][0]*s+i[2][1]*t+i[2][2]*e,o=Bn(r),l=Bn(n),d=Bn(a);return $b(o,l,d)}h(ML,"Fg");c(ML,"argbFromXyz");function AL(s){const t=us(xb(s)),e=us(kb(s)),i=us(Sb(s));return f0([t,e,i],PL)}h(AL,"Dg");c(AL,"xyzFromArgb");function RL(s){const t=us(xb(s)),e=us(kb(s)),i=us(Sb(s)),r=PL,n=r[0][0]*t+r[0][1]*e+r[0][2]*i,a=r[1][0]*t+r[1][1]*e+r[1][2]*i,o=r[2][0]*t+r[2][1]*e+r[2][2]*i,l=QL,d=n/l[0],u=a/l[1],p=o/l[2],f=Th(d),y=Th(u),g=Th(p),O=116*y-16,k=500*(f-y),$=200*(y-g);return[O,k,$]}h(RL,"Vg");c(RL,"labFromArgb");function EL(s){const t=Xs(s),e=Bn(t);return $b(e,e,e)}h(EL,"Hg");c(EL,"argbFromLstar");function OS(s){const t=AL(s)[1];return 116*Th(t/100)-16}h(OS,"rf");c(OS,"lstarFromArgb");function Xs(s){return 100*LL((s+16)/116)}h(Xs,"Or");c(Xs,"yFromLstar");function m0(s){return Th(s/100)*116-16}h(m0,"yp");c(m0,"lstarFromY");function us(s){const t=s/255;return t<=.040449936?t/12.92*100:Math.pow((t+.055)/1.055,2.4)*100}h(us,"Ji");c(us,"linearized");function Bn(s){const t=s/100;let e=0;return t<=.0031308?e=t*12.92:e=1.055*Math.pow(t,1/2.4)-.055,CL(0,255,Math.round(e*255))}h(Bn,"$n");c(Bn,"delinearized");function _L(){return QL}h(_L,"Bg");c(_L,"whitePointD65");function Th(s){const t=.008856451679035631,e=24389/27;return s>t?Math.pow(s,1/3):(e*s+16)/116}h(Th,"ul");c(Th,"labF");function LL(s){const t=.008856451679035631,e=24389/27,i=s*s*s;return i>t?i:(116*s-16)/e}h(LL,"Ng");c(LL,"labInvf");var al;const zL=(al=class{static make(t=_L(),e=200/Math.PI*Xs(50)/100,i=50,r=2,n=!1){const a=t,o=a[0]*.401288+a[1]*.650173+a[2]*-.051461,l=a[0]*-.250268+a[1]*1.204414+a[2]*.045854,d=a[0]*-.002079+a[1]*.048952+a[2]*.953127,u=.8+r/10,p=u>=.9?Qh(.59,.69,(u-.9)*10):Qh(.525,.59,(u-.8)*10);let f=n?1:u*(1-1/3.6*Math.exp((-e-42)/92));f=f>1?1:f<0?0:f;const y=u,g=[f*(100/o)+1-f,f*(100/l)+1-f,f*(100/d)+1-f],O=1/(5*e+1),k=O*O*O*O,$=1-k,T=k*e+.1*$*$*Math.cbrt(5*e),_=Xs(i)/t[1],D=1.48+Math.sqrt(_),A=.725/Math.pow(_,.2),z=A,V=[Math.pow(T*g[0]*o/100,.42),Math.pow(T*g[1]*l/100,.42),Math.pow(T*g[2]*d/100,.42)],j=[400*V[0]/(V[0]+27.13),400*V[1]/(V[1]+27.13),400*V[2]/(V[2]+27.13)],tt=(2*j[0]+j[1]+.05*j[2])*A;return new al(_,tt,A,z,p,y,g,T,Math.pow(T,.25),D)}constructor(t,e,i,r,n,a,o,l,d,u){this.n=t,this.aw=e,this.nbb=i,this.ncb=r,this.c=n,this.nc=a,this.rgbD=o,this.fl=l,this.fLRoot=d,this.z=u}},h(al,"wh"),al);c(zL,"ViewingConditions");let qn=zL;qn.DEFAULT=qn.make();var sr;const IL=(sr=class{constructor(t,e,i,r,n,a,o,l,d){this.hue=t,this.chroma=e,this.j=i,this.q=r,this.m=n,this.s=a,this.jstar=o,this.astar=l,this.bstar=d}distance(t){const e=this.jstar-t.jstar,i=this.astar-t.astar,r=this.bstar-t.bstar,n=Math.sqrt(e*e+i*i+r*r);return 1.41*Math.pow(n,.63)}static fromInt(t){return sr.fromIntInViewingConditions(t,qn.DEFAULT)}static fromIntInViewingConditions(t,e){const i=(t&16711680)>>16,r=(t&65280)>>8,n=t&255,a=us(i),o=us(r),l=us(n),d=.41233895*a+.35762064*o+.18051042*l,u=.2126*a+.7152*o+.0722*l,p=.01932141*a+.11916382*o+.95034478*l,f=.401288*d+.650173*u-.051461*p,y=-.250268*d+1.204414*u+.045854*p,g=-.002079*d+.048952*u+.953127*p,O=e.rgbD[0]*f,k=e.rgbD[1]*y,$=e.rgbD[2]*g,T=Math.pow(e.fl*Math.abs(O)/100,.42),_=Math.pow(e.fl*Math.abs(k)/100,.42),D=Math.pow(e.fl*Math.abs($)/100,.42),A=Si(O)*400*T/(T+27.13),z=Si(k)*400*_/(_+27.13),V=Si($)*400*D/(D+27.13),j=(11*A+-12*z+V)/11,tt=(A+z-2*V)/9,vt=(20*A+20*z+21*V)/20,dt=(40*A+20*z+V)/20,st=Math.atan2(tt,j)*180/Math.PI,Qt=Mi(st),ct=Qt*Math.PI/180,Wt=dt*e.nbb,Lt=100*Math.pow(Wt/e.aw,e.c*e.z),Nt=4/e.c*Math.sqrt(Lt/100)*(e.aw+4)*e.fLRoot,Xt=Qt<20.14?Qt+360:Qt,jt=.25*(Math.cos(Xt*Math.PI/180+2)+3.8),Ii=5e4/13*jt*e.nc*e.ncb*Math.sqrt(j*j+tt*tt)/(vt+.305),Ze=Math.pow(Ii,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),me=Ze*Math.sqrt(Lt/100),le=me*e.fLRoot,$e=50*Math.sqrt(Ze*e.c/(e.aw+4)),Di=(1+100*.007)*Lt/(1+.007*Lt),Gi=1/.0228*Math.log(1+.0228*le),fr=Gi*Math.cos(ct),ie=Gi*Math.sin(ct);return new sr(Qt,me,Lt,Nt,le,$e,Di,fr,ie)}static fromJch(t,e,i){return sr.fromJchInViewingConditions(t,e,i,qn.DEFAULT)}static fromJchInViewingConditions(t,e,i,r){const n=4/r.c*Math.sqrt(t/100)*(r.aw+4)*r.fLRoot,a=e*r.fLRoot,o=e/Math.sqrt(t/100),l=50*Math.sqrt(o*r.c/(r.aw+4)),d=i*Math.PI/180,u=(1+100*.007)*t/(1+.007*t),p=1/.0228*Math.log(1+.0228*a),f=p*Math.cos(d),y=p*Math.sin(d);return new sr(i,e,t,n,a,l,u,f,y)}static fromUcs(t,e,i){return sr.fromUcsInViewingConditions(t,e,i,qn.DEFAULT)}static fromUcsInViewingConditions(t,e,i,r){const n=e,a=i,o=Math.sqrt(n*n+a*a),l=(Math.exp(o*.0228)-1)/.0228/r.fLRoot;let d=Math.atan2(a,n)*(180/Math.PI);d<0&&(d+=360);const u=t/(1-(t-100)*.007);return sr.fromJchInViewingConditions(u,l,d,r)}toInt(){return this.viewed(qn.DEFAULT)}viewed(t){const e=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),i=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),r=this.hue*Math.PI/180,n=.25*(Math.cos(r+2)+3.8),a=t.aw*Math.pow(this.j/100,1/t.c/t.z),o=n*(5e4/13)*t.nc*t.ncb,l=a/t.nbb,d=Math.sin(r),u=Math.cos(r),p=23*(l+.305)*i/(23*o+11*i*u+108*i*d),f=p*u,y=p*d,g=(460*l+451*f+288*y)/1403,O=(460*l-891*f-261*y)/1403,k=(460*l-220*f-6300*y)/1403,$=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),T=Si(g)*(100/t.fl)*Math.pow($,1/.42),_=Math.max(0,27.13*Math.abs(O)/(400-Math.abs(O))),D=Si(O)*(100/t.fl)*Math.pow(_,1/.42),A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),z=Si(k)*(100/t.fl)*Math.pow(A,1/.42),V=T/t.rgbD[0],j=D/t.rgbD[1],tt=z/t.rgbD[2],vt=1.86206786*V-1.01125463*j+.14918677*tt,dt=.38752654*V+.62144744*j-.00897398*tt,st=-.0158415*V-.03412294*j+1.04996444*tt;return ML(vt,dt,st)}static fromXyzInViewingConditions(t,e,i,r){const n=.401288*t+.650173*e-.051461*i,a=-.250268*t+1.204414*e+.045854*i,o=-.002079*t+.048952*e+.953127*i,l=r.rgbD[0]*n,d=r.rgbD[1]*a,u=r.rgbD[2]*o,p=Math.pow(r.fl*Math.abs(l)/100,.42),f=Math.pow(r.fl*Math.abs(d)/100,.42),y=Math.pow(r.fl*Math.abs(u)/100,.42),g=Si(l)*400*p/(p+27.13),O=Si(d)*400*f/(f+27.13),k=Si(u)*400*y/(y+27.13),$=(11*g+-12*O+k)/11,T=(g+O-2*k)/9,_=(20*g+20*O+21*k)/20,D=(40*g+20*O+k)/20,A=Math.atan2(T,$)*180/Math.PI,z=A<0?A+360:A>=360?A-360:A,V=z*Math.PI/180,j=D*r.nbb,tt=100*Math.pow(j/r.aw,r.c*r.z),vt=4/r.c*Math.sqrt(tt/100)*(r.aw+4)*r.fLRoot,dt=z<20.14?z+360:z,st=1/4*(Math.cos(dt*Math.PI/180+2)+3.8),Qt=5e4/13*st*r.nc*r.ncb*Math.sqrt($*$+T*T)/(_+.305),ct=Math.pow(Qt,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),Wt=ct*Math.sqrt(tt/100),Lt=Wt*r.fLRoot,Nt=50*Math.sqrt(ct*r.c/(r.aw+4)),Xt=(1+100*.007)*tt/(1+.007*tt),jt=Math.log(1+.0228*Lt)/.0228,Ii=jt*Math.cos(V),Ze=jt*Math.sin(V);return new sr(z,Wt,tt,vt,Lt,Nt,Xt,Ii,Ze)}xyzInViewingConditions(t){const e=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),i=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),r=this.hue*Math.PI/180,n=.25*(Math.cos(r+2)+3.8),a=t.aw*Math.pow(this.j/100,1/t.c/t.z),o=n*(5e4/13)*t.nc*t.ncb,l=a/t.nbb,d=Math.sin(r),u=Math.cos(r),p=23*(l+.305)*i/(23*o+11*i*u+108*i*d),f=p*u,y=p*d,g=(460*l+451*f+288*y)/1403,O=(460*l-891*f-261*y)/1403,k=(460*l-220*f-6300*y)/1403,$=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),T=Si(g)*(100/t.fl)*Math.pow($,1/.42),_=Math.max(0,27.13*Math.abs(O)/(400-Math.abs(O))),D=Si(O)*(100/t.fl)*Math.pow(_,1/.42),A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),z=Si(k)*(100/t.fl)*Math.pow(A,1/.42),V=T/t.rgbD[0],j=D/t.rgbD[1],tt=z/t.rgbD[2],vt=1.86206786*V-1.01125463*j+.14918677*tt,dt=.38752654*V+.62144744*j-.00897398*tt,st=-.0158415*V-.03412294*j+1.04996444*tt;return[vt,dt,st]}},h(sr,"ki"),sr);c(IL,"Cam16");let Fg=IL;var Tt;const DL=(Tt=class{static sanitizeRadians(t){return(t+Math.PI*8)%(Math.PI*2)}static trueDelinearized(t){const e=t/100;let i=0;return e<=.0031308?i=e*12.92:i=1.055*Math.pow(e,1/2.4)-.055,i*255}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return Si(t)*400*e/(e+27.13)}static hueOf(t){const e=f0(t,Tt.SCALED_DISCOUNT_FROM_LINRGB),i=Tt.chromaticAdaptation(e[0]),r=Tt.chromaticAdaptation(e[1]),n=Tt.chromaticAdaptation(e[2]),a=(11*i+-12*r+n)/11,o=(i+r-2*n)/9;return Math.atan2(o,a)}static areInCyclicOrder(t,e,i){const r=Tt.sanitizeRadians(e-t),n=Tt.sanitizeRadians(i-t);return r<n}static intercept(t,e,i){return(e-t)/(i-t)}static lerpPoint(t,e,i){return[t[0]+(i[0]-t[0])*e,t[1]+(i[1]-t[1])*e,t[2]+(i[2]-t[2])*e]}static setCoordinate(t,e,i,r){const n=Tt.intercept(t[r],e,i[r]);return Tt.lerpPoint(t,n,i)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const i=Tt.Y_FROM_LINRGB[0],r=Tt.Y_FROM_LINRGB[1],n=Tt.Y_FROM_LINRGB[2],a=e%4<=1?0:100,o=e%2===0?0:100;if(e<4){const l=a,d=o,u=(t-l*r-d*n)/i;return Tt.isBounded(u)?[u,l,d]:[-1,-1,-1]}else if(e<8){const l=a,d=o,u=(t-d*i-l*n)/r;return Tt.isBounded(u)?[d,u,l]:[-1,-1,-1]}else{const l=a,d=o,u=(t-l*i-d*r)/n;return Tt.isBounded(u)?[l,d,u]:[-1,-1,-1]}}static bisectToSegment(t,e){let i=[-1,-1,-1],r=i,n=0,a=0,o=!1,l=!0;for(let d=0;d<12;d++){const u=Tt.nthVertex(t,d);if(u[0]<0)continue;const p=Tt.hueOf(u);if(!o){i=u,r=u,n=p,a=p,o=!0;continue}(l||Tt.areInCyclicOrder(n,p,a))&&(l=!1,Tt.areInCyclicOrder(n,e,p)?(r=u,a=p):(i=u,n=p))}return[i,r]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const i=Tt.bisectToSegment(t,e);let r=i[0],n=Tt.hueOf(r),a=i[1];for(let o=0;o<3;o++)if(r[o]!==a[o]){let l=-1,d=255;r[o]<a[o]?(l=Tt.criticalPlaneBelow(Tt.trueDelinearized(r[o])),d=Tt.criticalPlaneAbove(Tt.trueDelinearized(a[o]))):(l=Tt.criticalPlaneAbove(Tt.trueDelinearized(r[o])),d=Tt.criticalPlaneBelow(Tt.trueDelinearized(a[o])));for(let u=0;u<8&&!(Math.abs(d-l)<=1);u++){const p=Math.floor((l+d)/2),f=Tt.CRITICAL_PLANES[p],y=Tt.setCoordinate(r,f,a,o),g=Tt.hueOf(y);Tt.areInCyclicOrder(n,e,g)?(a=y,d=p):(r=y,n=g,l=p)}}return Tt.midpoint(r,a)}static inverseChromaticAdaptation(t){const e=Math.abs(t),i=Math.max(0,27.13*e/(400-e));return Si(t)*Math.pow(i,1/.42)}static findResultByJ(t,e,i){let r=Math.sqrt(i)*11;const n=qn.DEFAULT,a=1/Math.pow(1.64-Math.pow(.29,n.n),.73),o=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,l=Math.sin(t),d=Math.cos(t);for(let u=0;u<5;u++){const p=r/100,f=e===0||r===0?0:e/Math.sqrt(p),y=Math.pow(f*a,1/.9),g=n.aw*Math.pow(p,1/n.c/n.z)/n.nbb,O=23*(g+.305)*y/(23*o+11*y*d+108*y*l),k=O*d,$=O*l,T=(460*g+451*k+288*$)/1403,_=(460*g-891*k-261*$)/1403,D=(460*g-220*k-6300*$)/1403,A=Tt.inverseChromaticAdaptation(T),z=Tt.inverseChromaticAdaptation(_),V=Tt.inverseChromaticAdaptation(D),j=f0([A,z,V],Tt.LINRGB_FROM_SCALED_DISCOUNT);if(j[0]<0||j[1]<0||j[2]<0)return 0;const tt=Tt.Y_FROM_LINRGB[0],vt=Tt.Y_FROM_LINRGB[1],dt=Tt.Y_FROM_LINRGB[2],st=tt*j[0]+vt*j[1]+dt*j[2];if(st<=0)return 0;if(u===4||Math.abs(st-i)<.002)return j[0]>100.01||j[1]>100.01||j[2]>100.01?0:vS(j);r=r-(st-i)*r/(2*st)}return 0}static solveToInt(t,e,i){if(e<1e-4||i<1e-4||i>99.9999)return EL(i);t=Mi(t);const r=t/180*Math.PI,n=Xs(i),a=Tt.findResultByJ(r,e,n);if(a!==0)return a;const o=Tt.bisectToLimit(n,r);return vS(o)}static solveToCam(t,e,i){return Fg.fromInt(Tt.solveToInt(t,e,i))}},h(Tt,"wt"),Tt);c(DL,"HctSolver");let Zn=DL;Zn.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];Zn.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];Zn.Y_FROM_LINRGB=[.2126,.7152,.0722];Zn.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];var Ks;const VL=(Ks=class{static from(t,e,i){return new Ks(Zn.solveToInt(t,e,i))}static fromInt(t){return new Ks(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(Zn.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(Zn.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(Zn.solveToInt(this.internalHue,this.internalChroma,t))}setValue(t,e){this[t]=e}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(t){return t>=250&&t<270}static isYellow(t){return t>=105&&t<125}static isCyan(t){return t>=170&&t<207}constructor(t){this.argb=t;const e=Fg.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=OS(t),this.argb=t}setInternalState(t){const e=Fg.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=OS(t),this.argb=t}inViewingConditions(t){const e=Fg.fromInt(this.toInt()).xyzInViewingConditions(t),i=Fg.fromXyzInViewingConditions(e[0],e[1],e[2],qn.make());return Ks.from(i.hue,i.chroma,m0(e[1]))}},h(Ks,"Ca"),Ks);c(VL,"Hct");let zt=VL;var _r;const WL=(_r=class{static ratioOfTones(t,e){return t=Je(0,100,t),e=Je(0,100,e),_r.ratioOfYs(Xs(t),Xs(e))}static ratioOfYs(t,e){const i=t>e?t:e,r=i===e?t:e;return(i+5)/(r+5)}static lighter(t,e){if(t<0||t>100)return-1;const i=Xs(t),r=e*(i+5)-5,n=_r.ratioOfYs(r,i),a=Math.abs(n-e);if(n<e&&a>.04)return-1;const o=m0(r)+.4;return o<0||o>100?-1:o}static darker(t,e){if(t<0||t>100)return-1;const i=Xs(t),r=(i+5)/e-5,n=_r.ratioOfYs(i,r),a=Math.abs(n-e);if(n<e&&a>.04)return-1;const o=m0(r)-.4;return o<0||o>100?-1:o}static lighterUnsafe(t,e){const i=_r.lighter(t,e);return i<0?100:i}static darkerUnsafe(t,e){const i=_r.darker(t,e);return i<0?0:i}},h(_r,"xr"),_r);c(WL,"Contrast");let ti=WL;var ol;const FL=(ol=class{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,i=Math.round(t.chroma)>16,r=Math.round(t.tone)<65;return e&&i&&r}static fixIfDisliked(t){return ol.isDisliked(t)?zt.from(t.hue,t.chroma,70):t}},h(ol,"fh"),ol);c(FL,"DislikeAnalyzer");let bS=FL;function qL(s,t,e){if(s.name!==e.name)throw new Error(`Attempting to extend color ${s.name} with color ${e.name} of different name for spec version ${t}.`);if(s.isBackground!==e.isBackground)throw new Error(`Attempting to extend color ${s.name} as a ${s.isBackground?"background":"foreground"} with color ${e.name} as a ${e.isBackground?"background":"foreground"} for spec version ${t}.`)}h(qL,"Ug");c(qL,"validateExtendedColor");function Mt(s,t,e){return qL(s,t,e),F.fromPalette({name:s.name,palette:c(i=>i.specVersion===t?e.palette(i):s.palette(i),"palette"),tone:c(i=>i.specVersion===t?e.tone(i):s.tone(i),"tone"),isBackground:s.isBackground,chromaMultiplier:c(i=>{const r=i.specVersion===t?e.chromaMultiplier:s.chromaMultiplier;return r!==void 0?r(i):1},"chromaMultiplier"),background:c(i=>{const r=i.specVersion===t?e.background:s.background;return r!==void 0?r(i):void 0},"background"),secondBackground:c(i=>{const r=i.specVersion===t?e.secondBackground:s.secondBackground;return r!==void 0?r(i):void 0},"secondBackground"),contrastCurve:c(i=>{const r=i.specVersion===t?e.contrastCurve:s.contrastCurve;return r!==void 0?r(i):void 0},"contrastCurve"),toneDeltaPair:c(i=>{const r=i.specVersion===t?e.toneDeltaPair:s.toneDeltaPair;return r!==void 0?r(i):void 0},"toneDeltaPair")})}h(Mt,"ut");c(Mt,"extendSpecVersion");var mr;const ZL=(mr=class{static fromPalette(t){return new mr(t.name??"",t.palette,t.tone??mr.getInitialToneFromBackground(t.background),t.isBackground??!1,t.chromaMultiplier,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}static getInitialToneFromBackground(t){return t===void 0?e=>50:e=>t(e)?t(e).getTone(e):50}constructor(t,e,i,r,n,a,o,l,d){if(this.name=t,this.palette=e,this.tone=i,this.isBackground=r,this.chromaMultiplier=n,this.background=a,this.secondBackground=o,this.contrastCurve=l,this.toneDeltaPair=d,this.hctCache=new Map,!a&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!a&&l)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(a&&!l)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return mr.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(e!=null)return e;const i=$S(t.specVersion).getHct(t,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,i),i}getTone(t){return $S(t.specVersion).getTone(t,this)}static foregroundTone(t,e){const i=ti.lighterUnsafe(t,e),r=ti.darkerUnsafe(t,e),n=ti.ratioOfTones(i,t),a=ti.ratioOfTones(r,t);if(mr.tonePrefersLightForeground(t)){const o=Math.abs(n-a)<.1&&n<e&&a<e;return n>=e||n>=a||o?i:r}else return a>=e||a>=n?r:i}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return mr.tonePrefersLightForeground(t)&&!mr.toneAllowsLightForeground(t)?49:t}},h(mr,"qi"),mr);c(ZL,"DynamicColor");let F=ZL;var bp;const NL=(bp=class{getHct(t,e){const i=e.getTone(t);return e.palette(t).getHct(i)}getTone(t,e){const i=t.contrastLevel<0,r=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(r){const n=r.roleA,a=r.roleB,o=r.delta,l=r.polarity,d=r.stayTogether,u=l==="nearer"||l==="lighter"&&!t.isDark||l==="darker"&&t.isDark,p=u?n:a,f=u?a:n,y=e.name===p.name,g=t.isDark?1:-1;let O=p.tone(t),k=f.tone(t);if(e.background&&p.contrastCurve&&f.contrastCurve){const $=e.background(t),T=p.contrastCurve(t),_=f.contrastCurve(t);if($&&T&&_){const D=$.getTone(t),A=T.get(t.contrastLevel),z=_.get(t.contrastLevel);ti.ratioOfTones(D,O)<A&&(O=F.foregroundTone(D,A)),ti.ratioOfTones(D,k)<z&&(k=F.foregroundTone(D,z)),i&&(O=F.foregroundTone(D,A),k=F.foregroundTone(D,z))}}return(k-O)*g<o&&(k=Je(0,100,O+o*g),(k-O)*g>=o||(O=Je(0,100,k-o*g))),50<=O&&O<60?g>0?(O=60,k=Math.max(k,O+o*g)):(O=49,k=Math.min(k,O+o*g)):50<=k&&k<60&&(d?g>0?(O=60,k=Math.max(k,O+o*g)):(O=49,k=Math.min(k,O+o*g)):g>0?k=60:k=49),y?O:k}else{let n=e.tone(t);if(e.background==null||e.background(t)===void 0||e.contrastCurve==null||e.contrastCurve(t)===void 0)return n;const a=e.background(t).getTone(t),o=e.contrastCurve(t).get(t.contrastLevel);if(ti.ratioOfTones(a,n)>=o||(n=F.foregroundTone(a,o)),i&&(n=F.foregroundTone(a,o)),e.isBackground&&50<=n&&n<60&&(ti.ratioOfTones(49,a)>=o?n=49:n=60),e.secondBackground==null||e.secondBackground(t)===void 0)return n;const[l,d]=[e.background,e.secondBackground],[u,p]=[l(t).getTone(t),d(t).getTone(t)],[f,y]=[Math.max(u,p),Math.min(u,p)];if(ti.ratioOfTones(f,n)>=o&&ti.ratioOfTones(y,n)>=o)return n;const g=ti.lighter(f,o),O=ti.darker(y,o),k=[];return g!==-1&&k.push(g),O!==-1&&k.push(O),F.tonePrefersLightForeground(u)||F.tonePrefersLightForeground(p)?g<0?100:g:k.length===1?k[0]:O<0?0:O}}},h(bp,"Ky"),bp);c(NL,"ColorCalculationDelegateImpl2021");let Lj=NL;var $p;const BL=($p=class{getHct(t,e){const i=e.palette(t),r=e.getTone(t),n=i.hue,a=i.chroma*(e.chromaMultiplier?e.chromaMultiplier(t):1);return zt.from(n,a,r)}getTone(t,e){const i=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(i){const r=i.roleA,n=i.roleB,a=i.polarity,o=i.constraint,l=a==="darker"||a==="relative_lighter"&&t.isDark||a==="relative_darker"&&!t.isDark?-i.delta:i.delta,d=e.name===r.name,u=d?r:n,p=d?n:r;let f=u.tone(t),y=p.getTone(t);const g=l*(d?1:-1);if(o==="exact"?f=Je(0,100,y+g):o==="nearer"?g>0?f=Je(0,100,Je(y,y+g,f)):f=Je(0,100,Je(y+g,y,f)):o==="farther"&&(g>0?f=Je(y+g,100,f):f=Je(0,y+g,f)),e.background&&e.contrastCurve){const O=e.background(t),k=e.contrastCurve(t);if(O&&k){const $=O.getTone(t),T=k.get(t.contrastLevel);f=ti.ratioOfTones($,f)>=T&&t.contrastLevel>=0?f:F.foregroundTone($,T)}}return e.isBackground&&!e.name.endsWith("_fixed_dim")&&(f>=57?f=Je(65,100,f):f=Je(0,49,f)),f}else{let r=e.tone(t);if(e.background==null||e.background(t)===void 0||e.contrastCurve==null||e.contrastCurve(t)===void 0)return r;const n=e.background(t).getTone(t),a=e.contrastCurve(t).get(t.contrastLevel);if(r=ti.ratioOfTones(n,r)>=a&&t.contrastLevel>=0?r:F.foregroundTone(n,a),e.isBackground&&!e.name.endsWith("_fixed_dim")&&(r>=57?r=Je(65,100,r):r=Je(0,49,r)),e.secondBackground==null||e.secondBackground(t)===void 0)return r;const[o,l]=[e.background,e.secondBackground],[d,u]=[o(t).getTone(t),l(t).getTone(t)],[p,f]=[Math.max(d,u),Math.min(d,u)];if(ti.ratioOfTones(p,r)>=a&&ti.ratioOfTones(f,r)>=a)return r;const y=ti.lighter(p,a),g=ti.darker(f,a),O=[];return y!==-1&&O.push(y),g!==-1&&O.push(g),F.tonePrefersLightForeground(d)||F.tonePrefersLightForeground(u)?y<0?100:y:O.length===1?O[0]:g<0?0:g}}},h($p,"Qy"),$p);c(BL,"ColorCalculationDelegateImpl2025");let zj=BL;const Ij=new Lj,Dj=new zj;function $S(s){return s==="2025"?Dj:Ij}h($S,"nf");c($S,"getSpec$1");var Js;const XL=(Js=class{static fromInt(t){const e=zt.fromInt(t);return Js.fromHct(e)}static fromHct(t){return new Js(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){const i=new Vj(t,e).create();return new Js(t,e,i)}constructor(t,e,i){this.hue=t,this.chroma=e,this.keyColor=i,this.cache=new Map}tone(t){let e=this.cache.get(t);return e===void 0&&(t==99&&zt.isYellow(this.hue)?e=this.averageArgb(this.tone(98),this.tone(100)):e=zt.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return zt.fromInt(this.tone(t))}averageArgb(t,e){const i=t>>>16&255,r=t>>>8&255,n=t&255,a=e>>>16&255,o=e>>>8&255,l=e&255,d=Math.round((i+a)/2),u=Math.round((r+o)/2),p=Math.round((n+l)/2);return(255<<24|(d&255)<<16|(u&255)<<8|p&255)>>>0}},h(Js,"$a"),Js);c(XL,"TonalPalette");let G=XL;var xp;const jL=(xp=class{constructor(t,e){this.hue=t,this.requestedChroma=e,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,e=100;for(;t<e;){const i=Math.floor((t+e)/2),r=this.maxChroma(i)<this.maxChroma(i+1);if(this.maxChroma(i)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=i;else{if(t===i)return zt.from(this.hue,this.requestedChroma,t);t=i}else r?t=i+1:e=i}return zt.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=zt.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}},h(xp,"Gy"),xp);c(jL,"KeyColor");let Vj=jL;var tn;const UL=(tn=class{constructor(t){this.input=t,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const t=this.hctsByHue.concat([this.input]),e=this.tempsByHct;return t.sort((i,r)=>e.get(i)-e.get(r)),this.hctsByTempCache=t,t}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(t=5,e=12){const i=Math.round(this.input.hue),r=this.hctsByHue[i];let n=this.relativeTemperature(r);const a=[r];let o=0;for(let g=0;g<360;g++){const O=wS(i+g),k=this.hctsByHue[O],$=this.relativeTemperature(k),T=Math.abs($-n);n=$,o+=T}let l=1;const d=o/e;let u=0;for(n=this.relativeTemperature(r);a.length<e;){const g=wS(i+l),O=this.hctsByHue[g],k=this.relativeTemperature(O),$=Math.abs(k-n);u+=$;const T=a.length*d;let _=u>=T,D=1;for(;_&&a.length<e;){a.push(O);const A=(a.length+D)*d;_=u>=A,D++}if(n=k,l++,l>360){for(;a.length<e;)a.push(O);break}}const p=[this.input],f=Math.floor((t-1)/2);for(let g=1;g<f+1;g++){let O=0-g;for(;O<0;)O=a.length+O;O>=a.length&&(O=O%a.length),p.splice(0,0,a[O])}const y=t-f-1;for(let g=1;g<y+1;g++){let O=g;for(;O<0;)O=a.length+O;O>=a.length&&(O=O%a.length),p.push(a[O])}return p}get complement(){if(this.complementCache!=null)return this.complementCache;const t=this.coldest.hue,e=this.tempsByHct.get(this.coldest),i=this.warmest.hue,r=this.tempsByHct.get(this.warmest)-e,n=tn.isBetween(this.input.hue,t,i),a=n?i:t,o=n?t:i,l=1;let d=1e3,u=this.hctsByHue[Math.round(this.input.hue)];const p=1-this.inputRelativeTemperature;for(let f=0;f<=360;f+=1){const y=Mi(a+l*f);if(!tn.isBetween(y,a,o))continue;const g=this.hctsByHue[Math.round(y)],O=(this.tempsByHct.get(g)-e)/r,k=Math.abs(p-O);k<d&&(d=k,u=g)}return this.complementCache=u,this.complementCache}relativeTemperature(t){const e=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),i=this.tempsByHct.get(t)-this.tempsByHct.get(this.coldest);return e===0?.5:i/e}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0?this.inputRelativeTemperatureCache:(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input),this.inputRelativeTemperatureCache)}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const t=this.hctsByHue.concat([this.input]),e=new Map;for(const i of t)e.set(i,tn.rawTemperature(i));return this.tempsByHctCache=e,e}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const t=[];for(let e=0;e<=360;e+=1){const i=zt.from(e,this.input.chroma,this.input.tone);t.push(i)}return this.hctsByHueCache=t,this.hctsByHueCache}static isBetween(t,e,i){return e<i?e<=t&&t<=i:e<=t||t<=i}static rawTemperature(t){const e=RL(t.toInt()),i=Mi(Math.atan2(e[2],e[1])*180/Math.PI),r=Math.sqrt(e[1]*e[1]+e[2]*e[2]);return-.5+.02*Math.pow(r,1.07)*Math.cos(Mi(i-50)*Math.PI/180)}},h(tn,"ka"),tn);c(UL,"TemperatureCache");let f9=UL;var kp;const HL=(kp=class{constructor(t,e,i,r){this.low=t,this.normal=e,this.medium=i,this.high=r}get(t){return t<=-1?this.low:t<0?Qh(this.low,this.normal,(t- -1)/1):t<.5?Qh(this.normal,this.medium,(t-0)/.5):t<1?Qh(this.medium,this.high,(t-.5)/.5):this.high}},h(kp,"Zy"),kp);c(HL,"ContrastCurve");let Ot=HL;var Sp;const YL=(Sp=class{constructor(t,e,i,r,n,a){this.roleA=t,this.roleB=e,this.delta=i,this.polarity=r,this.stayTogether=n,this.constraint=a,this.constraint=a??"exact"}},h(Sp,"Yy"),Sp);c(YL,"ToneDeltaPair");let Kt=YL;var I;(function(s){s[s.MONOCHROME=0]="MONOCHROME",s[s.NEUTRAL=1]="NEUTRAL",s[s.TONAL_SPOT=2]="TONAL_SPOT",s[s.VIBRANT=3]="VIBRANT",s[s.EXPRESSIVE=4]="EXPRESSIVE",s[s.FIDELITY=5]="FIDELITY",s[s.CONTENT=6]="CONTENT",s[s.RAINBOW=7]="RAINBOW",s[s.FRUIT_SALAD=8]="FRUIT_SALAD"})(I||(I={}));function so(s){return s.variant===I.FIDELITY||s.variant===I.CONTENT}h(so,"la");c(so,"isFidelity");function ce(s){return s.variant===I.MONOCHROME}h(ce,"Ft");c(ce,"isMonochrome");function GL(s,t,e,i){let r=e,n=zt.from(s,t,e);if(n.chroma<t){let a=n.chroma;for(;n.chroma<t;){r+=i?-1:1;const o=zt.from(s,t,r);if(a>o.chroma||Math.abs(o.chroma-t)<.4)break;const l=Math.abs(o.chroma-t),d=Math.abs(n.chroma-t);l<d&&(n=o),a=Math.max(a,o.chroma)}}return r}h(GL,"Wg");c(GL,"findDesiredChromaByTone");var Cp;const KL=(Cp=class{primaryPaletteKeyColor(){return F.fromPalette({name:"primary_palette_key_color",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.primaryPalette.keyColor.tone,"tone")})}secondaryPaletteKeyColor(){return F.fromPalette({name:"secondary_palette_key_color",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.secondaryPalette.keyColor.tone,"tone")})}tertiaryPaletteKeyColor(){return F.fromPalette({name:"tertiary_palette_key_color",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>t.tertiaryPalette.keyColor.tone,"tone")})}neutralPaletteKeyColor(){return F.fromPalette({name:"neutral_palette_key_color",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.neutralPalette.keyColor.tone,"tone")})}neutralVariantPaletteKeyColor(){return F.fromPalette({name:"neutral_variant_palette_key_color",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.neutralVariantPalette.keyColor.tone,"tone")})}errorPaletteKeyColor(){return F.fromPalette({name:"error_palette_key_color",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.errorPalette.keyColor.tone,"tone")})}background(){return F.fromPalette({name:"background",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:98,"tone"),isBackground:!0})}onBackground(){return F.fromPalette({name:"on_background",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:10,"tone"),background:c(t=>this.background(),"background"),contrastCurve:c(t=>new Ot(3,3,4.5,7),"contrastCurve")})}surface(){return F.fromPalette({name:"surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:98,"tone"),isBackground:!0})}surfaceDim(){return F.fromPalette({name:"surface_dim",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:new Ot(87,87,80,75).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceBright(){return F.fromPalette({name:"surface_bright",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(24,24,29,34).get(t.contrastLevel):98,"tone"),isBackground:!0})}surfaceContainerLowest(){return F.fromPalette({name:"surface_container_lowest",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(4,4,2,0).get(t.contrastLevel):100,"tone"),isBackground:!0})}surfaceContainerLow(){return F.fromPalette({name:"surface_container_low",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(10,10,11,12).get(t.contrastLevel):new Ot(96,96,96,95).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainer(){return F.fromPalette({name:"surface_container",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(12,12,16,20).get(t.contrastLevel):new Ot(94,94,92,90).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainerHigh(){return F.fromPalette({name:"surface_container_high",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(17,17,21,25).get(t.contrastLevel):new Ot(92,92,88,85).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainerHighest(){return F.fromPalette({name:"surface_container_highest",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(22,22,26,30).get(t.contrastLevel):new Ot(90,90,84,80).get(t.contrastLevel),"tone"),isBackground:!0})}onSurface(){return F.fromPalette({name:"on_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:10,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}surfaceVariant(){return F.fromPalette({name:"surface_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?30:90,"tone"),isBackground:!0})}onSurfaceVariant(){return F.fromPalette({name:"on_surface_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?80:30,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}inverseSurface(){return F.fromPalette({name:"inverse_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:20,"tone"),isBackground:!0})}inverseOnSurface(){return F.fromPalette({name:"inverse_on_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?20:95,"tone"),background:c(t=>this.inverseSurface(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}outline(){return F.fromPalette({name:"outline",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?60:50,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1.5,3,4.5,7),"contrastCurve")})}outlineVariant(){return F.fromPalette({name:"outline_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?30:80,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve")})}shadow(){return F.fromPalette({name:"shadow",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>0,"tone")})}scrim(){return F.fromPalette({name:"scrim",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>0,"tone")})}surfaceTint(){return F.fromPalette({name:"surface_tint",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0})}primary(){return F.fromPalette({name:"primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?100:0:t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryContainer(),this.primary(),10,"nearer",!1),"toneDeltaPair")})}primaryDim(){}onPrimary(){return F.fromPalette({name:"on_primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:90:t.isDark?20:100,"tone"),background:c(t=>this.primary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}primaryContainer(){return F.fromPalette({name:"primary_container",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>so(t)?t.sourceColorHct.tone:ce(t)?t.isDark?85:25:t.isDark?30:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryContainer(),this.primary(),10,"nearer",!1),"toneDeltaPair")})}onPrimaryContainer(){return F.fromPalette({name:"on_primary_container",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>so(t)?F.foregroundTone(this.primaryContainer().tone(t),4.5):ce(t)?t.isDark?0:100:t.isDark?90:30,"tone"),background:c(t=>this.primaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}inversePrimary(){return F.fromPalette({name:"inverse_primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.isDark?40:80,"tone"),background:c(t=>this.inverseSurface(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve")})}secondary(){return F.fromPalette({name:"secondary",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryContainer(),this.secondary(),10,"nearer",!1),"toneDeltaPair")})}secondaryDim(){}onSecondary(){return F.fromPalette({name:"on_secondary",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:100:t.isDark?20:100,"tone"),background:c(t=>this.secondary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}secondaryContainer(){return F.fromPalette({name:"secondary_container",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>{const e=t.isDark?30:90;return ce(t)?t.isDark?30:85:so(t)?GL(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryContainer(),this.secondary(),10,"nearer",!1),"toneDeltaPair")})}onSecondaryContainer(){return F.fromPalette({name:"on_secondary_container",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:10:so(t)?F.foregroundTone(this.secondaryContainer().tone(t),4.5):t.isDark?90:30,"tone"),background:c(t=>this.secondaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}tertiary(){return F.fromPalette({name:"tertiary",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:25:t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1),"toneDeltaPair")})}tertiaryDim(){}onTertiary(){return F.fromPalette({name:"on_tertiary",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:90:t.isDark?20:100,"tone"),background:c(t=>this.tertiary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}tertiaryContainer(){return F.fromPalette({name:"tertiary_container",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>{if(ce(t))return t.isDark?60:49;if(!so(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return bS.fixIfDisliked(e).tone},"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1),"toneDeltaPair")})}onTertiaryContainer(){return F.fromPalette({name:"on_tertiary_container",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?0:100:so(t)?F.foregroundTone(this.tertiaryContainer().tone(t),4.5):t.isDark?90:30,"tone"),background:c(t=>this.tertiaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}error(){return F.fromPalette({name:"error",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorContainer(),this.error(),10,"nearer",!1),"toneDeltaPair")})}errorDim(){}onError(){return F.fromPalette({name:"on_error",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?20:100,"tone"),background:c(t=>this.error(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}errorContainer(){return F.fromPalette({name:"error_container",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?30:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorContainer(),this.error(),10,"nearer",!1),"toneDeltaPair")})}onErrorContainer(){return F.fromPalette({name:"on_error_container",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:10:t.isDark?90:30,"tone"),background:c(t=>this.errorContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}primaryFixed(){return F.fromPalette({name:"primary_fixed",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?40:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}primaryFixedDim(){return F.fromPalette({name:"primary_fixed_dim",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?30:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onPrimaryFixed(){return F.fromPalette({name:"on_primary_fixed",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?100:10,"tone"),background:c(t=>this.primaryFixedDim(),"background"),secondBackground:c(t=>this.primaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onPrimaryFixedVariant(){return F.fromPalette({name:"on_primary_fixed_variant",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?90:30,"tone"),background:c(t=>this.primaryFixedDim(),"background"),secondBackground:c(t=>this.primaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}secondaryFixed(){return F.fromPalette({name:"secondary_fixed",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?80:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}secondaryFixedDim(){return F.fromPalette({name:"secondary_fixed_dim",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?70:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onSecondaryFixed(){return F.fromPalette({name:"on_secondary_fixed",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>10,"tone"),background:c(t=>this.secondaryFixedDim(),"background"),secondBackground:c(t=>this.secondaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onSecondaryFixedVariant(){return F.fromPalette({name:"on_secondary_fixed_variant",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?25:30,"tone"),background:c(t=>this.secondaryFixedDim(),"background"),secondBackground:c(t=>this.secondaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}tertiaryFixed(){return F.fromPalette({name:"tertiary_fixed",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?40:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}tertiaryFixedDim(){return F.fromPalette({name:"tertiary_fixed_dim",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?30:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onTertiaryFixed(){return F.fromPalette({name:"on_tertiary_fixed",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?100:10,"tone"),background:c(t=>this.tertiaryFixedDim(),"background"),secondBackground:c(t=>this.tertiaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onTertiaryFixedVariant(){return F.fromPalette({name:"on_tertiary_fixed_variant",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?90:30,"tone"),background:c(t=>this.tertiaryFixedDim(),"background"),secondBackground:c(t=>this.tertiaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}highestSurface(t){return t.isDark?this.surfaceBright():this.surfaceDim()}},h(Cp,"Xy"),Cp);c(KL,"ColorSpecDelegateImpl2021");let Wj=KL;function Vt(s,t=0,e=100,i=1){let r=t4(s.hue,s.chroma*i,100,!0);return Je(t,e,r)}h(Vt,"mt");c(Vt,"tMaxC");function Ls(s,t=0,e=100){let i=t4(s.hue,s.chroma,0,!1);return Je(t,e,i)}h(Ls,"vr");c(Ls,"tMinC");function t4(s,t,e,i){let r=e,n=zt.from(s,t,r);for(;n.chroma<t&&!(e<0||e>100);){e+=i?-1:1;const a=zt.from(s,t,e);n.chroma<a.chroma&&(n=a,r=e)}return r}h(t4,"Pm");c(t4,"findBestToneForChroma");function bt(s){return s===1.5?new Ot(1.5,1.5,3,5.5):s===3?new Ot(3,3,4.5,7):s===4.5?new Ot(4.5,4.5,7,11):s===6?new Ot(6,6,7,11):s===7?new Ot(7,7,11,21):s===9?new Ot(9,9,11,21):s===11?new Ot(11,11,21,21):s===21?new Ot(21,21,21,21):new Ot(s,s,7,21)}h(bt,"at");c(bt,"getCurve");var Pp;const JL=(Pp=class extends Wj{surface(){const t=F.fromPalette({name:"surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>(super.surface().tone(e),e.platform==="phone"?e.isDark?4:zt.isYellow(e.neutralPalette.hue)?99:e.variant===I.VIBRANT?97:98:0),"tone"),isBackground:!0});return Mt(super.surface(),"2025",t)}surfaceDim(){const t=F.fromPalette({name:"surface_dim",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?4:zt.isYellow(e.neutralPalette.hue)?90:e.variant===I.VIBRANT?85:87,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(!e.isDark){if(e.variant===I.NEUTRAL)return 2.5;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===I.VIBRANT)return 1.36}return 1},"chromaMultiplier")});return Mt(super.surfaceDim(),"2025",t)}surfaceBright(){const t=F.fromPalette({name:"surface_bright",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?18:zt.isYellow(e.neutralPalette.hue)?99:e.variant===I.VIBRANT?97:98,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.isDark){if(e.variant===I.NEUTRAL)return 2.5;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===I.VIBRANT)return 1.36}return 1},"chromaMultiplier")});return Mt(super.surfaceBright(),"2025",t)}surfaceContainerLowest(){const t=F.fromPalette({name:"surface_container_lowest",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?0:100,"tone"),isBackground:!0});return Mt(super.surfaceContainerLowest(),"2025",t)}surfaceContainerLow(){const t=F.fromPalette({name:"surface_container_low",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?6:zt.isYellow(e.neutralPalette.hue)?98:e.variant===I.VIBRANT?95:96:15,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.3;if(e.variant===I.TONAL_SPOT)return 1.25;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.3:1.15;if(e.variant===I.VIBRANT)return 1.08}return 1},"chromaMultiplier")});return Mt(super.surfaceContainerLow(),"2025",t)}surfaceContainer(){const t=F.fromPalette({name:"surface_container",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?9:zt.isYellow(e.neutralPalette.hue)?96:e.variant===I.VIBRANT?92:94:20,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.6;if(e.variant===I.TONAL_SPOT)return 1.4;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.6:1.3;if(e.variant===I.VIBRANT)return 1.15}return 1},"chromaMultiplier")});return Mt(super.surfaceContainer(),"2025",t)}surfaceContainerHigh(){const t=F.fromPalette({name:"surface_container_high",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?12:zt.isYellow(e.neutralPalette.hue)?94:e.variant===I.VIBRANT?90:92:25,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.9;if(e.variant===I.TONAL_SPOT)return 1.5;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.95:1.45;if(e.variant===I.VIBRANT)return 1.22}return 1},"chromaMultiplier")});return Mt(super.surfaceContainerHigh(),"2025",t)}surfaceContainerHighest(){const t=F.fromPalette({name:"surface_container_highest",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?15:zt.isYellow(e.neutralPalette.hue)?92:e.variant===I.VIBRANT?88:90,"tone"),isBackground:!0,chromaMultiplier:c(e=>e.variant===I.NEUTRAL?2.2:e.variant===I.TONAL_SPOT?1.7:e.variant===I.EXPRESSIVE?zt.isYellow(e.neutralPalette.hue)?2.3:1.6:e.variant===I.VIBRANT?1.29:1,"chromaMultiplier")});return Mt(super.surfaceContainerHighest(),"2025",t)}onSurface(){const t=F.fromPalette({name:"on_surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.variant===I.VIBRANT?Vt(e.neutralPalette,0,100,1.1):F.getInitialToneFromBackground(i=>i.platform==="phone"?this.highestSurface(i):this.surfaceContainerHigh())(e),"tone"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.isDark&&e.platform==="phone"?bt(11):bt(9),"contrastCurve")});return Mt(super.onSurface(),"2025",t)}onSurfaceVariant(){const t=F.fromPalette({name:"on_surface_variant",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?e.isDark?bt(6):bt(4.5):bt(7),"contrastCurve")});return Mt(super.onSurfaceVariant(),"2025",t)}outline(){const t=F.fromPalette({name:"outline",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(3):bt(4.5),"contrastCurve")});return Mt(super.outline(),"2025",t)}outlineVariant(){const t=F.fromPalette({name:"outline_variant",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(1.5):bt(3),"contrastCurve")});return Mt(super.outlineVariant(),"2025",t)}inverseSurface(){const t=F.fromPalette({name:"inverse_surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?98:4,"tone"),isBackground:!0});return Mt(super.inverseSurface(),"2025",t)}inverseOnSurface(){const t=F.fromPalette({name:"inverse_on_surface",palette:c(e=>e.neutralPalette,"palette"),background:c(e=>this.inverseSurface(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.inverseOnSurface(),"2025",t)}primary(){const t=F.fromPalette({name:"primary",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>e.variant===I.NEUTRAL?e.platform==="phone"?e.isDark?80:40:90:e.variant===I.TONAL_SPOT?e.platform==="phone"?e.isDark?80:Vt(e.primaryPalette):Vt(e.primaryPalette,0,90):e.variant===I.EXPRESSIVE?e.platform==="phone"?Vt(e.primaryPalette,0,zt.isYellow(e.primaryPalette.hue)?25:zt.isCyan(e.primaryPalette.hue)?88:98):Vt(e.primaryPalette):e.platform==="phone"?Vt(e.primaryPalette,0,zt.isCyan(e.primaryPalette.hue)?88:98):Vt(e.primaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.primary(),"2025",t)}primaryDim(){return F.fromPalette({name:"primary_dim",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.variant===I.NEUTRAL?85:t.variant===I.TONAL_SPOT?Vt(t.primaryPalette,0,90):Vt(t.primaryPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryDim(),this.primary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onPrimary(){const t=F.fromPalette({name:"on_primary",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.primary():this.primaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onPrimary(),"2025",t)}primaryContainer(){const t=F.fromPalette({name:"primary_container",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.variant===I.NEUTRAL?e.isDark?30:90:e.variant===I.TONAL_SPOT?e.isDark?Ls(e.primaryPalette,35,93):Vt(e.primaryPalette,0,90):e.variant===I.EXPRESSIVE?e.isDark?Vt(e.primaryPalette,30,93):Vt(e.primaryPalette,78,zt.isCyan(e.primaryPalette.hue)?88:90):e.isDark?Ls(e.primaryPalette,66,93):Vt(e.primaryPalette,66,zt.isCyan(e.primaryPalette.hue)?88:93),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="phone"?void 0:new Kt(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.primaryContainer(),"2025",t)}onPrimaryContainer(){const t=F.fromPalette({name:"on_primary_container",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onPrimaryContainer(),"2025",t)}primaryFixed(){const t=F.fromPalette({name:"primary_fixed",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.primaryFixed(),"2025",t)}primaryFixedDim(){const t=F.fromPalette({name:"primary_fixed_dim",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>this.primaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.primaryFixedDim(),"2025",t)}onPrimaryFixed(){const t=F.fromPalette({name:"on_primary_fixed",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onPrimaryFixed(),"2025",t)}onPrimaryFixedVariant(){const t=F.fromPalette({name:"on_primary_fixed_variant",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onPrimaryFixedVariant(),"2025",t)}inversePrimary(){const t=F.fromPalette({name:"inverse_primary",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>Vt(e.primaryPalette),"tone"),background:c(e=>this.inverseSurface(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.inversePrimary(),"2025",t)}secondary(){const t=F.fromPalette({name:"secondary",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.NEUTRAL?90:Vt(e.secondaryPalette,0,90):e.variant===I.NEUTRAL?e.isDark?Ls(e.secondaryPalette,0,98):Vt(e.secondaryPalette):e.variant===I.VIBRANT?Vt(e.secondaryPalette,0,e.isDark?90:98):e.isDark?80:Vt(e.secondaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.secondary(),"2025",t)}secondaryDim(){return F.fromPalette({name:"secondary_dim",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.variant===I.NEUTRAL?85:Vt(t.secondaryPalette,0,90),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onSecondary(){const t=F.fromPalette({name:"on_secondary",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.secondary():this.secondaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onSecondary(),"2025",t)}secondaryContainer(){const t=F.fromPalette({name:"secondary_container",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.variant===I.VIBRANT?e.isDark?Ls(e.secondaryPalette,30,40):Vt(e.secondaryPalette,84,90):e.variant===I.EXPRESSIVE?e.isDark?15:Vt(e.secondaryPalette,90,95):e.isDark?25:90,"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.secondaryContainer(),"2025",t)}onSecondaryContainer(){const t=F.fromPalette({name:"on_secondary_container",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onSecondaryContainer(),"2025",t)}secondaryFixed(){const t=F.fromPalette({name:"secondary_fixed",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.secondaryFixed(),"2025",t)}secondaryFixedDim(){const t=F.fromPalette({name:"secondary_fixed_dim",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>this.secondaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.secondaryFixedDim(),"2025",t)}onSecondaryFixed(){const t=F.fromPalette({name:"on_secondary_fixed",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onSecondaryFixed(),"2025",t)}onSecondaryFixedVariant(){const t=F.fromPalette({name:"on_secondary_fixed_variant",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onSecondaryFixedVariant(),"2025",t)}tertiary(){const t=F.fromPalette({name:"tertiary",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,90):Vt(e.tertiaryPalette):e.variant===I.EXPRESSIVE||e.variant===I.VIBRANT?Vt(e.tertiaryPalette,0,zt.isCyan(e.tertiaryPalette.hue)?88:e.isDark?98:100):e.isDark?Vt(e.tertiaryPalette,0,98):Vt(e.tertiaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.tertiary(),"2025",t)}tertiaryDim(){return F.fromPalette({name:"tertiary_dim",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>t.variant===I.TONAL_SPOT?Vt(t.tertiaryPalette,0,90):Vt(t.tertiaryPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onTertiary(){const t=F.fromPalette({name:"on_tertiary",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.tertiary():this.tertiaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onTertiary(),"2025",t)}tertiaryContainer(){const t=F.fromPalette({name:"tertiary_container",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,90):Vt(e.tertiaryPalette):e.variant===I.NEUTRAL?e.isDark?Vt(e.tertiaryPalette,0,93):Vt(e.tertiaryPalette,0,96):e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,e.isDark?93:100):e.variant===I.EXPRESSIVE?Vt(e.tertiaryPalette,75,zt.isCyan(e.tertiaryPalette.hue)?88:e.isDark?93:100):e.isDark?Vt(e.tertiaryPalette,0,93):Vt(e.tertiaryPalette,72,100),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.tertiaryContainer(),"2025",t)}onTertiaryContainer(){const t=F.fromPalette({name:"on_tertiary_container",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onTertiaryContainer(),"2025",t)}tertiaryFixed(){const t=F.fromPalette({name:"tertiary_fixed",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.tertiaryFixed(),"2025",t)}tertiaryFixedDim(){const t=F.fromPalette({name:"tertiary_fixed_dim",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>this.tertiaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.tertiaryFixedDim(),"2025",t)}onTertiaryFixed(){const t=F.fromPalette({name:"on_tertiary_fixed",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onTertiaryFixed(),"2025",t)}onTertiaryFixedVariant(){const t=F.fromPalette({name:"on_tertiary_fixed_variant",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onTertiaryFixedVariant(),"2025",t)}error(){const t=F.fromPalette({name:"error",palette:c(e=>e.errorPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?Ls(e.errorPalette,0,98):Vt(e.errorPalette):Ls(e.errorPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.error(),"2025",t)}errorDim(){return F.fromPalette({name:"error_dim",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>Ls(t.errorPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorDim(),this.error(),5,"darker",!0,"farther"),"toneDeltaPair")})}onError(){const t=F.fromPalette({name:"on_error",palette:c(e=>e.errorPalette,"palette"),background:c(e=>e.platform==="phone"?this.error():this.errorDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onError(),"2025",t)}errorContainer(){const t=F.fromPalette({name:"error_container",palette:c(e=>e.errorPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.isDark?Ls(e.errorPalette,30,93):Vt(e.errorPalette,0,90),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.errorContainer(),"2025",t)}onErrorContainer(){const t=F.fromPalette({name:"on_error_container",palette:c(e=>e.errorPalette,"palette"),background:c(e=>this.errorContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve")});return Mt(super.onErrorContainer(),"2025",t)}surfaceVariant(){const t=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return Mt(super.surfaceVariant(),"2025",t)}surfaceTint(){const t=Object.assign(this.primary().clone(),{name:"surface_tint"});return Mt(super.surfaceTint(),"2025",t)}background(){const t=Object.assign(this.surface().clone(),{name:"background"});return Mt(super.background(),"2025",t)}onBackground(){const t=Object.assign(this.onSurface().clone(),{name:"on_background",tone:c(e=>e.platform==="watch"?100:this.onSurface().getTone(e),"tone")});return Mt(super.onBackground(),"2025",t)}},h(Pp,"Jy"),Pp);c(JL,"ColorSpecDelegateImpl2025");let Fj=JL;var ot;const tz=(ot=class{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(t=>t!==void 0)}highestSurface(t){return ot.colorSpec.highestSurface(t)}primaryPaletteKeyColor(){return ot.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return ot.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return ot.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return ot.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return ot.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return ot.colorSpec.errorPaletteKeyColor()}background(){return ot.colorSpec.background()}onBackground(){return ot.colorSpec.onBackground()}surface(){return ot.colorSpec.surface()}surfaceDim(){return ot.colorSpec.surfaceDim()}surfaceBright(){return ot.colorSpec.surfaceBright()}surfaceContainerLowest(){return ot.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return ot.colorSpec.surfaceContainerLow()}surfaceContainer(){return ot.colorSpec.surfaceContainer()}surfaceContainerHigh(){return ot.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return ot.colorSpec.surfaceContainerHighest()}onSurface(){return ot.colorSpec.onSurface()}surfaceVariant(){return ot.colorSpec.surfaceVariant()}onSurfaceVariant(){return ot.colorSpec.onSurfaceVariant()}outline(){return ot.colorSpec.outline()}outlineVariant(){return ot.colorSpec.outlineVariant()}inverseSurface(){return ot.colorSpec.inverseSurface()}inverseOnSurface(){return ot.colorSpec.inverseOnSurface()}shadow(){return ot.colorSpec.shadow()}scrim(){return ot.colorSpec.scrim()}surfaceTint(){return ot.colorSpec.surfaceTint()}primary(){return ot.colorSpec.primary()}primaryDim(){return ot.colorSpec.primaryDim()}onPrimary(){return ot.colorSpec.onPrimary()}primaryContainer(){return ot.colorSpec.primaryContainer()}onPrimaryContainer(){return ot.colorSpec.onPrimaryContainer()}inversePrimary(){return ot.colorSpec.inversePrimary()}primaryFixed(){return ot.colorSpec.primaryFixed()}primaryFixedDim(){return ot.colorSpec.primaryFixedDim()}onPrimaryFixed(){return ot.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return ot.colorSpec.onPrimaryFixedVariant()}secondary(){return ot.colorSpec.secondary()}secondaryDim(){return ot.colorSpec.secondaryDim()}onSecondary(){return ot.colorSpec.onSecondary()}secondaryContainer(){return ot.colorSpec.secondaryContainer()}onSecondaryContainer(){return ot.colorSpec.onSecondaryContainer()}secondaryFixed(){return ot.colorSpec.secondaryFixed()}secondaryFixedDim(){return ot.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return ot.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return ot.colorSpec.onSecondaryFixedVariant()}tertiary(){return ot.colorSpec.tertiary()}tertiaryDim(){return ot.colorSpec.tertiaryDim()}onTertiary(){return ot.colorSpec.onTertiary()}tertiaryContainer(){return ot.colorSpec.tertiaryContainer()}onTertiaryContainer(){return ot.colorSpec.onTertiaryContainer()}tertiaryFixed(){return ot.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return ot.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return ot.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return ot.colorSpec.onTertiaryFixedVariant()}error(){return ot.colorSpec.error()}errorDim(){return ot.colorSpec.errorDim()}onError(){return ot.colorSpec.onError()}errorContainer(){return ot.colorSpec.errorContainer()}onErrorContainer(){return ot.colorSpec.onErrorContainer()}static highestSurface(t){return ot.colorSpec.highestSurface(t)}},h(ot,"G"),ot);c(tz,"MaterialDynamicColors");let N=tz;N.contentAccentToneDelta=15;N.colorSpec=new Fj;N.primaryPaletteKeyColor=N.colorSpec.primaryPaletteKeyColor();N.secondaryPaletteKeyColor=N.colorSpec.secondaryPaletteKeyColor();N.tertiaryPaletteKeyColor=N.colorSpec.tertiaryPaletteKeyColor();N.neutralPaletteKeyColor=N.colorSpec.neutralPaletteKeyColor();N.neutralVariantPaletteKeyColor=N.colorSpec.neutralVariantPaletteKeyColor();N.background=N.colorSpec.background();N.onBackground=N.colorSpec.onBackground();N.surface=N.colorSpec.surface();N.surfaceDim=N.colorSpec.surfaceDim();N.surfaceBright=N.colorSpec.surfaceBright();N.surfaceContainerLowest=N.colorSpec.surfaceContainerLowest();N.surfaceContainerLow=N.colorSpec.surfaceContainerLow();N.surfaceContainer=N.colorSpec.surfaceContainer();N.surfaceContainerHigh=N.colorSpec.surfaceContainerHigh();N.surfaceContainerHighest=N.colorSpec.surfaceContainerHighest();N.onSurface=N.colorSpec.onSurface();N.surfaceVariant=N.colorSpec.surfaceVariant();N.onSurfaceVariant=N.colorSpec.onSurfaceVariant();N.inverseSurface=N.colorSpec.inverseSurface();N.inverseOnSurface=N.colorSpec.inverseOnSurface();N.outline=N.colorSpec.outline();N.outlineVariant=N.colorSpec.outlineVariant();N.shadow=N.colorSpec.shadow();N.scrim=N.colorSpec.scrim();N.surfaceTint=N.colorSpec.surfaceTint();N.primary=N.colorSpec.primary();N.onPrimary=N.colorSpec.onPrimary();N.primaryContainer=N.colorSpec.primaryContainer();N.onPrimaryContainer=N.colorSpec.onPrimaryContainer();N.inversePrimary=N.colorSpec.inversePrimary();N.secondary=N.colorSpec.secondary();N.onSecondary=N.colorSpec.onSecondary();N.secondaryContainer=N.colorSpec.secondaryContainer();N.onSecondaryContainer=N.colorSpec.onSecondaryContainer();N.tertiary=N.colorSpec.tertiary();N.onTertiary=N.colorSpec.onTertiary();N.tertiaryContainer=N.colorSpec.tertiaryContainer();N.onTertiaryContainer=N.colorSpec.onTertiaryContainer();N.error=N.colorSpec.error();N.onError=N.colorSpec.onError();N.errorContainer=N.colorSpec.errorContainer();N.onErrorContainer=N.colorSpec.onErrorContainer();N.primaryFixed=N.colorSpec.primaryFixed();N.primaryFixedDim=N.colorSpec.primaryFixedDim();N.onPrimaryFixed=N.colorSpec.onPrimaryFixed();N.onPrimaryFixedVariant=N.colorSpec.onPrimaryFixedVariant();N.secondaryFixed=N.colorSpec.secondaryFixed();N.secondaryFixedDim=N.colorSpec.secondaryFixedDim();N.onSecondaryFixed=N.colorSpec.onSecondaryFixed();N.onSecondaryFixedVariant=N.colorSpec.onSecondaryFixedVariant();N.tertiaryFixed=N.colorSpec.tertiaryFixed();N.tertiaryFixedDim=N.colorSpec.tertiaryFixedDim();N.onTertiaryFixed=N.colorSpec.onTertiaryFixed();N.onTertiaryFixedVariant=N.colorSpec.onTertiaryFixedVariant();var da;const ez=(da=class{static maybeFallbackSpecVersion(t,e){switch(e){case I.EXPRESSIVE:case I.VIBRANT:case I.TONAL_SPOT:case I.NEUTRAL:return t;default:return"2021"}}constructor(t){this.sourceColorArgb=t.sourceColorHct.toInt(),this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.platform=t.platform??"phone",this.specVersion=da.maybeFallbackSpecVersion(t.specVersion??"2021",this.variant),this.sourceColorHct=t.sourceColorHct,this.primaryPalette=t.primaryPalette??no(this.specVersion).getPrimaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=t.secondaryPalette??no(this.specVersion).getSecondaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=t.tertiaryPalette??no(this.specVersion).getTertiaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=t.neutralPalette??no(this.specVersion).getNeutralPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=t.neutralVariantPalette??no(this.specVersion).getNeutralVariantPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=t.errorPalette??no(this.specVersion).getErrorPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??G.fromHueAndChroma(25,84),this.colors=new N}toString(){return`Scheme: variant=${I[this.variant]}, mode=${this.isDark?"dark":"light"}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(t,e,i){const r=Math.min(e.length-1,i.length),n=t.hue;for(let a=0;a<r;a++)if(n>=e[a]&&n<e[a+1])return Mi(i[a]);return n}static getRotatedHue(t,e,i){let r=da.getPiecewiseHue(t,e,i);return Math.min(e.length-1,i.length)<=0&&(r=0),Mi(t.hue+r)}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(this.colors.primaryPaletteKeyColor())}get secondaryPaletteKeyColor(){return this.getArgb(this.colors.secondaryPaletteKeyColor())}get tertiaryPaletteKeyColor(){return this.getArgb(this.colors.tertiaryPaletteKeyColor())}get neutralPaletteKeyColor(){return this.getArgb(this.colors.neutralPaletteKeyColor())}get neutralVariantPaletteKeyColor(){return this.getArgb(this.colors.neutralVariantPaletteKeyColor())}get errorPaletteKeyColor(){return this.getArgb(this.colors.errorPaletteKeyColor())}get background(){return this.getArgb(this.colors.background())}get onBackground(){return this.getArgb(this.colors.onBackground())}get surface(){return this.getArgb(this.colors.surface())}get surfaceDim(){return this.getArgb(this.colors.surfaceDim())}get surfaceBright(){return this.getArgb(this.colors.surfaceBright())}get surfaceContainerLowest(){return this.getArgb(this.colors.surfaceContainerLowest())}get surfaceContainerLow(){return this.getArgb(this.colors.surfaceContainerLow())}get surfaceContainer(){return this.getArgb(this.colors.surfaceContainer())}get surfaceContainerHigh(){return this.getArgb(this.colors.surfaceContainerHigh())}get surfaceContainerHighest(){return this.getArgb(this.colors.surfaceContainerHighest())}get onSurface(){return this.getArgb(this.colors.onSurface())}get surfaceVariant(){return this.getArgb(this.colors.surfaceVariant())}get onSurfaceVariant(){return this.getArgb(this.colors.onSurfaceVariant())}get inverseSurface(){return this.getArgb(this.colors.inverseSurface())}get inverseOnSurface(){return this.getArgb(this.colors.inverseOnSurface())}get outline(){return this.getArgb(this.colors.outline())}get outlineVariant(){return this.getArgb(this.colors.outlineVariant())}get shadow(){return this.getArgb(this.colors.shadow())}get scrim(){return this.getArgb(this.colors.scrim())}get surfaceTint(){return this.getArgb(this.colors.surfaceTint())}get primary(){return this.getArgb(this.colors.primary())}get primaryDim(){const t=this.colors.primaryDim();if(t===void 0)throw new Error("`primaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onPrimary(){return this.getArgb(this.colors.onPrimary())}get primaryContainer(){return this.getArgb(this.colors.primaryContainer())}get onPrimaryContainer(){return this.getArgb(this.colors.onPrimaryContainer())}get primaryFixed(){return this.getArgb(this.colors.primaryFixed())}get primaryFixedDim(){return this.getArgb(this.colors.primaryFixedDim())}get onPrimaryFixed(){return this.getArgb(this.colors.onPrimaryFixed())}get onPrimaryFixedVariant(){return this.getArgb(this.colors.onPrimaryFixedVariant())}get inversePrimary(){return this.getArgb(this.colors.inversePrimary())}get secondary(){return this.getArgb(this.colors.secondary())}get secondaryDim(){const t=this.colors.secondaryDim();if(t===void 0)throw new Error("`secondaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onSecondary(){return this.getArgb(this.colors.onSecondary())}get secondaryContainer(){return this.getArgb(this.colors.secondaryContainer())}get onSecondaryContainer(){return this.getArgb(this.colors.onSecondaryContainer())}get secondaryFixed(){return this.getArgb(this.colors.secondaryFixed())}get secondaryFixedDim(){return this.getArgb(this.colors.secondaryFixedDim())}get onSecondaryFixed(){return this.getArgb(this.colors.onSecondaryFixed())}get onSecondaryFixedVariant(){return this.getArgb(this.colors.onSecondaryFixedVariant())}get tertiary(){return this.getArgb(this.colors.tertiary())}get tertiaryDim(){const t=this.colors.tertiaryDim();if(t===void 0)throw new Error("`tertiaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onTertiary(){return this.getArgb(this.colors.onTertiary())}get tertiaryContainer(){return this.getArgb(this.colors.tertiaryContainer())}get onTertiaryContainer(){return this.getArgb(this.colors.onTertiaryContainer())}get tertiaryFixed(){return this.getArgb(this.colors.tertiaryFixed())}get tertiaryFixedDim(){return this.getArgb(this.colors.tertiaryFixedDim())}get onTertiaryFixed(){return this.getArgb(this.colors.onTertiaryFixed())}get onTertiaryFixedVariant(){return this.getArgb(this.colors.onTertiaryFixedVariant())}get error(){return this.getArgb(this.colors.error())}get errorDim(){const t=this.colors.errorDim();if(t===void 0)throw new Error("`errorDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onError(){return this.getArgb(this.colors.onError())}get errorContainer(){return this.getArgb(this.colors.errorContainer())}get onErrorContainer(){return this.getArgb(this.colors.onErrorContainer())}},h(da,"wl"),da);c(ez,"DynamicScheme");let vi=ez;vi.DEFAULT_SPEC_VERSION="2021";vi.DEFAULT_PLATFORM="phone";var Qp;const iz=(Qp=class{getPrimaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma);case I.FRUIT_SALAD:return G.fromHueAndChroma(Mi(e.hue-50),48);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,12);case I.RAINBOW:return G.fromHueAndChroma(e.hue,48);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,36);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+240),40);case I.VIBRANT:return G.fromHueAndChroma(e.hue,200);default:throw new Error(`Unsupported variant: ${t}`)}}getSecondaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,Math.max(e.chroma-32,e.chroma*.5));case I.FRUIT_SALAD:return G.fromHueAndChroma(Mi(e.hue-50),36);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,8);case I.RAINBOW:return G.fromHueAndChroma(e.hue,16);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,16);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[45,95,45,20,45,90,45,45,45]),24);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[18,15,10,12,15,18,15,12,12]),24);default:throw new Error(`Unsupported variant: ${t}`)}}getTertiaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:return G.fromHct(bS.fixIfDisliked(new f9(e).analogous(3,6)[2]));case I.FIDELITY:return G.fromHct(bS.fixIfDisliked(new f9(e).complement));case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,36);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,16);case I.RAINBOW:case I.TONAL_SPOT:return G.fromHueAndChroma(Mi(e.hue+60),24);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[120,120,20,45,20,15,20,120,120]),32);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[35,30,20,25,30,35,30,25,25]),32);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma/8);case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,10);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,2);case I.RAINBOW:return G.fromHueAndChroma(e.hue,0);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,6);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+15),8);case I.VIBRANT:return G.fromHueAndChroma(e.hue,10);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralVariantPalette(t,e,i,r,n){switch(t){case I.CONTENT:return G.fromHueAndChroma(e.hue,e.chroma/8+4);case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma/8+4);case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,16);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,2);case I.RAINBOW:return G.fromHueAndChroma(e.hue,0);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,8);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+15),12);case I.VIBRANT:return G.fromHueAndChroma(e.hue,12);default:throw new Error(`Unsupported variant: ${t}`)}}getErrorPalette(t,e,i,r,n){}},h(Qp,"tw"),Qp);c(iz,"DynamicSchemePalettesDelegateImpl2021");let rz=iz;var wi;const sz=(wi=class extends rz{getPrimaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?zt.isBlue(e.hue)?12:8:zt.isBlue(e.hue)?16:12);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,r==="phone"&&i?26:32);case I.EXPRESSIVE:return G.fromHueAndChroma(e.hue,r==="phone"?i?36:48:40);case I.VIBRANT:return G.fromHueAndChroma(e.hue,r==="phone"?74:56);default:return super.getPrimaryPalette(t,e,i,r,n)}}getSecondaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?zt.isBlue(e.hue)?6:4:zt.isBlue(e.hue)?10:6);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,16);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-160,155,-100,96,-96,-156,-165,-160]),r==="phone"&&i?16:24);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,105,140,333,360],[-14,10,-14,10,-14]),r==="phone"?56:36);default:return super.getSecondaryPalette(t,e,i,r,n)}}getTertiaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,105,161,204,278,333,360],[-32,26,10,-39,24,-15,-32]),r==="phone"?20:36);case I.TONAL_SPOT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,20,71,161,333,360],[-40,48,-32,40,-32]),r==="phone"?28:32);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-165,160,-105,101,-101,-160,-170,-165]),48);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,71,105,140,161,253,333,360],[-72,35,24,-24,62,50,62,-72]),56);default:return super.getTertiaryPalette(t,e,i,r,n)}}static getExpressiveNeutralHue(t){return vi.getRotatedHue(t,[0,71,124,253,278,300,360],[10,0,10,0,10,0])}static getExpressiveNeutralChroma(t,e,i){const r=wi.getExpressiveNeutralHue(t);return i==="phone"?e?zt.isYellow(r)?6:14:18:12}static getVibrantNeutralHue(t){return vi.getRotatedHue(t,[0,38,105,140,333,360],[-14,10,-14,10,-14])}static getVibrantNeutralChroma(t,e){const i=wi.getVibrantNeutralHue(t);return e==="phone"||zt.isBlue(i)?28:20}getNeutralPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?1.4:6);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,r==="phone"?5:10);case I.EXPRESSIVE:return G.fromHueAndChroma(wi.getExpressiveNeutralHue(e),wi.getExpressiveNeutralChroma(e,i,r));case I.VIBRANT:return G.fromHueAndChroma(wi.getVibrantNeutralHue(e),wi.getVibrantNeutralChroma(e,r));default:return super.getNeutralPalette(t,e,i,r,n)}}getNeutralVariantPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,(r==="phone"?1.4:6)*2.2);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,(r==="phone"?5:10)*1.7);case I.EXPRESSIVE:const a=wi.getExpressiveNeutralHue(e),o=wi.getExpressiveNeutralChroma(e,i,r);return G.fromHueAndChroma(a,o*(a>=105&&a<125?1.6:2.3));case I.VIBRANT:const l=wi.getVibrantNeutralHue(e),d=wi.getVibrantNeutralChroma(e,r);return G.fromHueAndChroma(l,d*1.29);default:return super.getNeutralVariantPalette(t,e,i,r,n)}}getErrorPalette(t,e,i,r,n){const a=vi.getPiecewiseHue(e,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(t){case I.NEUTRAL:return G.fromHueAndChroma(a,r==="phone"?50:40);case I.TONAL_SPOT:return G.fromHueAndChroma(a,r==="phone"?60:48);case I.EXPRESSIVE:return G.fromHueAndChroma(a,r==="phone"?64:48);case I.VIBRANT:return G.fromHueAndChroma(a,r==="phone"?80:60);default:return super.getErrorPalette(t,e,i,r,n)}}},h(wi,"Xe"),wi);c(sz,"DynamicSchemePalettesDelegateImpl2025");let qj=sz;const Zj=new rz,Nj=new qj;function no(s){return s==="2025"?Nj:Zj}h(no,"da");c(no,"getSpec");function nz(s){s=s.replace("#","");const t=s.length===3,e=s.length===6,i=s.length===8;if(!t&&!e&&!i)throw new Error("unexpected hex "+s);let r=0,n=0,a=0;return t?(r=es(s.slice(0,1).repeat(2)),n=es(s.slice(1,2).repeat(2)),a=es(s.slice(2,3).repeat(2))):e?(r=es(s.slice(0,2)),n=es(s.slice(2,4)),a=es(s.slice(4,6))):i&&(r=es(s.slice(2,4)),n=es(s.slice(4,6)),a=es(s.slice(6,8))),(255<<24|(r&255)<<16|(n&255)<<8|a&255)>>>0}h(nz,"Gg");c(nz,"argbFromHex");function es(s){return parseInt(s,16)}h(es,"Ni");c(es,"parseIntHex");function az(s,t=!1){const e=s.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)$/)?.slice(1).map((o,l)=>l===3?Math.round(parseFloat(o)*255):parseFloat(o));if(!e)throw new Error("Could not parse rgba color.");const[i,r,n,a]=e;return((t?255:a&255)<<24|(i&255)<<16|(r&255)<<8|n&255)>>>0}h(az,"Zg");c(az,"argbFromRgba");function Rr(s,t){return Math.round(255*t)<<24|s&16777215}h(Rr,"$i");c(Rr,"addAlphaToArgb");function oz(s){const t=xb(s),e=kb(s),i=Sb(s),r=TL(s),n=[t.toString(16),e.toString(16),i.toString(16)];r!==255&&n.push(r.toString(16));for(const[a,o]of n.entries())o.length===1&&(n[a]="0"+o);return"#"+n.join("")}h(oz,"Yg");c(oz,"hexWithAlphaFromArgb");function lz(s){Pe();const t=document.createElement("wy-compute-styles");t.setAttribute("style",`color: ${s} !important;`),document.documentElement.append(t);const e=window.getComputedStyle(t).color;return t.remove(),e}h(lz,"Xg");c(lz,"getComputedColor");var Tp;const cz=(Tp=class extends vi{constructor(t,e,i,r=I.FIDELITY){const n=t.chroma,a=Math.min(36,t.chroma*16/36),o=a,l=Math.min(6,t.chroma*6/36),d=Math.min(8,t.chroma*8/36);super({sourceColorHct:t,variant:r,contrastLevel:i,isDark:e,primaryPalette:G.fromHueAndChroma(t.hue,n),secondaryPalette:G.fromHueAndChroma(t.hue,a),tertiaryPalette:G.fromHueAndChroma(Mi(t.hue-6*22.5),o),neutralPalette:G.fromHueAndChroma(t.hue,l),neutralVariantPalette:G.fromHueAndChroma(t.hue,d)}),this.allTones={98:98,95:95,90:90,80:80,70:70,60:60,50:50,40:40,30:30,20:20,10:10},this.namedColorToneMap={red:{light:60,dark:60},"deep-orange":{light:60,dark:60},orange:{light:70,dark:70},amber:{light:70,dark:70},yellow:{light:70,dark:80},lime:{light:70,dark:70},"light-green":{light:70,dark:70},green:{light:60,dark:60},teal:{light:60,dark:60},cyan:{light:50,dark:60},"light-blue":{light:60,dark:70},blue:{light:70,dark:80},indigo:{light:60,dark:60},"deep-purple":{light:60,dark:70},purple:{light:60,dark:70},pink:{light:60,dark:70},gray:{light:50,dark:60}};const u=t.hue,p=t.chroma,f=Math.max(48,p),y=Math.min(f,84),g=360/16,O=27.4,k=-8,$=(u+360-O-k+g/2)%g+O+k-g/2;this.errorPalette=G.fromHueAndChroma($,84),this.warningPalette=G.fromHueAndChroma($+4*g,y),this.namedColorPalettes={red:G.fromHueAndChroma($,y),"deep-orange":G.fromHueAndChroma($+1*g,y),orange:G.fromHueAndChroma($+2*g,y),amber:G.fromHueAndChroma($+3*g,y),yellow:G.fromHueAndChroma($+4*g,y),lime:G.fromHueAndChroma($+5*g,y),"light-green":G.fromHueAndChroma($+6*g,y),green:G.fromHueAndChroma($+7*g,y),teal:G.fromHueAndChroma($+8*g,y),cyan:G.fromHueAndChroma($+9*g,y),"light-blue":G.fromHueAndChroma($+10*g,y),blue:G.fromHueAndChroma($+11*g,y),indigo:G.fromHueAndChroma($+12*g,y),"deep-purple":G.fromHueAndChroma($+13*g,y),purple:G.fromHueAndChroma($+14*g,y),pink:G.fromHueAndChroma($+15*g,y),gray:G.fromHueAndChroma(u,4)}}get black(){return 0}get white(){return 16777215}get surfaceLayerLowest(){return this.isDark?Rr(this.black,.5):Rr(this.white,.75)}get surfaceLayerLow(){return this.isDark?Rr(this.black,.25):Rr(this.white,.5)}get surfaceLayer(){return this.isDark?Rr(this.white,.05):Rr(this.black,.05)}get surfaceLayerHigh(){return this.isDark?Rr(this.white,.1):Rr(this.black,.075)}get surfaceLayerHighest(){return this.isDark?Rr(this.white,.15):Rr(this.black,.1)}get warning(){return this.warningPalette.tone(this.isDark?90:70)}get onWarning(){return this.warningPalette.tone(this.isDark?30:0)}get warningContainer(){return this.warningPalette.tone(this.isDark?50:90)}get onWarningContainer(){return this.warningPalette.tone(this.isDark?95:10)}get highlight(){return this.primaryPalette.tone(this.isDark?20:95)}get onHighlight(){return this.primaryPalette.tone(this.isDark?90:10)}namedColor(t){return this.namedColorPalettes[t].tone(this.namedColorToneMap[t][this.isDark?"dark":"light"])}get red(){return this.namedColor("red")}get deepOrange(){return this.namedColor("deep-orange")}get orange(){return this.namedColor("orange")}get amber(){return this.namedColor("amber")}get yellow(){return this.namedColor("yellow")}get lime(){return this.namedColor("lime")}get lightGreen(){return this.namedColor("light-green")}get green(){return this.namedColor("green")}get teal(){return this.namedColor("teal")}get cyan(){return this.namedColor("cyan")}get lightBlue(){return this.namedColor("light-blue")}get blue(){return this.namedColor("blue")}get indigo(){return this.namedColor("indigo")}get deepPurple(){return this.namedColor("deep-purple")}get purple(){return this.namedColor("purple")}get pink(){return this.namedColor("pink")}get gray(){return this.namedColor("gray")}},h(Tp,"ew"),Tp);c(cz,"SchemeWeavy");let m9=cz;function y0(s){return getComputedStyle(s).getPropertyValue("--wy-theme-color")||void 0}h(y0,"xp");c(y0,"getCSSThemeColor");function hz(s,t){let e=y0(s);const i=new MutationObserver(()=>{const a=y0(s);a!==e&&(e=a,t(a))}),r={attributes:!0,attributeFilter:["class","style"]};let n=s;for(;n&&n!==document;)i.observe(n,r),n=n.parentNode;return()=>i.disconnect()}h(hz,"Jg");c(hz,"observeCSSThemeColor");function g0(){return Pe(),Array.from(document.head.querySelectorAll("meta[name='theme-color']")).filter(s=>{const t=s.getAttribute("media");return!t||window.matchMedia(t)?.matches}).pop()?.getAttribute("content")||void 0}h(g0,"Cp");c(g0,"getMetaThemeColor");function dz(s){Pe();const t=Array.from(document.head.querySelectorAll("meta[name='theme-color']"));if(!t)return()=>{};let e=g0();const i=c(()=>{const o=g0();o!==e&&(e=o,s(o))},"checkChangedColor"),r=new MutationObserver(i),n={attributes:!0,attributeFilter:["content"]},a=[];return t.forEach(o=>{r.observe(o,n);const l=o.getAttribute("media");if(l){const d=window.matchMedia(l);d.addEventListener("change",i),a.push(d)}}),()=>{r.disconnect(),a.forEach(o=>o.removeEventListener("change",i))}}h(dz,"t0");c(dz,"observeMetaThemeColor");const Sg=[],Bj=16;function uz(s,t=!1){if(Sg.some(l=>l.seedColor===s)){const l=Sg.find(d=>d.seedColor===s)?.colors;if(l)return l}const e=[];t&&e.push(`--wy-theme-color:${s};`);let i=s;!s.startsWith("#")&&!s.startsWith("rgb")&&(i=lz(s));const r=s.startsWith("#")?nz(i):az(i),n=zt.fromInt(r),a={light:new m9(n,!1,0,I.FIDELITY),dark:new m9(n,!0,0,I.FIDELITY)},o={primary:"primary",onPrimary:"on-primary",primaryContainer:"primary-container",onPrimaryContainer:"on-primary-container",secondary:"secondary",onSecondary:"on-secondary",secondaryContainer:"secondary-container",onSecondaryContainer:"on-secondary-container",tertiary:"tertiary",onTertiary:"on-tertiary",tertiaryContainer:"tertiary-container",onTertiaryContainer:"on-tertiary-container",error:"error",onError:"on-error",errorContainer:"error-container",onErrorContainer:"on-error-container",background:"background",onBackground:"on-background",surface:"surface",onSurface:"on-surface",surfaceVariant:"surface-variant",onSurfaceVariant:"on-surface-variant",surfaceContainerLowest:"surface-container-lowest",surfaceContainerLow:"surface-container-low",surfaceContainer:"surface-container",surfaceContainerHigh:"surface-container-high",surfaceContainerHighest:"surface-container-highest",outline:"outline",outlineVariant:"outline-variant",shadow:"shadow",scrim:"scrim",surfaceLayerLowest:"surface-layer-lowest",surfaceLayerLow:"surface-layer-low",surfaceLayer:"surface-layer",surfaceLayerHigh:"surface-layer-high",surfaceLayerHighest:"surface-layer-highest",warning:"warning",onWarning:"on-warning",warningContainer:"warning-container",onWarningContainer:"on-warning-container",highlight:"highlight",onHighlight:"on-highlight",red:"red",deepOrange:"deep-orange",orange:"orange",amber:"amber",yellow:"yellow",lime:"lime",lightGreen:"light-green",green:"green",teal:"teal",cyan:"cyan",lightBlue:"light-blue",blue:"blue",indigo:"indigo",deepPurple:"deep-purple",purple:"purple",pink:"pink",gray:"gray"};for(const l in a){const d=a[l];for(const u in o){const p=o[u],f=oz(d[u]);e.push(`--wy-${p}-${l}:${f};`)}}return Sg.unshift({seedColor:s,colors:e}),Sg.length=Math.min(Sg.length,Bj),e}h(uz,"i0");c(uz,"generateThemeColors");const Xj=c(s=>{if(Pe(),yb)document.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of s){const e=document.createElement("style"),i=global.litNonce;i!==void 0&&e.setAttribute("nonce",i),e.textContent=t.cssText,(document.head||document.documentElement).appendChild(e)}},"adoptGlobalStyles"),De=it`@property --wy-color-scheme{syntax:\"normal | light | dark\";inherits:true;initial-value:normal}:is(.wy-light,[part~=wy-light]) :where(wy-chat),:is(.wy-light,[part~=wy-light]) :where(wy-comments),:is(.wy-light,[part~=wy-light]) :where(wy-component),:is(.wy-light,[part~=wy-light]) :where(wy-copilot),:is(.wy-light,[part~=wy-light]) :where(wy-files),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-badge),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-button),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-conversation),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-new),:is(.wy-light,[part~=wy-light]) :where(wy-messenger),:is(.wy-light,[part~=wy-light]) :where(wy-notification-badge),:is(.wy-light,[part~=wy-light]) :where(wy-notification-button),:is(.wy-light,[part~=wy-light]) :where(wy-notification-toasts),:is(.wy-light,[part~=wy-light]) :where(wy-notifications),:is(.wy-light,[part~=wy-light]) :where(wy-posts),:host(:is(.wy-light,[part~=wy-light])),:host :is(.wy-light,[part~=wy-light]),::slotted(:is(.wy-light,[part~=wy-light])){color-scheme:light;--wy-primary:var(--wy-primary-light, #2f628c);--wy-on-primary:var(--wy-on-primary-light, #ffffff);--wy-primary-container:var(--wy-primary-container-light, #cee5ff);--wy-on-primary-container:var(--wy-on-primary-container-light, #0d4a73);--wy-secondary:var(--wy-secondary-light, #51606f);--wy-on-secondary:var(--wy-on-secondary-light, #ffffff);--wy-secondary-container:var(--wy-secondary-container-light, #d5e4f7);--wy-on-secondary-container:var(--wy-on-secondary-container-light, #3a4857);--wy-tertiary:var(--wy-tertiary-light, #645f41);--wy-on-tertiary:var(--wy-on-tertiary-light, #ffffff);--wy-tertiary-container:var(--wy-tertiary-container-light, #ebe3bd);--wy-on-tertiary-container:var(--wy-on-tertiary-container-light, #4c472b);--wy-error:var(--wy-error-light, #ba1821);--wy-on-error:var(--wy-on-error-light, #ffffff);--wy-error-container:var(--wy-error-container-light, #ffdad6);--wy-on-error-container:var(--wy-on-error-container-light, #930012);--wy-background:var(--wy-background-light, #f7f9ff);--wy-on-background:var(--wy-on-background-light, #181c20);--wy-surface:var(--wy-surface-light, #f7f9ff);--wy-on-surface:var(--wy-on-surface-light, #181c20);--wy-surface-variant:var(--wy-surface-variant-light, #dee3eb);--wy-on-surface-variant:var(--wy-on-surface-variant-light, #42474e);--wy-outline:var(--wy-outline-light, #72777f);--wy-outline-variant:var(--wy-outline-variant-light, #c2c7cf);--wy-surface-container-highest:var(--wy-surface-container-highest-light, #e0e2e8);--wy-surface-container-high:var(--wy-surface-container-high-light, #e6e8ee);--wy-surface-container:var(--wy-surface-container-light, #eceef3);--wy-surface-container-low:var(--wy-surface-container-low-light, #f1f3f9);--wy-surface-container-lowest:var(--wy-surface-container-lowest-light, #ffffff);--wy-surface-layer-highest:var(--wy-surface-layer-highest-light, rgba(0, 0, 0, .1019607843));--wy-surface-layer-high:var(--wy-surface-layer-high-light, rgba(0, 0, 0, .0745098039));--wy-surface-layer:var(--wy-surface-layer-light, rgba(0, 0, 0, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-light, rgba(255, 255, 255, .5019607843));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-light, rgba(255, 255, 255, .7490196078));--wy-warning:var(--wy-warning-light, #adb140);--wy-on-warning:var(--wy-on-warning-light, #000000);--wy-warning-container:var(--wy-warning-container-light, #e5e972);--wy-on-warning-container:var(--wy-on-warning-container-light, #1c1d00);--wy-highlight:var(--wy-highlight-light, #e8f2ff);--wy-on-highlight:var(--wy-on-highlight-light, #001d32);--wy-link:var(--wy-primary-light, #2f628c);--wy-presence-active:var(--wy-green-light, #00a38d);--wy-shade:var(--wy-shade-light, rgba(0, 0, 0, .3));--wy-shade-invert:var(--wy-shade-invert-light, rgba(255, 255, 255, .15));--wy-shade-opaque:var(--wy-shade-opaque-light, white);--wy-blue:var(--wy-blue-light, #8aa9fc);--wy-indigo:var(--wy-indigo-light, #9285de);--wy-purple:var(--wy-purple-light, #c675b6);--wy-pink:var(--wy-pink-light, #d57193);--wy-red:var(--wy-red-light, #db726b);--wy-orange:var(--wy-orange-light, #e79b3a);--wy-yellow:var(--wy-yellow-light, #adb140);--wy-green:var(--wy-green-light, #00a38d);--wy-teal:var(--wy-teal-light, #00a0a9);--wy-cyan:var(--wy-cyan-light, #0081a2);--wy-gray:var(--wy-gray-light, #76777a);--wy-code-text:var(--wy-code-text-light, #3b3b3b);--wy-code-variable:var(--wy-code-variable-light, #001080);--wy-code-operator:var(--wy-code-operator-light, #000000);--wy-code-prolog:var(--wy-code-prolog-light, #000080);--wy-code-comment:var(--wy-code-comment-light, #008000);--wy-code-builtin:var(--wy-code-builtin-light, #0070C1);--wy-code-number:var(--wy-code-number-light, #098658);--wy-code-inserted:var(--wy-code-inserted-light, #098658);--wy-code-constant:var(--wy-code-constant-light, #811F3F);--wy-code-hexcode:var(--wy-code-hexcode-light, #811F3F);--wy-code-regex:var(--wy-code-regex-light, #811F3F);--wy-code-char:var(--wy-code-char-light, #811F3F);--wy-code-tag:var(--wy-code-tag-light, #800000);--wy-code-attr-name:var(--wy-code-attr-name-light, #E50000);--wy-code-selector:var(--wy-code-selector-light, #E50000);--wy-code-property:var(--wy-code-property-light, #E50000);--wy-code-deleted:var(--wy-code-deleted-light, #A31515);--wy-code-string:var(--wy-code-string-light, #A31515);--wy-code-changed:var(--wy-code-changed-light, #0451A5);--wy-code-punctuation:var(--wy-code-punctuation-light, #000000);--wy-code-function:var(--wy-code-function-light, #0000FF);--wy-code-keyword:var(--wy-code-keyword-light, #AF00DB);--wy-code-class-name:var(--wy-code-class-name-light, #267F99)}:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-chat),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-comments),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-component),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-copilot),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-files),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-badge),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-button),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-conversation),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-new),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-badge),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-button),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-toasts),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notifications),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-posts),:host(:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light])),:host :is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]),::slotted(:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light])){color-scheme:dark;--wy-primary:var(--wy-primary-dark, #9bcbfa);--wy-on-primary:var(--wy-on-primary-dark, #003353);--wy-primary-container:var(--wy-primary-container-dark, #0d4a73);--wy-on-primary-container:var(--wy-on-primary-container-dark, #cee5ff);--wy-secondary:var(--wy-secondary-dark, #b9c8da);--wy-on-secondary:var(--wy-on-secondary-dark, #233240);--wy-secondary-container:var(--wy-secondary-container-dark, #3a4857);--wy-on-secondary-container:var(--wy-on-secondary-container-dark, #d5e4f7);--wy-tertiary:var(--wy-tertiary-dark, #cfc7a2);--wy-on-tertiary:var(--wy-on-tertiary-dark, #353117);--wy-tertiary-container:var(--wy-tertiary-container-dark, #4c472b);--wy-on-tertiary-container:var(--wy-on-tertiary-container-dark, #ebe3bd);--wy-error:var(--wy-error-dark, #ffb3ad);--wy-on-error:var(--wy-on-error-dark, #680009);--wy-error-container:var(--wy-error-container-dark, #930012);--wy-on-error-container:var(--wy-on-error-container-dark, #ffdad6);--wy-background:var(--wy-background-dark, #101418);--wy-on-background:var(--wy-on-background-dark, #e0e2e8);--wy-surface:var(--wy-surface-dark, #101418);--wy-on-surface:var(--wy-on-surface-dark, #e0e2e8);--wy-surface-variant:var(--wy-surface-variant-dark, #42474e);--wy-on-surface-variant:var(--wy-on-surface-variant-dark, #c2c7cf);--wy-outline:var(--wy-outline-dark, #8c9198);--wy-outline-variant:var(--wy-outline-variant-dark, #42474e);--wy-surface-container-highest:var(--wy-surface-container-highest-dark, #323539);--wy-surface-container-high:var(--wy-surface-container-high-dark, #272a2f);--wy-surface-container:var(--wy-surface-container-dark, #1c2024);--wy-surface-container-low:var(--wy-surface-container-low-dark, #181c20);--wy-surface-container-lowest:var(--wy-surface-container-lowest-dark, #0b0f12);--wy-surface-layer-highest:var(--wy-surface-layer-highest-dark, rgba(255, 255, 255, .1490196078));--wy-surface-layer-high:var(--wy-surface-layer-high-dark, rgba(255, 255, 255, .1019607843));--wy-surface-layer:var(--wy-surface-layer-dark, rgba(255, 255, 255, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-dark, rgba(0, 0, 0, .2509803922));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-dark, rgba(0, 0, 0, .5019607843));--wy-warning:var(--wy-warning-dark, #e5e972);--wy-on-warning:var(--wy-on-warning-dark, #484a00);--wy-warning-container:var(--wy-warning-container-dark, #787c07);--wy-on-warning-container:var(--wy-on-warning-container-dark, #f4f87e);--wy-highlight:var(--wy-highlight-dark, #003353);--wy-on-highlight:var(--wy-on-highlight-dark, #cee5ff);--wy-link:var(--wy-primary-dark, #9bcbfa);--wy-presence-active:var(--wy-green-dark, #00a38d);--wy-shade:var(--wy-shade-dark, rgba(0, 0, 0, .5));--wy-shade-invert:var(--wy-shade-invert-dark, rgba(255, 255, 255, .25));--wy-shade-opaque:var(--wy-shade-opaque-dark, grey);--wy-blue:var(--wy-blue-dark, #b2c5ff);--wy-indigo:var(--wy-indigo-dark, #9285de);--wy-purple:var(--wy-purple-dark, #e48fd2);--wy-pink:var(--wy-pink-dark, #f58bad);--wy-red:var(--wy-red-dark, #db726b);--wy-orange:var(--wy-orange-dark, #e79b3a);--wy-yellow:var(--wy-yellow-dark, #c9cd59);--wy-green:var(--wy-green-dark, #00a38d);--wy-teal:var(--wy-teal-dark, #00a0a9);--wy-cyan:var(--wy-cyan-dark, #009dc4);--wy-gray:var(--wy-gray-dark, #909194);--wy-code-text:var(--wy-code-text-dark, #cccccc);--wy-code-variable:var(--wy-code-variable-dark, #9CDCFE);--wy-code-operator:var(--wy-code-operator-dark, #d4d4d4);--wy-code-prolog:var(--wy-code-prolog-dark, #569CD6);--wy-code-comment:var(--wy-code-comment-dark, #6a9955);--wy-code-builtin:var(--wy-code-builtin-dark, #4fc1ff);--wy-code-number:var(--wy-code-number-dark, #b5cea8);--wy-code-inserted:var(--wy-code-inserted-dark, #b5cea8);--wy-code-constant:var(--wy-code-constant-dark, #646695);--wy-code-hexcode:var(--wy-code-hexcode-dark, #646695);--wy-code-regex:var(--wy-code-regex-dark, #d16969);--wy-code-char:var(--wy-code-char-dark, #d16969);--wy-code-tag:var(--wy-code-tag-dark, #569cd6);--wy-code-attr-name:var(--wy-code-attr-name-dark, #9cdcfe);--wy-code-selector:var(--wy-code-selector-dark, #9cdcfe);--wy-code-property:var(--wy-code-property-dark, #9cdcfe);--wy-code-deleted:var(--wy-code-deleted-dark, #ce9178);--wy-code-string:var(--wy-code-string-dark, #ce9178);--wy-code-changed:var(--wy-code-changed-dark, #569cd6);--wy-code-punctuation:var(--wy-code-punctuation-dark, #D4D4D4);--wy-code-function:var(--wy-code-function-dark, #569cd6);--wy-code-keyword:var(--wy-code-keyword-dark, #C586C0);--wy-code-class-name:var(--wy-code-class-name-dark, #4ec9b0)}@container style(--wy-color-scheme: dark){:not(.wy-light):not([part~=wy-light]) :where(wy-chat),:not(.wy-light):not([part~=wy-light]) :where(wy-comments),:not(.wy-light):not([part~=wy-light]) :where(wy-component),:not(.wy-light):not([part~=wy-light]) :where(wy-copilot),:not(.wy-light):not([part~=wy-light]) :where(wy-files),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-badge),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-button),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-conversation),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-new),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-badge),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-button),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-toasts),:not(.wy-light):not([part~=wy-light]) :where(wy-notifications),:not(.wy-light):not([part~=wy-light]) :where(wy-posts),:host(:not(.wy-light):not([part~=wy-light])),:host :not(.wy-light):not([part~=wy-light]),::slotted(:not(.wy-light):not([part~=wy-light])){color-scheme:dark;--wy-primary:var(--wy-primary-dark, #9bcbfa);--wy-on-primary:var(--wy-on-primary-dark, #003353);--wy-primary-container:var(--wy-primary-container-dark, #0d4a73);--wy-on-primary-container:var(--wy-on-primary-container-dark, #cee5ff);--wy-secondary:var(--wy-secondary-dark, #b9c8da);--wy-on-secondary:var(--wy-on-secondary-dark, #233240);--wy-secondary-container:var(--wy-secondary-container-dark, #3a4857);--wy-on-secondary-container:var(--wy-on-secondary-container-dark, #d5e4f7);--wy-tertiary:var(--wy-tertiary-dark, #cfc7a2);--wy-on-tertiary:var(--wy-on-tertiary-dark, #353117);--wy-tertiary-container:var(--wy-tertiary-container-dark, #4c472b);--wy-on-tertiary-container:var(--wy-on-tertiary-container-dark, #ebe3bd);--wy-error:var(--wy-error-dark, #ffb3ad);--wy-on-error:var(--wy-on-error-dark, #680009);--wy-error-container:var(--wy-error-container-dark, #930012);--wy-on-error-container:var(--wy-on-error-container-dark, #ffdad6);--wy-background:var(--wy-background-dark, #101418);--wy-on-background:var(--wy-on-background-dark, #e0e2e8);--wy-surface:var(--wy-surface-dark, #101418);--wy-on-surface:var(--wy-on-surface-dark, #e0e2e8);--wy-surface-variant:var(--wy-surface-variant-dark, #42474e);--wy-on-surface-variant:var(--wy-on-surface-variant-dark, #c2c7cf);--wy-outline:var(--wy-outline-dark, #8c9198);--wy-outline-variant:var(--wy-outline-variant-dark, #42474e);--wy-surface-container-highest:var(--wy-surface-container-highest-dark, #323539);--wy-surface-container-high:var(--wy-surface-container-high-dark, #272a2f);--wy-surface-container:var(--wy-surface-container-dark, #1c2024);--wy-surface-container-low:var(--wy-surface-container-low-dark, #181c20);--wy-surface-container-lowest:var(--wy-surface-container-lowest-dark, #0b0f12);--wy-surface-layer-highest:var(--wy-surface-layer-highest-dark, rgba(255, 255, 255, .1490196078));--wy-surface-layer-high:var(--wy-surface-layer-high-dark, rgba(255, 255, 255, .1019607843));--wy-surface-layer:var(--wy-surface-layer-dark, rgba(255, 255, 255, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-dark, rgba(0, 0, 0, .2509803922));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-dark, rgba(0, 0, 0, .5019607843));--wy-warning:var(--wy-warning-dark, #e5e972);--wy-on-warning:var(--wy-on-warning-dark, #484a00);--wy-warning-container:var(--wy-warning-container-dark, #787c07);--wy-on-warning-container:var(--wy-on-warning-container-dark, #f4f87e);--wy-highlight:var(--wy-highlight-dark, #003353);--wy-on-highlight:var(--wy-on-highlight-dark, #cee5ff);--wy-link:var(--wy-primary-dark, #9bcbfa);--wy-presence-active:var(--wy-green-dark, #00a38d);--wy-shade:var(--wy-shade-dark, rgba(0, 0, 0, .5));--wy-shade-invert:var(--wy-shade-invert-dark, rgba(255, 255, 255, .25));--wy-shade-opaque:var(--wy-shade-opaque-dark, grey);--wy-blue:var(--wy-blue-dark, #b2c5ff);--wy-indigo:var(--wy-indigo-dark, #9285de);--wy-purple:var(--wy-purple-dark, #e48fd2);--wy-pink:var(--wy-pink-dark, #f58bad);--wy-red:var(--wy-red-dark, #db726b);--wy-orange:var(--wy-orange-dark, #e79b3a);--wy-yellow:var(--wy-yellow-dark, #c9cd59);--wy-green:var(--wy-green-dark, #00a38d);--wy-teal:var(--wy-teal-dark, #00a0a9);--wy-cyan:var(--wy-cyan-dark, #009dc4);--wy-gray:var(--wy-gray-dark, #909194);--wy-code-text:var(--wy-code-text-dark, #cccccc);--wy-code-variable:var(--wy-code-variable-dark, #9CDCFE);--wy-code-operator:var(--wy-code-operator-dark, #d4d4d4);--wy-code-prolog:var(--wy-code-prolog-dark, #569CD6);--wy-code-comment:var(--wy-code-comment-dark, #6a9955);--wy-code-builtin:var(--wy-code-builtin-dark, #4fc1ff);--wy-code-number:var(--wy-code-number-dark, #b5cea8);--wy-code-inserted:var(--wy-code-inserted-dark, #b5cea8);--wy-code-constant:var(--wy-code-constant-dark, #646695);--wy-code-hexcode:var(--wy-code-hexcode-dark, #646695);--wy-code-regex:var(--wy-code-regex-dark, #d16969);--wy-code-char:var(--wy-code-char-dark, #d16969);--wy-code-tag:var(--wy-code-tag-dark, #569cd6);--wy-code-attr-name:var(--wy-code-attr-name-dark, #9cdcfe);--wy-code-selector:var(--wy-code-selector-dark, #9cdcfe);--wy-code-property:var(--wy-code-property-dark, #9cdcfe);--wy-code-deleted:var(--wy-code-deleted-dark, #ce9178);--wy-code-string:var(--wy-code-string-dark, #ce9178);--wy-code-changed:var(--wy-code-changed-dark, #569cd6);--wy-code-punctuation:var(--wy-code-punctuation-dark, #D4D4D4);--wy-code-function:var(--wy-code-function-dark, #569cd6);--wy-code-keyword:var(--wy-code-keyword-dark, #C586C0);--wy-code-class-name:var(--wy-code-class-name-dark, #4ec9b0)}}`,jj=it`@property --wy-component-color{syntax:\"<color>\";inherits:true;initial-value:currentColor}@property --wy-component-background-color{syntax:\"<color>\";inherits:true;initial-value:rgba(0,0,0,0)}`,Uj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),Xj([jj,De])}},h(e,"t"),e),c(t,"WeavyStyles"),t},"WeavyStylesMixin"),Hj=c(s=>{var i;var t,e;return e=(i=class extends s{constructor(...n){super(...n),q(this,t),this.version=Le.version,this.whenUrl().then(()=>{this.isDestroyed||this.checkVersion()})}async checkVersion(){return x(this,t)||E(this,t,(async()=>{await this.whenUrl(),this.networkStateIsPending=!0;let n;try{if(n=await fetch(new URL("/version",this.url),await this.fetchOptions({},!1)),!n.ok)throw new Error(`Could not verify environment version. ${n.status} ${n.statusText}`,{cause:n.status});this.networkStateIsPending=!1,this.serverState="ok"}catch(o){throw this.networkStateIsPending=!1,this.serverState="unreachable",new Error("Error checking Weavy version: "+o.toString(),{cause:o.cause})}const a=await n.text();if(!this.version||!a||this.version!==a)try{const o=this.version.split(".").slice(0,2),l=a.split(".").slice(0,2);if(o[0]!==l[0])throw new Error("Major version mismatch",{cause:"major"});if(o[1]!==l[1])throw new Error("Minor version mismatch",{cause:"minor"});if(o[2]!==l[2])throw new Error("Patch version mismatch",{cause:"patch"})}catch(o){throw new Error(`Weavy version mismatch! ${Le.sourceName}@${this.version} ≠ ${this.url?.hostname}@${a} - This will likely cause errors!`,{cause:{mismatch:o.cause,client:{name:Le.sourceName,version:this.version},environment:{name:this.url?.hostname,version:a}}})}finally{E(this,t,void 0)}else console.info(`Weavy version ${this.version} ☑️`);return{client:{name:Le.sourceName,version:this.version},environment:{name:this.url?.hostname,version:a}}})()),await x(this,t)}},h(i,"e"),i),t=new WeakMap,c(e,"WeavyVersion"),e},"WeavyVersionMixin");var b$,Mp;let pz=(b$=(Mp=class extends Event{constructor(t,e,i,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=r??!1}},h(Mp,"ts"),Mp),c(b$,"s"),b$);var $$,Ap;let xr=($$=(Ap=class{constructor(t,e,i,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){const n=e;this.context=n.context,this.callback=n.callback,this.subscribe=n.subscribe??!1}else this.context=e,this.callback=i,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new pz(this.context,this.host,this.t,this.subscribe))}},h(Ap,"es"),Ap),c($$,"s"),$$);var x$,Rp;let Yj=(x$=(Rp=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:i}]of this.subscriptions)e(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:c(()=>{this.subscriptions.delete(t)},"disposer"),consumerHost:e});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},h(Rp,"is"),Rp),c(x$,"s"),x$);var k$,Ep;let Gj=(k$=(Ep=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},h(Ep,"rs"),Ep),c(k$,"e"),k$);var S$,_p;let xS=(S$=(_p=class extends Yj{constructor(t,e,i){super(e.context!==void 0?e.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const n=r.contextTarget??r.composedPath()[0];n!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,n,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const n=new Set;for(const[a,{consumerHost:o}]of this.subscriptions)n.has(a)||(n.add(a),o.dispatchEvent(new pz(this.context,o,a,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Gj(this.context,this.host))}},h(_p,"ns"),_p),c(S$,"i"),S$);function wn({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(r){return i.get(this).setValue(r),t.set.call(this,r)},init(r){return i.set(this,new xS(this,{context:s,initialValue:r})),r}};{t.constructor.addInitializer((a=>{i.set(a,new xS(a,{context:s}))}));const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const a=new WeakMap;n={get(){return a.get(this)},set(o){i.get(this).setValue(o),a.set(this,o)},configurable:!0,enumerable:!0}}else{const a=r.set;n={...r,set(o){i.get(this).setValue(o),a?.call(this,o)}}}return void Object.defineProperty(t,e,n)}}}h(wn,"Yr");c(wn,"e$4");function je({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new xr(this,{context:s,callback:c(r=>{e.set.call(this,r)},"callback"),subscribe:t})})):e.constructor.addInitializer((r=>{new xr(r,{context:s,callback:c(n=>{r[i]=n},"callback"),subscribe:t})}))}}h(je,"be");c(je,"c$2");var Lp;const fz=(Lp=class extends Event{constructor(t,e,i,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=r??!1}},h(Lp,"iw"),Lp);c(fz,"ContextRequestEvent");let Kj=fz;var zp;const mz=(zp=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},h(zp,"rw"),zp);c(mz,"ContextProviderEvent");let Jj=mz;var Ip;const yz=(Ip=class extends xS{constructor(t,e,i){e.context!==void 0?super(t,e):super(t,e,i),e.context!==void 0?this._context=e.context:this._context=e,this.isAttached=!0,this.host instanceof wt||this.dispatchWhenConnected()}dispatchWhenConnected(){this.isAttached&&(this.host.isConnected?this.host.dispatchEvent(new Jj(this._context,this.host)):requestAnimationFrame(()=>this.dispatchWhenConnected()))}detachListeners(){this.isAttached=!1,this.host.removeEventListener("context-request",this.onContextRequest),this.host.removeEventListener("context-provider",this.onProviderRequest)}},h(Ip,"nw"),Ip);c(yz,"WyContextProvider");let gz=yz;const Ve=Symbol.for("weavy-client");function wz(s,t){return Pe(),new gz(s,{context:Ve,initialValue:t})}h(wz,"l0");c(wz,"createWeavyContextProvider");const Hc=W0()?wz(document.documentElement):void 0,tU=c(s=>{var i;var t,e;return e=(i=class extends s{constructor(...n){super(...n),q(this,t),this.host!==document.documentElement?(Hc?.detachListeners(),E(this,t,new gz(this.host,{context:Ve,initialValue:this}))):Hc?.setValue(this)}updateContext(){this.host!==document.documentElement?x(this,t)?.updateObservers():Hc?.updateObservers()}destroy(){super.destroy(),this.host!==document.documentElement?x(this,t)?.detachListeners():Hc?.value===this&&Hc?.setValue(void 0)}},h(i,"e"),i),t=new WeakMap,c(e,"WeavyContextProvider"),e},"WeavyContextProviderMixin");var Uv,Hv,Mn,qg,Ke;const Zg=(Ke=class{constructor(t){q(this,Uv),q(this,Hv),q(this,Mn),q(this,qg),this.weavySid=wy(),this.weavyId=`${Ke.sourceName}#${this.weavySid}`,this.cloudFilePickerUrl=Ke.defaults.cloudFilePickerUrl,this.configurationTimeout=Ke.defaults.configurationTimeout,this.disableEnvironmentImports=Ke.defaults.disableEnvironmentImports,this.gcTime=Ke.defaults.gcTime,this.scrollBehavior=Ke.defaults.scrollBehavior,this.staleTime=Ke.defaults.staleTime,this.tokenFactoryRetryDelay=Ke.defaults.tokenFactoryRetryDelay,this.tokenFactoryTimeout=Ke.defaults.tokenFactoryTimeout,E(this,Hv,new Promise(i=>{E(this,Uv,i)})),E(this,qg,!1),console.info(`${Ke.sourceName}@${Ke.version} #${this.weavySid}`),Pe(),this.host=document.documentElement;const e={};for(const i in t){const r=i;t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}e?.host&&(this.host=e.host,delete e.host),e&&Object.assign(this,e)}async whenUrl(){await x(this,Hv)}get url(){return x(this,Mn)}set url(t){var e;if(this.isDestroyed)throw new _e;try{if(typeof t=="string")t&&E(this,Mn,new URL(t,window.location.toString()));else if(t instanceof URL)E(this,Mn,t||void 0);else if(t==null)E(this,Mn,void 0);else throw new Error}catch{throw new TypeError("Invalid url")}t&&!this.disableEnvironmentImports&&globalThis.WEAVY_IMPORT_URL===void 0&&(globalThis.WEAVY_IMPORT_URL=new URL("./uikit-web/",t).href),x(this,Mn)&&((e=x(this,Uv))==null||e.call(this,x(this,Mn)))}get cachePrefix(){return`${Ke.version}:${this.url}`}async reset(){console.info(this.weavyId,"is reset")}get isDestroyed(){return x(this,qg)}destroy(){E(this,qg,!0),console.info(this.weavyId,"was destroyed")}},h(Ke,"we"),Ke);Uv=new WeakMap,Hv=new WeakMap,Mn=new WeakMap,qg=new WeakMap,c(Zg,"WeavyClient"),Zg.version="30.3.1",Zg.sourceName="@weavy/uikit-web",Zg.defaults={cloudFilePickerUrl:"https://filebrowser.weavy.io/v14/",configurationTimeout:5e3,disableEnvironmentImports:!1,gcTime:1e3*60*60*24,locale:J_,scrollBehavior:"auto",staleTime:1e3*1,tokenFactoryRetryDelay:2e3,tokenFactoryTimeout:2e4,annotations:"buttons-inline",enterToSend:"auto",reactions:"😍 😎 😉 😜 👍"};let Le=Zg;var Dp;const vz=(Dp=class extends tU(gj(mj(wj(fj(Rj(Hj(yj(Uj(Ej(Le)))))))))){},h(Dp,"aw"),Dp);c(vz,"Weavy");let Se=vz;const e4=Symbol.for("weavy-app"),Oz=Symbol.for("weavy-context-id"),bz=Symbol.for("weavy-data-blobs");var L=(s=>(s.Attachments="attachments",s.CloudFiles="cloud_files",s.ContextData="context_data",s.Comments="comments",s.Embeds="embeds",s.GoogleMeet="google_meet",s.Meetings="meetings",s.Mentions="mentions",s.MicrosoftTeams="microsoft_teams",s.Polls="polls",s.Previews="previews",s.Reactions="reactions",s.Receipts="receipts",s.Thumbnails="thumbnails",s.Typing="typing",s.Versions="versions",s.WebDAV="web_dav",s.ZoomMeetings="zoom_meetings",s))(L||{});const Cb=Symbol.for("weavy-features");var ao,Yc,zs,ll;const $z=(ll=class{constructor(t,e){q(this,ao),q(this,Yc),q(this,zs),E(this,ao,Object.keys(t)),E(this,Yc,Object.entries(t).reduce((i,[r,n])=>(n&&i.push(r),i),[])),E(this,zs,e??x(this,Yc))}features(){return x(this,ao)}supportedFeature(...t){return t.every(e=>x(this,ao).includes(e))}allowedFeatures(){return x(this,zs)}allowsFeature(...t){return t.every(e=>this.supportedFeature(e)?x(this,zs).includes(e):!1)}allowsAnyFeature(...t){return t.some(e=>this.supportedFeature(e)?x(this,zs).includes(e):!1)}setAllowedFeatures(t){return E(this,zs,typeof t=="string"?i4(t,x(this,ao)):x(this,Yc)),x(this,zs)}immutable(){const t=Pb(x(this,ao),x(this,Yc));return new ll(t,x(this,zs))}},h(ll,"mh"),ll);ao=new WeakMap,Yc=new WeakMap,zs=new WeakMap,c($z,"ComponentFeatures");let ui=$z;function i4(s,t){return s.split(" ").filter(e=>{if(e){if(t.includes(e))return!0;console.warn("Unknown feature provided:",e)}return!1})}h(i4,"Am");c(i4,"featureListFromString");function Pb(s,t){return t??=s,Object.fromEntries(s.map(e=>[e,t.includes(e)]))}h(Pb,"ly");c(Pb,"featureConfigFromList");const kS=Object.values(L),xz=Symbol.for("weavy-link");var Yv,Vp;const kz=(Vp=class{constructor(t){q(this,Yv),this.enterToSend=Le.defaults.enterToSend,this.reactions=Le.defaults.reactions,this.annotations=Le.defaults.annotations,E(this,Yv,t),Object.keys(this).forEach(e=>{e in t&&Object.assign(this,{[e]:t[e]})})}get component(){return x(this,Yv)}},h(Vp,"sw"),Vp);Yv=new WeakMap,c(kz,"WeavyComponentSettings");let y9=kz;const Sz=Symbol.for("weavy-component-settings"),Qb=Symbol.for("weavy-user");var Wp;const Cz=(Wp=class{constructor(t,e,i,r,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this._callback=(a,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=a,this.host.requestUpdate(),(!this.provided||this.subscribe)&&(this.provided=!0,this.callback&&this.callback(a,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const a=e;this.context=a.context,this.callback=a.callback,this.subscribe=a.subscribe??!1,this.ref=a.ref??t}else this.context=e,this.callback=i,this.subscribe=r??!1,this.ref=n??t;this.host.addController?.(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.ref.dispatchEvent(new Kj(this.context,this.host,this._callback,this.subscribe))}},h(Wp,"ow"),Wp);c(Cz,"ContextConsumer");let eU=Cz;var Fp;const Pz=(Fp=class{constructor(t,e,i){this.whenRef=new Promise(r=>this.resolveRef=r),t.addController(this),this.host=t,this.setRef(i),this.setContext(e)}get ref(){return this._ref}set ref(t){this._ref=t,t&&this.resolveRef?.(t)}setRef(t){this.ref=t}async setContext(t){this.whenContext=new Promise(i=>this.resolveContext=i);const e=await this.whenRef;this.context=new eU(this.host,{context:t,subscribe:!0,callback:c((i,r)=>{this.resolveContext?.(i),this.host.requestUpdate()},"callback"),ref:e}),await BS(e),this.context.dispatchRequest()}hostUpdate(){this.context?.value&&this.resolveContext?.(this.context.value)}},h(Fp,"cw"),Fp);c(Pz,"ContextController");let iU=Pz;var xt=(s=>(s.Chat="d65dd4bc-418e-403c-9f56-f9cf4da931ed",s.Comments="88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd",s.Files="523edd88-4bbf-4547-b60f-2859a6d2ddc1",s.Posts="5ebfa152-de85-48da-82dd-30a1b560c313",s.ChatRoom="edb400ac-839b-45a7-b2a8-6a01820d1c44",s.PrivateChat="7e14f418-8f15-46f4-b182-f619b671e470",s.AgentChat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(xt||{}),zr=(s=>(s.Chat="chat",s.Comments="comments",s.Files="files",s.Posts="posts",s.ChatRoom="chat_room",s.PrivateChat="private_chat",s.AgentChat="agent_chat",s))(zr||{}),Qz=(s=>(s["d65dd4bc-418e-403c-9f56-f9cf4da931ed"]="chat",s["88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd"]="comments",s["523edd88-4bbf-4547-b60f-2859a6d2ddc1"]="files",s["5ebfa152-de85-48da-82dd-30a1b560c313"]="posts",s["edb400ac-839b-45a7-b2a8-6a01820d1c44"]="chat_room",s["7e14f418-8f15-46f4-b182-f619b671e470"]="private_chat",s["2352a1c6-abc6-420e-8b85-ca7d5aed8779"]="agent_chat",s))(Qz||{}),Tz=(s=>(s.chat="d65dd4bc-418e-403c-9f56-f9cf4da931ed",s.comments="88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd",s.files="523edd88-4bbf-4547-b60f-2859a6d2ddc1",s.posts="5ebfa152-de85-48da-82dd-30a1b560c313",s.chat_room="edb400ac-839b-45a7-b2a8-6a01820d1c44",s.private_chat="7e14f418-8f15-46f4-b182-f619b671e470",s.agent_chat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(Tz||{}),Mz=(s=>(s["2352a1c6-abc6-420e-8b85-ca7d5aed8779"]="agent_chat",s))(Mz||{}),Az=(s=>(s.agent_chat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(Az||{}),zn=(s=>(s.None="none",s.Read="read",s.Write="write",s.Admin="admin",s))(zn||{}),yl=(s=>(s.List="list",s.Read="read",s.Create="create",s.Update="update",s.Delete="delete",s.Admin="admin",s))(yl||{}),Oi=(s=>(s.App="app",s.File="file",s.Message="message",s.User="user",s.Comment="comment",s.Post="post",s))(Oi||{});function Fy(s,t,e,i,r,n="GET"){return{queryKey:t,queryFn:c(async()=>{const a=await s.fetch(e||"/api/"+t.join("/"),{method:n,body:r});if(a.ok)return await a.json();throw new Error(`Error calling ${e||"/api/"+t.join("/")}`)},"queryFn"),...i}}h(Fy,"hd");c(Fy,"getApiOptions");const Rz=c(s=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(s,t)})):customElements.define(s,t)},"t$3"),rU={attribute:!0,type:String,converter:i0,reflect:!1,hasChanged:EP},sU=c((s=rU,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),n.set(e.name,s),i==="accessor"){const{name:a}=e;return{set(o){const l=t.get.call(this);t.set.call(this,o),this.requestUpdate(a,l,s)},init(o){return o!==void 0&&this.C(a,void 0,s,o),o}}}if(i==="setter"){const{name:a}=e;return function(o){const l=this[a];t.call(this,o),this.requestUpdate(a,l,s)}}throw Error("Unsupported decorator location: "+i)},"r$3");function b(s){return(t,e)=>typeof e=="object"?sU(s,t,e):((i,r,n)=>{const a=r.hasOwnProperty(n);return r.constructor.createProperty(n,i),a?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}h(b,"u");c(b,"n$3");function B(s){return b({...s,state:!0,attribute:!1})}h(B,"D");c(B,"r$2");const nU=c((s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e),"e$3");function Vl(s){return(t,e)=>{const{slot:i,selector:r}=s??{},n="slot"+(i?`[name=${i}]`:":not([name])");return nU(t,e,{get(){const a=this.renderRoot?.querySelector(n),o=a?.assignedElements(s)??[];return r===void 0?o:o.filter((l=>l.matches(r)))}})}}h(Vl,"Kc");c(Vl,"o$6");var qp;const Ez=(qp=class{get result(){return this._result&&this.observer?this.observer.trackResult(this._result):{isPending:!0}}constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenQueryClient=new Promise(e=>this.resolveQueryClient=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0,callback:c(t=>{t&&(this.resolveContext?.(t),this.queryClient=t.queryClient,this.resolveQueryClient?.(t.queryClient))},"callback")})}async trackQuery(t,e=!0){this.observerUnsubscribe?.();const i=await this.whenQueryClient;if(!i)throw new Error("No QueryClient provided");const r=new gL(i,t);this.observer=r,this.observerSubscribe(e)}observerSubscribe(t=!0){if(this.queryClient&&this.observer){t?this._result=this.observer.getOptimisticResult(this.observer.options):this._result=this.observer.getCurrentResult(),this.observerUnsubscribe=this.observer.subscribe(()=>{if(this.observer){const i=Wy(this.result,this.observer.getCurrentResult());i!==this._result&&(this._result=i,this.host.requestUpdate())}}),this.observer.updateResult(),this.host.requestUpdate();let e;t?e=this.observer.fetchOptimistic(this.observer.options):e=this.queryClient.getQueryCache().get(this.observer.options.queryHash)?.promise,e?.catch(()=>{}).finally(()=>{this.observer?.updateResult()})}}untrackQuery(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this._result=void 0,this.observer=void 0,this.host.requestUpdate()}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(qp,"lw"),qp);c(Ez,"QueryController");let Tr=Ez;function w0(s){return s.signal instanceof AbortSignal||typeof s.abort=="function"}h(w0,"Mp");c(w0,"hasAbort");var Zp;const _z=(Zp=class{constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenObserver=new Promise(e=>this.resolveObserver=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0})}hostUpdate(){this.context?.value&&this.resolveContext?.()}async trackMutation(t,e){if(e||(await this.whenContext,e=this.context?.value?.queryClient),!e)throw new Error("No QueryClient provided");return this.observerUnsubscribe?.(),this.observer&&(this.whenObserver=new Promise(i=>this.resolveObserver=i)),this.observer=new Gt(e,{...t}),this.observerSubscribe(),this.resolveObserver?.(this.observer),this.observer}observerSubscribe(){this.observer&&(this.result=this.observer.getCurrentResult(),this.observerUnsubscribe??=this.observer.subscribe(()=>{if(this.observer){const t=Wy(this.result,this.observer.getCurrentResult());this.result!==t&&(this.result=t,this.host.requestUpdate())}}),this.host.requestUpdate())}untrackMutation(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this.result=void 0,this.observer=void 0,this.host.requestUpdate()}async mutate(t,e){const i=await this.whenObserver,r=new AbortController;return i.mutate({...t,signal:r.signal,abort:r.abort.bind(r)},e)}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(Zp,"dw"),Zp);c(_z,"MutationController");let Fr=_z;function r4(s){if(s)return s.match(/^[0-9]+$/)?parseInt(s):s}h(r4,"Fm");c(r4,"toIntOrString");const oi=[];for(let s=0;s<256;++s)oi.push((s+256).toString(16).slice(1));function Lz(s,t=0){return(oi[s[t+0]]+oi[s[t+1]]+oi[s[t+2]]+oi[s[t+3]]+"-"+oi[s[t+4]]+oi[s[t+5]]+"-"+oi[s[t+6]]+oi[s[t+7]]+"-"+oi[s[t+8]]+oi[s[t+9]]+"-"+oi[s[t+10]]+oi[s[t+11]]+oi[s[t+12]]+oi[s[t+13]]+oi[s[t+14]]+oi[s[t+15]]).toLowerCase()}h(Lz,"y0");c(Lz,"unsafeStringify");let C$;const aU=new Uint8Array(16);function zz(){if(!C$){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");C$=crypto.getRandomValues.bind(crypto)}return C$(aU)}h(zz,"f0");c(zz,"rng");const oU=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),g9={randomUUID:oU};function Iz(s,t,e){s=s||{};const i=s.random??s.rng?.()??zz();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Lz(i)}h(Iz,"v0");c(Iz,"_v4");function Mh(s,t,e){return g9.randomUUID&&!s?g9.randomUUID():Iz(s)}h(Mh,"pl");c(Mh,"v4");function Dz(s){let t;if(s instanceof URL)t={type:"url",item:s};else if(s instanceof File)t={type:"file",item:s};else if(s instanceof Blob)t={type:"file",item:new File([s],`${Mh()}`,{type:s.type})};else if(typeof s=="string")t={type:"file",item:new File([s],`${Mh()}.data.txt`,{type:"text/plain;charset=UTF-8"})};else if(Z_(s)||n0(s))try{const e=n0(s)?s.toJSON():JSON.stringify(s,U_(),2);t={type:"file",item:new File([e],`${Mh()}.json.txt`,{type:"text/plain;charset=UTF-8"})}}catch(e){console.error("Could not serialize context data to JSON.",e)}return t}h(Dz,"g0");c(Dz,"getContextDataRef");const Tb=c((s,t=3)=>{const e=[" B"," KB"," MB"," GB"," TB"," PB"," EB"," ZB"," YB"];let i=s,r=0;for(;r<e.length-1&&i>=1024;)i=100*i/1024/100,r++;return i.toLocaleString(void 0,{maximumSignificantDigits:t})+e[r]},"fileSizeAsString");function ur(s){return s.lastIndexOf(".")===-1?".":(s.substring(s.lastIndexOf("."),s.length)||s).toLowerCase()}h(ur,"di");c(ur,"getExtension");function s4(s){switch(s){case".aac":case".aif":case".aiff":case".au":case".gsm":case".m4a":case".mid":case".midi":case".mka":case".mp3":case".oga":case".ogg":case".ra":case".ram":case".snd":case".spx":case".wav":case".wma":return!0;default:return!1}}h(s4,"Dm");c(s4,"isAudio");function Vz(s){switch(s){case".ai":case".apng":case".bmp":case".emf":case".eps":case".gif":case".heic":case".ico":case".jpg":case".jpeg":case".png":case".psd":case".svg":case".tif":case".tiff":case".webp":case".wmf":return!0;default:return!1}}h(Vz,"b0");c(Vz,"isImage");function Wz(s){switch(ur(s)){case".apng":case".bmp":case".gif":case".ico":case".jpg":case".jpeg":case".png":case".svg":case".webp":return!0;default:return!1}}h(Wz,"x0");c(Wz,"isWebImage");function n4(s){switch(s){case".3g2":case".asx":case".asf":case".avi":case".flv":case".mk3d":case".mkv":case".mov":case".mp4":case".mpeg":case".mpg":case".ogm":case".ogv":case".ogx":case".qt":case".rm":case".rv":case".smi":case".smil":case".swf":case".webm":case".wmv":case".xaml":return!0;default:return!1}}h(n4,"Vm");c(n4,"isVideo");function Fz(s){switch(s){case".markdown":case".md":return!0;default:return!1}}h(Fz,"C0");c(Fz,"isMarkdown");function a4(s){switch(s){case".htm":case".html":case".xhtml":case".xml":return!0;default:return!1}}h(a4,"Hm");c(a4,"isMarkup");function Mb(s){if(a4(s))return!0;switch(s){case".as":case".as3":case".asm":case".aspx":case".bat":case".c":case".cc":case".cmake":case".coffee":case".cpp":case".cs":case".css":case".cxx":case".diff":case".erb":case".erl":case".groovy":case".gvy":case".h":case".haml":case".hh":case".hpp":case".hxx":case".java":case".js":case".json":case".jsx":case".less":case".lst":case".m":case".make":case".ml":case".mm":case".out":case".patch":case".php":case".pl":case".plist":case".properties":case".py":case".rb":case".sass":case".scala":case".scm":case".script":case".scss":case".sh":case".sml":case".sql":case".vb":case".vi":case".vim":case".xsd":case".xsl":case".yaml":case".yml":return!0;default:return!1}}h(Mb,"dy");c(Mb,"isCode");function o4(s){if(Mb(s)||Fz(s))return!0;switch(s){case".txt":return!0;default:return!1}}h(o4,"Bm");c(o4,"isText");function vn(s){const t=ur(s);if(t==="")return{icon:"file"};if(s4(t))return{icon:"file-music",color:"indigo"};if(Vz(t))return{icon:"file-image",color:"cyan"};if(n4(t))return{icon:"file-video",color:"pink"};if(a4(t))return{icon:"file-xml",color:"purple"};if(Mb(t))return{icon:"file-code",color:"purple"};if(o4(t))return{icon:"file-document"};switch(t){case".7z":case".zip":return{icon:"file-compressed",color:"orange"};case".doc":case".docm":case".docx":case".dotm":case".dotx":return{icon:"file-word",color:"native"};case".eml":case".msg":return{icon:"email",color:""};case".xls":case".xlsm":case".xlsx":case".xltx":return{icon:"file-excel",color:"native"};case".pdf":return{icon:"file-pdf",color:"native"};case".ppt":case".pptm":case".pptx":case".potx":return{icon:"file-powerpoint",color:"native"};case".pages":return{icon:"file",color:"orange"};case".numbers":return{icon:"file",color:"green"};case".keynote":return{icon:"file",color:"blue"}}return{icon:"file"}}h(vn,"Xr");c(vn,"getIcon");function qz(s){const t=ur(s);return t===""?"none":Wz(t)?"image":Mb(t)?"code":o4(t)?"text":s4(t)?"audio":n4(t)?"video":"none"}h(qz,"$0");c(qz,"getWebPreviewFormat");function qy(s){switch(s){case"Google Drive":return"google-drive";case"Dropbox":return"dropbox";case"OneDrive":return"onedrive";case"Box":return"box";default:return""}}h(qy,"ud");c(qy,"getProvider");function Ab(s){let t="file";switch(ur(s)){case".7z":case".zip":t="archive";break;case".aac":case".aif":case".aiff":case".au":case".gsm":case".m4a":case".mid":case".midi":case".mka":case".mp3":case".oga":case".ogg":case".ra":case".ram":case".snd":case".spx":case".wav":case".wma":t="audio";break;case".c":case".cgi":case".cpp":case".cs":case".cshtml":case".css":case".html":case".java":case".js":case".json":case".less":case".php":case".pl":case".ps1":case".py":case".rb":case".rs":case".scss":case".sh":case".swift":case".sql":case".ts":case".xml":case".yaml":case".yml":t="code";break;case".doc":case".docm":case".docx":case".dotm":case".dotx":case".gdoc":case".pages":case".pdf":t="document";break;case".eml":case".msg":t="email";break;case".gslides":case".keynote":case".ppt":case".pptm":case".pptx":case".potx":t="presentation";break;case".gsheet":case".numbers":case".xls":case".xlsm":case".xlsx":case".xltx":t="spreadsheet";break;case".ai":case".apng":case".bmp":case".emf":case".eps":case".gif":case".heic":case".ico":case".jpg":case".jpeg":case".png":case".psd":case".svg":case".tif":case".tiff":case".webp":case".wmf":t="image";break;case".md":case".markdown":case".txt":t="text";break;case".3g2":case".asx":case".asf":case".avi":case".flv":case".mk3d":case".mkv":case".mov":case".mp4":case".mpeg":case".mpg":case".ogm":case".ogv":case".ogx":case".qt":case".rm":case".rv":case".smi":case".smil":case".swf":case".webm":case".wmv":case".xaml":t="video";break}return t}h(Ab,"hy");c(Ab,"getKind");function Rb(s){const t=s.target,e=t?.value.lastIndexOf(".");e===-1?t?.select():e!==void 0&&t?.setSelectionRange(0,e)}h(Rb,"uy");c(Rb,"handleSelectFilename");async function v0(s,t="SHA-256"){return await new Promise(e=>{if(s){const i=new FileReader;i.readAsArrayBuffer(s),i.onloadend=async()=>{const r=await crypto.subtle.digest(t,i.result);let n="";r&&(n=Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")),e(n)}}else e("")})}h(v0,"Ap");c(v0,"getHash");function Gv(s,t){return s.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}h(Gv,"Vu");c(Gv,"getResult");var Np;const Zz=(Np=class{constructor(t){this.alwaysUpdate=!1,t.addController(this),this.host=t,this.setContext()}async setContext(){this.whenContext=new Promise(t=>this.resolveContext=t),await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0})}hostUpdate(){this.context?.value&&this.resolveContext?.()}async trackMutationState(t,e){if(e||(await this.whenContext,e=this.context?.value?.queryClient),!e)throw new Error("No QueryClient provided");return this.mutationCacheUnsubscribe?.(),this.options=t,this.mutationCache=e.getMutationCache(),this.mutationCacheSubscribe(),this.result}mutationCacheSubscribe(){this.mutationCache&&this.options&&(this.result=Gv(this.mutationCache,this.options),this.mutationCacheUnsubscribe=this.mutationCache.subscribe(t=>{if(this.mutationCache&&this.options&&/added|removed|updated/.test(t.type)){const e=Gv(this.mutationCache,this.options);this.result!==e&&!vo(this.result,e)&&(this.result=e,this.host.requestUpdate())}}),this.host.requestUpdate())}get isMutating(){return!this.mutationCache||!this.options?.filters?0:Gv(this.mutationCache,{filters:{...this.options.filters,status:"pending"}}).length}untrackMutationState(){this.mutationCacheUnsubscribe?.(),this.mutationCacheUnsubscribe=void 0,this.result=void 0,this.options=void 0,this.mutationCache=void 0,this.host.requestUpdate()}hostConnected(){this.mutationCacheSubscribe()}hostDisconnected(){this.mutationCacheUnsubscribe?.()}},h(Np,"hw"),Np);c(Zz,"MutationStateController");let Eb=Zz;function de(s,t,e,i){const r=s.getMutationCache(),n=r.find({mutationKey:t,predicate:c(a=>a.state.variables===e,"predicate")});if(n&&n.state.context){const a={...n.state.context};i(a);const o={...n.state,context:a};n.state=o,r.notify({mutation:n,type:"updated",action:{type:"pending",context:n.state.context,variables:n.state.variables,isPaused:!1}})}}h(de,"qt");c(de,"updateMutationContext");function l4(s,t,e){const i=s.getMutationCache().find({mutationKey:t,exact:!0,predicate:e});i&&s.getMutationCache().remove(i)}h(l4,"Nm");c(l4,"removeMutation");function Nz(s,t){const e=s.getMutationCache();e.findAll({mutationKey:t,exact:!0}).forEach(i=>{e.remove(i)})}h(Nz,"k0");c(Nz,"removeMutations");const c4=c((s,t,e=0,i="application/octet-stream",r,n=Date.now())=>{const a=s&&(s instanceof URL?s.toString():URL.createObjectURL(s));return{id:n,app:{id:-1},name:t,kind:Ab(t),size:e,media_type:i,embed_url:"",preview_format:qz(t),thumbnail_url:a,preview_url:a,download_url:a,rev:-1,created_by:r,created_at:new Date().toUTCString(),is_subscribed:!1,is_trashed:!1,is_starred:!1}},"getTempFile");function h4(s){const t=s?s.reduce((e,i)=>{const r=i.context?.file;return r&&i.context?.status.progress&&r.size?{loaded:e.loaded+Math.floor(i.context.status.progress/100*r.size),total:e.total+r.size}:e},{loaded:0,total:0}):{loaded:0,total:0};return{loaded:t.loaded,total:t.total,percent:t.total>0?t.loaded/t.total*100:null}}h(h4,"Um");c(h4,"getFileMutationsTotalProgress");function O0(s){return s?s.some(t=>t.context?.status.state==="conflict")?"conflict":s.some(t=>t.status==="error")?"error":s.every(t=>t.status==="success")?"ok":"pending":"ok"}h(O0,"Ep");c(O0,"getFileMutationsTotalStatus");function SS(s){return s?.filter(t=>t.context?.status.state==="pending")||[]}h(SS,"of");c(SS,"getPendingFileMutations");function CS(s){return s?.filter(t=>t.context?.status.state==="conflict"||t.status==="error")||[]}h(CS,"cf");c(CS,"getFileMutationsByConflictOrError");function Bz(s,t){const e=s.queryClient;e.getMutationCache().findAll({mutationKey:["apps",t.id,"blobs"],exact:!0}).forEach(i=>{i.state.context?.status.state==="error"&&e.getMutationCache().remove(i)}),e.getMutationCache().findAll({mutationKey:["apps",t.id,"files"],exact:!0}).forEach(i=>{i.state.context?.status.state==="conflict"&&e.getMutationCache().remove(i)})}h(Bz,"P0");c(Bz,"removeErroredFileMutations");function b0(s,t,e){const i=s.queryClient;i.getMutationCache().findAll({mutationKey:["apps",t.id,"blobs"],exact:!0,predicate:c(r=>/error|success/.test(r.state.status)&&(!e||r.state.variables?.blob?.name===e),"predicate")}).forEach(r=>{i.getMutationCache().remove(r)}),i.getMutationCache().findAll({mutationKey:["apps",t.id,"files"],exact:!0,predicate:c(r=>/error|success/.test(r.state.status)&&(!e||r.state.variables?.blob?.name===e),"predicate")}).forEach(r=>{i.getMutationCache().remove(r)})}h(b0,"Rp");c(b0,"removeSettledFileMutations");function Xz(s,t,e){const i=s.queryClient,r=["apps",e.id,"files"];return{mutationFn:c(async({blob:n,replace:a=!1})=>{const o=await s.fetch("/api/apps/"+e.id+"/files",{method:"POST",body:JSON.stringify({blob_id:n.id,replace:a})});if(!o.ok){const l=await o.json();throw new Error(l.detail||l.title,{cause:l})}return await o.json()},"mutationFn"),mutationKey:r,onMutate:c(async n=>{await i.cancelQueries({queryKey:r,exact:!0}),jz(s,e,n.blob.name),b0(s,e,n.blob.name);let a;try{a=n.blob.thumbnail_url&&new URL(n.blob.thumbnail_url)||void 0}catch{}const o=c4(a,n.blob.name,n.blob.size,n.blob.media_type,t);return{type:n.replace?"replace":"create",file:o,status:{state:"pending"}}},"onMutate"),onSuccess:c((n,a,o)=>(de(i,r,a,l=>{l&&(l.status.state="ok",l.status.progress=void 0,l.status.text=void 0)}),i.invalidateQueries({queryKey:r})),"onSuccess"),onError(n,a,o){n?.cause?.status===409?de(i,r,a,l=>{l&&(l.status.progress=void 0,l.status.state="conflict",l.status.text=n.message)}):de(i,r,a,l=>{l&&(l.status.state="error",l.status.progress=void 0,l.status.text=n.message)})}}}h(Xz,"_0");c(Xz,"getCreateFileMutationOptions");function jz(s,t,e,i,r="blobs"){const n=s.queryClient;n.getMutationCache().findAll({mutationKey:["apps",t.id,r],exact:!0,status:"success",predicate:c(a=>a.state.data?.name===e,"predicate")}).forEach(a=>{n.getMutationCache().remove(a)})}h(jz,"S0");c(jz,"removeSuccessfulUploadBlobMutations");async function d4(s,t,e,i){const r=new FormData;r.append("blob",t);const n=await s.upload("/api/blobs","POST",r,a0.Auto,a=>{e&&e({progress:a})},i);if(!n.ok){const a=await n.json();throw new Error(a.detail||a.title,{cause:a})}return await n.json()}h(d4,"qm");c(d4,"uploadBlob");function Uz(s){return{mutationFn:c(async t=>await d4(s,t.file,t.onProgress),"mutationFn")}}h(Uz,"M0");c(Uz,"getSimpleUploadBlobMutationOptions");function _b(s,t,e,i,r="blobs"){const n=s.queryClient,a=i?["apps",e,r,i]:["apps",e,r];return{mutationFn:c(async o=>await d4(s,o.file,o.onProgress,o.signal),"mutationFn"),mutationKey:a,onMutate:c(async o=>{await n.cancelQueries({queryKey:a,exact:!0});const l=c4(o.file,o.file.name,o.file.size,o.file.type,t);o.onProgress=({progress:u})=>{de(n,a,o,p=>{p.status.state="pending",p.status.progress=u})};const d=await v0(o.file);return{type:"upload",file:l,status:{state:"pending"},sha256:d}},"onMutate"),onSuccess:c((o,l,d)=>{de(n,a,l,u=>{u.status.state="ok",u.status.progress=void 0,u.status.text=void 0})},"onSuccess"),onError(o,l,d){const u=o.cause;u&&u.status===409?de(n,a,l,p=>{p.status.state="conflict",p.status.progress=void 0,p.status.text=u.detail||u.title}):de(n,a,l,p=>{p&&(p.status.state="error",p.status.progress=void 0,p.status.text=u.detail||u.title)})}}}h(_b,"yy");c(_b,"getUploadBlobMutationOptions");var lU=Object.defineProperty,u4=c((s,t,e,i)=>{for(var r=void 0,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=a(t,e,r)||r);return r&&lU(t,e,r),r},"__decorateClass$1j"),Ng,Bg,Xg,jg,Ug,Hg,An,Bp;const Hz=(Bp=class extends wt{constructor(){super(...arguments),q(this,Ng),q(this,Bg),q(this,Xg),q(this,jg),q(this,Ug),q(this,Hg),q(this,An),this.contextId=Mh(),E(this,Bg,new Promise(t=>{E(this,Ng,t)})),E(this,jg,new Promise(t=>{E(this,Xg,t)})),E(this,Hg,new Promise(t=>{E(this,Ug,t)})),E(this,An,new Tr(this))}async whenContextId(){return await x(this,Bg)}async whenUser(){return await x(this,jg)}async whenWeavy(){return await x(this,Hg)}connectedCallback(){super.connectedCallback(),this.contextId&&this.requestUpdate("contextId"),this.user&&this.requestUpdate("user"),this.weavy&&this.requestUpdate("weavy")}async scheduleUpdate(){await Ss(this),await super.scheduleUpdate()}async willUpdate(t){var e,i,r;super.willUpdate(t),this.weavyContextConsumer??=new xr(this,{context:Ve,subscribe:!0}),this.weavyContextConsumer?.value&&this.weavy!==this.weavyContextConsumer?.value&&(this.weavy=this.weavyContextConsumer?.value),t.has("weavy")&&this.weavy&&await x(this,An).trackQuery(Fy(this.weavy,["user"])),x(this,An).result?.isPending||(this.user&&x(this,An).result.data&&this.user.id!==x(this,An).result.data.id&&(console.warn("User mismatch, resetting"),this.weavy?.reset()),this.user=x(this,An).result?.data),t.has("contextId")&&this.contextId&&(t.get("contextId")&&E(this,Bg,new Promise(n=>{E(this,Ng,n)})),(e=x(this,Ng))==null||e.call(this,this.contextId)),t.has("user")&&this.user&&(t.get("user")&&E(this,jg,new Promise(n=>{E(this,Xg,n)})),(i=x(this,Xg))==null||i.call(this,this.user)),t.has("weavy")&&this.weavy&&(t.get("weavy")&&E(this,Hg,new Promise(n=>{E(this,Ug,n)})),(r=x(this,Ug))==null||r.call(this,this.weavy))}},h(Bp,"uw"),Bp);Ng=new WeakMap,Bg=new WeakMap,Xg=new WeakMap,jg=new WeakMap,Ug=new WeakMap,Hg=new WeakMap,An=new WeakMap,c(Hz,"WeavyComponent");let Lb=Hz;u4([B()],Lb.prototype,"weavy");u4([wn({context:Oz}),B()],Lb.prototype,"contextId");u4([wn({context:Qb}),B()],Lb.prototype,"user");var cU=Object.defineProperty,hU=Object.getOwnPropertyDescriptor,Bi=c((s,t,e,i)=>{for(var r=i>1?void 0:i?hU(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&cU(t,e,r),r},"__decorateClass$1i"),Kv,Jv,tO,eO,Yg,Gg,Kg,Jg,Gc,Kc,tw,ew,Is,iw,Jc,Xp;const Yz=(Xp=class extends Lb{constructor(){super(),q(this,Kv),q(this,Jv),q(this,tO),q(this,eO),q(this,Yg),q(this,Gg),q(this,Kg),q(this,Jg),q(this,Gc),q(this,Kc),q(this,tw),q(this,ew),q(this,Is),q(this,iw),q(this,Jc),this.storage=ZP("localStorage"),this.storageLinkHandler=t=>{t.storageArea===this.storage&&t.key==="wy-link"&&t.newValue&&this.readStorageLink()},this.linkEventHandler=async t=>{!t.defaultPrevented&&t.detail.link&&(this.link&&this.link.id===t.detail.link.id&&(this.link=void 0,await this.updateComplete),this.link=t.detail.link,this.link||this.provideStorageLink(t.detail.link))},this.notificationEventConsumer=t=>{t.stopPropagation(),t.defaultPrevented||this.visibilityElement&&this.visibilityElement.isConnected&&this.visibilityElement.checkVisibility(XS)&&this.matchesLink(t.detail.link)&&t.preventDefault()},E(this,Gg,new Promise(t=>{E(this,Yg,t)})),E(this,Jg,new Promise(t=>{E(this,Kg,t)})),E(this,Kc,new Promise(t=>{E(this,Gc,t)})),E(this,ew,new Promise(t=>{E(this,tw,t)})),E(this,Is,new Map),E(this,iw,new Fr(this)),E(this,Jc,new Eb(this)),this.settings=new y9(this)}matchesLink(t){return t?.app?.type&&this.componentTypes?.includes(t.app.type)?t.agent?t.agent===this.agent:!0:!1}set link(t){const e=this._link;this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e)}get link(){return this._link}clearLink(){this.link&&(E(this,Kc,new Promise(t=>{E(this,Gc,t)})),this.link=void 0)}provideStorageLink(t){this.storage?.setItem("wy-link",btoa(JSON.stringify(t)))}readStorageLink(){if(!this.storage){console.error("Storage not available");return}const t=this.storage.getItem("wy-link");if(t)try{const e=JSON.parse(atob(t));e&&(this.link=e)}catch(e){console.error("Error parsing link",e)}}consumeStorageLink(){this.storage?.removeItem("wy-link")}get visibilityElement(){return this}set agent(t){this._agentUid=t||void 0}get agent(){return this._agentUid}set data(t){console.warn(".data property array is deprecated. Use .contextualData string instead."),E(this,Kv,t)}get data(){return x(this,Kv)}set annotations(t){E(this,Jv,t)}get annotations(){return x(this,Jv)??this.weavy?.annotations??Le.defaults.annotations}set enterToSend(t){E(this,tO,t)}get enterToSend(){return x(this,tO)??this.weavy?.enterToSend??Le.defaults.enterToSend}set reactions(t){E(this,eO,t)}get reactions(){return x(this,eO)??this.weavy?.reactions??Le.defaults.reactions}async whenContextDataBlobs(){return await x(this,Gg)}async whenComponentFeatures(){return await x(this,Jg)}async whenLink(){return await x(this,Kc)}async whenSettings(){return await x(this,ew)}connectedCallback(){super.connectedCallback(),document.addEventListener("wy-link",this.linkEventHandler),window.addEventListener("storage",this.storageLinkHandler),this.componentFeatures&&this.requestUpdate("componentFeatures"),this.contextDataBlobs&&this.requestUpdate("contextDataBlobs"),this.link&&this.requestUpdate("link"),this.settings&&this.requestUpdate("settings")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("wy-link",this.linkEventHandler),window.removeEventListener("storage",this.storageLinkHandler),this.weavy?.host.removeEventListener("wy-notification",this.notificationEventConsumer,{capture:!0})}async willUpdate(t){var e,i,r,n;await super.willUpdate(t),t.has("bot")&&typeof this.bot=="string"&&console.error(`Using .bot property is deprecated. Use .agent = "${this.bot}"; instead`);const a=Object.keys(this.settings);if((t.has("weavy")||a.find(o=>t.has(o)))&&(this.settings=new y9(this)),t.has("features")&&this.componentFeatures&&(this.componentFeatures.setAllowedFeatures(this.features),this.componentFeatures instanceof ui&&(this.componentFeatures=this.componentFeatures.immutable())),(t.has("weavy")||t.has("contextId")||t.has("user")||t.has("componentFeatures"))&&this.weavy&&this.contextId&&this.user&&this.componentFeatures?.allowsFeature(L.ContextData)&&(await x(this,iw).trackMutation(_b(this.weavy,this.user,this.contextId,void 0,"data")),await x(this,Jc).trackMutationState({filters:{mutationKey:["apps",this.contextId,"data"],exact:!0}},this.weavy.queryClient)),t.has("contextualData")||t.has("data")||t.has("componentFeatures")){const o=this.contextualData?[this.contextualData]:this.data?this.data:[],l=x(this,Is);if(E(this,Is,new Map),o.forEach(d=>{const u=l.get(d);if(u)x(this,Is).set(d,u);else{const p=Dz(d);p&&x(this,Is).set(d,p)}}),x(this,Is)&&this.componentFeatures?.allowsFeature(L.ContextData)){for(const f of Array.from(x(this,Is).values()))if(f.type==="file"){const y=await v0(f.item);await B_(x(this,Jc).result??[],async g=>(g.context?.sha256??await v0(g.variables?.file))===y)||await x(this,iw).mutate({file:f.item})}const d=x(this,Jc).result,u=d?.some(f=>f.status==="pending"),p=d?.map(f=>f.data?.id).filter(f=>f).reverse()??[];u||(this.contextDataBlobs=p)}else this.contextDataBlobs=[]}(t.has("componentTypes")||t.has("agent"))&&this.componentTypes&&this.readStorageLink(),t.has("link")&&this.link&&(console.info("Opening notification link"),this.consumeStorageLink()),t.has("contextDataBlobs")&&this.contextDataBlobs&&(t.get("contextDataBlobs")&&E(this,Gg,new Promise(o=>{E(this,Yg,o)})),(e=x(this,Yg))==null||e.call(this,this.contextDataBlobs)),t.has("componentFeatures")&&this.componentFeatures&&(t.get("componentFeatures")&&E(this,Jg,new Promise(o=>{E(this,Kg,o)})),(i=x(this,Kg))==null||i.call(this,this.componentFeatures)),t.has("link")&&this.link&&(t.get("link")&&E(this,Kc,new Promise(o=>{E(this,Gc,o)})),(r=x(this,Gc))==null||r.call(this,this.link)),t.has("settings")&&this.settings&&(t.get("settings")&&E(this,ew,new Promise(o=>{E(this,tw,o)})),(n=x(this,tw))==null||n.call(this,this.settings)),t.has("weavy")&&this.weavy&&this.weavy.host.addEventListener("wy-notification",this.notificationEventConsumer,{capture:!0})}},h(Xp,"pw"),Xp);Kv=new WeakMap,Jv=new WeakMap,tO=new WeakMap,eO=new WeakMap,Yg=new WeakMap,Gg=new WeakMap,Kg=new WeakMap,Jg=new WeakMap,Gc=new WeakMap,Kc=new WeakMap,tw=new WeakMap,ew=new WeakMap,Is=new WeakMap,iw=new WeakMap,Jc=new WeakMap,c(Yz,"WeavyTypeComponent");let We=Yz;Bi([wn({context:bz}),B()],We.prototype,"contextDataBlobs",2);Bi([wn({context:Cb}),B()],We.prototype,"componentFeatures",2);Bi([wn({context:Sz}),B()],We.prototype,"settings",2);Bi([wn({context:xz})],We.prototype,"_link",2);Bi([b({type:Object})],We.prototype,"link",1);Bi([B()],We.prototype,"componentTypes",2);Bi([b()],We.prototype,"features",2);Bi([b({type:String})],We.prototype,"agent",1);Bi([b({attribute:!0,type:String})],We.prototype,"contextualData",2);Bi([b({attribute:!0,type:String,converter:{fromAttribute(s){return N_(s)}}})],We.prototype,"data",1);Bi([b({type:String})],We.prototype,"annotations",1);Bi([b({type:String})],We.prototype,"enterToSend",1);Bi([b({type:String})],We.prototype,"reactions",1);Bi([b()],We.prototype,"bot",2);const Gz=new Map(DP(Qz)),Kz=new Map(DP(Tz)),$0=new Map(Object.entries(Mz));new Map(Object.entries(Az));var dU=Object.defineProperty,uU=Object.getOwnPropertyDescriptor,Wl=c((s,t,e,i)=>{for(var r=i>1?void 0:i?uU(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&dU(t,e,r),r},"__decorateClass$1h");const Xn="unknown";var rw,sw,oo,jp;const Jz=(jp=class extends We{constructor(){super(...arguments),q(this,rw),q(this,sw),q(this,oo),this.appSubscribeMutation=new Fr(this),E(this,sw,new Promise(t=>{E(this,rw,t)})),E(this,oo,new Tr(this))}reset(){this.app&&(this.app=void 0),this._appName!==this._initialAppName&&(this._appName=this._initialAppName)}matchesLink(t){return t?.app?.type&&!this.appType&&this.componentTypes?.includes(t.app.type)?t.agent?t.agent===this.agent:!0:!!(t&&t.app&&this.appType!==Xn&&(typeof this.uid=="string"&&t.app?.uid===this.uid||typeof this.uid=="number"&&t.app?.id===this.uid||!this.uid&&this.app&&t.app.id===this.app.id))}set link(t){const e=this._link;!this.uid&&this.appType&&this.appType!==Xn?this.whenApp().then(()=>{this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e)}):(this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e))}get link(){return this._link}set name(t){this._initialAppName=t,this._appName=t}get name(){return this._appName}async subscribe(t=!0){if(!this.uid)throw new Error(`Cannot ${t?"subscribe":"unsubscribe"} without a uid.`);await this.whenApp(),this.app?.id&&this.appSubscribeMutation.mutate({subscribe:t})}async whenApp(){return await x(this,sw)}connectedCallback(){super.connectedCallback(),this.app&&this.requestUpdate("app")}async willUpdate(t){var e;if(await super.willUpdate(t),t.has("autoUid")&&typeof this.autoUid=="string"&&(console.error(`Using .autoUid property is deprecated. Use .generateUid = "${this.autoUid}"; instead`),this.generateUid=this.autoUid),(t.has("generateUid")||t.has("user")||t.has("agent"))&&this.generateUid&&this.user&&(this.appType&&$0.has(this.appType)&&this.agent||this.appType&&!$0.has(this.appType))){const r=[this.generateUid];this.agent&&r.push(this.agent),this.user&&r.push(this.user.uid||this.user.id),this.uid=r.join("-")}const i=this.name;if((t.has("appType")||t.has("uid")||t.has("agent")||t.has("weavy"))&&this._appName!==this._initialAppName&&(this._appName=this._initialAppName,this.requestUpdate("name",i)),t.has("appType")||t.has("uid")||t.has("agent")||t.has("name")||t.has("weavy"))if(this.appType&&this.uid&&this.weavy){const r=this.name?{name:this.name}:void 0,n=this.agent?[this.agent]:void 0;await x(this,oo).trackQuery(tI(this.weavy,this.uid,this.appType,n,r))}else x(this,oo).untrackQuery();if(x(this,oo).result?.isPending||(this.app=x(this,oo).result?.data,this.app?.name&&this._appName!==this.app.name&&(this.name=this.app.name,this.requestUpdate("name",i))),t.has("uid")&&(this.uid||t.get("uid"))&&this.uid!==t.get("uid")&&this.clearLink(),!this.link&&(t.has("uid")&&this.uid||t.has("app")&&this.app)&&this.appType&&this.appType!==Xn&&this.readStorageLink(),t.has("app")&&this.app){const r=new CustomEvent("wy-app",{bubbles:!1,composed:!0,detail:{app:this.app}});this.dispatchEvent(r)}t.has("app")&&this.app&&(t.get("app")&&E(this,sw,new Promise(r=>{E(this,rw,r)})),(e=x(this,rw))==null||e.call(this,this.app)),(t.has("weavy")||t.has("app"))&&this.weavy&&this.app&&this.appSubscribeMutation.trackMutation(iI(this.weavy,this.app))}},h(jp,"yw"),jp);rw=new WeakMap,sw=new WeakMap,oo=new WeakMap,c(Jz,"WeavyAppComponent");let Xi=Jz;Wl([wn({context:e4}),B()],Xi.prototype,"app",2);Wl([b({type:Object})],Xi.prototype,"link",1);Wl([B()],Xi.prototype,"appType",2);Wl([b()],Xi.prototype,"generateUid",2);Wl([b({converter:r4})],Xi.prototype,"uid",2);Wl([b({type:String})],Xi.prototype,"name",1);Wl([b()],Xi.prototype,"autoUid",2);function tI(s,t,e=Xn,i,r){return{queryKey:["apps",t],queryFn:c(async()=>{const n=[];e===Xn||typeof t=="number"?n.push(s.fetch(`/api/apps/${t}`)):i?.length?(n.push(s.fetch(`/api/apps/${t}`)),n.push(s.fetch("/api/apps",{method:"POST",body:JSON.stringify({type:e,members:i,uid:t,...r})}))):n.push(s.fetch(`/api/apps/${t}`,{method:"PUT",body:JSON.stringify({type:e,...r})}));const a=(await Promise.allSettled(n)).findLast(l=>l.status==="fulfilled"&&l.value?.ok),o=a?.status==="fulfilled"&&a.value;if(o)return await o.json();throw new Error(`Error getting or creating app ${t}`)},"queryFn")}}h(tI,"I0");c(tI,"getOrCreateAppOptions");function eI(s){return{mutationFn:c(async({name:t,members:e,type:i,uid:r})=>await(await s.fetch("/api/apps",{method:"POST",body:JSON.stringify({name:t,members:e,type:i,uid:r})})).json(),"mutationFn"),onSettled:c(async()=>{await s.queryClient.invalidateQueries({queryKey:["apps"]})},"onSettled")}}h(eI,"F0");c(eI,"getCreateAppMutationOptions");function p4(s){return new Gt(s.queryClient,eI(s))}h(p4,"jm");c(p4,"getCreateAppMutation");function iI(s,t){const e=s.queryClient,i=["apps",t.uid||t.id];return{mutationFn:c(async({subscribe:r})=>{if(t.id>=1){const n=await s.fetch(`/api/apps/${t.id}/${r?"subscribe":"unsubscribe"}`,{method:"POST"});if(!n.ok)throw await n.json()}else throw new Error(`Could not subscribe to app ${t.uid||t.id}.`)},"mutationFn"),onMutate:c(r=>{let n;return e.setQueryData(i,a=>(n=a.is_subscribed,{...a,is_subscribed:r.subscribe})),{previousSubscribe:n,subscribe:r.subscribe}},"onMutate"),onError(r,n,a){a&&a.previousSubscribe!==void 0&&e.setQueryData(i,o=>({...o,is_subscribed:a?.previousSubscribe}))}}}h(iI,"D0");c(iI,"getAppSubscribeMutationOptions");function rI(s,t=[xt.ChatRoom,xt.PrivateChat],e){const i=new URLSearchParams({count_only:"true",unread:"true",uid:"false"});e&&i.append("member",e),t?.forEach(n=>i.append("type",n));const r=`/api/apps?${i.toString()}`;return Fy(s,["apps","unread",t,e],r)}h(rI,"V0");c(rI,"getAppsUnreadOptions");function sI(s,t={},e,i,r,n,a){return{...t,initialPageParam:0,queryKey:["apps","list",e,i,n,a],queryFn:c(async o=>{const l=new URLSearchParams;i&&l.append("member",i),o.pageParam&&typeof o.pageParam=="number"&&l.append("skip",o.pageParam?.toString()),e?.forEach(f=>l.append("type",f)),l.append("order_by",n);const d=r?.();d&&l.append("q",d),l.append("uid","false");const u=`/api/apps?${l.toString()}`,p=await(await s.fetch(u)).json();return p.data=p.data||[],p},"queryFn"),getNextPageParam:c(o=>{if(o.end&&o?.end<o?.count)return o.end},"getNextPageParam")}}h(sI,"H0");c(sI,"getAppListOptions");var bi=(s=>(s.Default="",s.Select="select",s.Star="star",s.Unstar="unstar",s.Subscribe="subscribe",s.Unsubscribe="unsubscribe",s.Pin="pin",s.Unpin="unpin",s.Download="download",s.Preview="preview",s))(bi||{}),Up;const nI=(Up=class{get weavy(){return this.weavyContext?.value}constructor(t){t.addController(this),this.host=t,this.whenWeavyContext=new Promise(e=>this.resolveWeavyContext=e),this.setContexts()}async setContexts(){await Ss(this.host),this.weavyContext=new xr(this.host,{context:Ve,subscribe:!0})}dispatchActionEvent(t){const e=new CustomEvent("wy-action",{detail:{action:bi.Select,app:t},bubbles:!0,composed:!0});return this.host.dispatchEvent(e)}async initMutation(){if(!this.addConversationMutation){const t=await this.whenWeavyContext;this.addConversationMutation=p4(t)}return this.addConversationMutation}async create(t=[]){const e=await this.initMutation(),i=this.agent??this.host.agent,r=i?{members:[i],type:zr.AgentChat}:{members:t,type:t.length===1?zr.PrivateChat:zr.ChatRoom},n=await e.mutate(r);return this.dispatchActionEvent(n),n}hostUpdate(){this.weavyContext?.value&&this.resolveWeavyContext?.(this.weavyContext?.value)}},h(Up,"ww"),Up);c(nI,"CreateConversationController");let zb=nI;var nw,Hp;const aI=(Hp=class{constructor(t){q(this,nw,!1),t.addController(this),this.host=t,t.addEventListener("dragstart",()=>this.isDragActive=!0),t.addEventListener("dragenter",()=>this.isDragActive=!0),t.addEventListener("dragover",e=>{e.preventDefault(),this.isDragActive=!0}),t.addEventListener("dragleave",()=>this.isDragActive=!1),t.addEventListener("dragend",()=>this.isDragActive=!1),t.addEventListener("drop",e=>this.handleDrop(e))}get isDragActive(){return x(this,nw)}set isDragActive(t){x(this,nw)!==t&&(E(this,nw,t),this.host.requestUpdate())}handleDrop(t){t.preventDefault();const e=[];t.dataTransfer?.items?[...t.dataTransfer.items].forEach(i=>{if(i.kind==="file"){const r=i.getAsFile();r?e.push(r):console.error("Could not add file")}}):t.dataTransfer?.files&&[...t.dataTransfer.files].forEach(i=>{e.push(i)}),e.length&&this.dispatchUploadFiles(e),this.isDragActive=!1}dispatchUploadFiles(t){const e=new CustomEvent("drop-files",{detail:{files:t}});return this.host.dispatchEvent(e)}hostDisconnected(){}},h(Hp,"fw"),Hp);nw=new WeakMap,c(aI,"DropZoneController");let oI=aI;function Sw(s,t){Pe();const e=wo({},window.history.state,!0);if(!e.weavy||!e.weavy[s]||!Object.hasOwn(e.weavy[s],t))throw new Error("Property not found");return e.weavy[s][t]}h(Sw,"Fd");c(Sw,"getBrowserStateProperty");function x0(s,t,e="push",i){if(Pe(),t){const r=wo({},window.history.state,!0);r.weavy??={},r.weavy[s]=t,i=i&&String(i)||window.location.href;try{e==="replace"?window.history.replaceState(r,"",i):window.history.pushState(r,"",i)}catch(n){console.warn("history: Could not push history state.",n,t)}}}h(x0,"Tp");c(x0,"setBrowserState");function lI(s,t,e){Pe();const i=`${typeof s}:${t}`;e.forEach(r=>{try{const n=Sw(i,r),a=s[r];f4(a,n)&&(s[r]=n)}catch{}})}h(lI,"B0");c(lI,"restoreHistoryProperties");function k0(s,t,e,i="push"){Pe();const r=`${typeof s}:${t}`,n={};e.forEach(a=>{n[a]=s[a]}),x0(r,n,i)}h(k0,"Lp");c(k0,"pushHistoryProperties");function cI(s,t,e){k0(s,t,e,"replace")}h(cI,"N0");c(cI,"updateHistoryProperties");function f4(s,t){return s&&t&&(nn(s)||nn(t))?s&&Object.hasOwn(s,"id")||t&&Object.hasOwn(t,"id")?s.id!==t.id:!vo(s,t):s!==t}h(f4,"Wm");c(f4,"itemHasChanged");var Yp;const pU=(Yp=class{constructor(t,e,i){if(this._backCount=0,this.restoreHistory=r=>{if(this.prefixKey&&this.properties){lI(this.host,this.prefixKey,this.properties);try{this._backCount=Sw(this.prefixKey,"_backCount")||0}catch{this._backCount=0}this.updatePrevPropertyValues()}},t.addController(this),this.host=t,i&&(this.properties=i),e){this.prefixKey=e;try{this._backCount=Sw(this.prefixKey,"_backCount")||this._backCount}catch{}}}get hasBackNavigation(){return this._backCount>0}back(){window.history.back()}backAll(){window.history.go(this._backCount*-1)}observe(t,e){if(this.properties=t,e){this.prefixKey=e;try{this._backCount=Sw(this.prefixKey,"_hasBack")||this._backCount}catch{}}}pushCurrentState(){this.prefixKey&&(k0(this.host,this.prefixKey,this.properties),this._backCount++,x0(this.prefixKey,{_backCount:this._backCount},"replace"))}updatePrevPropertyValues(){this.properties&&this.properties.forEach(t=>{this.prevPropertyValues??={};const e=this.host[t];this.prevPropertyValues[t]!==e&&(this.prevPropertyValues[t]=e&&JSON.parse(JSON.stringify(e)))})}hostConnected(){window.addEventListener("popstate",this.restoreHistory)}hostUpdated(){this.prefixKey&&this.properties&&(this.prevPropertyValues?this.properties.some(t=>{const e=this.prevPropertyValues?.[t],i=this.host[t];return f4(e,i)})&&(k0(this.prevPropertyValues,this.prefixKey,this.properties),this._backCount++,x0(this.prefixKey,{_backCount:this._backCount},"replace")):this.prevPropertyValues={},cI(this.host,this.prefixKey,this.properties),this.updatePrevPropertyValues())}hostDisconnected(){window.removeEventListener("popstate",this.restoreHistory)}},h(Yp,"mw"),Yp);c(pU,"HistoryController");var Gp;const hI=(Gp=class{get result(){return this._result&&this.observer?this.observer.trackResult(this._result):this.observer?.getCurrentResult()??{isPending:!0}}constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenQueryClient=new Promise(e=>this.resolveQueryClient=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0,callback:c(t=>{t&&(this.resolveContext?.(t),this.queryClient=t.queryClient,this.resolveQueryClient?.(t.queryClient))},"callback")})}async trackInfiniteQuery(t,e=!0){this.observerUnsubscribe?.();const i=await this.whenQueryClient;if(!i)throw new Error("No QueryClient provided");const r=new Cj(i,t);this.observer=r,this.observerSubscribe(e)}observerSubscribe(t=!0){if(this.queryClient&&this.observer){t?this._result=this.observer.getOptimisticResult(this.observer.options):this._result=this.observer.getCurrentResult(),this.observerUnsubscribe=this.observer.subscribe(()=>{if(this.observer){const i=Wy(this.result,this.observer.getCurrentResult());i!==this._result&&(this._result=i,this.host.requestUpdate())}}),this.observer.updateResult(),this.host.requestUpdate();let e;t?e=this.observer.fetchOptimistic(this.observer.options):e=this.queryClient.getQueryCache().get(this.observer.options.queryHash)?.promise,e?.catch(()=>{}).finally(()=>{this.observer?.updateResult()})}}untrackInfiniteQuery(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this._result=void 0,this.observer=void 0,this.host.requestUpdate()}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(Gp,"vw"),Gp);c(hI,"InfiniteQueryController");let Fl=hI;function S0(s,t=!1){for(s&&!t&&(s=s.nextElementSibling);s;){if(!(s instanceof HTMLElement))continue;const e=getComputedStyle(s);if(e.display!=="none"){if(e.display==="contents"){if(s.shadowRoot&&s.shadowRoot.firstElementChild instanceof HTMLElement){const i=S0(s.shadowRoot.firstElementChild,!0);if(i)return i}if(s.firstElementChild instanceof HTMLElement){const i=S0(s.firstElementChild,!0);if(i)return i}}if(/absolute|sticky|fixed/.test(e.position)===!1)return s;s=s.nextElementSibling}}return null}h(S0,"Op");c(S0,"getNextPositionedChild");function Q1(s,t=!1){if(Pe(),s){let e=getComputedStyle(s);const i=e.position==="absolute",r=t?/(auto|scroll|overlay|hidden)/:/(auto|overlay|scroll)/;if(e.position==="fixed"&&document.scrollingElement)return document.scrollingElement;for(let n=s;n=n.parentElement||n.parentNode||n.host;)if(n instanceof Element&&(e=getComputedStyle(n),!(i&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX)))return n}return document.scrollingElement||s}h(Q1,"$h");c(Q1,"getScrollParent");function dI(s){if(s&&s.isConnected){const t=Q1(s);return t.clientHeight!==t.scrollHeight}return!1}h(dI,"U0");c(dI,"hasScroll");function uI(s,t=32){if(s){const e=Q1(s);return Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)<t}return!1}h(uI,"q0");c(uI,"isParentAtBottom");async function pI(s,t=!1){if(s){const e=Q1(s);Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)>1&&(t?e.scrollTo({top:e.scrollHeight,left:0,behavior:"smooth"}):e.scrollTop=e.scrollHeight),await new Promise(i=>{let r=e.scrollTop;const n=c(()=>{t&&e.scrollTop===r&&(e.scrollTop=e.scrollHeight),r=e.scrollTop,Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)>1?requestAnimationFrame(n):i(void 0)},"scrollCheck");requestAnimationFrame(n)})}}h(pI,"j0");c(pI,"scrollParentToBottom");const fU=0,mU=void 0;function fI(s,t,e=!1){Pe(),t??=c(()=>Promise.reject(new Error("No scroll function defined")),"whenNext");const i=e?Q1(s):document.documentElement,r=i===document.documentElement?document:i;let n=!1;const a=new IntersectionObserver(o=>{o.forEach(l=>{if(l.isIntersecting&&!n)if(n=!0,e&&i&&r instanceof HTMLElement){const d=S0(l.target)||l.target,u=i.scrollHeight,p=d.offsetTop,f=c(()=>{queueMicrotask(()=>{if(u!==i.scrollHeight){if(d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)}else queueMicrotask(()=>{if(u!==i.scrollHeight){if(d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)}else requestAnimationFrame(()=>{if(a.takeRecords().length&&d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)})})})},"afterNext");t().then(f)}else t().then(()=>{requestAnimationFrame(()=>n=!1)})})},{root:r,threshold:fU,rootMargin:mU});return a.observe(s),a}h(fI,"Q0");c(fI,"createScroller");var Kp;const mI=(Kp=class{constructor(t,e=!1){this.reverse=!1,this.isObservePending=!1,t.addController(this),this.host=t,this.reverse=e}observe(t,e){t&&e&&!t.isLoading&&!this.isObservePending&&(this.isObservePending=!0,requestAnimationFrame(()=>{this.loadMoreRefElement=e,this.scroller?.disconnect(),this.scroller=fI(e,async()=>{t.hasNextPage&&!t.isFetching&&(await t.fetchNextPage({cancelRefetch:!1}),this.reverse&&await this.host.updateComplete)},this.reverse),this.isObservePending=!1}))}hostConnected(){this.loadMoreRefElement&&this.scroller?.observe(this.loadMoreRefElement)}hostDisconnected(){this.scroller?.disconnect()}},h(Kp,"gw"),Kp);c(mI,"InfiniteScrollController");let ql=mI;var Jp;const yI=(Jp=class extends ql{constructor(t){super(t,!0)}},h(Jp,"bw"),Jp);c(yI,"ReverseInfiniteScrollController");let yU=yI;var Rn,th,tf;const gI=(tf=class{constructor(t){if(q(this,Rn),q(this,th),E(this,Rn,new Map),this.keyPrefix="WEAVY_OFFLINE_CACHE",t)E(this,th,t);else try{Pe(),E(this,th,window.sessionStorage)}catch{console.warn("Session storage not available.")}}resetPersistPropertiesCache(){x(this,Rn).clear()}getStorageItem(t,e){const i=x(this,th)?.getItem(`${t}-${e.toString()}`);if(i)return JSON.parse(i)}setStorageItem(t,e,i){const r=JSON.stringify(i);r&&x(this,th)?.setItem(`${t}-${e.toString()}`,r)}persistProperties(t,e,i,r,n){const a=`${this.keyPrefix}:${r?`${r}:`:""}${typeof t}:${e}`,o=new Map;for(const l of i){if(!x(this,Rn).has(l.name)){const d=this.getStorageItem(a,l.name);d&&(l.override||!t[l.name])&&(o.set(l.name,t[l.name]),t[l.name]=d),x(this,Rn).set(l.name,d)}if(n?.(o),t[l.name]!==x(this,Rn).get(l.name)){const d=t[l.name];x(this,Rn).set(l.name,d),this.setStorageItem(a,l.name,d)}}}},h(tf,"xw"),tf);Rn=new WeakMap,th=new WeakMap,c(gI,"PersistStorageCache");let gU=gI;var eh,aw,ef;const wI=(ef=class{constructor(t){q(this,eh),q(this,aw),E(this,eh,""),this.properties=[],this.initialProperties=new Map,this.persistStorageCache=new gU,t.addController(this),this.host=t}get prefixKey(){return x(this,eh)}set prefixKey(t){t!==x(this,eh)&&(this.persistStorageCache.resetPersistPropertiesCache(),E(this,eh,t),this.host.requestUpdate())}get cachePrefix(){return x(this,aw)}set cachePrefix(t){t!==x(this,aw)&&(this.persistStorageCache.resetPersistPropertiesCache(),E(this,aw,t),this.host.requestUpdate())}observe(t,e,i,r){this.properties=t,this.callback=r;const n=!!(this.prefixKey&&this.prefixKey!==e||this.cachePrefix&&this.cachePrefix!==i);this.properties.forEach(a=>{n&&this.initialProperties.has(a.name)?this.host[a.name]=this.initialProperties.get(a.name):this.initialProperties.has(a.name)||this.initialProperties.set(a.name,this.host[a.name])}),e&&(this.prefixKey=e),i&&(this.cachePrefix=i)}hostUpdate(){this.prefixKey&&this.properties&&this.host.weavy&&this.persistStorageCache.persistProperties(this.host,this.prefixKey,this.properties,this.cachePrefix?`${this.host.weavy.cachePrefix}:${this.cachePrefix}`:this.host.weavy.cachePrefix,this.callback)}},h(ef,"Cw"),ef);eh=new WeakMap,aw=new WeakMap,c(wI,"PersistStateController");let T1=wI;var rf;const wU=(rf=class{constructor(t){this.observers=[],this.conditions={},this.resizer=new ResizeObserver(e=>{let i=!1;for(const r of e)i=this.checkConditions(r)||i;i&&this.host.requestUpdate()}),t.addController(this),this.host=t}checkConditions(t){let e=!1;return this.observers.forEach(i=>{if(t.target===i.target){const r=this.conditions[i.name],n=i.condition(t);r!==n&&(this.conditions[i.name]=n,e=!0)}}),e}observe(t){const e=t.target,i=e.getBoundingClientRect();this.observers.push(t),this.resizer.observe(e),this.checkConditions({contentBoxSize:[{inlineSize:e.clientWidth,blockSize:e.clientHeight}],borderBoxSize:[{inlineSize:i.width,blockSize:i.height}],devicePixelContentBoxSize:[{inlineSize:i.width*window.devicePixelRatio,blockSize:i.height*window.devicePixelRatio}],contentRect:i,target:e})}reset(){this.conditions={},this.observers.length=0,this.resizer.disconnect()}hostConnected(){this.observers.forEach(t=>{this.resizer.observe(t.target)})}hostDisconnected(){this.resizer.disconnect()}},h(rf,"$w"),rf);c(wU,"ResizeController");var sf;const vI=(sf=class{constructor(t,e){this.additionalTargets=new Set,this.setExportParts=i=>{(!this.host.hasAttribute("exportparts")||this.shadowParts)&&(this.shadowParts??=new Set,i.forEach(r=>{r.part.forEach(n=>this.shadowParts?.add(n)),r.getAttribute("exportparts")?.split(", ").forEach(n=>this.shadowParts?.add(n))}),this.shadowParts.size&&this.host.setAttribute("exportparts",Array.from(this.shadowParts.values()).join(", ")))},t.addController(this),this.host=t,this.addLocalName=e}addPartsFrom(t){t&&!this.additionalTargets.has(t)&&(this.setExportParts([t]),this.observer?.observe(t,{attributeFilter:["part","exportparts"]}),this.additionalTargets.add(t))}async hostConnected(){if(await this.host.updateComplete,$k(this.host)&&this.host.shadowRoot){const t=Array.from(this.host.shadowRoot.querySelectorAll("[part], [exportparts]"));this.setExportParts(t),this.observer=new MutationObserver(e=>{const i=e.flatMap(r=>r.type==="attributes"?[r.target]:Array.from(r.addedNodes)).filter(r=>r instanceof Element);this.setExportParts(i)}),this.observer.observe(this.host.shadowRoot,{subtree:!0,childList:!0,attributeFilter:["part","exportparts"]}),Array.from(this.additionalTargets).forEach(e=>{this.observer?.observe(e,{attributeFilter:["part","exportparts"]})})}}hostUpdated(){$k(this.host)&&this.addLocalName!==!1&&!this.host.part.contains(this.host.localName)&&(this.addLocalName||getComputedStyle(this.host).display!=="contents")&&this.host.part.add(this.host.localName)}hostDisconnected(){this.observer?.disconnect()}},h(sf,"kw"),sf);c(vI,"ShadowPartsController");let rt=vI;var nf;const OI=(nf=class{constructor(t){this.delay=NaN,this.sleep=!1,t.addController(this),this.host=t}createObserver(t){this.scrollObserver?.disconnect(),this.swipeElement=t,this.scrollObserver=new IntersectionObserver(e=>{e.forEach(async i=>{i.isIntersecting&&!this.sleep&&i.intersectionRatio>=1&&(this.sleep=!0,Number.isNaN(this.delay)||await new Promise(r=>{setTimeout(r,this.delay)}),i.target===this.prevElement&&this.whenPrev&&await this.whenPrev(),i.target===this.nextElement&&this.whenNext&&await this.whenNext(),await this.host.updateComplete)})},{root:t,threshold:1,rootMargin:"0px"})}observe(t,e){this.prevElement&&(this.scrollObserver?.unobserve(this.prevElement),this.prevElement=void 0),this.nextElement&&(this.scrollObserver?.unobserve(this.nextElement),this.nextElement=void 0),t&&(this.scrollObserver?.observe(t),this.prevElement=t),e&&(this.scrollObserver?.observe(e),this.nextElement=e),this.sleep=!1}clearObserver(){this.prevElement=void 0,this.nextElement=void 0,this.scrollObserver?.disconnect(),this.sleep=!1}hostConnected(){this.scrollObserver&&(this.prevElement&&this.scrollObserver.observe(this.prevElement),this.nextElement&&this.scrollObserver.observe(this.nextElement),this.sleep=!1)}hostDisconnected(){this.scrollObserver?.disconnect()}},h(nf,"Pw"),nf);c(OI,"SwipeScrollController");let vU=OI;var ow,iO,af;const bI=(af=class{constructor(t,e){q(this,ow),q(this,iO),E(this,ow,!0),this.styles=[],t.addController(this),this.host=t,e&&(this.styles=e)}get themeColor(){return x(this,iO)}set themeColor(t){E(this,iO,t),this.checkThemeUpdate()}checkThemeUpdate(){const t=this.themeColor||y0(this.host)||g0();if(t&&t!==this._resolvedThemeColor){this._resolvedThemeColor=t,console.info("Configuring theme",this._resolvedThemeColor);const e=uz(this._resolvedThemeColor).join(""),i=it`
|
|
31
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),a9=/'/g,o9=/"/g,A_=/^(?:script|style|textarea|title)$/i,R_=yt(s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),"y"),v=R_(1),s0=R_(2),ys=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),l9=new WeakMap,fo=fl.createTreeWalker(fl,129);function LP(s,t){if(!_P(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return r9!==void 0?r9.createHTML(t):t}h(LP,"Mt$1");yt(LP,"P");const GX=yt((s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":t===3?"<math>":"",a=dg;for(let o=0;o<e;o++){const l=s[o];let d,u,p=-1,f=0;for(;f<l.length&&(a.lastIndex=f,u=a.exec(l),u!==null);)f=a.lastIndex,a===dg?u[1]==="!--"?a=s9:u[1]!==void 0?a=n9:u[2]!==void 0?(A_.test(u[2])&&(r=RegExp("</"+u[2],"g")),a=Na):u[3]!==void 0&&(a=Na):a===Na?u[0]===">"?(a=r??dg,p=-1):u[1]===void 0?p=-2:(p=a.lastIndex-u[2].length,d=u[1],a=u[3]===void 0?Na:u[3]==='"'?o9:a9):a===o9||a===a9?a=Na:a===s9||a===n9?a=dg:(a=Na,r=void 0);const y=a===Na&&s[o+1].startsWith("/>")?" ":"";n+=a===dg?l+HX:p>=0?(i.push(d),l.slice(0,p)+T_+l.slice(p)+Dn+y):l+Dn+(p===-2?o:y)}return[LP(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},"V");var sl;const E_=(sl=class{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,a=0;const o=t.length-1,l=this.parts,[d,u]=GX(t,e);if(this.el=sl.createElement(d,i),fo.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=fo.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(T_)){const f=u[a++],y=r.getAttribute(p).split(Dn),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:n,name:g[2],strings:y,ctor:g[1]==="."?JX:g[1]==="?"?tj:g[1]==="@"?ej:vb}),r.removeAttribute(p)}else p.startsWith(Dn)&&(l.push({type:6,index:n}),r.removeAttribute(p));if(A_.test(r.tagName)){const p=r.textContent.split(Dn),f=p.length-1;if(f>0){r.textContent=r0?r0.emptyScript:"";for(let y=0;y<f;y++)r.append(p[y],Bw()),fo.nextNode(),l.push({type:2,index:++n});r.append(p[f],Bw())}}}else if(r.nodeType===8)if(r.data===M_)l.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(Dn,p+1))!==-1;)l.push({type:7,index:n}),p+=Dn.length-1}n++}}static createElement(t,e){const i=fl.createElement("template");return i.innerHTML=t,i}},h(sl,"ge"),sl);yt(E_,"N");let nS=E_;function ml(s,t,e=s,i){if(t===ys)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl;const n=Xw(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=ml(s,r._$AS(s,t.values),r,i)),t}h(ml,"V");yt(ml,"S");var Ju;const __=(Ju=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??fl).importNode(e,!0);fo.currentNode=r;let n=fo.nextNode(),a=0,o=0,l=i[0];for(;l!==void 0;){if(a===l.index){let d;l.type===2?d=new wb(n,n.nextSibling,this,t):l.type===1?d=new l.ctor(n,l.name,l.strings,this,t):l.type===6&&(d=new ij(n,this,t)),this._$AV.push(d),l=i[++o]}a!==l?.index&&(n=fo.nextNode(),a++)}return fo.currentNode=fl,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},h(Ju,"Ge"),Ju);yt(__,"M");let KX=__;var nl;const L_=(nl=class{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ml(this,t,e),Xw(t)?t===C||t==null||t===""?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==ys&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):YX(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&Xw(this._$AH)?this._$AA.nextSibling.data=t:this.T(fl.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=nS.createElement(LP(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const n=new KX(r,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=l9.get(t.strings);return e===void 0&&l9.set(t.strings,e=new nS(t)),e}k(t){_P(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new nl(this.O(Bw()),this.O(Bw()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},h(nl,"me"),nl);yt(L_,"k");let wb=L_;var tp;const z_=(tp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=C}_$AI(t,e=this,i,r){const n=this.strings;let a=!1;if(n===void 0)t=ml(this,t,e,0),a=!Xw(t)||t!==this._$AH&&t!==ys,a&&(this._$AH=t);else{const o=t;let l,d;for(t=n[0],l=0;l<n.length-1;l++)d=ml(this,o[i+l],e,l),d===ys&&(d=this._$AH[l]),a||=!Xw(d)||d!==this._$AH[l],d===C?t=C:t!==C&&(t+=(d??"")+n[l+1]),this._$AH[l]=d}a&&!r&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},h(tp,"qe"),tp);yt(z_,"R");let vb=z_;var ep;const I_=(ep=class extends vb{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}},h(ep,"Ke"),ep);yt(I_,"H");let JX=I_;var ip;const D_=(ip=class extends vb{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}},h(ip,"Ze"),ip);yt(D_,"I");let tj=D_;var rp;const V_=(rp=class extends vb{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=ml(this,t,e,0)??C)===ys)return;const i=this._$AH,r=t===C&&i!==C||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==C&&(i===C||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},h(rp,"Je"),rp);yt(V_,"L");let ej=V_;var sp;const W_=(sp=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ml(this,t)}},h(sp,"Xe"),sp);yt(W_,"z");let ij=W_;const rj={I:wb},sj=gb.litHtmlPolyfillSupport;sj?.(nS,wb),(gb.litHtmlVersions??=[]).push("3.3.1");const nj=yt((s,t,e)=>{const i=e?.renderBefore??t;let r=i._$litPart$;if(r===void 0){const n=e?.renderBefore??null;i._$litPart$=r=new wb(t.insertBefore(Bw(),n),n,void 0,e??{})}return r._$AI(s),r},"j"),zP=globalThis;var np;const F_=(np=class extends Uc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nj(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ys}},h(np,"Qe"),np);yt(F_,"i");let wt=F_;wt._$litElement$=!0,wt.finalized=!0,zP.litElementHydrateSupport?.({LitElement:wt});const aj=zP.litElementPolyfillSupport;aj?.({LitElement:wt});(zP.litElementVersions??=[]).push("4.2.1");v`<strong>${0}</strong> redigerade <em>${1}</em>`,v`<strong>${0}</strong> nämnde dig i ett inlägg`,v`<strong>${0}</strong> kommenterade på <strong>${1}</strong>`,v`<strong>${0}</strong> reagerade med ${1} på <em>${2}</em>`,v`<strong>${0}</strong> svarade på ett inlägg`,v`<strong>${0}</strong> redigerade ett inlägg`,v`<strong>${0}</strong> nämnde dig i ett meddelande`,v`<strong>${0}</strong> nämnde dig i en kommentar`,v`<strong>${0}</strong> och <strong>${1}</strong> röstade i din omröstning`,v`<strong>${0}</strong> reagerade med ${1} på ditt inlägg`,v`<strong>${0}</strong> reagerade med ${1} på din kommentar`,v`Nytt meddelande från <strong>${0}</strong>`,v`<strong>${0}</strong> svarade på ditt inlägg`,v`<strong>${0}</strong> röstade i din omröstning`,v`<strong>${0}</strong> publicerade ett inlägg i <strong>${1}</strong>`,v`<strong>${0}</strong> gillade ditt meddelande`,v`<strong>${0}</strong>, <strong>${1}</strong> och <strong>${2}</strong> röstade i din omröstning`,v`<strong>${0}</strong> lade till <em>${1}</em> till <strong>${2}</strong>`,v`<strong>${0}</strong> skickade ett meddelande i <strong>${1}</strong>`,v`<strong>${0}</strong> reagerade med ${1} på ditt meddelande`,v`<strong>${0}</strong> gillade <em>${1}</em>`,v`<strong>${0}</strong> gillade ditt inlägg`,v`<strong>${0}</strong> gillade din kommentar`,v`<strong>${0}</strong> och ${1} andra röstade i din omröstning`,v`<strong>${0}</strong> kommenterade på <em>${1}</em>`,lt`${0} svarade på ditt inlägg`,lt`${0} röstade i din omröstning`,lt`${0} skriver${1}`,lt`${0} och ${1} röstade i din omröstning`,lt`${0} kommenterade på ${1}`,lt`${0} gillade ${1}`,lt`${0} skickade ett meddelande i ${1}`,lt`${0} redigerade ett inlägg`,lt`Röster på ${0}`,lt`${0} kommentarer`,lt`Sedd av ${0} vid ${1}`,lt`${0} och ${1} andra röstade i din omröstning`,lt`Nytt meddelande från ${0}`,lt`${0} reagerade med ${1} på ditt inlägg`,lt`${0} nämnde dig i ett inlägg`,lt`${0} nämnde dig i en kommentar`,lt`${0} publicerade ett inlägg i ${1}`,lt`${0} gillade ditt inlägg`,lt`${0} nämnde dig i ett meddelande`,lt`${0} reagerade med ${1} på din kommentar`,lt`Öppna i ${0}`,lt`${0} svarade på ett inlägg`,lt`${0} lade till ${1} till ${2}`,lt`${0} redigerade ${1}`,lt`${0} gillade ditt meddelande`,lt`${0}, ${1} och ${2} röstade i din omröstning`,lt`Alternativ ${0}`,lt`${0} reagerade med ${1} på ${2}`,lt`${0} reagerade med ${1} på ditt meddelande`,lt`${0} gillade din kommentar`,lt`${0} skriver${1}`;var oj=Object.defineProperty,q_=h(s=>{throw TypeError(s)},"Hw"),c=h((s,t)=>oj(s,"name",{value:t,configurable:!0}),"a"),IP=h((s,t,e)=>t.has(s)||q_("Cannot "+e),"Ou"),x=h((s,t,e)=>(IP(s,t,"read from private field"),e?e.call(s):t.get(s)),"y"),q=h((s,t,e)=>t.has(s)?q_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),"O"),E=h((s,t,e,i)=>(IP(s,t,"write to private field"),t.set(s,e),e),"_"),St=h((s,t,e)=>(IP(s,t,"access private method"),e),"lt"),aS=h((s,t,e,i)=>({set _(r){E(s,t,r)},get _(){return x(s,t,i)}}),"Rd");function jw(s){return Object.prototype.toString.call(s)==="[object Object]"}h(jw,"Ud");c(jw,"isObject");function nn(s){if(jw(s)===!1)return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(jw(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}h(nn,"Dr");c(nn,"isPlainObject$1");function n0(s){return typeof s.toJSON=="function"}h(n0,"Yu");c(n0,"hasToJSON");function Z_(s){return typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s===null||nn(s)||Array.isArray(s)}h(Z_,"A1");c(Z_,"isJSONSerializable");function wo(s,t,e=!1){s=s||{},t=t||{};const i={};for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r]);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e&&i[r]&&nn(i[r])&&nn(t[r])?i[r]=wo(i[r],t[r],e):i[r]=t[r]);return i}h(wo,"Pa");c(wo,"assign");function N_(s){return s?Array.isArray(s)?s:[s]:[]}h(N_,"E1");c(N_,"asArray");async function B_(s,t){for(const e of s)if(await t(e))return e}h(B_,"R1");c(B_,"findAsyncSequential");function vo(s,t,e=!1,i=!1){if(!i&&(!nn(s)||!nn(t))||i&&(!jw(s)||!jw(t)))return!1;const r=Object.getOwnPropertyNames(s),n=Object.getOwnPropertyNames(t);if(!e&&r.length!==n.length)return!1;for(let a=0;a<r.length;a++){const o=r[a],l=s[o],d=t[o];if(l!==d&&!vo(l,d,e))return!1}return!0}h(vo,"_a");c(vo,"eqObjects");function DP(s){return Object.entries(s)}h(DP,"am");c(DP,"objectAsIterable");function VP(s){return s.charAt(0).toUpperCase()+s.substring(1).toLowerCase()}h(VP,"sm");c(VP,"toUpperCaseFirst");const lj='\\s,.:;"',cj=new RegExp(`^|[${lj}]|$`,"g"),hj=".!?",dj=new RegExp(`^|(?<=[${hj}])|$`);function WP(s){return s.length>0?s.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").replace(/_|\s+/g,"-").toLowerCase():s}h(WP,"om");c(WP,"toKebabCase");function X_(s,t=2){if(!s)return null;let e="";const i=s.split(cj).filter(r=>r);return i.length==1?e=i[0]:i.forEach(r=>{e+=r.charAt(0)}),e.substring(0,t).toUpperCase()}h(X_,"I1");c(X_,"getInitials");function FP(s){let t;const e=s.split(dj).filter(i=>i);return e.length?t=e[0]:t=s,t}h(FP,"cm");c(FP,"getTitleFromText");function qP(s,t=256){return s.length>t&&(s=s.substring(0,t-1)+"…"),s}h(qP,"lm");c(qP,"truncateText");const uj=/^[\p{Extended_Pictographic}\p{Emoji_Presentation}]+$/u;function j_(s){return!!s?.match(uj)?.length}h(j_,"D1");c(j_,"checkOnlyEmojis");const pj={credentials:"omit",headers:{"X-Requested-With":"XMLHttpRequest"},redirect:"manual"};function U_(){const s=new WeakSet,t=c(function(e,i){if(n0(i)&&(i=i.toJSON()),!(i!==null&&typeof i=="object"))return i;if(s.has(i))return"[Circular]";let r;if(s.add(i),nn(i)){const n={};Object.keys(i).forEach(a=>{n[a]=t(a,i[a])}),r=n}else Array.isArray(i)&&(r=i.map((n,a)=>t(a,n)));return s.delete(i),r},"replacer");return t}h(U_,"H1");c(U_,"getCircularReferenceReplacer");function wy(){return((1+Math.random())*65536|0).toString(16).substring(1)}h(wy,"fl");c(wy,"S4");function H_(s){if(s&&s.ok&&s.body){const t=s.body.getReader();return new ReadableStream({start(e){const i=c(()=>t.read().then(({done:r,value:n})=>{if(r){e.close();return}return e.enqueue(n),i()}),"pump");return i()}})}else throw new Error("Could not parse text stream")}h(H_,"B1");c(H_,"getTextStreamFromResponse");function ZP(s){let t;try{if(t=window[s],t){const e="__storage_test__";t.setItem(e,e),t.removeItem(e)}}catch(e){e instanceof DOMException&&e.name==="QuotaExceededError"&&t&&t.length!==0&&console.error("Storage not available:",s)}return t}h(ZP,"dm");c(ZP,"getStorage");var ap;const Y_=(ap=class extends Error{constructor(){super("Instance destroyed"),this.name="DestroyError"}},h(ap,"Wy"),ap);c(Y_,"DestroyError");let _e=Y_;const fj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._whenTokenFactory=new Promise(n=>{this._resolveTokenFactory=n}),this._whenUrlAndTokenFactory=new Promise(n=>{this._resolveUrlAndTokenFactory=a=>{n(a),this.configurationState="configured"}}),this._whenTokenIsValid=new Promise(n=>{this._resolveTokenIsValid=n}),this._tokenPromise=null,this._token="",this._validTokenFromFactory=async(n=!1)=>{const a=[this.whenTokenFactory()];this.tokenFactoryRetryDelay>=0&&this.tokenFactoryRetryDelay<1/0&&a.push(new Promise(l=>setTimeout(l,this.tokenFactoryRetryDelay))),await Promise.race(a);const o=await this.tokenFactory?.(n)??"";if(this._validateToken(o)){if(n&&o===this._token&&this.tokenFactoryRetryDelay>=0&&this.tokenFactoryRetryDelay<1/0)return await new Promise(l=>setTimeout(l,this.tokenFactoryRetryDelay)),await this._validTokenFromFactory(!0)}else if(this._whenTokenFactory=new Promise(l=>{this._resolveTokenFactory=l}),!n)return await this._validTokenFromFactory(!1);if(!o)throw new TypeError("Could not get a valid token from tokenFactory.");return this._resolveTokenFactory?.(!0),this.whenUrl().then(this._resolveUrlAndTokenFactory),o},Promise.all([this.whenUrl(),this.whenTokenFactory()]).then(()=>{this.url&&this.tokenFactory&&this._resolveUrlAndTokenFactory?.(!0)})}async whenTokenFactory(){await this._whenTokenFactory}async whenUrlAndTokenFactory(){await this._whenUrlAndTokenFactory}async whenTokenIsValid(){await this._whenTokenIsValid}get tokenFactory(){return this._tokenFactory}set tokenFactory(r){if(this.isDestroyed)throw new _e;this._tokenFactory&&this._tokenFactory!==r&&this.whenTokenFactory().then(()=>{this.queryClient.refetchQueries({stale:!0})}),this._tokenFactory=r??void 0,this._tokenFactory&&queueMicrotask(()=>{this._resolveTokenFactory?.(!0)})}get tokenUrl(){return this._tokenUrl}set tokenUrl(r){if(this.isDestroyed)throw new _e;try{if(typeof r=="string")r&&(this._tokenUrl=new URL(r,window.location.toString()));else if(r instanceof URL)this._tokenUrl=r;else if(r==null)this._tokenUrl=void 0;else throw new Error}catch(n){throw new Error("Invalid url",n)}this._tokenUrl&&!this.tokenFactory&&(this.tokenFactory=async n=>{if(!this.tokenUrl)throw new Error("tokenURL property is not valid");const a=new URL(this.tokenUrl);n?a.searchParams.set("refresh","true"):a.searchParams.delete("refresh");const o=await fetch(a);if(o.ok){const l=await o.json();if(l.access_token===void 0)throw new Error("Token response does not contain required property: access_token");return l.access_token}else throw new Error("Could not get access token from server!")})}_validateToken(r){if(!r)return!1;if(typeof r!="string")throw new TypeError(`You have provided an invalid string access token of type ${typeof r}.`);if(typeof r=="string"&&!r.startsWith("wyu_"))throw r.startsWith("wys_")?new TypeError("You have provided an API key for authentication. Provide a user access token instead."):new TypeError("You have provided an invalid string as access token.");return this._resolveTokenIsValid?.(r),!0}async getToken(r=!1){if(this.isDestroyed)throw new _e;if(this._token&&!r)return this._token;if(this._tokenPromise)return await this._tokenPromise;this._tokenPromise=new Promise((n,a)=>{this._validTokenFromFactory(r).then(n).catch(a),this.tokenFactoryTimeout>=0&&this.tokenFactoryTimeout<1/0&&setTimeout(()=>a(new Error("Token factory timeout.")),this.tokenFactoryTimeout),window.addEventListener("offline",()=>a(new Error("Network changed.")),{once:!0}),window.addEventListener("online",()=>a(new Error("Network changed.")),{once:!0})});try{const n=await this._tokenPromise;return this._tokenPromise=null,this._token=n,this._token}catch(n){throw this._tokenPromise=null,n}}},h(e,"t"),e),c(t,"WeavyAuthentication"),t},"WeavyAuthenticationMixin");var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G_(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}h(G_,"U1");c(G_,"getDefaultExportFromCjs");function Xv(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}h(Xv,"zu");c(Xv,"commonjsRequire");var c9={exports:{}},h9;function K_(){return h9||(h9=1,(function(s,t){var e;e=c(()=>(()=>{var ic,rc,sc,nc,ac,oc,lc,cc,hc,dc,uc,pc,Ps,fc,mc,yc,gc,wc,Qs,vc,Oc,bc,$c,Wa,xc,kc,Sc,Cc,Pc,Qc,Tc,Mc,Fa,Ac,Rc,Ec;var i={d:c((H,w)=>{for(var S in w)i.o(w,S)&&!i.o(H,S)&&Object.defineProperty(H,S,{enumerable:!0,get:w[S]})},"d")};i.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),i.o=(H,w)=>Object.prototype.hasOwnProperty.call(H,w),i.r=H=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"t",{value:!0})};var r,n={};i.r(n),i.d(n,{AbortError:c(()=>p,"AbortError"),DefaultHttpClient:c(()=>y3,"DefaultHttpClient"),HttpClient:c(()=>tt,"HttpClient"),HttpError:c(()=>o,"HttpError"),HttpResponse:c(()=>V,"HttpResponse"),HttpTransportType:c(()=>Ee,"HttpTransportType"),HubConnection:c(()=>k3,"HubConnection"),HubConnectionBuilder:c(()=>VW,"HubConnectionBuilder"),HubConnectionState:c(()=>ae,"HubConnectionState"),JsonHubProtocol:c(()=>D3,"JsonHubProtocol"),LogLevel:c(()=>r,"LogLevel"),MessageType:c(()=>It,"MessageType"),NullLogger:c(()=>dt,"NullLogger"),Subject:c(()=>O3,"Subject"),TimeoutError:c(()=>d,"TimeoutError"),TransferFormat:c(()=>si,"TransferFormat"),VERSION:c(()=>st,"VERSION")});const a=(ic=class extends Error{constructor(w,S){const M=new.target.prototype;super(`${w}: Status code '${S}'`),this.statusCode=S,this.__proto__=M}},h(ic,"iu"),ic);c(a,"i");let o=a;const l=(rc=class extends Error{constructor(w="A timeout occurred."){const S=new.target.prototype;super(w),this.__proto__=S}},h(rc,"ru"),rc);c(l,"n");let d=l;const u=(sc=class extends Error{constructor(w="An abort occurred."){const S=new.target.prototype;super(w),this.__proto__=S}},h(sc,"nu"),sc);c(u,"r");let p=u;const f=(nc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="UnsupportedTransportError",this.__proto__=M}},h(nc,"au"),nc);c(f,"o");let y=f;const g=(ac=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="DisabledTransportError",this.__proto__=M}},h(ac,"su"),ac);c(g,"h");let O=g;const k=(oc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.transport=S,this.errorType="FailedToStartTransportError",this.__proto__=M}},h(oc,"ou"),oc);c(k,"c");let $=k;const T=(lc=class extends Error{constructor(w){const S=new.target.prototype;super(w),this.errorType="FailedToNegotiateWithServerError",this.__proto__=S}},h(lc,"cu"),lc);c(T,"a");let _=T;const D=(cc=class extends Error{constructor(w,S){const M=new.target.prototype;super(w),this.innerErrors=S,this.__proto__=M}},h(cc,"lu"),cc);c(D,"l");let A=D;const z=(hc=class{constructor(w,S,M){this.statusCode=w,this.statusText=S,this.content=M}},h(hc,"du"),hc);c(z,"u");let V=z;const j=(dc=class{get(w,S){return this.send({...S,method:"GET",url:w})}post(w,S){return this.send({...S,method:"POST",url:w})}delete(w,S){return this.send({...S,method:"DELETE",url:w})}getCookieString(w){return""}},h(dc,"hu"),dc);c(j,"d");let tt=j;(function(H){H[H.Trace=0]="Trace",H[H.Debug=1]="Debug",H[H.Information=2]="Information",H[H.Warning=3]="Warning",H[H.Error=4]="Error",H[H.Critical=5]="Critical",H[H.None=6]="None"})(r||(r={}));const vt=(uc=class{constructor(){}log(w,S){}},h(uc,"uu"),uc);c(vt,"f");let dt=vt;dt.instance=new dt;const st="9.0.6",Qt=(pc=class{static isRequired(w,S){if(w==null)throw new Error(`The '${S}' argument is required.`)}static isNotEmpty(w,S){if(!w||w.match(/^\s*$/))throw new Error(`The '${S}' argument should not be empty.`)}static isIn(w,S,M){if(!(w in S))throw new Error(`Unknown ${M} value: ${w}.`)}},h(pc,"pu"),pc);c(Qt,"w");let ct=Qt;const Wt=(Ps=class{static get isBrowser(){return!Ps.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Ps.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Ps.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}},h(Ps,"sa"),Ps);c(Wt,"g");let Lt=Wt;function Nt(H,w){let S="";return Xt(H)?(S=`Binary data of length ${H.byteLength}`,w&&(S+=`. Content: '${(function(M){const R=new Uint8Array(M);let W="";return R.forEach((Z=>{W+=`0x${Z<16?"0":""}${Z.toString(16)} `})),W.substr(0,W.length-1)})(H)}'`)):typeof H=="string"&&(S=`String data of length ${H.length}`,w&&(S+=`. Content: '${H}'`)),S}h(Nt,"q"),c(Nt,"m");function Xt(H){return H&&typeof ArrayBuffer<"u"&&(H instanceof ArrayBuffer||H.constructor&&H.constructor.name==="ArrayBuffer")}h(Xt,"F"),c(Xt,"y");async function jt(H,w,S,M,R,W){const Z={},[ut,pt]=$e();Z[ut]=pt,H.log(r.Trace,`(${w} transport) sending data. ${Nt(R,W.logMessageContent)}.`);const Dt=Xt(R)?"arraybuffer":"text",re=await S.post(M,{content:R,headers:{...Z,...W.headers},responseType:Dt,timeout:W.timeout,withCredentials:W.withCredentials});H.log(r.Trace,`(${w} transport) request complete. Response status: ${re.statusCode}.`)}h(jt,"H"),c(jt,"b");const Ii=(fc=class{constructor(w,S){this.i=w,this.h=S}dispose(){const w=this.i.observers.indexOf(this.h);w>-1&&this.i.observers.splice(w,1),this.i.observers.length===0&&this.i.cancelCallback&&this.i.cancelCallback().catch((S=>{}))}},h(fc,"yu"),fc);c(Ii,"v");let Ze=Ii;const me=(mc=class{constructor(w){this.l=w,this.out=console}log(w,S){if(w>=this.l){const M=`[${new Date().toISOString()}] ${r[w]}: ${S}`;switch(w){case r.Critical:case r.Error:this.out.error(M);break;case r.Warning:this.out.warn(M);break;case r.Information:this.out.info(M);break;default:this.out.log(M)}}}},h(mc,"wu"),mc);c(me,"E");let le=me;function $e(){let H="X-SignalR-User-Agent";return Lt.isNode&&(H="User-Agent"),[H,Di(st,Gi(),Lt.isNode?"NodeJS":"Browser",fr())]}h($e,"ot"),c($e,"$");function Di(H,w,S,M){let R="Microsoft SignalR/";const W=H.split(".");return R+=`${W[0]}.${W[1]}`,R+=` (${H}; `,R+=w&&w!==""?`${w}; `:"Unknown OS; ",R+=`${S}`,R+=M?`; ${M}`:"; Unknown Runtime Version",R+=")",R}h(Di,"rt"),c(Di,"C");function Gi(){if(!Lt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}h(Gi,"Lt"),c(Gi,"S");function fr(){if(Lt.isNode)return process.versions.node}h(fr,"Ot"),c(fr,"k");function ie(H){return H.stack?H.stack:H.message?H.message:`${H}`}h(ie,"At"),c(ie,"P");const Mr=(yc=class extends tt{constructor(w){if(super(),this.u=w,typeof fetch>"u"||Lt.isNode){const S=Xv;this.p=new(S("tough-cookie")).CookieJar,typeof fetch>"u"?this.m=S("node-fetch"):this.m=fetch,this.m=S("fetch-cookie")(this.m,this.p)}else this.m=fetch.bind((function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(i.g!==void 0)return i.g;throw new Error("could not find global")})());if(typeof AbortController>"u"){const S=Xv;this.v=S("abort-controller")}else this.v=AbortController}async send(w){if(w.abortSignal&&w.abortSignal.aborted)throw new p;if(!w.method)throw new Error("No method defined.");if(!w.url)throw new Error("No url defined.");const S=new this.v;let M;w.abortSignal&&(w.abortSignal.onabort=()=>{S.abort(),M=new p});let R,W=null;if(w.timeout){const pt=w.timeout;W=setTimeout((()=>{S.abort(),this.u.log(r.Warning,"Timeout from HTTP request."),M=new d}),pt)}w.content===""&&(w.content=void 0),w.content&&(w.headers=w.headers||{},Xt(w.content)?w.headers["Content-Type"]="application/octet-stream":w.headers["Content-Type"]="text/plain;charset=UTF-8");try{R=await this.m(w.url,{body:w.content,cache:"no-cache",credentials:w.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...w.headers},method:w.method,mode:"cors",redirect:"follow",signal:S.signal})}catch(pt){throw M||(this.u.log(r.Warning,`Error from HTTP request. ${pt}.`),pt)}finally{W&&clearTimeout(W),w.abortSignal&&(w.abortSignal.onabort=null)}if(!R.ok){const pt=await ec(R,"text");throw new o(pt||R.statusText,R.status)}const Z=ec(R,w.responseType),ut=await Z;return new V(R.status,R.statusText,ut)}getCookieString(w){let S="";return Lt.isNode&&this.p&&this.p.getCookies(w,((M,R)=>S=R.join("; "))),S}},h(yc,"fu"),yc);c(Mr,"T");let Da=Mr;function ec(H,w){let S;switch(w){case"arraybuffer":S=H.arrayBuffer();break;case"text":default:S=H.text();break;case"blob":case"document":case"json":throw new Error(`${w} is not supported.`)}return S}h(ec,"Bt"),c(ec,"I");const f3=(gc=class extends tt{constructor(w){super(),this.u=w}send(w){return w.abortSignal&&w.abortSignal.aborted?Promise.reject(new p):w.method?w.url?new Promise(((S,M)=>{const R=new XMLHttpRequest;R.open(w.method,w.url,!0),R.withCredentials=w.withCredentials===void 0||w.withCredentials,R.setRequestHeader("X-Requested-With","XMLHttpRequest"),w.content===""&&(w.content=void 0),w.content&&(Xt(w.content)?R.setRequestHeader("Content-Type","application/octet-stream"):R.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const W=w.headers;W&&Object.keys(W).forEach((Z=>{R.setRequestHeader(Z,W[Z])})),w.responseType&&(R.responseType=w.responseType),w.abortSignal&&(w.abortSignal.onabort=()=>{R.abort(),M(new p)}),w.timeout&&(R.timeout=w.timeout),R.onload=()=>{w.abortSignal&&(w.abortSignal.onabort=null),R.status>=200&&R.status<300?S(new V(R.status,R.statusText,R.response||R.responseText)):M(new o(R.response||R.responseText||R.statusText,R.status))},R.onerror=()=>{this.u.log(r.Warning,`Error from HTTP request. ${R.status}: ${R.statusText}.`),M(new o(R.statusText,R.status))},R.ontimeout=()=>{this.u.log(r.Warning,"Timeout from HTTP request."),M(new d)},R.send(w.content)})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}},h(gc,"mu"),gc);c(f3,"_");let PW=f3;const m3=(wc=class extends tt{constructor(w){if(super(),typeof fetch<"u"||Lt.isNode)this.$=new Da(w);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this.$=new PW(w)}}send(w){return w.abortSignal&&w.abortSignal.aborted?Promise.reject(new p):w.method?w.url?this.$.send(w):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(w){return this.$.getCookieString(w)}},h(wc,"vu"),wc);c(m3,"H");let y3=m3;const g3=(Qs=class{static write(w){return`${w}${Qs.RecordSeparator}`}static parse(w){if(w[w.length-1]!==Qs.RecordSeparator)throw new Error("Message is incomplete.");const S=w.split(Qs.RecordSeparator);return S.pop(),S}},h(Qs,"oa"),Qs);c(g3,"D");let Cs=g3;Cs.RecordSeparatorCode=30,Cs.RecordSeparator=String.fromCharCode(Cs.RecordSeparatorCode);const w3=(vc=class{writeHandshakeRequest(w){return Cs.write(JSON.stringify(w))}parseHandshakeResponse(w){let S,M;if(Xt(w)){const Z=new Uint8Array(w),ut=Z.indexOf(Cs.RecordSeparatorCode);if(ut===-1)throw new Error("Message is incomplete.");const pt=ut+1;S=String.fromCharCode.apply(null,Array.prototype.slice.call(Z.slice(0,pt))),M=Z.byteLength>pt?Z.slice(pt).buffer:null}else{const Z=w,ut=Z.indexOf(Cs.RecordSeparator);if(ut===-1)throw new Error("Message is incomplete.");const pt=ut+1;S=Z.substring(0,pt),M=Z.length>pt?Z.substring(pt):null}const R=Cs.parse(S),W=JSON.parse(R[0]);if(W.type)throw new Error("Expected a handshake response from the server.");return[M,W]}},h(vc,"gu"),vc);c(w3,"R");let QW=w3;var It,ae;(function(H){H[H.Invocation=1]="Invocation",H[H.StreamItem=2]="StreamItem",H[H.Completion=3]="Completion",H[H.StreamInvocation=4]="StreamInvocation",H[H.CancelInvocation=5]="CancelInvocation",H[H.Ping=6]="Ping",H[H.Close=7]="Close",H[H.Ack=8]="Ack",H[H.Sequence=9]="Sequence"})(It||(It={}));const v3=(Oc=class{constructor(){this.observers=[]}next(w){for(const S of this.observers)S.next(w)}error(w){for(const S of this.observers)S.error&&S.error(w)}complete(){for(const w of this.observers)w.complete&&w.complete()}subscribe(w){return this.observers.push(w),new Ze(this,w)}},h(Oc,"bu"),Oc);c(v3,"U");let O3=v3;const b3=(bc=class{constructor(w,S,M){this.C=1e5,this.S=[],this.k=0,this.P=!1,this.T=1,this.I=0,this._=0,this.H=!1,this.D=w,this.R=S,this.C=M}async A(w){const S=this.D.writeMessage(w);let M=Promise.resolve();if(this.U(w)){this.k++;let R=c(()=>{},"t"),W=c(()=>{},"i");Xt(S)?this._+=S.byteLength:this._+=S.length,this._>=this.C&&(M=new Promise(((Z,ut)=>{R=Z,W=ut}))),this.S.push(new MW(S,this.k,R,W))}try{this.H||await this.R.send(S)}catch{this.L()}await M}N(w){let S=-1;for(let M=0;M<this.S.length;M++){const R=this.S[M];if(R.q<=w.sequenceId)S=M,Xt(R.M)?this._-=R.M.byteLength:this._-=R.M.length,R.j();else{if(!(this._<this.C))break;R.j()}}S!==-1&&(this.S=this.S.slice(S+1))}W(w){if(this.P)return w.type===It.Sequence&&(this.P=!1,!0);if(!this.U(w))return!0;const S=this.T;return this.T++,S<=this.I?(S===this.I&&this.O(),!1):(this.I=S,this.O(),!0)}F(w){w.sequenceId>this.T?this.R.stop(new Error("Sequence ID greater than amount of messages we've received.")):this.T=w.sequenceId}L(){this.H=!0,this.P=!0}async B(){const w=this.S.length!==0?this.S[0].q:this.k+1;await this.R.send(this.D.writeMessage({type:It.Sequence,sequenceId:w}));const S=this.S;for(const M of S)await this.R.send(M.M);this.H=!1}X(w){w!=null||(w=new Error("Unable to reconnect to server."));for(const S of this.S)S.J(w)}U(w){switch(w.type){case It.Invocation:case It.StreamItem:case It.Completion:case It.StreamInvocation:case It.CancelInvocation:return!0;case It.Close:case It.Sequence:case It.Ping:case It.Ack:return!1}}O(){this.V===void 0&&(this.V=setTimeout((async()=>{try{this.H||await this.R.send(this.D.writeMessage({type:It.Ack,sequenceId:this.I}))}catch{}clearTimeout(this.V),this.V=void 0}),1e3))}},h(bc,"xu"),bc);c(b3,"L");let TW=b3;const $3=($c=class{constructor(w,S,M,R){this.M=w,this.q=S,this.j=M,this.J=R}},h($c,"Cu"),$c);c($3,"N");let MW=$3;(function(H){H.Disconnected="Disconnected",H.Connecting="Connecting",H.Connected="Connected",H.Disconnecting="Disconnecting",H.Reconnecting="Reconnecting"})(ae||(ae={}));const x3=(Wa=class{static create(w,S,M,R,W,Z,ut){return new Wa(w,S,M,R,W,Z,ut)}constructor(w,S,M,R,W,Z,ut){this.K=0,this.G=()=>{this.u.log(r.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ct.isRequired(w,"connection"),ct.isRequired(S,"logger"),ct.isRequired(M,"protocol"),this.serverTimeoutInMilliseconds=W??3e4,this.keepAliveIntervalInMilliseconds=Z??15e3,this.Y=ut??1e5,this.u=S,this.D=M,this.connection=w,this.Z=R,this.tt=new QW,this.connection.onreceive=pt=>this.et(pt),this.connection.onclose=pt=>this.st(pt),this.it={},this.nt={},this.rt=[],this.ot=[],this.ht=[],this.ct=0,this.lt=!1,this.ut=ae.Disconnected,this.dt=!1,this.ft=this.D.writeMessage({type:It.Ping})}get state(){return this.ut}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(w){if(this.ut!==ae.Disconnected&&this.ut!==ae.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!w)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=w}start(){return this.wt=this.gt(),this.wt}async gt(){if(this.ut!==ae.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this.ut=ae.Connecting,this.u.log(r.Debug,"Starting HubConnection.");try{await this.yt(),Lt.isBrowser&&window.document.addEventListener("freeze",this.G),this.ut=ae.Connected,this.dt=!0,this.u.log(r.Debug,"HubConnection connected successfully.")}catch(w){return this.ut=ae.Disconnected,this.u.log(r.Debug,`HubConnection failed to start successfully because of error '${w}'.`),Promise.reject(w)}}async yt(){this.bt=void 0,this.lt=!1;const w=new Promise(((S,M)=>{this.vt=S,this.Et=M}));await this.connection.start(this.D.transferFormat);try{let S=this.D.version;this.connection.features.reconnect||(S=1);const M={protocol:this.D.name,version:S};if(this.u.log(r.Debug,"Sending handshake request."),await this.$t(this.tt.writeHandshakeRequest(M)),this.u.log(r.Information,`Using HubProtocol '${this.D.name}'.`),this.Ct(),this.St(),this.kt(),await w,this.bt)throw this.bt;this.connection.features.reconnect&&(this.Pt=new TW(this.D,this.connection,this.Y),this.connection.features.disconnected=this.Pt.L.bind(this.Pt),this.connection.features.resend=()=>{if(this.Pt)return this.Pt.B()}),this.connection.features.inherentKeepAlive||await this.$t(this.ft)}catch(S){throw this.u.log(r.Debug,`Hub handshake failed with error '${S}' during start(). Stopping HubConnection.`),this.Ct(),this.Tt(),await this.connection.stop(S),S}}async stop(){const w=this.wt;this.connection.features.reconnect=!1,this.It=this._t(),await this.It;try{await w}catch{}}_t(w){if(this.ut===ae.Disconnected)return this.u.log(r.Debug,`Call to HubConnection.stop(${w}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this.ut===ae.Disconnecting)return this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnecting state.`),this.It;const S=this.ut;return this.ut=ae.Disconnecting,this.u.log(r.Debug,"Stopping HubConnection."),this.Ht?(this.u.log(r.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.Ht),this.Ht=void 0,this.Dt(),Promise.resolve()):(S===ae.Connected&&this.Rt(),this.Ct(),this.Tt(),this.bt=w||new p("The connection was stopped before the hub handshake could complete."),this.connection.stop(w))}async Rt(){try{await this.xt(this.At())}catch{}}stream(w,...S){const[M,R]=this.Ut(S),W=this.Lt(w,S,R);let Z;const ut=new O3;return ut.cancelCallback=()=>{const pt=this.Nt(W.invocationId);return delete this.it[W.invocationId],Z.then((()=>this.xt(pt)))},this.it[W.invocationId]=(pt,Dt)=>{Dt?ut.error(Dt):pt&&(pt.type===It.Completion?pt.error?ut.error(new Error(pt.error)):ut.complete():ut.next(pt.item))},Z=this.xt(W).catch((pt=>{ut.error(pt),delete this.it[W.invocationId]})),this.qt(M,Z),ut}$t(w){return this.kt(),this.connection.send(w)}xt(w){return this.Pt?this.Pt.A(w):this.$t(this.D.writeMessage(w))}send(w,...S){const[M,R]=this.Ut(S),W=this.xt(this.Mt(w,S,!0,R));return this.qt(M,W),W}invoke(w,...S){const[M,R]=this.Ut(S),W=this.Mt(w,S,!1,R);return new Promise(((Z,ut)=>{this.it[W.invocationId]=(Dt,re)=>{re?ut(re):Dt&&(Dt.type===It.Completion?Dt.error?ut(new Error(Dt.error)):Z(Dt.result):ut(new Error(`Unexpected message type: ${Dt.type}`)))};const pt=this.xt(W).catch((Dt=>{ut(Dt),delete this.it[W.invocationId]}));this.qt(M,pt)}))}on(w,S){w&&S&&(w=w.toLowerCase(),this.nt[w]||(this.nt[w]=[]),this.nt[w].indexOf(S)===-1&&this.nt[w].push(S))}off(w,S){if(!w)return;w=w.toLowerCase();const M=this.nt[w];if(M)if(S){const R=M.indexOf(S);R!==-1&&(M.splice(R,1),M.length===0&&delete this.nt[w])}else delete this.nt[w]}onclose(w){w&&this.rt.push(w)}onreconnecting(w){w&&this.ot.push(w)}onreconnected(w){w&&this.ht.push(w)}et(w){if(this.Ct(),this.lt||(w=this.jt(w),this.lt=!0),w){const S=this.D.parseMessages(w,this.u);for(const M of S)if(!this.Pt||this.Pt.W(M))switch(M.type){case It.Invocation:this.Wt(M).catch((R=>{this.u.log(r.Error,`Invoke client method threw error: ${ie(R)}`)}));break;case It.StreamItem:case It.Completion:{const R=this.it[M.invocationId];if(R){M.type===It.Completion&&delete this.it[M.invocationId];try{R(M)}catch(W){this.u.log(r.Error,`Stream callback threw error: ${ie(W)}`)}}break}case It.Ping:break;case It.Close:{this.u.log(r.Information,"Close message received from server.");const R=M.error?new Error("Server returned an error on close: "+M.error):void 0;M.allowReconnect===!0?this.connection.stop(R):this.It=this._t(R);break}case It.Ack:this.Pt&&this.Pt.N(M);break;case It.Sequence:this.Pt&&this.Pt.F(M);break;default:this.u.log(r.Warning,`Invalid message type: ${M.type}.`)}}this.St()}jt(w){let S,M;try{[M,S]=this.tt.parseHandshakeResponse(w)}catch(R){const W="Error parsing handshake response: "+R;this.u.log(r.Error,W);const Z=new Error(W);throw this.Et(Z),Z}if(S.error){const R="Server returned handshake error: "+S.error;this.u.log(r.Error,R);const W=new Error(R);throw this.Et(W),W}return this.u.log(r.Debug,"Server handshake complete."),this.vt(),M}kt(){this.connection.features.inherentKeepAlive||(this.K=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this.Tt())}St(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this.Ot=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),this.Ft!==void 0))){let w=this.K-new Date().getTime();w<0&&(w=0),this.Ft=setTimeout((async()=>{if(this.ut===ae.Connected)try{await this.$t(this.ft)}catch{this.Tt()}}),w)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async Wt(w){const S=w.target.toLowerCase(),M=this.nt[S];if(!M)return this.u.log(r.Warning,`No client method with the name '${S}' found.`),void(w.invocationId&&(this.u.log(r.Warning,`No result given for '${S}' method and invocation ID '${w.invocationId}'.`),await this.xt(this.Bt(w.invocationId,"Client didn't provide a result.",null))));const R=M.slice(),W=!!w.invocationId;let Z,ut,pt;for(const Dt of R)try{const re=Z;Z=await Dt.apply(this,w.arguments),W&&Z&&re&&(this.u.log(r.Error,`Multiple results provided for '${S}'. Sending error to server.`),pt=this.Bt(w.invocationId,"Client provided multiple results.",null)),ut=void 0}catch(re){ut=re,this.u.log(r.Error,`A callback for the method '${S}' threw error '${re}'.`)}pt?await this.xt(pt):W?(ut?pt=this.Bt(w.invocationId,`${ut}`,null):Z!==void 0?pt=this.Bt(w.invocationId,null,Z):(this.u.log(r.Warning,`No result given for '${S}' method and invocation ID '${w.invocationId}'.`),pt=this.Bt(w.invocationId,"Client didn't provide a result.",null)),await this.xt(pt)):Z&&this.u.log(r.Error,`Result given for '${S}' method but server is not expecting a result.`)}st(w){this.u.log(r.Debug,`HubConnection.connectionClosed(${w}) called while in state ${this.ut}.`),this.bt=this.bt||w||new p("The underlying connection was closed before the hub handshake could complete."),this.vt&&this.vt(),this.Xt(w||new Error("Invocation canceled due to the underlying connection being closed.")),this.Ct(),this.Tt(),this.ut===ae.Disconnecting?this.Dt(w):this.ut===ae.Connected&&this.Z?this.Jt(w):this.ut===ae.Connected&&this.Dt(w)}Dt(w){if(this.dt){this.ut=ae.Disconnected,this.dt=!1,this.Pt&&(this.Pt.X(w??new Error("Connection closed.")),this.Pt=void 0),Lt.isBrowser&&window.document.removeEventListener("freeze",this.G);try{this.rt.forEach((S=>S.apply(this,[w])))}catch(S){this.u.log(r.Error,`An onclose callback called with error '${w}' threw error '${S}'.`)}}}async Jt(w){const S=Date.now();let M=0,R=w!==void 0?w:new Error("Attempting to reconnect due to a unknown error."),W=this.zt(M++,0,R);if(W===null)return this.u.log(r.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this.Dt(w);if(this.ut=ae.Reconnecting,w?this.u.log(r.Information,`Connection reconnecting because of error '${w}'.`):this.u.log(r.Information,"Connection reconnecting."),this.ot.length!==0){try{this.ot.forEach((Z=>Z.apply(this,[w])))}catch(Z){this.u.log(r.Error,`An onreconnecting callback called with error '${w}' threw error '${Z}'.`)}if(this.ut!==ae.Reconnecting)return void this.u.log(r.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;W!==null;){if(this.u.log(r.Information,`Reconnect attempt number ${M} will start in ${W} ms.`),await new Promise((Z=>{this.Ht=setTimeout(Z,W)})),this.Ht=void 0,this.ut!==ae.Reconnecting)return void this.u.log(r.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this.yt(),this.ut=ae.Connected,this.u.log(r.Information,"HubConnection reconnected successfully."),this.ht.length!==0)try{this.ht.forEach((Z=>Z.apply(this,[this.connection.connectionId])))}catch(Z){this.u.log(r.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${Z}'.`)}return}catch(Z){if(this.u.log(r.Information,`Reconnect attempt failed because of error '${Z}'.`),this.ut!==ae.Reconnecting)return this.u.log(r.Debug,`Connection moved to the '${this.ut}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this.ut===ae.Disconnecting&&this.Dt());R=Z instanceof Error?Z:new Error(Z.toString()),W=this.zt(M++,Date.now()-S,R)}}this.u.log(r.Information,`Reconnect retries have been exhausted after ${Date.now()-S} ms and ${M} failed attempts. Connection disconnecting.`),this.Dt()}zt(w,S,M){try{return this.Z.nextRetryDelayInMilliseconds({elapsedMilliseconds:S,previousRetryCount:w,retryReason:M})}catch(R){return this.u.log(r.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${w}, ${S}) threw error '${R}'.`),null}}Xt(w){const S=this.it;this.it={},Object.keys(S).forEach((M=>{const R=S[M];try{R(null,w)}catch(W){this.u.log(r.Error,`Stream 'error' callback called with '${w}' threw error: ${ie(W)}`)}}))}Tt(){this.Ft&&(clearTimeout(this.Ft),this.Ft=void 0)}Ct(){this.Ot&&clearTimeout(this.Ot)}Mt(w,S,M,R){if(M)return R.length!==0?{target:w,arguments:S,streamIds:R,type:It.Invocation}:{target:w,arguments:S,type:It.Invocation};{const W=this.ct;return this.ct++,R.length!==0?{target:w,arguments:S,invocationId:W.toString(),streamIds:R,type:It.Invocation}:{target:w,arguments:S,invocationId:W.toString(),type:It.Invocation}}}qt(w,S){if(w.length!==0){S||(S=Promise.resolve());for(const M in w)w[M].subscribe({complete:c(()=>{S=S.then((()=>this.xt(this.Bt(M))))},"complete"),error:c(R=>{let W;W=R instanceof Error?R.message:R&&R.toString?R.toString():"Unknown error",S=S.then((()=>this.xt(this.Bt(M,W))))},"error"),next:c(R=>{S=S.then((()=>this.xt(this.Vt(M,R))))},"next")})}}Ut(w){const S=[],M=[];for(let R=0;R<w.length;R++){const W=w[R];if(this.Kt(W)){const Z=this.ct;this.ct++,S[Z]=W,M.push(Z.toString()),w.splice(R,1)}}return[S,M]}Kt(w){return w&&w.subscribe&&typeof w.subscribe=="function"}Lt(w,S,M){const R=this.ct;return this.ct++,M.length!==0?{target:w,arguments:S,invocationId:R.toString(),streamIds:M,type:It.StreamInvocation}:{target:w,arguments:S,invocationId:R.toString(),type:It.StreamInvocation}}Nt(w){return{invocationId:w,type:It.CancelInvocation}}Vt(w,S){return{invocationId:w,item:S,type:It.StreamItem}}Bt(w,S,M){return S?{error:S,invocationId:w,type:It.Completion}:{invocationId:w,result:M,type:It.Completion}}At(){return{type:It.Close}}},h(Wa,"Ad"),Wa);c(x3,"q");let k3=x3;const AW=[0,2e3,1e4,3e4,null],S3=(xc=class{constructor(w){this.Gt=w!==void 0?[...w,null]:AW}nextRetryDelayInMilliseconds(w){return this.Gt[w.previousRetryCount]}},h(xc,"$u"),xc);c(S3,"j");let C3=S3;const P3=(kc=class{},h(kc,"ku"),kc);c(P3,"W");let Va=P3;Va.Authorization="Authorization",Va.Cookie="Cookie";const Q3=(Sc=class extends tt{constructor(w,S){super(),this.Qt=w,this.Yt=S}async send(w){let S=!0;this.Yt&&(!this.Zt||w.url&&w.url.indexOf("/negotiate?")>0)&&(S=!1,this.Zt=await this.Yt()),this.te(w);const M=await this.Qt.send(w);return S&&M.statusCode===401&&this.Yt?(this.Zt=await this.Yt(),this.te(w),await this.Qt.send(w)):M}te(w){w.headers||(w.headers={}),this.Zt?w.headers[Va.Authorization]=`Bearer ${this.Zt}`:this.Yt&&w.headers[Va.Authorization]&&delete w.headers[Va.Authorization]}getCookieString(w){return this.Qt.getCookieString(w)}},h(Sc,"Pu"),Sc);c(Q3,"O");let RW=Q3;var Ee,si;(function(H){H[H.None=0]="None",H[H.WebSockets=1]="WebSockets",H[H.ServerSentEvents=2]="ServerSentEvents",H[H.LongPolling=4]="LongPolling"})(Ee||(Ee={})),(function(H){H[H.Text=1]="Text",H[H.Binary=2]="Binary"})(si||(si={}));const T3=(Cc=class{constructor(){this.ee=!1,this.onabort=null}abort(){this.ee||(this.ee=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this.ee}},h(Cc,"_u"),Cc);c(T3,"X");let EW=T3;const M3=(Pc=class{get pollAborted(){return this.se.aborted}constructor(w,S,M){this.$=w,this.u=S,this.se=new EW,this.ie=M,this.ne=!1,this.onreceive=null,this.onclose=null}async connect(w,S){if(ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.re=w,this.u.log(r.Trace,"(LongPolling transport) Connecting."),S===si.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[M,R]=$e(),W={[M]:R,...this.ie.headers},Z={abortSignal:this.se.signal,headers:W,timeout:1e5,withCredentials:this.ie.withCredentials};S===si.Binary&&(Z.responseType="arraybuffer");const ut=`${w}&_=${Date.now()}`;this.u.log(r.Trace,`(LongPolling transport) polling: ${ut}.`);const pt=await this.$.get(ut,Z);pt.statusCode!==200?(this.u.log(r.Error,`(LongPolling transport) Unexpected response code: ${pt.statusCode}.`),this.oe=new o(pt.statusText||"",pt.statusCode),this.ne=!1):this.ne=!0,this.he=this.ce(this.re,Z)}async ce(w,S){try{for(;this.ne;)try{const M=`${w}&_=${Date.now()}`;this.u.log(r.Trace,`(LongPolling transport) polling: ${M}.`);const R=await this.$.get(M,S);R.statusCode===204?(this.u.log(r.Information,"(LongPolling transport) Poll terminated by server."),this.ne=!1):R.statusCode!==200?(this.u.log(r.Error,`(LongPolling transport) Unexpected response code: ${R.statusCode}.`),this.oe=new o(R.statusText||"",R.statusCode),this.ne=!1):R.content?(this.u.log(r.Trace,`(LongPolling transport) data received. ${Nt(R.content,this.ie.logMessageContent)}.`),this.onreceive&&this.onreceive(R.content)):this.u.log(r.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(M){this.ne?M instanceof d?this.u.log(r.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.oe=M,this.ne=!1):this.u.log(r.Trace,`(LongPolling transport) Poll errored after shutdown: ${M.message}`)}}finally{this.u.log(r.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.ae()}}async send(w){return this.ne?jt(this.u,"LongPolling",this.$,this.re,w,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this.u.log(r.Trace,"(LongPolling transport) Stopping polling."),this.ne=!1,this.se.abort();try{await this.he,this.u.log(r.Trace,`(LongPolling transport) sending DELETE request to ${this.re}.`);const w={},[S,M]=$e();w[S]=M;const R={headers:{...w,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials};let W;try{await this.$.delete(this.re,R)}catch(Z){W=Z}W?W instanceof o&&(W.statusCode===404?this.u.log(r.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this.u.log(r.Trace,`(LongPolling transport) Error sending a DELETE request: ${W}`)):this.u.log(r.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this.u.log(r.Trace,"(LongPolling transport) Stop finished."),this.ae()}}ae(){if(this.onclose){let w="(LongPolling transport) Firing onclose event.";this.oe&&(w+=" Error: "+this.oe),this.u.log(r.Trace,w),this.onclose(this.oe)}}},h(Pc,"Su"),Pc);c(M3,"J");let A3=M3;const R3=(Qc=class{constructor(w,S,M,R){this.$=w,this.Zt=S,this.u=M,this.ie=R,this.onreceive=null,this.onclose=null}async connect(w,S){return ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.u.log(r.Trace,"(SSE transport) Connecting."),this.re=w,this.Zt&&(w+=(w.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this.Zt)}`),new Promise(((M,R)=>{let W,Z=!1;if(S===si.Text){if(Lt.isBrowser||Lt.isWebWorker)W=new this.ie.EventSource(w,{withCredentials:this.ie.withCredentials});else{const ut=this.$.getCookieString(w),pt={};pt.Cookie=ut;const[Dt,re]=$e();pt[Dt]=re,W=new this.ie.EventSource(w,{withCredentials:this.ie.withCredentials,headers:{...pt,...this.ie.headers}})}try{W.onmessage=ut=>{if(this.onreceive)try{this.u.log(r.Trace,`(SSE transport) data received. ${Nt(ut.data,this.ie.logMessageContent)}.`),this.onreceive(ut.data)}catch(pt){return void this.le(pt)}},W.onerror=ut=>{Z?this.le():R(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},W.onopen=()=>{this.u.log(r.Information,`SSE connected to ${this.re}`),this.ue=W,Z=!0,M()}}catch(ut){return void R(ut)}}else R(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(w){return this.ue?jt(this.u,"SSE",this.$,this.re,w,this.ie):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this.le(),Promise.resolve()}le(w){this.ue&&(this.ue.close(),this.ue=void 0,this.onclose&&this.onclose(w))}},h(Qc,"Mu"),Qc);c(R3,"z");let _W=R3;const E3=(Tc=class{constructor(w,S,M,R,W,Z){this.u=M,this.Yt=S,this.de=R,this.fe=W,this.$=w,this.onreceive=null,this.onclose=null,this.pe=Z}async connect(w,S){let M;return ct.isRequired(w,"url"),ct.isRequired(S,"transferFormat"),ct.isIn(S,si,"transferFormat"),this.u.log(r.Trace,"(WebSockets transport) Connecting."),this.Yt&&(M=await this.Yt()),new Promise(((R,W)=>{let Z;w=w.replace(/^http/,"ws");const ut=this.$.getCookieString(w);let pt=!1;if(Lt.isNode||Lt.isReactNative){const Dt={},[re,_c]=$e();Dt[re]=_c,M&&(Dt[Va.Authorization]=`Bearer ${M}`),ut&&(Dt[Va.Cookie]=ut),Z=new this.fe(w,void 0,{headers:{...Dt,...this.pe}})}else M&&(w+=(w.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(M)}`);Z||(Z=new this.fe(w)),S===si.Binary&&(Z.binaryType="arraybuffer"),Z.onopen=Dt=>{this.u.log(r.Information,`WebSocket connected to ${w}.`),this.we=Z,pt=!0,R()},Z.onerror=Dt=>{let re=null;re=typeof ErrorEvent<"u"&&Dt instanceof ErrorEvent?Dt.error:"There was an error with the transport",this.u.log(r.Information,`(WebSockets transport) ${re}.`)},Z.onmessage=Dt=>{if(this.u.log(r.Trace,`(WebSockets transport) data received. ${Nt(Dt.data,this.de)}.`),this.onreceive)try{this.onreceive(Dt.data)}catch(re){return void this.le(re)}},Z.onclose=Dt=>{if(pt)this.le(Dt);else{let re=null;re=typeof ErrorEvent<"u"&&Dt instanceof ErrorEvent?Dt.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",W(new Error(re))}}}))}send(w){return this.we&&this.we.readyState===this.fe.OPEN?(this.u.log(r.Trace,`(WebSockets transport) sending data. ${Nt(w,this.de)}.`),this.we.send(w),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this.we&&this.le(void 0),Promise.resolve()}le(w){this.we&&(this.we.onclose=()=>{},this.we.onmessage=()=>{},this.we.onerror=()=>{},this.we.close(),this.we=void 0),this.u.log(r.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this.ge(w)||w.wasClean!==!1&&w.code===1e3?w instanceof Error?this.onclose(w):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${w.code} (${w.reason||"no reason given"}).`)))}ge(w){return w&&typeof w.wasClean=="boolean"&&typeof w.code=="number"}},h(Tc,"Au"),Tc);c(E3,"V");let LW=E3;const _3=(Mc=class{constructor(w,S={}){var M;if(this.me=()=>{},this.features={},this.ye=1,ct.isRequired(w,"url"),this.u=(M=S.logger)===void 0?new le(r.Information):M===null?dt.instance:M.log!==void 0?M:new le(M),this.baseUrl=this.be(w),(S=S||{}).logMessageContent=S.logMessageContent!==void 0&&S.logMessageContent,typeof S.withCredentials!="boolean"&&S.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");S.withCredentials=S.withCredentials===void 0||S.withCredentials,S.timeout=S.timeout===void 0?1e5:S.timeout;let R=null,W=null;if(Lt.isNode){const Z=Xv;R=Z("ws"),W=Z("eventsource")}Lt.isNode||typeof WebSocket>"u"||S.WebSocket?Lt.isNode&&!S.WebSocket&&R&&(S.WebSocket=R):S.WebSocket=WebSocket,Lt.isNode||typeof EventSource>"u"||S.EventSource?Lt.isNode&&!S.EventSource&&W!==void 0&&(S.EventSource=W):S.EventSource=EventSource,this.$=new RW(S.httpClient||new y3(this.u),S.accessTokenFactory),this.ut="Disconnected",this.dt=!1,this.ie=S,this.onreceive=null,this.onclose=null}async start(w){if(w=w||si.Binary,ct.isIn(w,si,"transferFormat"),this.u.log(r.Debug,`Starting connection with transfer format '${si[w]}'.`),this.ut!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this.ut="Connecting",this.ve=this.yt(w),await this.ve,this.ut==="Disconnecting"){const S="Failed to start the HttpConnection before stop() was called.";return this.u.log(r.Error,S),await this.It,Promise.reject(new p(S))}if(this.ut!=="Connected"){const S="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this.u.log(r.Error,S),Promise.reject(new p(S))}this.dt=!0}send(w){return this.ut!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.Ee||(this.Ee=new IW(this.transport)),this.Ee.send(w))}async stop(w){return this.ut==="Disconnected"?(this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this.ut==="Disconnecting"?(this.u.log(r.Debug,`Call to HttpConnection.stop(${w}) ignored because the connection is already in the disconnecting state.`),this.It):(this.ut="Disconnecting",this.It=new Promise((S=>{this.me=S})),await this._t(w),void await this.It)}async _t(w){this.$e=w;try{await this.ve}catch{}if(this.transport){try{await this.transport.stop()}catch(S){this.u.log(r.Error,`HttpConnection.transport.stop() threw error '${S}'.`),this.Ce()}this.transport=void 0}else this.u.log(r.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async yt(w){let S=this.baseUrl;this.Yt=this.ie.accessTokenFactory,this.$.Yt=this.Yt;try{if(this.ie.skipNegotiation){if(this.ie.transport!==Ee.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this.Se(Ee.WebSockets),await this.ke(S,w)}else{let M=null,R=0;do{if(M=await this.Pe(S),this.ut==="Disconnecting"||this.ut==="Disconnected")throw new p("The connection was stopped during negotiation.");if(M.error)throw new Error(M.error);if(M.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(M.url&&(S=M.url),M.accessToken){const W=M.accessToken;this.Yt=()=>W,this.$.Zt=W,this.$.Yt=void 0}R++}while(M.url&&R<100);if(R===100&&M.url)throw new Error("Negotiate redirection limit exceeded.");await this.Te(S,this.ie.transport,M,w)}this.transport instanceof A3&&(this.features.inherentKeepAlive=!0),this.ut==="Connecting"&&(this.u.log(r.Debug,"The HttpConnection connected successfully."),this.ut="Connected")}catch(M){return this.u.log(r.Error,"Failed to start the connection: "+M),this.ut="Disconnected",this.transport=void 0,this.me(),Promise.reject(M)}}async Pe(w){const S={},[M,R]=$e();S[M]=R;const W=this.Ie(w);this.u.log(r.Debug,`Sending negotiation request: ${W}.`);try{const Z=await this.$.post(W,{content:"",headers:{...S,...this.ie.headers},timeout:this.ie.timeout,withCredentials:this.ie.withCredentials});if(Z.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${Z.statusCode}'`));const ut=JSON.parse(Z.content);return(!ut.negotiateVersion||ut.negotiateVersion<1)&&(ut.connectionToken=ut.connectionId),ut.useStatefulReconnect&&this.ie._e!==!0?Promise.reject(new _("Client didn't negotiate Stateful Reconnect but the server did.")):ut}catch(Z){let ut="Failed to complete negotiation with the server: "+Z;return Z instanceof o&&Z.statusCode===404&&(ut+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this.u.log(r.Error,ut),Promise.reject(new _(ut))}}He(w,S){return S?w+(w.indexOf("?")===-1?"?":"&")+`id=${S}`:w}async Te(w,S,M,R){let W=this.He(w,M.connectionToken);if(this.De(S))return this.u.log(r.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=S,await this.ke(W,R),void(this.connectionId=M.connectionId);const Z=[],ut=M.availableTransports||[];let pt=M;for(const Dt of ut){const re=this.Re(Dt,S,R,pt?.useStatefulReconnect===!0);if(re instanceof Error)Z.push(`${Dt.transport} failed:`),Z.push(re);else if(this.De(re)){if(this.transport=re,!pt){try{pt=await this.Pe(w)}catch(_c){return Promise.reject(_c)}W=this.He(w,pt.connectionToken)}try{return await this.ke(W,R),void(this.connectionId=pt.connectionId)}catch(_c){if(this.u.log(r.Error,`Failed to start the transport '${Dt.transport}': ${_c}`),pt=void 0,Z.push(new $(`${Dt.transport} failed: ${_c}`,Ee[Dt.transport])),this.ut!=="Connecting"){const W3="Failed to select transport before stop() was called.";return this.u.log(r.Debug,W3),Promise.reject(new p(W3))}}}}return Z.length>0?Promise.reject(new A(`Unable to connect to the server with any of the available transports. ${Z.join(" ")}`,Z)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}Se(w){switch(w){case Ee.WebSockets:if(!this.ie.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new LW(this.$,this.Yt,this.u,this.ie.logMessageContent,this.ie.WebSocket,this.ie.headers||{});case Ee.ServerSentEvents:if(!this.ie.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new _W(this.$,this.$.Zt,this.u,this.ie);case Ee.LongPolling:return new A3(this.$,this.u,this.ie);default:throw new Error(`Unknown transport: ${w}.`)}}ke(w,S){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async M=>{let R=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(w,S),await this.features.resend()}catch{R=!0}R&&this.Ce(M)}else this.Ce(M)}:this.transport.onclose=M=>this.Ce(M),this.transport.connect(w,S)}Re(w,S,M,R){const W=Ee[w.transport];if(W==null)return this.u.log(r.Debug,`Skipping transport '${w.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${w.transport}' because it is not supported by this client.`);if(!(function(Z,ut){return!Z||!!(ut&Z)})(S,W))return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it was disabled by the client.`),new O(`'${Ee[W]}' is disabled by the client.`,W);if(!(w.transferFormats.map((Z=>si[Z])).indexOf(M)>=0))return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it does not support the requested transfer format '${si[M]}'.`),new Error(`'${Ee[W]}' does not support ${si[M]}.`);if(W===Ee.WebSockets&&!this.ie.WebSocket||W===Ee.ServerSentEvents&&!this.ie.EventSource)return this.u.log(r.Debug,`Skipping transport '${Ee[W]}' because it is not supported in your environment.'`),new y(`'${Ee[W]}' is not supported in your environment.`,W);this.u.log(r.Debug,`Selecting transport '${Ee[W]}'.`);try{return this.features.reconnect=W===Ee.WebSockets?R:void 0,this.Se(W)}catch(Z){return Z}}De(w){return w&&typeof w=="object"&&"connect"in w}Ce(w){if(this.u.log(r.Debug,`HttpConnection.stopConnection(${w}) called while in state ${this.ut}.`),this.transport=void 0,w=this.$e||w,this.$e=void 0,this.ut!=="Disconnected"){if(this.ut==="Connecting")throw this.u.log(r.Warning,`Call to HttpConnection.stopConnection(${w}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${w}) was called while the connection is still in the connecting state.`);if(this.ut==="Disconnecting"&&this.me(),w?this.u.log(r.Error,`Connection disconnected with error '${w}'.`):this.u.log(r.Information,"Connection disconnected."),this.Ee&&(this.Ee.stop().catch((S=>{this.u.log(r.Error,`TransportSendQueue.stop() threw error '${S}'.`)})),this.Ee=void 0),this.connectionId=void 0,this.ut="Disconnected",this.dt){this.dt=!1;try{this.onclose&&this.onclose(w)}catch(S){this.u.log(r.Error,`HttpConnection.onclose(${w}) threw error '${S}'.`)}}}else this.u.log(r.Debug,`Call to HttpConnection.stopConnection(${w}) was ignored because the connection is already in the disconnected state.`)}be(w){if(w.lastIndexOf("https://",0)===0||w.lastIndexOf("http://",0)===0)return w;if(!Lt.isBrowser)throw new Error(`Cannot resolve '${w}'.`);const S=window.document.createElement("a");return S.href=w,this.u.log(r.Information,`Normalizing '${w}' to '${S.href}'.`),S.href}Ie(w){const S=new URL(w);S.pathname.endsWith("/")?S.pathname+="negotiate":S.pathname+="/negotiate";const M=new URLSearchParams(S.searchParams);return M.has("negotiateVersion")||M.append("negotiateVersion",this.ye.toString()),M.has("useStatefulReconnect")?M.get("useStatefulReconnect")==="true"&&(this.ie._e=!0):this.ie._e===!0&&M.append("useStatefulReconnect","true"),S.search=M.toString(),S.toString()}},h(Mc,"Eu"),Mc);c(_3,"K");let zW=_3;const L3=(Fa=class{constructor(w){this.xe=w,this.Ae=[],this.Ue=!0,this.Le=new G1,this.Ne=new G1,this.qe=this.Me()}send(w){return this.je(w),this.Ne||(this.Ne=new G1),this.Ne.promise}stop(){return this.Ue=!1,this.Le.resolve(),this.qe}je(w){if(this.Ae.length&&typeof this.Ae[0]!=typeof w)throw new Error(`Expected data to be of type ${typeof this.Ae} but was of type ${typeof w}`);this.Ae.push(w),this.Le.resolve()}async Me(){for(;;){if(await this.Le.promise,!this.Ue){this.Ne&&this.Ne.reject("Connection stopped.");break}this.Le=new G1;const w=this.Ne;this.Ne=void 0;const S=typeof this.Ae[0]=="string"?this.Ae.join(""):Fa.We(this.Ae);this.Ae.length=0;try{await this.xe.send(S),w.resolve()}catch(M){w.reject(M)}}}static We(w){const S=w.map((W=>W.byteLength)).reduce(((W,Z)=>W+Z)),M=new Uint8Array(S);let R=0;for(const W of w)M.set(new Uint8Array(W),R),R+=W.byteLength;return M.buffer}},h(Fa,"Ed"),Fa);c(L3,"G");let IW=L3;const z3=(Ac=class{constructor(){this.promise=new Promise(((w,S)=>[this.j,this.Oe]=[w,S]))}resolve(){this.j()}reject(w){this.Oe(w)}},h(Ac,"Ru"),Ac);c(z3,"Q");let G1=z3;const I3=(Rc=class{constructor(){this.name="json",this.version=2,this.transferFormat=si.Text}parseMessages(w,S){if(typeof w!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!w)return[];S===null&&(S=dt.instance);const M=Cs.parse(w),R=[];for(const W of M){const Z=JSON.parse(W);if(typeof Z.type!="number")throw new Error("Invalid payload.");switch(Z.type){case It.Invocation:this.U(Z);break;case It.StreamItem:this.Fe(Z);break;case It.Completion:this.Be(Z);break;case It.Ping:case It.Close:break;case It.Ack:this.Xe(Z);break;case It.Sequence:this.Je(Z);break;default:S.log(r.Information,"Unknown message type '"+Z.type+"' ignored.");continue}R.push(Z)}return R}writeMessage(w){return Cs.write(JSON.stringify(w))}U(w){this.ze(w.target,"Invalid payload for Invocation message."),w.invocationId!==void 0&&this.ze(w.invocationId,"Invalid payload for Invocation message.")}Fe(w){if(this.ze(w.invocationId,"Invalid payload for StreamItem message."),w.item===void 0)throw new Error("Invalid payload for StreamItem message.")}Be(w){if(w.result&&w.error)throw new Error("Invalid payload for Completion message.");!w.result&&w.error&&this.ze(w.error,"Invalid payload for Completion message."),this.ze(w.invocationId,"Invalid payload for Completion message.")}Xe(w){if(typeof w.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}Je(w){if(typeof w.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}ze(w,S){if(typeof w!="string"||w==="")throw new Error(S)}},h(Rc,"Tu"),Rc);c(I3,"Y");let D3=I3;const DW={trace:r.Trace,debug:r.Debug,info:r.Information,information:r.Information,warn:r.Warning,warning:r.Warning,error:r.Error,critical:r.Critical,none:r.None},V3=(Ec=class{configureLogging(w){if(ct.isRequired(w,"logging"),w.log!==void 0)this.logger=w;else if(typeof w=="string"){const S=(function(M){const R=DW[M.toLowerCase()];if(R!==void 0)return R;throw new Error(`Unknown log level: ${M}`)})(w);this.logger=new le(S)}else this.logger=new le(w);return this}withUrl(w,S){return ct.isRequired(w,"url"),ct.isNotEmpty(w,"url"),this.url=w,this.httpConnectionOptions=typeof S=="object"?{...this.httpConnectionOptions,...S}:{...this.httpConnectionOptions,transport:S},this}withHubProtocol(w){return ct.isRequired(w,"protocol"),this.protocol=w,this}withAutomaticReconnect(w){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return w?Array.isArray(w)?this.reconnectPolicy=new C3(w):this.reconnectPolicy=w:this.reconnectPolicy=new C3,this}withServerTimeout(w){return ct.isRequired(w,"milliseconds"),this.Ve=w,this}withKeepAliveInterval(w){return ct.isRequired(w,"milliseconds"),this.Ke=w,this}withStatefulReconnect(w){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._e=!0,this.Y=w?.bufferSize,this}build(){const w=this.httpConnectionOptions||{};if(w.logger===void 0&&(w.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const S=new zW(this.url,w);return k3.create(S,this.logger||dt.instance,this.protocol||new D3,this.reconnectPolicy,this.Ve,this.Ke,this.Y)}},h(Ec,"Lu"),Ec);c(V3,"tt");let VW=V3;return Uint8Array.prototype.indexOf||Object.defineProperty(Uint8Array.prototype,"indexOf",{value:Array.prototype.indexOf,writable:!0}),Uint8Array.prototype.slice||Object.defineProperty(Uint8Array.prototype,"slice",{value:c(function(H,w){return new Uint8Array(Array.prototype.slice.call(this,H,w))},"value"),writable:!0}),Uint8Array.prototype.forEach||Object.defineProperty(Uint8Array.prototype,"forEach",{value:Array.prototype.forEach,writable:!0}),n})(),"e"),s.exports=e()})(c9)),c9.exports}h(K_,"q1");c(K_,"requireSignalr_min");var d9=K_();const mj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._whenConnectionRequested=new Promise(n=>{this._resolveConnectionRequested=n}),this._whenConnectionCreated=new Promise(n=>{this._resolveConnectionCreated=n}),this._connectionEventListeners=[],this.signalRAccessTokenRefresh=!1,this._whenConnectionStarted=new Promise((n,a)=>{this._whenConnectionStartedResolve=n,this._whenConnectionStartedReject=a}),this.whenConnectionRequested().then(()=>{this.isDestroyed||this.createConnection()})}async whenConnectionRequested(){await this._whenConnectionRequested}async whenConnectionCreated(){return await this._whenConnectionCreated}get rtmConnection(){return this._connection}async whenConnectionStarted(){return await this._whenConnectionStarted}async createConnection(){if(this.isDestroyed)throw new _e;if(this.networkStateIsPending=!0,await this.whenUrlAndTokenFactory(),this._connection){const r=new URL("/hubs/rtm",this.url);this._connection.baseUrl!==r.toString()&&(this.connectionState="reconnecting",console.info(this.weavyId,"Reconnecting due to changed url.",this._connection.baseUrl,"=>",r.toString()),await this.disconnect(),this._connection.baseUrl=r.toString(),this.connect())}else{this.connectionState="connecting";const r=new URL("/hubs/rtm",this.url);this._connection=new d9.HubConnectionBuilder().configureLogging(d9.LogLevel.None).withUrl(r.toString(),{accessTokenFactory:c(async()=>{try{if(this.signalRAccessTokenRefresh){const n=await this.getToken(!0);return this.signalRAccessTokenRefresh=!1,n}else return await this.getToken()}catch(n){throw console.error(n),n}},"accessTokenFactory")}).withAutomaticReconnect({nextRetryDelayInMilliseconds:c(n=>!this.isDestroyed&&window.navigator.onLine&&document?.visibilityState!=="hidden"&&n.elapsedMilliseconds<6e4?[0,2e3,1e4][n.previousRetryCount]||1e4:null,"nextRetryDelayInMilliseconds")}).build(),this._connection.onclose(()=>{console.info(this.weavyId,"SignalR closed."),this.connectionState="disconnected",!this.isDestroyed&&(this.networkStateIsPending=!0,this._whenConnectionStarted=new Promise((n,a)=>{this._whenConnectionStartedResolve=n,this._whenConnectionStartedReject=a}),this.connect())}),this._connection.onreconnecting(()=>{console.info(this.weavyId,"SignalR reconnecting..."),this.connectionState="reconnecting"}),this._connection.onreconnected(n=>{console.info(this.weavyId,`SignalR reconnected ${n}`),this.connectionState="connected",this.networkStateIsPending=!1;for(let a=0;a<this._connectionEventListeners.length;a++)this._connection?.invoke("Subscribe",this._connectionEventListeners[a].name)}),this._resolveConnectionCreated?.(this._connection),this.connect()}return this._connection}async disconnect(){this._connection&&(await this._connection.stop(),this.connectionState="disconnected")}async connect(){if(this.isDestroyed)throw new _e;let r;this._connection?r=this._connection:r=await this.whenConnectionCreated(),console.info(this.weavyId,"Connecting SignalR...");try{if(!window.navigator.onLine)throw new Error;await Promise.race([r.start(),this.whenConnectionStarted()]),this.signalRAccessTokenRefresh=!1,this.networkStateIsPending=!1,this.connectionState="connected",this._whenConnectionStartedResolve?.(r),console.info(this.weavyId,`SignalR connected ${r.connectionId}`)}catch(n){if(n instanceof _e)return console.warn(this.weavyId,"SignalR connection aborted."),r;window.navigator.onLine?!this.signalRAccessTokenRefresh&&window.document.visibilityState!=="hidden"&&n.toString().includes("Unauthorized")?(console.info(this.weavyId,"Retrying SignalR connect with fresh token."),this.signalRAccessTokenRefresh=!0):(console.info(this.weavyId,"Server is probably down, retrying SignalR connect after a delay or when window regains focus."),this.connectionState="reconnecting",await new Promise(a=>{setTimeout(a,5e3),window.addEventListener("visibilitychange",a,{once:!0}),window.addEventListener("offline",a,{once:!0}),window.addEventListener("online",a,{once:!0})})):(this.networkStateIsPending=!1,console.info(this.weavyId,"Offline, reconnecting SignalR when online."),await new Promise(a=>{window.addEventListener("online",a,{once:!0})})),window.navigator.onLine&&document?.visibilityState!=="hidden"&&await new Promise(a=>setTimeout(a,1e3)),this.checkVersion(),this.networkStateIsPending=!0,await this.connect()}return r}async subscribe(r,n,a){if(this.isDestroyed)throw new _e;this._resolveConnectionRequested?.(!0);const o=r?r+":"+n:n;try{if(this._connectionEventListeners||await new Promise(l=>queueMicrotask(()=>l(!0))),this._connectionEventListeners.some(l=>l.name===o&&l.callback===a))throw new Error("Duplicate subscribe: "+o);if(this._connectionEventListeners.push({name:o,callback:a}),await this.whenConnectionStarted(),!this._connection)throw new Error("Connection not created");if(this._connection.on(o,a),await this._connection.invoke("Subscribe",o)===!1)throw new Error("Could not subscribe to "+o);return!0}catch(l){l instanceof _e||console.error(this.weavyId,"Error in Subscribe:",l);const d=this._connectionEventListeners.findIndex(u=>u.name===o&&u.callback===a);return d!==-1&&(this._connectionEventListeners.splice(d,1),this._connection?.off(o,a)),!1}}async unsubscribe(r,n,a){if(this.isDestroyed)throw new _e;try{const o=r?r+":"+n:n,l=this._connectionEventListeners.findIndex(d=>d.name===o&&d.callback===a);if(l!==-1){if(this._connectionEventListeners.splice(l,1),await this.whenConnectionStarted(),!this._connection)throw new Error("Connection not created");this._connection?.off(o,a),this._connectionEventListeners.some(d=>d.name===o)||await this._connection.invoke("Unsubscribe",o)}}catch(o){o instanceof _e||console.error(this.weavyId,"Error in Unsubscribe:",o)}}destroy(){super.destroy(),this.disconnect(),this._whenConnectionStartedReject&&(this._whenConnectionStarted.catch(()=>{}),this._whenConnectionStartedReject(new _e))}},h(e,"t"),e),c(t,"WeavyConnection"),t},"WeavyConnectionMixin");var a0=(s=>(s.JSON="application/json;charset=utf-8",s.FormData="multipart/form-data;charset=utf-8",s.URLEncoded="application/x-www-form-urlencoded;charset=utf-8",s.Text="text/plain;charset=utf-8",s.Auto="",s))(a0||{});const yj=c(s=>{var e;var t;return t=(e=class extends s{async fetchOptions(r={},n=!0){if(this.isDestroyed)throw new _e;const a={headers:{"X-Weavy-Source":`${Le.sourceName}@${Le.version}`,"Content-Type":a0.JSON},method:"GET"},o=wo(wo(pj,a,!0),r,!0);return n?wo(o,{headers:{Authorization:"Bearer "+await this.getToken()}},!0):o}async fetch(r,n,a=!0){if(this.isDestroyed)throw new _e;const o=await this.fetchOptions(n);this.networkStateIsPending=!0;const l=await fetch(new URL(r,this.url),o);if(l.ok)this.networkStateIsPending=!1,this.serverState="ok";else if(l.status===401||l.status===403){if(a)return await this.getToken(!0),await this.fetch(r,n,!1);this.networkStateIsPending=!1,this.serverState="unauthorized"}else this.networkStateIsPending=!1;return l}async upload(r,n,a,o=a0.JSON,l,d,u=!0){if(this.isDestroyed)throw new _e;const p=await this.getToken();return await new Promise((f,y)=>{const g=new XMLHttpRequest;g.open(n,new URL(r,this.url),!0),g.setRequestHeader("Authorization","Bearer "+p),g.setRequestHeader("X-Weavy-Source",`${Le.sourceName}@${Le.version}`),o&&g.setRequestHeader("Content-Type",o),l&&g.upload.addEventListener("progress",O=>{l(O.loaded/O.total*100||100)}),g.onload=O=>{u&&(g.status===401||g.status===401)?this.getToken(!0).then(()=>this.upload(r,n,a,o,l,d,!1)).then(f).catch(y):f(new Response(g.response,{status:g.status,statusText:g.statusText}))},g.onerror=y,g.onabort=y,d?.addEventListener("abort",()=>{g.abort()}),g.send(a)})}async get(r){return console.warn(`weavy.get() is deprecated, use weavy.fetch("${r}") instead.`),this.fetch(r)}async post(r,n,a,o){console.warn(`weavy.post() is deprecated, use weavy.fetch("${r}", { method: "${n}"}) instead.`);const l=o?{"Content-Type":o}:void 0;return this.fetch(r,{method:n,body:a,headers:l})}},h(e,"t"),e),c(t,"WeavyFetch"),t},"WeavyFetchMixin"),J_="en",gj=c(s=>{var e;var t;return t=(e=class extends s{constructor(){super(...arguments),this._locales=new Map([["sv-SE",()=>import(new URL("./es/locales/sv-SE-DNn-JJCG.js",typeof WEAVY_IMPORT_URL=="string"&&(!(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href)||!new URL(typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href.startsWith(WEAVY_IMPORT_URL))?WEAVY_IMPORT_URL:typeof document>"u"?require("url").pathToFileURL(__filename).href:kt&&kt.tagName.toUpperCase()==="SCRIPT"&&kt.src||new URL("weavy.cjs",document.baseURI).href).href).then(r=>r.svSE)]]),this._locale=t.sourceLocale}static get sourceLocale(){try{return J_}catch{return""}}get locales(){return Array.from(this._locales.entries())}set locales(r){if(this.isDestroyed)throw new _e;if(this.localization)throw new Error("Locales may only be configured once");if(r){if(!Array.isArray(r))throw new TypeError("Provided locales have invalid format.");r.forEach(n=>{if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string")throw new TypeError("Invalid locale provided: "+n[0]);this._locales.set(...n)}),this.configureLocalization()}}get localization(){return this._localization}get locale(){return this._locale}set locale(r){if(this.isDestroyed)throw new _e;!this._locale&&!r||(r||=t.sourceLocale,this._locale=r,this.localization?this.localization.setLocale(this._locale):queueMicrotask(()=>{this.localization?this.localization.setLocale(this._locale):this._locale!==t.sourceLocale&&(this._locales.has(this._locale)&&this.configureLocalization(),this.localization?this.localization.setLocale(this._locale):console.error(this.weavyId,`You need to configure additional languages in config to use '${r}'.`))}))}async loadLocale(r){if(this.isDestroyed)throw new _e;if(this._locales?.has(r)){const n=this._locales.get(r);return console.info(this.weavyId,typeof n=="function"?"loading locale":"preloaded locale",r),await(typeof n=="function"?n():n)}else throw new Error("The requested locale is not configured")}configureLocalization(){if(this.isDestroyed)throw new _e;if(this._locales?.size&&!this.localization){const r=this._locales.keys();console.info(this.weavyId,"Configuring locales",r);const{getLocale:n,setLocale:a}=QX({sourceLocale:t.sourceLocale,targetLocales:r,loadLocale:c(o=>this.loadLocale(o),"loadLocale")});this._localization={getLocale:n,setLocale:a}}}},h(e,"t"),e),c(t,"WeavyLocalization"),t},"WeavyLocalizationMixin"),wj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._configurationState="pending",this._networkEvents=new Set,this._connectionState="connecting",this._serverState="ok",this._networkState=window.navigator.onLine?"online":"offline",this._networkStateIsPending=!1,window.addEventListener("online",()=>{this.networkState="online"}),window.addEventListener("offline",()=>{this.networkState="offline",this.networkStateIsPending=!1}),queueMicrotask(()=>this.requestConfigurationCheck())}get configurationState(){return this._configurationState}set configurationState(r){this._configurationState=r,this._configurationTimer&&r==="configured"&&(window.clearTimeout(this._configurationTimer),this._configurationTimer=null),this.triggerNetworkChange()}get networkState(){return this._networkState}set networkState(r){this._networkState=r,this.triggerNetworkChange()}get serverState(){return this._serverState}set serverState(r){this._serverState=r,this.triggerNetworkChange()}get connectionState(){return this._connectionState}set connectionState(r){this._connectionState=r,this.triggerNetworkChange()}get networkStateIsPending(){return this._networkStateIsPending}set networkStateIsPending(r){this._networkStateIsPending=r,this.triggerNetworkChange()}get network(){return{state:this._networkState==="online"?(this._connectionState==="connected"||this._serverState==="ok")&&this.configurationState!=="uninitialized"?"online":"unreachable":"offline",isPending:this._networkStateIsPending}}requestConfigurationCheck(){!this._configurationTimer&&this.configurationTimeout>=0&&this.configurationTimeout<1/0&&(this._configurationTimer=window.setTimeout(()=>{this.configurationState==="pending"&&(this.configurationState="uninitialized",console.error("Weavy was not configured with required url and tokenFactory/tokenUrl within a reasonable time. Please check your configuration!")),this._configurationTimer=null},this.configurationTimeout))}triggerNetworkChange(){const r=this.network;this._networkEvents.forEach(n=>{n(r)})}addNetworkListener(r){this._networkEvents.add(r)}removeNetworkListener(r){this._networkEvents.delete(r)}},h(e,"t"),e),c(t,"WeavyNetwork"),t},"WeavyNetworkMixin");var J2,op,Vy=(J2=(op=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},h(op,"Ma"),op),c(J2,"Subscribable"),J2),vj={setTimeout:c((s,t)=>setTimeout(s,t),"setTimeout"),clearTimeout:c(s=>clearTimeout(s),"clearTimeout"),setInterval:c((s,t)=>setInterval(s,t),"setInterval"),clearInterval:c(s=>clearInterval(s),"clearInterval")},Ba,u9,t$,lp,Oj=(t$=(lp=class{constructor(){q(this,Ba,vj),q(this,u9,!1)}setTimeoutProvider(t){E(this,Ba,t)}setTimeout(t,e){return x(this,Ba).setTimeout(t,e)}clearTimeout(t){x(this,Ba).clearTimeout(t)}setInterval(t,e){return x(this,Ba).setInterval(t,e)}clearInterval(t){x(this,Ba).clearInterval(t)}},h(lp,"Aa"),lp),Ba=new WeakMap,u9=new WeakMap,c(t$,"TimeoutManager"),t$),Fn=new Oj;function tL(s){setTimeout(s,0)}h(tL,"Y1");c(tL,"systemSetTimeoutZero");var vy=typeof window>"u"||"Deno"in globalThis;function li(){}h(li,"Ae");c(li,"noop$1");function eL(s,t){return typeof s=="function"?s(t):s}h(eL,"X1");c(eL,"functionalUpdate");function o0(s){return typeof s=="number"&&s>=0&&s!==1/0}h(o0,"Xu");c(o0,"isValidTimeout");function NP(s,t){return Math.max(s+(t||0)-Date.now(),0)}h(NP,"um");c(NP,"timeUntilStale");function en(s,t){return typeof s=="function"?s(t):s}h(en,"Ir");c(en,"resolveStaleTime");function nr(s,t){return typeof s=="function"?s(t):s}h(nr,"ai");c(nr,"resolveEnabled");function oS(s,t){const{type:e="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:o}=s;if(a){if(i){if(t.queryHash!==Ob(a,t.options))return!1}else if(!Oy(t.queryKey,a))return!1}if(e!=="all"){const l=t.isActive();if(e==="active"&&!l||e==="inactive"&&l)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||r&&r!==t.state.fetchStatus||n&&!n(t))}h(oS,"qw");c(oS,"matchQuery");function lS(s,t){const{exact:e,status:i,predicate:r,mutationKey:n}=s;if(n){if(!t.options.mutationKey)return!1;if(e){if(ya(t.options.mutationKey)!==ya(n))return!1}else if(!Oy(t.options.mutationKey,n))return!1}return!(i&&t.state.status!==i||r&&!r(t))}h(lS,"jw");c(lS,"matchMutation");function Ob(s,t){return(t?.queryKeyHashFn||ya)(s)}h(Ob,"ty");c(Ob,"hashQueryKeyByOptions");function ya(s){return JSON.stringify(s,(t,e)=>l0(e)?Object.keys(e).sort().reduce((i,r)=>(i[r]=e[r],i),{}):e)}h(ya,"Pn");c(ya,"hashKey");function Oy(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?Object.keys(t).every(e=>Oy(s[e],t[e])):!1}h(Oy,"ml");c(Oy,"partialMatchKey");var bj=Object.prototype.hasOwnProperty;function Wy(s,t,e=0){if(s===t)return s;if(e>500)return t;const i=cS(s)&&cS(t);if(!i&&!(l0(s)&&l0(t)))return t;const r=(i?s:Object.keys(s)).length,n=i?t:Object.keys(t),a=n.length,o=i?new Array(a):{};let l=0;for(let d=0;d<a;d++){const u=i?d:n[d],p=s[u],f=t[u];if(p===f){o[u]=p,(i?d<r:bj.call(s,u))&&l++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){o[u]=f;continue}const y=Wy(p,f,e+1);o[u]=y,y===p&&l++}return r===a&&l===r?s:o}h(Wy,"dd");c(Wy,"replaceEqualDeep");function Uw(s,t){if(!t||Object.keys(s).length!==Object.keys(t).length)return!1;for(const e in s)if(s[e]!==t[e])return!1;return!0}h(Uw,"jd");c(Uw,"shallowEqualObjects");function cS(s){return Array.isArray(s)&&s.length===Object.keys(s).length}h(cS,"Ww");c(cS,"isPlainArray");function l0(s){if(!hS(s))return!1;const t=s.constructor;if(t===void 0)return!0;const e=t.prototype;return!(!hS(e)||!e.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}h(l0,"Ju");c(l0,"isPlainObject");function hS(s){return Object.prototype.toString.call(s)==="[object Object]"}h(hS,"Kw");c(hS,"hasObjectPrototype");function iL(s){return new Promise(t=>{Fn.setTimeout(t,s)})}h(iL,"tg");c(iL,"sleep");function c0(s,t,e){return typeof e.structuralSharing=="function"?e.structuralSharing(s,t):e.structuralSharing!==!1?Wy(s,t):t}h(c0,"tp");c(c0,"replaceData");function rL(s,t,e=0){const i=[...s,t];return e&&i.length>e?i.slice(1):i}h(rL,"eg");c(rL,"addToEnd");function sL(s,t,e=0){const i=[t,...s];return e&&i.length>e?i.slice(0,-1):i}h(sL,"ig");c(sL,"addToStart");var BP=Symbol();function XP(s,t){return!s.queryFn&&t?.initialPromise?()=>t.initialPromise:!s.queryFn||s.queryFn===BP?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}h(XP,"pm");c(XP,"ensureQueryFn");function nL(s,t,e){let i=!1,r;return Object.defineProperty(s,"signal",{enumerable:!0,get:c(()=>(r??=t(),i||(i=!0,r.aborted?e():r.addEventListener("abort",e,{once:!0})),r),"get")}),s}h(nL,"rg");c(nL,"addConsumeAwareSignal");var zc,Xa,ug,e$,cp,$j=(e$=(cp=class extends Vy{constructor(){super(),q(this,zc),q(this,Xa),q(this,ug),E(this,ug,t=>{if(!vy&&window.addEventListener){const e=c(()=>t(),"listener");return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}})}onSubscribe(){x(this,Xa)||this.setEventListener(x(this,ug))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,Xa))==null||t.call(this),E(this,Xa,void 0))}setEventListener(t){var e;E(this,ug,t),(e=x(this,Xa))==null||e.call(this),E(this,Xa,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){x(this,zc)!==t&&(E(this,zc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof x(this,zc)=="boolean"?x(this,zc):globalThis.document?.visibilityState!=="hidden"}},h(cp,"Ra"),cp),zc=new WeakMap,Xa=new WeakMap,ug=new WeakMap,c(e$,"FocusManager"),e$),jP=new $j;function h0(){let s,t;const e=new Promise((r,n)=>{s=r,t=n});e.status="pending",e.catch(()=>{});function i(r){Object.assign(e,r),delete e.resolve,delete e.reject}return h(i,"i"),c(i,"finalize"),e.resolve=r=>{i({status:"fulfilled",value:r}),s(r)},e.reject=r=>{i({status:"rejected",reason:r}),t(r)},e}h(h0,"ep");c(h0,"pendingThenable");function aL(s){let t;if(s.then(e=>(t=e,e),li)?.catch(li),t!==void 0)return{data:t}}h(aL,"ag");c(aL,"tryResolveSync");function UP(s){return s}h(UP,"ym");c(UP,"defaultTransformerFn");function oL(s){return{mutationKey:s.options.mutationKey,state:s.state,...s.options.scope&&{scope:s.options.scope},...s.meta&&{meta:s.meta}}}h(oL,"sg");c(oL,"dehydrateMutation");function lL(s,t,e){const i=c(()=>{const r=s.promise?.then(t).catch(n=>e(n)?Promise.reject(new Error("redacted")):Promise.reject(n));return r?.catch(li),r},"dehydratePromise");return{dehydratedAt:Date.now(),state:{...s.state,...s.state.data!==void 0&&{data:t(s.state.data)}},queryKey:s.queryKey,queryHash:s.queryHash,...s.state.status==="pending"&&{promise:i()},...s.meta&&{meta:s.meta}}}h(lL,"og");c(lL,"dehydrateQuery");function cL(s){return s.state.isPaused}h(cL,"cg");c(cL,"defaultShouldDehydrateMutation");function hL(s){return s.state.status==="success"}h(hL,"lg");c(hL,"defaultShouldDehydrateQuery");function dL(s){return!0}h(dL,"dg");c(dL,"defaultShouldRedactErrors");function uL(s,t={}){const e=t.shouldDehydrateMutation??s.getDefaultOptions().dehydrate?.shouldDehydrateMutation??cL,i=s.getMutationCache().getAll().flatMap(l=>e(l)?[oL(l)]:[]),r=t.shouldDehydrateQuery??s.getDefaultOptions().dehydrate?.shouldDehydrateQuery??hL,n=t.shouldRedactErrors??s.getDefaultOptions().dehydrate?.shouldRedactErrors??dL,a=t.serializeData??s.getDefaultOptions().dehydrate?.serializeData??UP,o=s.getQueryCache().getAll().flatMap(l=>r(l)?[lL(l,a,n)]:[]);return{mutations:i,queries:o}}h(uL,"hg");c(uL,"dehydrate");function pL(s,t,e){if(typeof t!="object"||t===null)return;const i=s.getMutationCache(),r=s.getQueryCache(),n=s.getDefaultOptions().hydrate?.deserializeData??UP,a=t.mutations||[],o=t.queries||[];a.forEach(({state:l,...d})=>{i.build(s,{...s.getDefaultOptions().hydrate?.mutations,...e?.defaultOptions?.mutations,...d},l)}),o.forEach(({queryKey:l,state:d,queryHash:u,meta:p,promise:f,dehydratedAt:y})=>{const g=f?aL(f):void 0,O=d.data===void 0?g?.data:d.data,k=O===void 0?O:n(O);let $=r.get(u);const T=$?.state.status==="pending",_=$?.state.fetchStatus==="fetching";if($){const D=g&&y!==void 0&&y>$.state.dataUpdatedAt;if(d.dataUpdatedAt>$.state.dataUpdatedAt||D){const{fetchStatus:A,...z}=d;$.setState({...z,data:k})}}else $=r.build(s,{...s.getDefaultOptions().hydrate?.queries,...e?.defaultOptions?.queries,queryKey:l,queryHash:u,meta:p},{...d,data:k,fetchStatus:"idle",status:k!==void 0?"success":d.status});f&&!T&&!_&&(y===void 0||y>$.state.dataUpdatedAt)&&$.fetch(void 0,{initialPromise:Promise.resolve(f).then(n)}).catch(li)})}h(pL,"ug");c(pL,"hydrate");var xj=tL;function fL(){let s=[],t=0,e=c(o=>{o()},"notifyFn"),i=c(o=>{o()},"batchNotifyFn"),r=xj;const n=c(o=>{t?s.push(o):r(()=>{e(o)})},"schedule"),a=c(()=>{const o=s;s=[],o.length&&r(()=>{i(()=>{o.forEach(l=>{e(l)})})})},"flush");return{batch:c(o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},"batch"),batchCalls:c(o=>(...l)=>{n(()=>{o(...l)})},"batchCalls"),schedule:n,setNotifyFunction:c(o=>{e=o},"setNotifyFunction"),setBatchNotifyFunction:c(o=>{i=o},"setBatchNotifyFunction"),setScheduler:c(o=>{r=o},"setScheduler")}}h(fL,"yg");c(fL,"createNotifyManager");var di=fL(),pg,ja,fg,i$,hp,kj=(i$=(hp=class extends Vy{constructor(){super(),q(this,pg,!0),q(this,ja),q(this,fg),E(this,fg,t=>{if(!vy&&window.addEventListener){const e=c(()=>t(!0),"onlineListener"),i=c(()=>t(!1),"offlineListener");return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}})}onSubscribe(){x(this,ja)||this.setEventListener(x(this,fg))}onUnsubscribe(){var t;this.hasListeners()||((t=x(this,ja))==null||t.call(this),E(this,ja,void 0))}setEventListener(t){var e;E(this,fg,t),(e=x(this,ja))==null||e.call(this),E(this,ja,t(this.setOnline.bind(this)))}setOnline(t){x(this,pg)!==t&&(E(this,pg,t),this.listeners.forEach(e=>{e(t)}))}isOnline(){return x(this,pg)}},h(hp,"Oa"),hp),pg=new WeakMap,ja=new WeakMap,fg=new WeakMap,c(i$,"OnlineManager"),i$),d0=new kj;function mL(s){return Math.min(1e3*2**s,3e4)}h(mL,"fg");c(mL,"defaultRetryDelay");function HP(s){return(s??"online")==="online"?d0.isOnline():!0}h(HP,"wm");c(HP,"canFetch");var r$,dp,dS=(r$=(dp=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}},h(dp,"za"),dp),c(r$,"CancelledError"),r$);function YP(s){let t=!1,e=0,i;const r=h0(),n=c(()=>r.status!=="pending","isResolved"),a=c(O=>{if(!n()){const k=new dS(O);f(k),s.onCancel?.(k)}},"cancel"),o=c(()=>{t=!0},"cancelRetry"),l=c(()=>{t=!1},"continueRetry"),d=c(()=>jP.isFocused()&&(s.networkMode==="always"||d0.isOnline())&&s.canRun(),"canContinue"),u=c(()=>HP(s.networkMode)&&s.canRun(),"canStart"),p=c(O=>{n()||(i?.(),r.resolve(O))},"resolve"),f=c(O=>{n()||(i?.(),r.reject(O))},"reject"),y=c(()=>new Promise(O=>{i=c(k=>{(n()||d())&&O(k)},"continueFn"),s.onPause?.()}).then(()=>{i=void 0,n()||s.onContinue?.()}),"pause"),g=c(()=>{if(n())return;let O;const k=e===0?s.initialPromise:void 0;try{O=k??s.fn()}catch($){O=Promise.reject($)}Promise.resolve(O).then(p).catch($=>{if(n())return;const T=s.retry??(vy?0:3),_=s.retryDelay??mL,D=typeof _=="function"?_(e,$):_,A=T===!0||typeof T=="number"&&e<T||typeof T=="function"&&T(e,$);if(t||!A){f($);return}e++,s.onFail?.(e,$),iL(D).then(()=>d()?void 0:y()).then(()=>{t?f($):g()})})},"run");return{promise:r,status:c(()=>r.status,"status"),cancel:a,continue:c(()=>(i?.(),r),"continue"),cancelRetry:o,continueRetry:l,canStart:u,start:c(()=>(u()?g():y().then(g),r),"start")}}h(YP,"fm");c(YP,"createRetryer");var Ic,s$,up,yL=(s$=(up=class{constructor(){q(this,Ic)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o0(this.gcTime)&&E(this,Ic,Fn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(vy?1/0:300*1e3))}clearGcTimeout(){x(this,Ic)&&(Fn.clearTimeout(x(this,Ic)),E(this,Ic,void 0))}},h(up,"Ia"),up),Ic=new WeakMap,c(s$,"Removable"),s$),Dc,mg,Ar,Vc,ni,gv,Wc,Gr,Ms,n$,pp,Sj=(n$=(pp=class extends yL{constructor(t){super(),q(this,Gr),q(this,Dc),q(this,mg),q(this,Ar),q(this,Vc),q(this,ni),q(this,gv),q(this,Wc),E(this,Wc,!1),E(this,gv,t.defaultOptions),this.setOptions(t.options),this.observers=[],E(this,Vc,t.client),E(this,Ar,x(this,Vc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,E(this,Dc,pS(this.options)),this.state=t.state??x(this,Dc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){return x(this,ni)?.promise}setOptions(t){if(this.options={...x(this,gv),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=pS(this.options);e.data!==void 0&&(this.setState(uS(e.data,e.dataUpdatedAt)),E(this,Dc,e))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&x(this,Ar).remove(this)}setData(t,e){const i=c0(this.state.data,t,this.options);return St(this,Gr,Ms).call(this,{data:i,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),i}setState(t,e){St(this,Gr,Ms).call(this,{type:"setState",state:t,setStateOptions:e})}cancel(t){const e=x(this,ni)?.promise;return x(this,ni)?.cancel(t),e?e.then(li).catch(li):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(x(this,Dc))}isActive(){return this.observers.some(t=>nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BP||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>en(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!NP(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),x(this,ni)?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),x(this,ni)?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),x(this,Ar).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(x(this,ni)&&(x(this,Wc)?x(this,ni).cancel({revert:!0}):x(this,ni).cancelRetry()),this.scheduleGc()),x(this,Ar).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||St(this,Gr,Ms).call(this,{type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&x(this,ni)?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(x(this,ni))return x(this,ni).continueRetry(),x(this,ni).promise}if(t&&this.setOptions(t),!this.options.queryFn){const o=this.observers.find(l=>l.options.queryFn);o&&this.setOptions(o.options)}const i=new AbortController,r=c(o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:c(()=>(E(this,Wc,!0),i.signal),"get")})},"addSignalProperty"),n=c(()=>{const o=XP(this.options,e),l=c(()=>{const d={client:x(this,Vc),queryKey:this.queryKey,meta:this.meta};return r(d),d},"createQueryFnContext")();return E(this,Wc,!1),this.options.persister?this.options.persister(o,l,this):o(l)},"fetchFn"),a=c(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:x(this,Vc),state:this.state,fetchFn:n};return r(o),o},"createFetchContext")();this.options.behavior?.onFetch(a,this),E(this,mg,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&St(this,Gr,Ms).call(this,{type:"fetch",meta:a.fetchOptions?.meta}),E(this,ni,YP({initialPromise:e?.initialPromise,fn:a.fetchFn,onCancel:c(o=>{o instanceof dS&&o.revert&&this.setState({...x(this,mg),fetchStatus:"idle"}),i.abort()},"onCancel"),onFail:c((o,l)=>{St(this,Gr,Ms).call(this,{type:"failed",failureCount:o,error:l})},"onFail"),onPause:c(()=>{St(this,Gr,Ms).call(this,{type:"pause"})},"onPause"),onContinue:c(()=>{St(this,Gr,Ms).call(this,{type:"continue"})},"onContinue"),retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:c(()=>!0,"canRun")}));try{const o=await x(this,ni).start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),x(this,Ar).config.onSuccess?.(o,this),x(this,Ar).config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof dS){if(o.silent)return x(this,ni).promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw St(this,Gr,Ms).call(this,{type:"error",error:o}),x(this,Ar).config.onError?.(o,this),x(this,Ar).config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}},h(pp,"Da"),pp),Dc=new WeakMap,mg=new WeakMap,Ar=new WeakMap,Vc=new WeakMap,ni=new WeakMap,gv=new WeakMap,Wc=new WeakMap,Gr=new WeakSet,Ms=c(function(s){const t=c(e=>{switch(s.type){case"failed":return{...e,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...GP(e.data,this.options),fetchMeta:s.meta??null};case"success":const i={...e,...uS(s.data,s.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return E(this,mg,s.manual?i:void 0),i;case"error":const r=s.error;return{...e,error:r,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...s.state}}},"reducer");this.state=t(this.state),di.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),x(this,Ar).notify({query:this,type:"updated",action:s})})},"#dispatch"),c(n$,"Query"),n$);function GP(s,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HP(t.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}h(GP,"vm");c(GP,"fetchState");function uS(s,t){return{data:s,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}h(uS,"Qw");c(uS,"successState");function pS(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,e=t!==void 0,i=e?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:e?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:e?"success":"pending",fetchStatus:"idle"}}h(pS,"Gw");c(pS,"getDefaultState$1");var tr,Zt,wv,Vi,Fc,yg,kn,Ua,vv,gg,wg,qc,Zc,Ha,vg,xe,Og,a$,o$,l$,c$,h$,d$,u$,p9,p$,fp,gL=(p$=(fp=class extends Vy{constructor(t,e){super(),q(this,xe),q(this,tr),q(this,Zt),q(this,wv),q(this,Vi),q(this,Fc),q(this,yg),q(this,kn),q(this,Ua),q(this,vv),q(this,gg),q(this,wg),q(this,qc),q(this,Zc),q(this,Ha),q(this,vg,new Set),this.options=e,E(this,tr,t),E(this,Ua,null),E(this,kn,h0()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(x(this,Zt).addObserver(this),fS(x(this,Zt),this.options)?St(this,xe,Og).call(this):this.updateResult(),St(this,xe,c$).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return u0(x(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return u0(x(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,St(this,xe,h$).call(this),St(this,xe,d$).call(this),x(this,Zt).removeObserver(this)}setOptions(t){const e=this.options,i=x(this,Zt);if(this.options=x(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nr(this.options.enabled,x(this,Zt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");St(this,xe,u$).call(this),x(this,Zt).setOptions(this.options),e._defaulted&&!Uw(this.options,e)&&x(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:x(this,Zt),observer:this});const r=this.hasListeners();r&&mS(x(this,Zt),i,this.options,e)&&St(this,xe,Og).call(this),this.updateResult(),r&&(x(this,Zt)!==i||nr(this.options.enabled,x(this,Zt))!==nr(e.enabled,x(this,Zt))||en(this.options.staleTime,x(this,Zt))!==en(e.staleTime,x(this,Zt)))&&St(this,xe,a$).call(this);const n=St(this,xe,o$).call(this);r&&(x(this,Zt)!==i||nr(this.options.enabled,x(this,Zt))!==nr(e.enabled,x(this,Zt))||n!==x(this,Ha))&&St(this,xe,l$).call(this,n)}getOptimisticResult(t){const e=x(this,tr).getQueryCache().build(x(this,tr),t),i=this.createResult(e,t);return vL(this,i)&&(E(this,Vi,i),E(this,yg,this.options),E(this,Fc,x(this,Zt).state)),i}getCurrentResult(){return x(this,Vi)}trackResult(t,e){return new Proxy(t,{get:c((i,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&x(this,kn).status==="pending"&&x(this,kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r)),"get")})}trackProp(t){x(this,vg).add(t)}getCurrentQuery(){return x(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=x(this,tr).defaultQueryOptions(t),i=x(this,tr).getQueryCache().build(x(this,tr),e);return i.fetch().then(()=>this.createResult(i,e))}fetch(t){return St(this,xe,Og).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),x(this,Vi)))}createResult(t,e){const i=x(this,Zt),r=this.options,n=x(this,Vi),a=x(this,Fc),o=x(this,yg),l=t!==i?t.state:x(this,wv),{state:d}=t;let u={...d},p=!1,f;if(e._optimisticResults){const V=this.hasListeners(),j=!V&&fS(t,e),tt=V&&mS(t,i,e,r);(j||tt)&&(u={...u,...GP(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:O}=u;f=u.data;let k=!1;if(e.placeholderData!==void 0&&f===void 0&&O==="pending"){let V;n?.isPlaceholderData&&e.placeholderData===o?.placeholderData?(V=n.data,k=!0):V=typeof e.placeholderData=="function"?e.placeholderData(x(this,wg)?.state.data,x(this,wg)):e.placeholderData,V!==void 0&&(O="success",f=c0(n?.data,V,e),p=!0)}if(e.select&&f!==void 0&&!k)if(n&&f===a?.data&&e.select===x(this,vv))f=x(this,gg);else try{E(this,vv,e.select),f=e.select(f),f=c0(n?.data,f,e),E(this,gg,f),E(this,Ua,null)}catch(V){E(this,Ua,V)}x(this,Ua)&&(y=x(this,Ua),f=x(this,gg),g=Date.now(),O="error");const $=u.fetchStatus==="fetching",T=O==="pending",_=O==="error",D=T&&$,A=f!==void 0,z={status:O,fetchStatus:u.fetchStatus,isPending:T,isSuccess:O==="success",isError:_,isInitialLoading:D,isLoading:D,data:f,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:$,isRefetching:$&&!T,isLoadingError:_&&!A,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&A,isStale:bb(t,e),refetch:this.refetch,promise:x(this,kn),isEnabled:nr(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=z.data!==void 0,j=z.status==="error"&&!V,tt=c(st=>{j?st.reject(z.error):V&&st.resolve(z.data)},"finalizeThenableIfPossible"),vt=c(()=>{const st=E(this,kn,z.promise=h0());tt(st)},"recreateThenable"),dt=x(this,kn);switch(dt.status){case"pending":t.queryHash===i.queryHash&&tt(dt);break;case"fulfilled":(j||z.data!==dt.value)&&vt();break;case"rejected":(!j||z.error!==dt.reason)&&vt();break}}return z}updateResult(){const t=x(this,Vi),e=this.createResult(x(this,Zt),this.options);if(E(this,Fc,x(this,Zt).state),E(this,yg,this.options),x(this,Fc).data!==void 0&&E(this,wg,x(this,Zt)),Uw(e,t))return;E(this,Vi,e);const i=c(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!x(this,vg).size)return!0;const a=new Set(n??x(this,vg));return this.options.throwOnError&&a.add("error"),Object.keys(x(this,Vi)).some(o=>{const l=o;return x(this,Vi)[l]!==t[l]&&a.has(l)})},"shouldNotifyListeners");St(this,xe,p9).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&St(this,xe,c$).call(this)}},h(fp,"Ua"),fp),tr=new WeakMap,Zt=new WeakMap,wv=new WeakMap,Vi=new WeakMap,Fc=new WeakMap,yg=new WeakMap,kn=new WeakMap,Ua=new WeakMap,vv=new WeakMap,gg=new WeakMap,wg=new WeakMap,qc=new WeakMap,Zc=new WeakMap,Ha=new WeakMap,vg=new WeakMap,xe=new WeakSet,Og=c(function(s){St(this,xe,u$).call(this);let t=x(this,Zt).fetch(this.options,s);return s?.throwOnError||(t=t.catch(li)),t},"#executeFetch"),a$=c(function(){St(this,xe,h$).call(this);const s=en(this.options.staleTime,x(this,Zt));if(vy||x(this,Vi).isStale||!o0(s))return;const t=NP(x(this,Vi).dataUpdatedAt,s)+1;E(this,qc,Fn.setTimeout(()=>{x(this,Vi).isStale||this.updateResult()},t))},"#updateStaleTimeout"),o$=c(function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(x(this,Zt)):this.options.refetchInterval)??!1},"#computeRefetchInterval"),l$=c(function(s){St(this,xe,d$).call(this),E(this,Ha,s),!(vy||nr(this.options.enabled,x(this,Zt))===!1||!o0(x(this,Ha))||x(this,Ha)===0)&&E(this,Zc,Fn.setInterval(()=>{(this.options.refetchIntervalInBackground||jP.isFocused())&&St(this,xe,Og).call(this)},x(this,Ha)))},"#updateRefetchInterval"),c$=c(function(){St(this,xe,a$).call(this),St(this,xe,l$).call(this,St(this,xe,o$).call(this))},"#updateTimers"),h$=c(function(){x(this,qc)&&(Fn.clearTimeout(x(this,qc)),E(this,qc,void 0))},"#clearStaleTimeout"),d$=c(function(){x(this,Zc)&&(Fn.clearInterval(x(this,Zc)),E(this,Zc,void 0))},"#clearRefetchInterval"),u$=c(function(){const s=x(this,tr).getQueryCache().build(x(this,tr),this.options);if(s===x(this,Zt))return;const t=x(this,Zt);E(this,Zt,s),E(this,wv,s.state),this.hasListeners()&&(t?.removeObserver(this),s.addObserver(this))},"#updateQuery"),p9=c(function(s){di.batch(()=>{s.listeners&&this.listeners.forEach(t=>{t(x(this,Vi))}),x(this,tr).getQueryCache().notify({query:x(this,Zt),type:"observerResultsUpdated"})})},"#notify"),c(p$,"QueryObserver"),p$);function wL(s,t){return nr(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&t.retryOnMount===!1)}h(wL,"vg");c(wL,"shouldLoadOnMount");function fS(s,t){return wL(s,t)||s.state.data!==void 0&&u0(s,t,t.refetchOnMount)}h(fS,"Zw");c(fS,"shouldFetchOnMount");function u0(s,t,e){if(nr(t.enabled,s)!==!1&&en(t.staleTime,s)!=="static"){const i=typeof e=="function"?e(s):e;return i==="always"||i!==!1&&bb(s,t)}return!1}h(u0,"dp");c(u0,"shouldFetchOn");function mS(s,t,e,i){return(s!==t||nr(i.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&bb(s,e)}h(mS,"Yw");c(mS,"shouldFetchOptionally");function bb(s,t){return nr(t.enabled,s)!==!1&&s.isStaleByTime(en(t.staleTime,s))}h(bb,"ry");c(bb,"isStale");function vL(s,t){return!Uw(s.getCurrentResult(),t)}h(vL,"gg");c(vL,"shouldAssignObserverCurrentProperties");function Hw(s){return{onFetch:c((t,e)=>{const i=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},l=0;const d=c(async()=>{let u=!1;const p=c(g=>{nL(g,()=>t.signal,()=>u=!0)},"addSignalProperty"),f=XP(t.options,t.fetchOptions),y=c(async(g,O,k)=>{if(u)return Promise.reject();if(O==null&&g.pages.length)return Promise.resolve(g);const $=c(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:O,direction:k?"backward":"forward",meta:t.options.meta};return p(A),A},"createQueryFnContext")(),T=await f($),{maxPages:_}=t.options,D=k?sL:rL;return{pages:D(g.pages,T,_),pageParams:D(g.pageParams,O,_)}},"fetchPage");if(r&&n.length){const g=r==="backward",O=g?KP:p0,k={pages:n,pageParams:a},$=O(i,k);o=await y(k,$,g)}else{const g=s??n.length;do{const O=l===0?a[0]??i.initialPageParam:p0(i,o);if(l>0&&O==null)break;o=await y(o,O),l++}while(l<g)}return o},"fetchFn");t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e):t.fetchFn=d},"onFetch")}}h(Hw,"Kd");c(Hw,"infiniteQueryBehavior");function p0(s,{pages:t,pageParams:e}){const i=t.length-1;return t.length>0?s.getNextPageParam(t[i],t,e[i],e):void 0}h(p0,"hp");c(p0,"getNextPageParam");function KP(s,{pages:t,pageParams:e}){return t.length>0?s.getPreviousPageParam?.(t[0],t,e[0],e):void 0}h(KP,"xm");c(KP,"getPreviousPageParam");function OL(s,t){return t?p0(s,t)!=null:!1}h(OL,"bg");c(OL,"hasNextPage");function bL(s,t){return!t||!s.getPreviousPageParam?!1:KP(s,t)!=null}h(bL,"xg");c(bL,"hasPreviousPage");var f$,mp,Cj=(f$=(mp=class extends gL{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Hw()})}getOptimisticResult(t){return t.behavior=Hw(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:i}=t,r=super.createResult(t,e),{isFetching:n,isRefetching:a,isError:o,isRefetchError:l}=r,d=i.fetchMeta?.fetchMore?.direction,u=o&&d==="forward",p=n&&d==="forward",f=o&&d==="backward",y=n&&d==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:OL(e,i.data),hasPreviousPage:bL(e,i.data),isFetchNextPageError:u,isFetchingNextPage:p,isFetchPreviousPageError:f,isFetchingPreviousPage:y,isRefetchError:l&&!u&&!f,isRefetching:a&&!p&&!y}}},h(mp,"qa"),mp),c(f$,"InfiniteQueryObserver"),f$),Ov,As,ki,Nc,Rs,Sn,m$,yp,Pj=(m$=(yp=class extends yL{constructor(t){super(),q(this,Rs),q(this,Ov),q(this,As),q(this,ki),q(this,Nc),E(this,Ov,t.client),this.mutationId=t.mutationId,E(this,ki,t.mutationCache),E(this,As,[]),this.state=t.state||JP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){x(this,As).includes(t)||(x(this,As).push(t),this.clearGcTimeout(),x(this,ki).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){E(this,As,x(this,As).filter(e=>e!==t)),this.scheduleGc(),x(this,ki).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){x(this,As).length||(this.state.status==="pending"?this.scheduleGc():x(this,ki).remove(this))}continue(){return x(this,Nc)?.continue()??this.execute(this.state.variables)}async execute(t){const e=c(()=>{St(this,Rs,Sn).call(this,{type:"continue"})},"onContinue"),i={client:x(this,Ov),meta:this.options.meta,mutationKey:this.options.mutationKey};E(this,Nc,YP({fn:c(()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),"fn"),onFail:c((a,o)=>{St(this,Rs,Sn).call(this,{type:"failed",failureCount:a,error:o})},"onFail"),onPause:c(()=>{St(this,Rs,Sn).call(this,{type:"pause"})},"onPause"),onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:c(()=>x(this,ki).canRun(this),"canRun")}));const r=this.state.status==="pending",n=!x(this,Nc).canStart();try{if(r)e();else{St(this,Rs,Sn).call(this,{type:"pending",variables:t,isPaused:n}),x(this,ki).config.onMutate&&await x(this,ki).config.onMutate(t,this,i);const o=await this.options.onMutate?.(t,i);o!==this.state.context&&St(this,Rs,Sn).call(this,{type:"pending",context:o,variables:t,isPaused:n})}const a=await x(this,Nc).start();return await x(this,ki).config.onSuccess?.(a,t,this.state.context,this,i),await this.options.onSuccess?.(a,t,this.state.context,i),await x(this,ki).config.onSettled?.(a,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(a,null,t,this.state.context,i),St(this,Rs,Sn).call(this,{type:"success",data:a}),a}catch(a){try{await x(this,ki).config.onError?.(a,t,this.state.context,this,i)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,t,this.state.context,i)}catch(o){Promise.reject(o)}try{await x(this,ki).config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,i)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,t,this.state.context,i)}catch(o){Promise.reject(o)}throw St(this,Rs,Sn).call(this,{type:"error",error:a}),a}finally{x(this,ki).runNext(this)}}},h(yp,"ja"),yp),Ov=new WeakMap,As=new WeakMap,ki=new WeakMap,Nc=new WeakMap,Rs=new WeakSet,Sn=c(function(s){const t=c(e=>{switch(s.type){case"failed":return{...e,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...e,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:s.error,failureCount:e.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}},"reducer");this.state=t(this.state),di.batch(()=>{x(this,As).forEach(e=>{e.onMutationUpdate(s)}),x(this,ki).notify({mutation:this,type:"updated",action:s})})},"#dispatch"),c(m$,"Mutation"),m$);function JP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}h(JP,"Cm");c(JP,"getDefaultState");var Cn,Kr,bv,y$,gp,Qj=(y$=(gp=class extends Vy{constructor(t={}){super(),q(this,Cn),q(this,Kr),q(this,bv),this.config=t,E(this,Cn,new Set),E(this,Kr,new Map),E(this,bv,0)}build(t,e,i){const r=new Pj({client:t,mutationCache:this,mutationId:++aS(this,bv)._,options:t.defaultMutationOptions(e),state:i});return this.add(r),r}add(t){x(this,Cn).add(t);const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e);i?i.push(t):x(this,Kr).set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(x(this,Cn).delete(t)){const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e);if(i)if(i.length>1){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}else i[0]===t&&x(this,Kr).delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=Wg(t);if(typeof e=="string"){const i=x(this,Kr).get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=Wg(t);return typeof e=="string"?x(this,Kr).get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){di.batch(()=>{x(this,Cn).forEach(t=>{this.notify({type:"removed",mutation:t})}),x(this,Cn).clear(),x(this,Kr).clear()})}getAll(){return Array.from(x(this,Cn))}find(t){const e={exact:!0,...t};return this.getAll().find(i=>lS(e,i))}findAll(t={}){return this.getAll().filter(e=>lS(t,e))}notify(t){di.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return di.batch(()=>Promise.all(t.map(e=>e.continue().catch(li))))}},h(gp,"Wa"),gp),Cn=new WeakMap,Kr=new WeakMap,bv=new WeakMap,c(y$,"MutationCache"),y$);function Wg(s){return s.options.scope?.id}h(Wg,"Ld");c(Wg,"scopeFor");var Pn,Ya,er,Qn,Ga,$v,g$,w$,wp,Gt=(w$=(wp=class extends Vy{constructor(t,e){super(),q(this,Ga),q(this,Pn),q(this,Ya),q(this,er),q(this,Qn),E(this,Pn,t),this.setOptions(e),this.bindMethods(),St(this,Ga,$v).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=x(this,Pn).defaultMutationOptions(t),Uw(this.options,e)||x(this,Pn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:x(this,er),observer:this}),e?.mutationKey&&this.options.mutationKey&&ya(e.mutationKey)!==ya(this.options.mutationKey)?this.reset():x(this,er)?.state.status==="pending"&&x(this,er).setOptions(this.options)}onUnsubscribe(){this.hasListeners()||x(this,er)?.removeObserver(this)}onMutationUpdate(t){St(this,Ga,$v).call(this),St(this,Ga,g$).call(this,t)}getCurrentResult(){return x(this,Ya)}reset(){x(this,er)?.removeObserver(this),E(this,er,void 0),St(this,Ga,$v).call(this),St(this,Ga,g$).call(this)}mutate(t,e){return E(this,Qn,e),x(this,er)?.removeObserver(this),E(this,er,x(this,Pn).getMutationCache().build(x(this,Pn),this.options)),x(this,er).addObserver(this),x(this,er).execute(t)}},h(wp,"Ka"),wp),Pn=new WeakMap,Ya=new WeakMap,er=new WeakMap,Qn=new WeakMap,Ga=new WeakSet,$v=c(function(){const s=x(this,er)?.state??JP();E(this,Ya,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},"#updateResult"),g$=c(function(s){di.batch(()=>{if(x(this,Qn)&&this.hasListeners()){const t=x(this,Ya).variables,e=x(this,Ya).context,i={client:x(this,Pn),meta:this.options.meta,mutationKey:this.options.mutationKey};if(s?.type==="success"){try{x(this,Qn).onSuccess?.(s.data,t,e,i)}catch(r){Promise.reject(r)}try{x(this,Qn).onSettled?.(s.data,null,t,e,i)}catch(r){Promise.reject(r)}}else if(s?.type==="error"){try{x(this,Qn).onError?.(s.error,t,e,i)}catch(r){Promise.reject(r)}try{x(this,Qn).onSettled?.(void 0,s.error,t,e,i)}catch(r){Promise.reject(r)}}}this.listeners.forEach(t=>{t(x(this,Ya))})})},"#notify"),c(w$,"MutationObserver"),w$),Es,v$,vp,Tj=(v$=(vp=class extends Vy{constructor(t={}){super(),q(this,Es),this.config=t,E(this,Es,new Map)}build(t,e,i){const r=e.queryKey,n=e.queryHash??Ob(r,e);let a=this.get(n);return a||(a=new Sj({client:t,queryKey:r,queryHash:n,options:t.defaultQueryOptions(e),state:i,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){x(this,Es).has(t.queryHash)||(x(this,Es).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=x(this,Es).get(t.queryHash);e&&(t.destroy(),e===t&&x(this,Es).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){di.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return x(this,Es).get(t)}getAll(){return[...x(this,Es).values()]}find(t){const e={exact:!0,...t};return this.getAll().find(i=>oS(e,i))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(i=>oS(t,i)):e}notify(t){di.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){di.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){di.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},h(vp,"Qa"),vp),Es=new WeakMap,c(v$,"QueryCache"),v$),ke,Ka,Ja,bg,$g,to,xg,kg,O$,Op,Mj=(O$=(Op=class{constructor(t={}){q(this,ke),q(this,Ka),q(this,Ja),q(this,bg),q(this,$g),q(this,to),q(this,xg),q(this,kg),E(this,ke,t.queryCache||new Tj),E(this,Ka,t.mutationCache||new Qj),E(this,Ja,t.defaultOptions||{}),E(this,bg,new Map),E(this,$g,new Map),E(this,to,0)}mount(){aS(this,to)._++,x(this,to)===1&&(E(this,xg,jP.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,ke).onFocus())})),E(this,kg,d0.subscribe(async t=>{t&&(await this.resumePausedMutations(),x(this,ke).onOnline())})))}unmount(){var t,e;aS(this,to)._--,x(this,to)===0&&((t=x(this,xg))==null||t.call(this),E(this,xg,void 0),(e=x(this,kg))==null||e.call(this),E(this,kg,void 0))}isFetching(t){return x(this,ke).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return x(this,Ka).findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return x(this,ke).get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),i=x(this,ke).build(this,e),r=i.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&i.isStaleByTime(en(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return x(this,ke).findAll(t).map(({queryKey:e,state:i})=>{const r=i.data;return[e,r]})}setQueryData(t,e,i){const r=this.defaultQueryOptions({queryKey:t}),n=x(this,ke).get(r.queryHash)?.state.data,a=eL(e,n);if(a!==void 0)return x(this,ke).build(this,r).setData(a,{...i,manual:!0})}setQueriesData(t,e,i){return di.batch(()=>x(this,ke).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return x(this,ke).get(e.queryHash)?.state}removeQueries(t){const e=x(this,ke);di.batch(()=>{e.findAll(t).forEach(i=>{e.remove(i)})})}resetQueries(t,e){const i=x(this,ke);return di.batch(()=>(i.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const i={revert:!0,...e},r=di.batch(()=>x(this,ke).findAll(t).map(n=>n.cancel(i)));return Promise.all(r).then(li).catch(li)}invalidateQueries(t,e={}){return di.batch(()=>(x(this,ke).findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},r=di.batch(()=>x(this,ke).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,i);return i.throwOnError||(a=a.catch(li)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(li)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const i=x(this,ke).build(this,e);return i.isStaleByTime(en(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(li).catch(li)}fetchInfiniteQuery(t){return t.behavior=Hw(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(li).catch(li)}ensureInfiniteQueryData(t){return t.behavior=Hw(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d0.isOnline()?x(this,Ka).resumePausedMutations():Promise.resolve()}getQueryCache(){return x(this,ke)}getMutationCache(){return x(this,Ka)}getDefaultOptions(){return x(this,Ja)}setDefaultOptions(t){E(this,Ja,t)}setQueryDefaults(t,e){x(this,bg).set(ya(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...x(this,bg).values()],i={};return e.forEach(r=>{Oy(t,r.queryKey)&&Object.assign(i,r.defaultOptions)}),i}setMutationDefaults(t,e){x(this,$g).set(ya(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...x(this,$g).values()],i={};return e.forEach(r=>{Oy(t,r.mutationKey)&&Object.assign(i,r.defaultOptions)}),i}defaultQueryOptions(t){if(t._defaulted)return t;const e={...x(this,Ja).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ob(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===BP&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...x(this,Ja).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){x(this,ke).clear(),x(this,Ka).clear()}},h(Op,"Ja"),Op),ke=new WeakMap,Ka=new WeakMap,Ja=new WeakMap,bg=new WeakMap,$g=new WeakMap,to=new WeakMap,xg=new WeakMap,kg=new WeakMap,c(O$,"QueryClient"),O$);function jv(){}h(jv,"Fu");c(jv,"noop");function $L({storage:s,key:t="REACT_QUERY_OFFLINE_CACHE",throttleTime:e=1e3,serialize:i=JSON.stringify,deserialize:r=JSON.parse,retry:n}){if(s){const a=c(o=>{try{s.setItem(t,i(o));return}catch(l){return l}},"trySave");return{persistClient:xL(o=>{let l=o,d=a(l),u=0;for(;d&&l;)u++,l=n?.({persistedClient:l,error:d,errorCount:u}),l&&(d=a(l))},e),restoreClient:c(()=>{const o=s.getItem(t);if(o)return r(o)},"restoreClient"),removeClient:c(()=>{s.removeItem(t)},"removeClient")}}return{persistClient:jv,restoreClient:jv,removeClient:jv}}h($L,"Sg");c($L,"createSyncStoragePersister");function xL(s,t=100){let e=null,i;return function(...r){i=r,e===null&&(e=Fn.setTimeout(()=>{s(...i),e=null},t))}}h(xL,"Mg");c(xL,"throttle$1");var Aj=["added","removed","updated"];function yS(s){return Aj.includes(s)}h(yS,"Xw");c(yS,"isCacheEventType");async function kL({queryClient:s,persister:t,maxAge:e=1e3*60*60*24,buster:i="",hydrateOptions:r}){try{const n=await t.restoreClient();if(n)if(n.timestamp){const a=Date.now()-n.timestamp>e,o=n.buster!==i;if(a||o)return t.removeClient();pL(s,n.clientState,r)}else return t.removeClient()}catch(n){throw await t.removeClient(),n}}h(kL,"Eg");c(kL,"persistQueryClientRestore");async function gS({queryClient:s,persister:t,buster:e="",dehydrateOptions:i}){const r={buster:e,timestamp:Date.now(),clientState:uL(s,i)};await t.persistClient(r)}h(gS,"Jw");c(gS,"persistQueryClientSave");function SL(s){const t=s.queryClient.getQueryCache().subscribe(i=>{yS(i.type)&&gS(s)}),e=s.queryClient.getMutationCache().subscribe(i=>{yS(i.type)&&gS(s)});return()=>{t(),e()}}h(SL,"Rg");c(SL,"persistQueryClientSubscribe");const Rj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),this._queryClient=new Mj({defaultOptions:{queries:{staleTime:this.staleTime,gcTime:this.gcTime}}}),this.initQueryClient()}get queryClient(){return this._queryClient}async initQueryClient(){if(this.isDestroyed)throw new _e;await this.whenUrl();try{this._sessionStoragePersister=$L({key:"WEAVY_QUERY_OFFLINE_CACHE",storage:window.sessionStorage,throttleTime:this.staleTime});const r={queryClient:this._queryClient,persister:this._sessionStoragePersister,maxAge:this.gcTime,buster:this.cachePrefix,hydrateOptions:void 0,dehydrateOptions:{shouldDehydrateMutation:c(n=>{const a=n.state.context?.status?.state==="pending";return!!(n.state.context&&!a||n.state.isPaused)},"shouldDehydrateMutation")}};await kL(r),this._unsubscribeQueryClient=SL(r)}catch{console.warn(this.weavyId,"Query cache persister not available.")}this.host.isConnected&&this._queryClient.mount(),this._hostIsConnectedObserver=tT(this.host,r=>{this.isDestroyed||(r?(console.info(this.weavyId,"Query client mounted"),this._queryClient.mount()):(console.info(this.weavyId,"Query client unmounted"),this._queryClient.unmount()))})}async reset(){await super.reset(),await this._queryClient.cancelQueries(),await this._sessionStoragePersister?.removeClient(),await this.queryClient.resetQueries()}async disconnectQueryClient(){console.info(this.weavyId,"Query client disconnected"),await this._queryClient.cancelQueries(),await this._sessionStoragePersister?.removeClient(),this._unsubscribeQueryClient?.(),this._queryClient.unmount(),this._queryClient.clear()}destroy(){super.destroy(),this._hostIsConnectedObserver?.disconnect(),this.disconnectQueryClient()}},h(e,"t"),e),c(t,"WeavyQuery"),t},"WeavyQueryMixin"),Ej=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r)}set annotations(r){this._annotations=r,this.updateContext()}get annotations(){return this._annotations??Le.defaults.annotations}set enterToSend(r){this._enterToSend=r,this.updateContext()}get enterToSend(){return this._enterToSend??Le.defaults.enterToSend}set reactions(r){this._reactions=r,this.updateContext()}get reactions(){return this._reactions??Le.defaults.reactions}},h(e,"t"),e),c(t,"WeavySettings"),t},"WeavySettingsMixin");function Si(s){return s<0?-1:s===0?0:1}h(Si,"He");c(Si,"signum");function Qh(s,t,e){return(1-e)*s+e*t}h(Qh,"hl");c(Qh,"lerp");function CL(s,t,e){return e<s?s:e>t?t:e}h(CL,"Og");c(CL,"clampInt");function Je(s,t,e){return e<s?s:e>t?t:e}h(Je,"$e");c(Je,"clampDouble");function wS(s){return s=s%360,s<0&&(s=s+360),s}h(wS,"tf");c(wS,"sanitizeDegreesInt");function Mi(s){return s=s%360,s<0&&(s=s+360),s}h(Mi,"Ue");c(Mi,"sanitizeDegreesDouble");function f0(s,t){const e=s[0]*t[0][0]+s[1]*t[0][1]+s[2]*t[0][2],i=s[0]*t[1][0]+s[1]*t[1][1]+s[2]*t[1][2],r=s[0]*t[2][0]+s[1]*t[2][1]+s[2]*t[2][2];return[e,i,r]}h(f0,"pp");c(f0,"matrixMultiply");const PL=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],_j=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],QL=[95.047,100,108.883];function $b(s,t,e){return(255<<24|(s&255)<<16|(t&255)<<8|e&255)>>>0}h($b,"ny");c($b,"argbFromRgb");function vS(s){const t=Bn(s[0]),e=Bn(s[1]),i=Bn(s[2]);return $b(t,e,i)}h(vS,"ef");c(vS,"argbFromLinrgb");function TL(s){return s>>24&255}h(TL,"Ig");c(TL,"alphaFromArgb");function xb(s){return s>>16&255}h(xb,"ay");c(xb,"redFromArgb");function kb(s){return s>>8&255}h(kb,"sy");c(kb,"greenFromArgb");function Sb(s){return s&255}h(Sb,"oy");c(Sb,"blueFromArgb");function ML(s,t,e){const i=_j,r=i[0][0]*s+i[0][1]*t+i[0][2]*e,n=i[1][0]*s+i[1][1]*t+i[1][2]*e,a=i[2][0]*s+i[2][1]*t+i[2][2]*e,o=Bn(r),l=Bn(n),d=Bn(a);return $b(o,l,d)}h(ML,"Fg");c(ML,"argbFromXyz");function AL(s){const t=us(xb(s)),e=us(kb(s)),i=us(Sb(s));return f0([t,e,i],PL)}h(AL,"Dg");c(AL,"xyzFromArgb");function RL(s){const t=us(xb(s)),e=us(kb(s)),i=us(Sb(s)),r=PL,n=r[0][0]*t+r[0][1]*e+r[0][2]*i,a=r[1][0]*t+r[1][1]*e+r[1][2]*i,o=r[2][0]*t+r[2][1]*e+r[2][2]*i,l=QL,d=n/l[0],u=a/l[1],p=o/l[2],f=Th(d),y=Th(u),g=Th(p),O=116*y-16,k=500*(f-y),$=200*(y-g);return[O,k,$]}h(RL,"Vg");c(RL,"labFromArgb");function EL(s){const t=Xs(s),e=Bn(t);return $b(e,e,e)}h(EL,"Hg");c(EL,"argbFromLstar");function OS(s){const t=AL(s)[1];return 116*Th(t/100)-16}h(OS,"rf");c(OS,"lstarFromArgb");function Xs(s){return 100*LL((s+16)/116)}h(Xs,"Or");c(Xs,"yFromLstar");function m0(s){return Th(s/100)*116-16}h(m0,"yp");c(m0,"lstarFromY");function us(s){const t=s/255;return t<=.040449936?t/12.92*100:Math.pow((t+.055)/1.055,2.4)*100}h(us,"Ji");c(us,"linearized");function Bn(s){const t=s/100;let e=0;return t<=.0031308?e=t*12.92:e=1.055*Math.pow(t,1/2.4)-.055,CL(0,255,Math.round(e*255))}h(Bn,"$n");c(Bn,"delinearized");function _L(){return QL}h(_L,"Bg");c(_L,"whitePointD65");function Th(s){const t=.008856451679035631,e=24389/27;return s>t?Math.pow(s,1/3):(e*s+16)/116}h(Th,"ul");c(Th,"labF");function LL(s){const t=.008856451679035631,e=24389/27,i=s*s*s;return i>t?i:(116*s-16)/e}h(LL,"Ng");c(LL,"labInvf");var al;const zL=(al=class{static make(t=_L(),e=200/Math.PI*Xs(50)/100,i=50,r=2,n=!1){const a=t,o=a[0]*.401288+a[1]*.650173+a[2]*-.051461,l=a[0]*-.250268+a[1]*1.204414+a[2]*.045854,d=a[0]*-.002079+a[1]*.048952+a[2]*.953127,u=.8+r/10,p=u>=.9?Qh(.59,.69,(u-.9)*10):Qh(.525,.59,(u-.8)*10);let f=n?1:u*(1-1/3.6*Math.exp((-e-42)/92));f=f>1?1:f<0?0:f;const y=u,g=[f*(100/o)+1-f,f*(100/l)+1-f,f*(100/d)+1-f],O=1/(5*e+1),k=O*O*O*O,$=1-k,T=k*e+.1*$*$*Math.cbrt(5*e),_=Xs(i)/t[1],D=1.48+Math.sqrt(_),A=.725/Math.pow(_,.2),z=A,V=[Math.pow(T*g[0]*o/100,.42),Math.pow(T*g[1]*l/100,.42),Math.pow(T*g[2]*d/100,.42)],j=[400*V[0]/(V[0]+27.13),400*V[1]/(V[1]+27.13),400*V[2]/(V[2]+27.13)],tt=(2*j[0]+j[1]+.05*j[2])*A;return new al(_,tt,A,z,p,y,g,T,Math.pow(T,.25),D)}constructor(t,e,i,r,n,a,o,l,d,u){this.n=t,this.aw=e,this.nbb=i,this.ncb=r,this.c=n,this.nc=a,this.rgbD=o,this.fl=l,this.fLRoot=d,this.z=u}},h(al,"wh"),al);c(zL,"ViewingConditions");let qn=zL;qn.DEFAULT=qn.make();var sr;const IL=(sr=class{constructor(t,e,i,r,n,a,o,l,d){this.hue=t,this.chroma=e,this.j=i,this.q=r,this.m=n,this.s=a,this.jstar=o,this.astar=l,this.bstar=d}distance(t){const e=this.jstar-t.jstar,i=this.astar-t.astar,r=this.bstar-t.bstar,n=Math.sqrt(e*e+i*i+r*r);return 1.41*Math.pow(n,.63)}static fromInt(t){return sr.fromIntInViewingConditions(t,qn.DEFAULT)}static fromIntInViewingConditions(t,e){const i=(t&16711680)>>16,r=(t&65280)>>8,n=t&255,a=us(i),o=us(r),l=us(n),d=.41233895*a+.35762064*o+.18051042*l,u=.2126*a+.7152*o+.0722*l,p=.01932141*a+.11916382*o+.95034478*l,f=.401288*d+.650173*u-.051461*p,y=-.250268*d+1.204414*u+.045854*p,g=-.002079*d+.048952*u+.953127*p,O=e.rgbD[0]*f,k=e.rgbD[1]*y,$=e.rgbD[2]*g,T=Math.pow(e.fl*Math.abs(O)/100,.42),_=Math.pow(e.fl*Math.abs(k)/100,.42),D=Math.pow(e.fl*Math.abs($)/100,.42),A=Si(O)*400*T/(T+27.13),z=Si(k)*400*_/(_+27.13),V=Si($)*400*D/(D+27.13),j=(11*A+-12*z+V)/11,tt=(A+z-2*V)/9,vt=(20*A+20*z+21*V)/20,dt=(40*A+20*z+V)/20,st=Math.atan2(tt,j)*180/Math.PI,Qt=Mi(st),ct=Qt*Math.PI/180,Wt=dt*e.nbb,Lt=100*Math.pow(Wt/e.aw,e.c*e.z),Nt=4/e.c*Math.sqrt(Lt/100)*(e.aw+4)*e.fLRoot,Xt=Qt<20.14?Qt+360:Qt,jt=.25*(Math.cos(Xt*Math.PI/180+2)+3.8),Ii=5e4/13*jt*e.nc*e.ncb*Math.sqrt(j*j+tt*tt)/(vt+.305),Ze=Math.pow(Ii,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),me=Ze*Math.sqrt(Lt/100),le=me*e.fLRoot,$e=50*Math.sqrt(Ze*e.c/(e.aw+4)),Di=(1+100*.007)*Lt/(1+.007*Lt),Gi=1/.0228*Math.log(1+.0228*le),fr=Gi*Math.cos(ct),ie=Gi*Math.sin(ct);return new sr(Qt,me,Lt,Nt,le,$e,Di,fr,ie)}static fromJch(t,e,i){return sr.fromJchInViewingConditions(t,e,i,qn.DEFAULT)}static fromJchInViewingConditions(t,e,i,r){const n=4/r.c*Math.sqrt(t/100)*(r.aw+4)*r.fLRoot,a=e*r.fLRoot,o=e/Math.sqrt(t/100),l=50*Math.sqrt(o*r.c/(r.aw+4)),d=i*Math.PI/180,u=(1+100*.007)*t/(1+.007*t),p=1/.0228*Math.log(1+.0228*a),f=p*Math.cos(d),y=p*Math.sin(d);return new sr(i,e,t,n,a,l,u,f,y)}static fromUcs(t,e,i){return sr.fromUcsInViewingConditions(t,e,i,qn.DEFAULT)}static fromUcsInViewingConditions(t,e,i,r){const n=e,a=i,o=Math.sqrt(n*n+a*a),l=(Math.exp(o*.0228)-1)/.0228/r.fLRoot;let d=Math.atan2(a,n)*(180/Math.PI);d<0&&(d+=360);const u=t/(1-(t-100)*.007);return sr.fromJchInViewingConditions(u,l,d,r)}toInt(){return this.viewed(qn.DEFAULT)}viewed(t){const e=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),i=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),r=this.hue*Math.PI/180,n=.25*(Math.cos(r+2)+3.8),a=t.aw*Math.pow(this.j/100,1/t.c/t.z),o=n*(5e4/13)*t.nc*t.ncb,l=a/t.nbb,d=Math.sin(r),u=Math.cos(r),p=23*(l+.305)*i/(23*o+11*i*u+108*i*d),f=p*u,y=p*d,g=(460*l+451*f+288*y)/1403,O=(460*l-891*f-261*y)/1403,k=(460*l-220*f-6300*y)/1403,$=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),T=Si(g)*(100/t.fl)*Math.pow($,1/.42),_=Math.max(0,27.13*Math.abs(O)/(400-Math.abs(O))),D=Si(O)*(100/t.fl)*Math.pow(_,1/.42),A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),z=Si(k)*(100/t.fl)*Math.pow(A,1/.42),V=T/t.rgbD[0],j=D/t.rgbD[1],tt=z/t.rgbD[2],vt=1.86206786*V-1.01125463*j+.14918677*tt,dt=.38752654*V+.62144744*j-.00897398*tt,st=-.0158415*V-.03412294*j+1.04996444*tt;return ML(vt,dt,st)}static fromXyzInViewingConditions(t,e,i,r){const n=.401288*t+.650173*e-.051461*i,a=-.250268*t+1.204414*e+.045854*i,o=-.002079*t+.048952*e+.953127*i,l=r.rgbD[0]*n,d=r.rgbD[1]*a,u=r.rgbD[2]*o,p=Math.pow(r.fl*Math.abs(l)/100,.42),f=Math.pow(r.fl*Math.abs(d)/100,.42),y=Math.pow(r.fl*Math.abs(u)/100,.42),g=Si(l)*400*p/(p+27.13),O=Si(d)*400*f/(f+27.13),k=Si(u)*400*y/(y+27.13),$=(11*g+-12*O+k)/11,T=(g+O-2*k)/9,_=(20*g+20*O+21*k)/20,D=(40*g+20*O+k)/20,A=Math.atan2(T,$)*180/Math.PI,z=A<0?A+360:A>=360?A-360:A,V=z*Math.PI/180,j=D*r.nbb,tt=100*Math.pow(j/r.aw,r.c*r.z),vt=4/r.c*Math.sqrt(tt/100)*(r.aw+4)*r.fLRoot,dt=z<20.14?z+360:z,st=1/4*(Math.cos(dt*Math.PI/180+2)+3.8),Qt=5e4/13*st*r.nc*r.ncb*Math.sqrt($*$+T*T)/(_+.305),ct=Math.pow(Qt,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),Wt=ct*Math.sqrt(tt/100),Lt=Wt*r.fLRoot,Nt=50*Math.sqrt(ct*r.c/(r.aw+4)),Xt=(1+100*.007)*tt/(1+.007*tt),jt=Math.log(1+.0228*Lt)/.0228,Ii=jt*Math.cos(V),Ze=jt*Math.sin(V);return new sr(z,Wt,tt,vt,Lt,Nt,Xt,Ii,Ze)}xyzInViewingConditions(t){const e=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),i=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),r=this.hue*Math.PI/180,n=.25*(Math.cos(r+2)+3.8),a=t.aw*Math.pow(this.j/100,1/t.c/t.z),o=n*(5e4/13)*t.nc*t.ncb,l=a/t.nbb,d=Math.sin(r),u=Math.cos(r),p=23*(l+.305)*i/(23*o+11*i*u+108*i*d),f=p*u,y=p*d,g=(460*l+451*f+288*y)/1403,O=(460*l-891*f-261*y)/1403,k=(460*l-220*f-6300*y)/1403,$=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),T=Si(g)*(100/t.fl)*Math.pow($,1/.42),_=Math.max(0,27.13*Math.abs(O)/(400-Math.abs(O))),D=Si(O)*(100/t.fl)*Math.pow(_,1/.42),A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),z=Si(k)*(100/t.fl)*Math.pow(A,1/.42),V=T/t.rgbD[0],j=D/t.rgbD[1],tt=z/t.rgbD[2],vt=1.86206786*V-1.01125463*j+.14918677*tt,dt=.38752654*V+.62144744*j-.00897398*tt,st=-.0158415*V-.03412294*j+1.04996444*tt;return[vt,dt,st]}},h(sr,"ki"),sr);c(IL,"Cam16");let Fg=IL;var Tt;const DL=(Tt=class{static sanitizeRadians(t){return(t+Math.PI*8)%(Math.PI*2)}static trueDelinearized(t){const e=t/100;let i=0;return e<=.0031308?i=e*12.92:i=1.055*Math.pow(e,1/2.4)-.055,i*255}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return Si(t)*400*e/(e+27.13)}static hueOf(t){const e=f0(t,Tt.SCALED_DISCOUNT_FROM_LINRGB),i=Tt.chromaticAdaptation(e[0]),r=Tt.chromaticAdaptation(e[1]),n=Tt.chromaticAdaptation(e[2]),a=(11*i+-12*r+n)/11,o=(i+r-2*n)/9;return Math.atan2(o,a)}static areInCyclicOrder(t,e,i){const r=Tt.sanitizeRadians(e-t),n=Tt.sanitizeRadians(i-t);return r<n}static intercept(t,e,i){return(e-t)/(i-t)}static lerpPoint(t,e,i){return[t[0]+(i[0]-t[0])*e,t[1]+(i[1]-t[1])*e,t[2]+(i[2]-t[2])*e]}static setCoordinate(t,e,i,r){const n=Tt.intercept(t[r],e,i[r]);return Tt.lerpPoint(t,n,i)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const i=Tt.Y_FROM_LINRGB[0],r=Tt.Y_FROM_LINRGB[1],n=Tt.Y_FROM_LINRGB[2],a=e%4<=1?0:100,o=e%2===0?0:100;if(e<4){const l=a,d=o,u=(t-l*r-d*n)/i;return Tt.isBounded(u)?[u,l,d]:[-1,-1,-1]}else if(e<8){const l=a,d=o,u=(t-d*i-l*n)/r;return Tt.isBounded(u)?[d,u,l]:[-1,-1,-1]}else{const l=a,d=o,u=(t-l*i-d*r)/n;return Tt.isBounded(u)?[l,d,u]:[-1,-1,-1]}}static bisectToSegment(t,e){let i=[-1,-1,-1],r=i,n=0,a=0,o=!1,l=!0;for(let d=0;d<12;d++){const u=Tt.nthVertex(t,d);if(u[0]<0)continue;const p=Tt.hueOf(u);if(!o){i=u,r=u,n=p,a=p,o=!0;continue}(l||Tt.areInCyclicOrder(n,p,a))&&(l=!1,Tt.areInCyclicOrder(n,e,p)?(r=u,a=p):(i=u,n=p))}return[i,r]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const i=Tt.bisectToSegment(t,e);let r=i[0],n=Tt.hueOf(r),a=i[1];for(let o=0;o<3;o++)if(r[o]!==a[o]){let l=-1,d=255;r[o]<a[o]?(l=Tt.criticalPlaneBelow(Tt.trueDelinearized(r[o])),d=Tt.criticalPlaneAbove(Tt.trueDelinearized(a[o]))):(l=Tt.criticalPlaneAbove(Tt.trueDelinearized(r[o])),d=Tt.criticalPlaneBelow(Tt.trueDelinearized(a[o])));for(let u=0;u<8&&!(Math.abs(d-l)<=1);u++){const p=Math.floor((l+d)/2),f=Tt.CRITICAL_PLANES[p],y=Tt.setCoordinate(r,f,a,o),g=Tt.hueOf(y);Tt.areInCyclicOrder(n,e,g)?(a=y,d=p):(r=y,n=g,l=p)}}return Tt.midpoint(r,a)}static inverseChromaticAdaptation(t){const e=Math.abs(t),i=Math.max(0,27.13*e/(400-e));return Si(t)*Math.pow(i,1/.42)}static findResultByJ(t,e,i){let r=Math.sqrt(i)*11;const n=qn.DEFAULT,a=1/Math.pow(1.64-Math.pow(.29,n.n),.73),o=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,l=Math.sin(t),d=Math.cos(t);for(let u=0;u<5;u++){const p=r/100,f=e===0||r===0?0:e/Math.sqrt(p),y=Math.pow(f*a,1/.9),g=n.aw*Math.pow(p,1/n.c/n.z)/n.nbb,O=23*(g+.305)*y/(23*o+11*y*d+108*y*l),k=O*d,$=O*l,T=(460*g+451*k+288*$)/1403,_=(460*g-891*k-261*$)/1403,D=(460*g-220*k-6300*$)/1403,A=Tt.inverseChromaticAdaptation(T),z=Tt.inverseChromaticAdaptation(_),V=Tt.inverseChromaticAdaptation(D),j=f0([A,z,V],Tt.LINRGB_FROM_SCALED_DISCOUNT);if(j[0]<0||j[1]<0||j[2]<0)return 0;const tt=Tt.Y_FROM_LINRGB[0],vt=Tt.Y_FROM_LINRGB[1],dt=Tt.Y_FROM_LINRGB[2],st=tt*j[0]+vt*j[1]+dt*j[2];if(st<=0)return 0;if(u===4||Math.abs(st-i)<.002)return j[0]>100.01||j[1]>100.01||j[2]>100.01?0:vS(j);r=r-(st-i)*r/(2*st)}return 0}static solveToInt(t,e,i){if(e<1e-4||i<1e-4||i>99.9999)return EL(i);t=Mi(t);const r=t/180*Math.PI,n=Xs(i),a=Tt.findResultByJ(r,e,n);if(a!==0)return a;const o=Tt.bisectToLimit(n,r);return vS(o)}static solveToCam(t,e,i){return Fg.fromInt(Tt.solveToInt(t,e,i))}},h(Tt,"wt"),Tt);c(DL,"HctSolver");let Zn=DL;Zn.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];Zn.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];Zn.Y_FROM_LINRGB=[.2126,.7152,.0722];Zn.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];var Ks;const VL=(Ks=class{static from(t,e,i){return new Ks(Zn.solveToInt(t,e,i))}static fromInt(t){return new Ks(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(Zn.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(Zn.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(Zn.solveToInt(this.internalHue,this.internalChroma,t))}setValue(t,e){this[t]=e}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(t){return t>=250&&t<270}static isYellow(t){return t>=105&&t<125}static isCyan(t){return t>=170&&t<207}constructor(t){this.argb=t;const e=Fg.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=OS(t),this.argb=t}setInternalState(t){const e=Fg.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=OS(t),this.argb=t}inViewingConditions(t){const e=Fg.fromInt(this.toInt()).xyzInViewingConditions(t),i=Fg.fromXyzInViewingConditions(e[0],e[1],e[2],qn.make());return Ks.from(i.hue,i.chroma,m0(e[1]))}},h(Ks,"Ca"),Ks);c(VL,"Hct");let zt=VL;var _r;const WL=(_r=class{static ratioOfTones(t,e){return t=Je(0,100,t),e=Je(0,100,e),_r.ratioOfYs(Xs(t),Xs(e))}static ratioOfYs(t,e){const i=t>e?t:e,r=i===e?t:e;return(i+5)/(r+5)}static lighter(t,e){if(t<0||t>100)return-1;const i=Xs(t),r=e*(i+5)-5,n=_r.ratioOfYs(r,i),a=Math.abs(n-e);if(n<e&&a>.04)return-1;const o=m0(r)+.4;return o<0||o>100?-1:o}static darker(t,e){if(t<0||t>100)return-1;const i=Xs(t),r=(i+5)/e-5,n=_r.ratioOfYs(i,r),a=Math.abs(n-e);if(n<e&&a>.04)return-1;const o=m0(r)-.4;return o<0||o>100?-1:o}static lighterUnsafe(t,e){const i=_r.lighter(t,e);return i<0?100:i}static darkerUnsafe(t,e){const i=_r.darker(t,e);return i<0?0:i}},h(_r,"xr"),_r);c(WL,"Contrast");let ti=WL;var ol;const FL=(ol=class{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,i=Math.round(t.chroma)>16,r=Math.round(t.tone)<65;return e&&i&&r}static fixIfDisliked(t){return ol.isDisliked(t)?zt.from(t.hue,t.chroma,70):t}},h(ol,"fh"),ol);c(FL,"DislikeAnalyzer");let bS=FL;function qL(s,t,e){if(s.name!==e.name)throw new Error(`Attempting to extend color ${s.name} with color ${e.name} of different name for spec version ${t}.`);if(s.isBackground!==e.isBackground)throw new Error(`Attempting to extend color ${s.name} as a ${s.isBackground?"background":"foreground"} with color ${e.name} as a ${e.isBackground?"background":"foreground"} for spec version ${t}.`)}h(qL,"Ug");c(qL,"validateExtendedColor");function Mt(s,t,e){return qL(s,t,e),F.fromPalette({name:s.name,palette:c(i=>i.specVersion===t?e.palette(i):s.palette(i),"palette"),tone:c(i=>i.specVersion===t?e.tone(i):s.tone(i),"tone"),isBackground:s.isBackground,chromaMultiplier:c(i=>{const r=i.specVersion===t?e.chromaMultiplier:s.chromaMultiplier;return r!==void 0?r(i):1},"chromaMultiplier"),background:c(i=>{const r=i.specVersion===t?e.background:s.background;return r!==void 0?r(i):void 0},"background"),secondBackground:c(i=>{const r=i.specVersion===t?e.secondBackground:s.secondBackground;return r!==void 0?r(i):void 0},"secondBackground"),contrastCurve:c(i=>{const r=i.specVersion===t?e.contrastCurve:s.contrastCurve;return r!==void 0?r(i):void 0},"contrastCurve"),toneDeltaPair:c(i=>{const r=i.specVersion===t?e.toneDeltaPair:s.toneDeltaPair;return r!==void 0?r(i):void 0},"toneDeltaPair")})}h(Mt,"ut");c(Mt,"extendSpecVersion");var mr;const ZL=(mr=class{static fromPalette(t){return new mr(t.name??"",t.palette,t.tone??mr.getInitialToneFromBackground(t.background),t.isBackground??!1,t.chromaMultiplier,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}static getInitialToneFromBackground(t){return t===void 0?e=>50:e=>t(e)?t(e).getTone(e):50}constructor(t,e,i,r,n,a,o,l,d){if(this.name=t,this.palette=e,this.tone=i,this.isBackground=r,this.chromaMultiplier=n,this.background=a,this.secondBackground=o,this.contrastCurve=l,this.toneDeltaPair=d,this.hctCache=new Map,!a&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!a&&l)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(a&&!l)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return mr.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(e!=null)return e;const i=$S(t.specVersion).getHct(t,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,i),i}getTone(t){return $S(t.specVersion).getTone(t,this)}static foregroundTone(t,e){const i=ti.lighterUnsafe(t,e),r=ti.darkerUnsafe(t,e),n=ti.ratioOfTones(i,t),a=ti.ratioOfTones(r,t);if(mr.tonePrefersLightForeground(t)){const o=Math.abs(n-a)<.1&&n<e&&a<e;return n>=e||n>=a||o?i:r}else return a>=e||a>=n?r:i}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return mr.tonePrefersLightForeground(t)&&!mr.toneAllowsLightForeground(t)?49:t}},h(mr,"qi"),mr);c(ZL,"DynamicColor");let F=ZL;var bp;const NL=(bp=class{getHct(t,e){const i=e.getTone(t);return e.palette(t).getHct(i)}getTone(t,e){const i=t.contrastLevel<0,r=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(r){const n=r.roleA,a=r.roleB,o=r.delta,l=r.polarity,d=r.stayTogether,u=l==="nearer"||l==="lighter"&&!t.isDark||l==="darker"&&t.isDark,p=u?n:a,f=u?a:n,y=e.name===p.name,g=t.isDark?1:-1;let O=p.tone(t),k=f.tone(t);if(e.background&&p.contrastCurve&&f.contrastCurve){const $=e.background(t),T=p.contrastCurve(t),_=f.contrastCurve(t);if($&&T&&_){const D=$.getTone(t),A=T.get(t.contrastLevel),z=_.get(t.contrastLevel);ti.ratioOfTones(D,O)<A&&(O=F.foregroundTone(D,A)),ti.ratioOfTones(D,k)<z&&(k=F.foregroundTone(D,z)),i&&(O=F.foregroundTone(D,A),k=F.foregroundTone(D,z))}}return(k-O)*g<o&&(k=Je(0,100,O+o*g),(k-O)*g>=o||(O=Je(0,100,k-o*g))),50<=O&&O<60?g>0?(O=60,k=Math.max(k,O+o*g)):(O=49,k=Math.min(k,O+o*g)):50<=k&&k<60&&(d?g>0?(O=60,k=Math.max(k,O+o*g)):(O=49,k=Math.min(k,O+o*g)):g>0?k=60:k=49),y?O:k}else{let n=e.tone(t);if(e.background==null||e.background(t)===void 0||e.contrastCurve==null||e.contrastCurve(t)===void 0)return n;const a=e.background(t).getTone(t),o=e.contrastCurve(t).get(t.contrastLevel);if(ti.ratioOfTones(a,n)>=o||(n=F.foregroundTone(a,o)),i&&(n=F.foregroundTone(a,o)),e.isBackground&&50<=n&&n<60&&(ti.ratioOfTones(49,a)>=o?n=49:n=60),e.secondBackground==null||e.secondBackground(t)===void 0)return n;const[l,d]=[e.background,e.secondBackground],[u,p]=[l(t).getTone(t),d(t).getTone(t)],[f,y]=[Math.max(u,p),Math.min(u,p)];if(ti.ratioOfTones(f,n)>=o&&ti.ratioOfTones(y,n)>=o)return n;const g=ti.lighter(f,o),O=ti.darker(y,o),k=[];return g!==-1&&k.push(g),O!==-1&&k.push(O),F.tonePrefersLightForeground(u)||F.tonePrefersLightForeground(p)?g<0?100:g:k.length===1?k[0]:O<0?0:O}}},h(bp,"Ky"),bp);c(NL,"ColorCalculationDelegateImpl2021");let Lj=NL;var $p;const BL=($p=class{getHct(t,e){const i=e.palette(t),r=e.getTone(t),n=i.hue,a=i.chroma*(e.chromaMultiplier?e.chromaMultiplier(t):1);return zt.from(n,a,r)}getTone(t,e){const i=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(i){const r=i.roleA,n=i.roleB,a=i.polarity,o=i.constraint,l=a==="darker"||a==="relative_lighter"&&t.isDark||a==="relative_darker"&&!t.isDark?-i.delta:i.delta,d=e.name===r.name,u=d?r:n,p=d?n:r;let f=u.tone(t),y=p.getTone(t);const g=l*(d?1:-1);if(o==="exact"?f=Je(0,100,y+g):o==="nearer"?g>0?f=Je(0,100,Je(y,y+g,f)):f=Je(0,100,Je(y+g,y,f)):o==="farther"&&(g>0?f=Je(y+g,100,f):f=Je(0,y+g,f)),e.background&&e.contrastCurve){const O=e.background(t),k=e.contrastCurve(t);if(O&&k){const $=O.getTone(t),T=k.get(t.contrastLevel);f=ti.ratioOfTones($,f)>=T&&t.contrastLevel>=0?f:F.foregroundTone($,T)}}return e.isBackground&&!e.name.endsWith("_fixed_dim")&&(f>=57?f=Je(65,100,f):f=Je(0,49,f)),f}else{let r=e.tone(t);if(e.background==null||e.background(t)===void 0||e.contrastCurve==null||e.contrastCurve(t)===void 0)return r;const n=e.background(t).getTone(t),a=e.contrastCurve(t).get(t.contrastLevel);if(r=ti.ratioOfTones(n,r)>=a&&t.contrastLevel>=0?r:F.foregroundTone(n,a),e.isBackground&&!e.name.endsWith("_fixed_dim")&&(r>=57?r=Je(65,100,r):r=Je(0,49,r)),e.secondBackground==null||e.secondBackground(t)===void 0)return r;const[o,l]=[e.background,e.secondBackground],[d,u]=[o(t).getTone(t),l(t).getTone(t)],[p,f]=[Math.max(d,u),Math.min(d,u)];if(ti.ratioOfTones(p,r)>=a&&ti.ratioOfTones(f,r)>=a)return r;const y=ti.lighter(p,a),g=ti.darker(f,a),O=[];return y!==-1&&O.push(y),g!==-1&&O.push(g),F.tonePrefersLightForeground(d)||F.tonePrefersLightForeground(u)?y<0?100:y:O.length===1?O[0]:g<0?0:g}}},h($p,"Qy"),$p);c(BL,"ColorCalculationDelegateImpl2025");let zj=BL;const Ij=new Lj,Dj=new zj;function $S(s){return s==="2025"?Dj:Ij}h($S,"nf");c($S,"getSpec$1");var Js;const XL=(Js=class{static fromInt(t){const e=zt.fromInt(t);return Js.fromHct(e)}static fromHct(t){return new Js(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){const i=new Vj(t,e).create();return new Js(t,e,i)}constructor(t,e,i){this.hue=t,this.chroma=e,this.keyColor=i,this.cache=new Map}tone(t){let e=this.cache.get(t);return e===void 0&&(t==99&&zt.isYellow(this.hue)?e=this.averageArgb(this.tone(98),this.tone(100)):e=zt.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return zt.fromInt(this.tone(t))}averageArgb(t,e){const i=t>>>16&255,r=t>>>8&255,n=t&255,a=e>>>16&255,o=e>>>8&255,l=e&255,d=Math.round((i+a)/2),u=Math.round((r+o)/2),p=Math.round((n+l)/2);return(255<<24|(d&255)<<16|(u&255)<<8|p&255)>>>0}},h(Js,"$a"),Js);c(XL,"TonalPalette");let G=XL;var xp;const jL=(xp=class{constructor(t,e){this.hue=t,this.requestedChroma=e,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,e=100;for(;t<e;){const i=Math.floor((t+e)/2),r=this.maxChroma(i)<this.maxChroma(i+1);if(this.maxChroma(i)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=i;else{if(t===i)return zt.from(this.hue,this.requestedChroma,t);t=i}else r?t=i+1:e=i}return zt.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=zt.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}},h(xp,"Gy"),xp);c(jL,"KeyColor");let Vj=jL;var tn;const UL=(tn=class{constructor(t){this.input=t,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const t=this.hctsByHue.concat([this.input]),e=this.tempsByHct;return t.sort((i,r)=>e.get(i)-e.get(r)),this.hctsByTempCache=t,t}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(t=5,e=12){const i=Math.round(this.input.hue),r=this.hctsByHue[i];let n=this.relativeTemperature(r);const a=[r];let o=0;for(let g=0;g<360;g++){const O=wS(i+g),k=this.hctsByHue[O],$=this.relativeTemperature(k),T=Math.abs($-n);n=$,o+=T}let l=1;const d=o/e;let u=0;for(n=this.relativeTemperature(r);a.length<e;){const g=wS(i+l),O=this.hctsByHue[g],k=this.relativeTemperature(O),$=Math.abs(k-n);u+=$;const T=a.length*d;let _=u>=T,D=1;for(;_&&a.length<e;){a.push(O);const A=(a.length+D)*d;_=u>=A,D++}if(n=k,l++,l>360){for(;a.length<e;)a.push(O);break}}const p=[this.input],f=Math.floor((t-1)/2);for(let g=1;g<f+1;g++){let O=0-g;for(;O<0;)O=a.length+O;O>=a.length&&(O=O%a.length),p.splice(0,0,a[O])}const y=t-f-1;for(let g=1;g<y+1;g++){let O=g;for(;O<0;)O=a.length+O;O>=a.length&&(O=O%a.length),p.push(a[O])}return p}get complement(){if(this.complementCache!=null)return this.complementCache;const t=this.coldest.hue,e=this.tempsByHct.get(this.coldest),i=this.warmest.hue,r=this.tempsByHct.get(this.warmest)-e,n=tn.isBetween(this.input.hue,t,i),a=n?i:t,o=n?t:i,l=1;let d=1e3,u=this.hctsByHue[Math.round(this.input.hue)];const p=1-this.inputRelativeTemperature;for(let f=0;f<=360;f+=1){const y=Mi(a+l*f);if(!tn.isBetween(y,a,o))continue;const g=this.hctsByHue[Math.round(y)],O=(this.tempsByHct.get(g)-e)/r,k=Math.abs(p-O);k<d&&(d=k,u=g)}return this.complementCache=u,this.complementCache}relativeTemperature(t){const e=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),i=this.tempsByHct.get(t)-this.tempsByHct.get(this.coldest);return e===0?.5:i/e}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0?this.inputRelativeTemperatureCache:(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input),this.inputRelativeTemperatureCache)}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const t=this.hctsByHue.concat([this.input]),e=new Map;for(const i of t)e.set(i,tn.rawTemperature(i));return this.tempsByHctCache=e,e}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const t=[];for(let e=0;e<=360;e+=1){const i=zt.from(e,this.input.chroma,this.input.tone);t.push(i)}return this.hctsByHueCache=t,this.hctsByHueCache}static isBetween(t,e,i){return e<i?e<=t&&t<=i:e<=t||t<=i}static rawTemperature(t){const e=RL(t.toInt()),i=Mi(Math.atan2(e[2],e[1])*180/Math.PI),r=Math.sqrt(e[1]*e[1]+e[2]*e[2]);return-.5+.02*Math.pow(r,1.07)*Math.cos(Mi(i-50)*Math.PI/180)}},h(tn,"ka"),tn);c(UL,"TemperatureCache");let f9=UL;var kp;const HL=(kp=class{constructor(t,e,i,r){this.low=t,this.normal=e,this.medium=i,this.high=r}get(t){return t<=-1?this.low:t<0?Qh(this.low,this.normal,(t- -1)/1):t<.5?Qh(this.normal,this.medium,(t-0)/.5):t<1?Qh(this.medium,this.high,(t-.5)/.5):this.high}},h(kp,"Zy"),kp);c(HL,"ContrastCurve");let Ot=HL;var Sp;const YL=(Sp=class{constructor(t,e,i,r,n,a){this.roleA=t,this.roleB=e,this.delta=i,this.polarity=r,this.stayTogether=n,this.constraint=a,this.constraint=a??"exact"}},h(Sp,"Yy"),Sp);c(YL,"ToneDeltaPair");let Kt=YL;var I;(function(s){s[s.MONOCHROME=0]="MONOCHROME",s[s.NEUTRAL=1]="NEUTRAL",s[s.TONAL_SPOT=2]="TONAL_SPOT",s[s.VIBRANT=3]="VIBRANT",s[s.EXPRESSIVE=4]="EXPRESSIVE",s[s.FIDELITY=5]="FIDELITY",s[s.CONTENT=6]="CONTENT",s[s.RAINBOW=7]="RAINBOW",s[s.FRUIT_SALAD=8]="FRUIT_SALAD"})(I||(I={}));function so(s){return s.variant===I.FIDELITY||s.variant===I.CONTENT}h(so,"la");c(so,"isFidelity");function ce(s){return s.variant===I.MONOCHROME}h(ce,"Ft");c(ce,"isMonochrome");function GL(s,t,e,i){let r=e,n=zt.from(s,t,e);if(n.chroma<t){let a=n.chroma;for(;n.chroma<t;){r+=i?-1:1;const o=zt.from(s,t,r);if(a>o.chroma||Math.abs(o.chroma-t)<.4)break;const l=Math.abs(o.chroma-t),d=Math.abs(n.chroma-t);l<d&&(n=o),a=Math.max(a,o.chroma)}}return r}h(GL,"Wg");c(GL,"findDesiredChromaByTone");var Cp;const KL=(Cp=class{primaryPaletteKeyColor(){return F.fromPalette({name:"primary_palette_key_color",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.primaryPalette.keyColor.tone,"tone")})}secondaryPaletteKeyColor(){return F.fromPalette({name:"secondary_palette_key_color",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.secondaryPalette.keyColor.tone,"tone")})}tertiaryPaletteKeyColor(){return F.fromPalette({name:"tertiary_palette_key_color",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>t.tertiaryPalette.keyColor.tone,"tone")})}neutralPaletteKeyColor(){return F.fromPalette({name:"neutral_palette_key_color",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.neutralPalette.keyColor.tone,"tone")})}neutralVariantPaletteKeyColor(){return F.fromPalette({name:"neutral_variant_palette_key_color",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.neutralVariantPalette.keyColor.tone,"tone")})}errorPaletteKeyColor(){return F.fromPalette({name:"error_palette_key_color",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.errorPalette.keyColor.tone,"tone")})}background(){return F.fromPalette({name:"background",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:98,"tone"),isBackground:!0})}onBackground(){return F.fromPalette({name:"on_background",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:10,"tone"),background:c(t=>this.background(),"background"),contrastCurve:c(t=>new Ot(3,3,4.5,7),"contrastCurve")})}surface(){return F.fromPalette({name:"surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:98,"tone"),isBackground:!0})}surfaceDim(){return F.fromPalette({name:"surface_dim",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?6:new Ot(87,87,80,75).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceBright(){return F.fromPalette({name:"surface_bright",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(24,24,29,34).get(t.contrastLevel):98,"tone"),isBackground:!0})}surfaceContainerLowest(){return F.fromPalette({name:"surface_container_lowest",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(4,4,2,0).get(t.contrastLevel):100,"tone"),isBackground:!0})}surfaceContainerLow(){return F.fromPalette({name:"surface_container_low",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(10,10,11,12).get(t.contrastLevel):new Ot(96,96,96,95).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainer(){return F.fromPalette({name:"surface_container",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(12,12,16,20).get(t.contrastLevel):new Ot(94,94,92,90).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainerHigh(){return F.fromPalette({name:"surface_container_high",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(17,17,21,25).get(t.contrastLevel):new Ot(92,92,88,85).get(t.contrastLevel),"tone"),isBackground:!0})}surfaceContainerHighest(){return F.fromPalette({name:"surface_container_highest",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?new Ot(22,22,26,30).get(t.contrastLevel):new Ot(90,90,84,80).get(t.contrastLevel),"tone"),isBackground:!0})}onSurface(){return F.fromPalette({name:"on_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:10,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}surfaceVariant(){return F.fromPalette({name:"surface_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?30:90,"tone"),isBackground:!0})}onSurfaceVariant(){return F.fromPalette({name:"on_surface_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?80:30,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}inverseSurface(){return F.fromPalette({name:"inverse_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?90:20,"tone"),isBackground:!0})}inverseOnSurface(){return F.fromPalette({name:"inverse_on_surface",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>t.isDark?20:95,"tone"),background:c(t=>this.inverseSurface(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}outline(){return F.fromPalette({name:"outline",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?60:50,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1.5,3,4.5,7),"contrastCurve")})}outlineVariant(){return F.fromPalette({name:"outline_variant",palette:c(t=>t.neutralVariantPalette,"palette"),tone:c(t=>t.isDark?30:80,"tone"),background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve")})}shadow(){return F.fromPalette({name:"shadow",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>0,"tone")})}scrim(){return F.fromPalette({name:"scrim",palette:c(t=>t.neutralPalette,"palette"),tone:c(t=>0,"tone")})}surfaceTint(){return F.fromPalette({name:"surface_tint",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0})}primary(){return F.fromPalette({name:"primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?100:0:t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryContainer(),this.primary(),10,"nearer",!1),"toneDeltaPair")})}primaryDim(){}onPrimary(){return F.fromPalette({name:"on_primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:90:t.isDark?20:100,"tone"),background:c(t=>this.primary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}primaryContainer(){return F.fromPalette({name:"primary_container",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>so(t)?t.sourceColorHct.tone:ce(t)?t.isDark?85:25:t.isDark?30:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryContainer(),this.primary(),10,"nearer",!1),"toneDeltaPair")})}onPrimaryContainer(){return F.fromPalette({name:"on_primary_container",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>so(t)?F.foregroundTone(this.primaryContainer().tone(t),4.5):ce(t)?t.isDark?0:100:t.isDark?90:30,"tone"),background:c(t=>this.primaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}inversePrimary(){return F.fromPalette({name:"inverse_primary",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.isDark?40:80,"tone"),background:c(t=>this.inverseSurface(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve")})}secondary(){return F.fromPalette({name:"secondary",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryContainer(),this.secondary(),10,"nearer",!1),"toneDeltaPair")})}secondaryDim(){}onSecondary(){return F.fromPalette({name:"on_secondary",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:100:t.isDark?20:100,"tone"),background:c(t=>this.secondary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}secondaryContainer(){return F.fromPalette({name:"secondary_container",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>{const e=t.isDark?30:90;return ce(t)?t.isDark?30:85:so(t)?GL(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryContainer(),this.secondary(),10,"nearer",!1),"toneDeltaPair")})}onSecondaryContainer(){return F.fromPalette({name:"on_secondary_container",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:10:so(t)?F.foregroundTone(this.secondaryContainer().tone(t),4.5):t.isDark?90:30,"tone"),background:c(t=>this.secondaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}tertiary(){return F.fromPalette({name:"tertiary",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:25:t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1),"toneDeltaPair")})}tertiaryDim(){}onTertiary(){return F.fromPalette({name:"on_tertiary",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?10:90:t.isDark?20:100,"tone"),background:c(t=>this.tertiary(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}tertiaryContainer(){return F.fromPalette({name:"tertiary_container",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>{if(ce(t))return t.isDark?60:49;if(!so(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return bS.fixIfDisliked(e).tone},"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1),"toneDeltaPair")})}onTertiaryContainer(){return F.fromPalette({name:"on_tertiary_container",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?t.isDark?0:100:so(t)?F.foregroundTone(this.tertiaryContainer().tone(t),4.5):t.isDark?90:30,"tone"),background:c(t=>this.tertiaryContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}error(){return F.fromPalette({name:"error",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?80:40,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,7),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorContainer(),this.error(),10,"nearer",!1),"toneDeltaPair")})}errorDim(){}onError(){return F.fromPalette({name:"on_error",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?20:100,"tone"),background:c(t=>this.error(),"background"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}errorContainer(){return F.fromPalette({name:"error_container",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>t.isDark?30:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorContainer(),this.error(),10,"nearer",!1),"toneDeltaPair")})}onErrorContainer(){return F.fromPalette({name:"on_error_container",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>ce(t)?t.isDark?90:10:t.isDark?90:30,"tone"),background:c(t=>this.errorContainer(),"background"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}primaryFixed(){return F.fromPalette({name:"primary_fixed",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?40:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}primaryFixedDim(){return F.fromPalette({name:"primary_fixed_dim",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?30:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onPrimaryFixed(){return F.fromPalette({name:"on_primary_fixed",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?100:10,"tone"),background:c(t=>this.primaryFixedDim(),"background"),secondBackground:c(t=>this.primaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onPrimaryFixedVariant(){return F.fromPalette({name:"on_primary_fixed_variant",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>ce(t)?90:30,"tone"),background:c(t=>this.primaryFixedDim(),"background"),secondBackground:c(t=>this.primaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}secondaryFixed(){return F.fromPalette({name:"secondary_fixed",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?80:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}secondaryFixedDim(){return F.fromPalette({name:"secondary_fixed_dim",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?70:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onSecondaryFixed(){return F.fromPalette({name:"on_secondary_fixed",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>10,"tone"),background:c(t=>this.secondaryFixedDim(),"background"),secondBackground:c(t=>this.secondaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onSecondaryFixedVariant(){return F.fromPalette({name:"on_secondary_fixed_variant",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>ce(t)?25:30,"tone"),background:c(t=>this.secondaryFixedDim(),"background"),secondBackground:c(t=>this.secondaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}tertiaryFixed(){return F.fromPalette({name:"tertiary_fixed",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?40:90,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}tertiaryFixedDim(){return F.fromPalette({name:"tertiary_fixed_dim",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?30:80,"tone"),isBackground:!0,background:c(t=>this.highestSurface(t),"background"),contrastCurve:c(t=>new Ot(1,1,3,4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0),"toneDeltaPair")})}onTertiaryFixed(){return F.fromPalette({name:"on_tertiary_fixed",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?100:10,"tone"),background:c(t=>this.tertiaryFixedDim(),"background"),secondBackground:c(t=>this.tertiaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(4.5,7,11,21),"contrastCurve")})}onTertiaryFixedVariant(){return F.fromPalette({name:"on_tertiary_fixed_variant",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>ce(t)?90:30,"tone"),background:c(t=>this.tertiaryFixedDim(),"background"),secondBackground:c(t=>this.tertiaryFixed(),"secondBackground"),contrastCurve:c(t=>new Ot(3,4.5,7,11),"contrastCurve")})}highestSurface(t){return t.isDark?this.surfaceBright():this.surfaceDim()}},h(Cp,"Xy"),Cp);c(KL,"ColorSpecDelegateImpl2021");let Wj=KL;function Vt(s,t=0,e=100,i=1){let r=t4(s.hue,s.chroma*i,100,!0);return Je(t,e,r)}h(Vt,"mt");c(Vt,"tMaxC");function Ls(s,t=0,e=100){let i=t4(s.hue,s.chroma,0,!1);return Je(t,e,i)}h(Ls,"vr");c(Ls,"tMinC");function t4(s,t,e,i){let r=e,n=zt.from(s,t,r);for(;n.chroma<t&&!(e<0||e>100);){e+=i?-1:1;const a=zt.from(s,t,e);n.chroma<a.chroma&&(n=a,r=e)}return r}h(t4,"Pm");c(t4,"findBestToneForChroma");function bt(s){return s===1.5?new Ot(1.5,1.5,3,5.5):s===3?new Ot(3,3,4.5,7):s===4.5?new Ot(4.5,4.5,7,11):s===6?new Ot(6,6,7,11):s===7?new Ot(7,7,11,21):s===9?new Ot(9,9,11,21):s===11?new Ot(11,11,21,21):s===21?new Ot(21,21,21,21):new Ot(s,s,7,21)}h(bt,"at");c(bt,"getCurve");var Pp;const JL=(Pp=class extends Wj{surface(){const t=F.fromPalette({name:"surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>(super.surface().tone(e),e.platform==="phone"?e.isDark?4:zt.isYellow(e.neutralPalette.hue)?99:e.variant===I.VIBRANT?97:98:0),"tone"),isBackground:!0});return Mt(super.surface(),"2025",t)}surfaceDim(){const t=F.fromPalette({name:"surface_dim",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?4:zt.isYellow(e.neutralPalette.hue)?90:e.variant===I.VIBRANT?85:87,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(!e.isDark){if(e.variant===I.NEUTRAL)return 2.5;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===I.VIBRANT)return 1.36}return 1},"chromaMultiplier")});return Mt(super.surfaceDim(),"2025",t)}surfaceBright(){const t=F.fromPalette({name:"surface_bright",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?18:zt.isYellow(e.neutralPalette.hue)?99:e.variant===I.VIBRANT?97:98,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.isDark){if(e.variant===I.NEUTRAL)return 2.5;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?2.7:1.75;if(e.variant===I.VIBRANT)return 1.36}return 1},"chromaMultiplier")});return Mt(super.surfaceBright(),"2025",t)}surfaceContainerLowest(){const t=F.fromPalette({name:"surface_container_lowest",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?0:100,"tone"),isBackground:!0});return Mt(super.surfaceContainerLowest(),"2025",t)}surfaceContainerLow(){const t=F.fromPalette({name:"surface_container_low",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?6:zt.isYellow(e.neutralPalette.hue)?98:e.variant===I.VIBRANT?95:96:15,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.3;if(e.variant===I.TONAL_SPOT)return 1.25;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.3:1.15;if(e.variant===I.VIBRANT)return 1.08}return 1},"chromaMultiplier")});return Mt(super.surfaceContainerLow(),"2025",t)}surfaceContainer(){const t=F.fromPalette({name:"surface_container",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?9:zt.isYellow(e.neutralPalette.hue)?96:e.variant===I.VIBRANT?92:94:20,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.6;if(e.variant===I.TONAL_SPOT)return 1.4;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.6:1.3;if(e.variant===I.VIBRANT)return 1.15}return 1},"chromaMultiplier")});return Mt(super.surfaceContainer(),"2025",t)}surfaceContainerHigh(){const t=F.fromPalette({name:"surface_container_high",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?12:zt.isYellow(e.neutralPalette.hue)?94:e.variant===I.VIBRANT?90:92:25,"tone"),isBackground:!0,chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 1.9;if(e.variant===I.TONAL_SPOT)return 1.5;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?1.95:1.45;if(e.variant===I.VIBRANT)return 1.22}return 1},"chromaMultiplier")});return Mt(super.surfaceContainerHigh(),"2025",t)}surfaceContainerHighest(){const t=F.fromPalette({name:"surface_container_highest",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?15:zt.isYellow(e.neutralPalette.hue)?92:e.variant===I.VIBRANT?88:90,"tone"),isBackground:!0,chromaMultiplier:c(e=>e.variant===I.NEUTRAL?2.2:e.variant===I.TONAL_SPOT?1.7:e.variant===I.EXPRESSIVE?zt.isYellow(e.neutralPalette.hue)?2.3:1.6:e.variant===I.VIBRANT?1.29:1,"chromaMultiplier")});return Mt(super.surfaceContainerHighest(),"2025",t)}onSurface(){const t=F.fromPalette({name:"on_surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.variant===I.VIBRANT?Vt(e.neutralPalette,0,100,1.1):F.getInitialToneFromBackground(i=>i.platform==="phone"?this.highestSurface(i):this.surfaceContainerHigh())(e),"tone"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.isDark&&e.platform==="phone"?bt(11):bt(9),"contrastCurve")});return Mt(super.onSurface(),"2025",t)}onSurfaceVariant(){const t=F.fromPalette({name:"on_surface_variant",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?e.isDark?bt(6):bt(4.5):bt(7),"contrastCurve")});return Mt(super.onSurfaceVariant(),"2025",t)}outline(){const t=F.fromPalette({name:"outline",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(3):bt(4.5),"contrastCurve")});return Mt(super.outline(),"2025",t)}outlineVariant(){const t=F.fromPalette({name:"outline_variant",palette:c(e=>e.neutralPalette,"palette"),chromaMultiplier:c(e=>{if(e.platform==="phone"){if(e.variant===I.NEUTRAL)return 2.2;if(e.variant===I.TONAL_SPOT)return 1.7;if(e.variant===I.EXPRESSIVE)return zt.isYellow(e.neutralPalette.hue)?e.isDark?3:2.3:1.6}return 1},"chromaMultiplier"),background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(1.5):bt(3),"contrastCurve")});return Mt(super.outlineVariant(),"2025",t)}inverseSurface(){const t=F.fromPalette({name:"inverse_surface",palette:c(e=>e.neutralPalette,"palette"),tone:c(e=>e.isDark?98:4,"tone"),isBackground:!0});return Mt(super.inverseSurface(),"2025",t)}inverseOnSurface(){const t=F.fromPalette({name:"inverse_on_surface",palette:c(e=>e.neutralPalette,"palette"),background:c(e=>this.inverseSurface(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.inverseOnSurface(),"2025",t)}primary(){const t=F.fromPalette({name:"primary",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>e.variant===I.NEUTRAL?e.platform==="phone"?e.isDark?80:40:90:e.variant===I.TONAL_SPOT?e.platform==="phone"?e.isDark?80:Vt(e.primaryPalette):Vt(e.primaryPalette,0,90):e.variant===I.EXPRESSIVE?e.platform==="phone"?Vt(e.primaryPalette,0,zt.isYellow(e.primaryPalette.hue)?25:zt.isCyan(e.primaryPalette.hue)?88:98):Vt(e.primaryPalette):e.platform==="phone"?Vt(e.primaryPalette,0,zt.isCyan(e.primaryPalette.hue)?88:98):Vt(e.primaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.primary(),"2025",t)}primaryDim(){return F.fromPalette({name:"primary_dim",palette:c(t=>t.primaryPalette,"palette"),tone:c(t=>t.variant===I.NEUTRAL?85:t.variant===I.TONAL_SPOT?Vt(t.primaryPalette,0,90):Vt(t.primaryPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.primaryDim(),this.primary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onPrimary(){const t=F.fromPalette({name:"on_primary",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.primary():this.primaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onPrimary(),"2025",t)}primaryContainer(){const t=F.fromPalette({name:"primary_container",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.variant===I.NEUTRAL?e.isDark?30:90:e.variant===I.TONAL_SPOT?e.isDark?Ls(e.primaryPalette,35,93):Vt(e.primaryPalette,0,90):e.variant===I.EXPRESSIVE?e.isDark?Vt(e.primaryPalette,30,93):Vt(e.primaryPalette,78,zt.isCyan(e.primaryPalette.hue)?88:90):e.isDark?Ls(e.primaryPalette,66,93):Vt(e.primaryPalette,66,zt.isCyan(e.primaryPalette.hue)?88:93),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="phone"?void 0:new Kt(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.primaryContainer(),"2025",t)}onPrimaryContainer(){const t=F.fromPalette({name:"on_primary_container",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onPrimaryContainer(),"2025",t)}primaryFixed(){const t=F.fromPalette({name:"primary_fixed",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.primaryFixed(),"2025",t)}primaryFixedDim(){const t=F.fromPalette({name:"primary_fixed_dim",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>this.primaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.primaryFixedDim(),"2025",t)}onPrimaryFixed(){const t=F.fromPalette({name:"on_primary_fixed",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onPrimaryFixed(),"2025",t)}onPrimaryFixedVariant(){const t=F.fromPalette({name:"on_primary_fixed_variant",palette:c(e=>e.primaryPalette,"palette"),background:c(e=>this.primaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onPrimaryFixedVariant(),"2025",t)}inversePrimary(){const t=F.fromPalette({name:"inverse_primary",palette:c(e=>e.primaryPalette,"palette"),tone:c(e=>Vt(e.primaryPalette),"tone"),background:c(e=>this.inverseSurface(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.inversePrimary(),"2025",t)}secondary(){const t=F.fromPalette({name:"secondary",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.NEUTRAL?90:Vt(e.secondaryPalette,0,90):e.variant===I.NEUTRAL?e.isDark?Ls(e.secondaryPalette,0,98):Vt(e.secondaryPalette):e.variant===I.VIBRANT?Vt(e.secondaryPalette,0,e.isDark?90:98):e.isDark?80:Vt(e.secondaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.secondary(),"2025",t)}secondaryDim(){return F.fromPalette({name:"secondary_dim",palette:c(t=>t.secondaryPalette,"palette"),tone:c(t=>t.variant===I.NEUTRAL?85:Vt(t.secondaryPalette,0,90),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onSecondary(){const t=F.fromPalette({name:"on_secondary",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.secondary():this.secondaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onSecondary(),"2025",t)}secondaryContainer(){const t=F.fromPalette({name:"secondary_container",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.variant===I.VIBRANT?e.isDark?Ls(e.secondaryPalette,30,40):Vt(e.secondaryPalette,84,90):e.variant===I.EXPRESSIVE?e.isDark?15:Vt(e.secondaryPalette,90,95):e.isDark?25:90,"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.secondaryContainer(),"2025",t)}onSecondaryContainer(){const t=F.fromPalette({name:"on_secondary_container",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onSecondaryContainer(),"2025",t)}secondaryFixed(){const t=F.fromPalette({name:"secondary_fixed",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.secondaryFixed(),"2025",t)}secondaryFixedDim(){const t=F.fromPalette({name:"secondary_fixed_dim",palette:c(e=>e.secondaryPalette,"palette"),tone:c(e=>this.secondaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.secondaryFixedDim(),"2025",t)}onSecondaryFixed(){const t=F.fromPalette({name:"on_secondary_fixed",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onSecondaryFixed(),"2025",t)}onSecondaryFixedVariant(){const t=F.fromPalette({name:"on_secondary_fixed_variant",palette:c(e=>e.secondaryPalette,"palette"),background:c(e=>this.secondaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onSecondaryFixedVariant(),"2025",t)}tertiary(){const t=F.fromPalette({name:"tertiary",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,90):Vt(e.tertiaryPalette):e.variant===I.EXPRESSIVE||e.variant===I.VIBRANT?Vt(e.tertiaryPalette,0,zt.isCyan(e.tertiaryPalette.hue)?88:e.isDark?98:100):e.isDark?Vt(e.tertiaryPalette,0,98):Vt(e.tertiaryPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.tertiary(),"2025",t)}tertiaryDim(){return F.fromPalette({name:"tertiary_dim",palette:c(t=>t.tertiaryPalette,"palette"),tone:c(t=>t.variant===I.TONAL_SPOT?Vt(t.tertiaryPalette,0,90):Vt(t.tertiaryPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther"),"toneDeltaPair")})}onTertiary(){const t=F.fromPalette({name:"on_tertiary",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>e.platform==="phone"?this.tertiary():this.tertiaryDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onTertiary(),"2025",t)}tertiaryContainer(){const t=F.fromPalette({name:"tertiary_container",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>e.platform==="watch"?e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,90):Vt(e.tertiaryPalette):e.variant===I.NEUTRAL?e.isDark?Vt(e.tertiaryPalette,0,93):Vt(e.tertiaryPalette,0,96):e.variant===I.TONAL_SPOT?Vt(e.tertiaryPalette,0,e.isDark?93:100):e.variant===I.EXPRESSIVE?Vt(e.tertiaryPalette,75,zt.isCyan(e.tertiaryPalette.hue)?88:e.isDark?93:100):e.isDark?Vt(e.tertiaryPalette,0,93):Vt(e.tertiaryPalette,72,100),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.tertiaryContainer(),"2025",t)}onTertiaryContainer(){const t=F.fromPalette({name:"on_tertiary_container",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onTertiaryContainer(),"2025",t)}tertiaryFixed(){const t=F.fromPalette({name:"tertiary_fixed",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>{let i=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(i)},"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.tertiaryFixed(),"2025",t)}tertiaryFixedDim(){const t=F.fromPalette({name:"tertiary_fixed_dim",palette:c(e=>e.tertiaryPalette,"palette"),tone:c(e=>this.tertiaryFixed().getTone(e),"tone"),isBackground:!0,toneDeltaPair:c(e=>new Kt(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact"),"toneDeltaPair")});return Mt(super.tertiaryFixedDim(),"2025",t)}onTertiaryFixed(){const t=F.fromPalette({name:"on_tertiary_fixed",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryFixedDim(),"background"),contrastCurve:c(e=>bt(7),"contrastCurve")});return Mt(super.onTertiaryFixed(),"2025",t)}onTertiaryFixedVariant(){const t=F.fromPalette({name:"on_tertiary_fixed_variant",palette:c(e=>e.tertiaryPalette,"palette"),background:c(e=>this.tertiaryFixedDim(),"background"),contrastCurve:c(e=>bt(4.5),"contrastCurve")});return Mt(super.onTertiaryFixedVariant(),"2025",t)}error(){const t=F.fromPalette({name:"error",palette:c(e=>e.errorPalette,"palette"),tone:c(e=>e.platform==="phone"?e.isDark?Ls(e.errorPalette,0,98):Vt(e.errorPalette):Ls(e.errorPalette),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):this.surfaceContainerHigh(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve"),toneDeltaPair:c(e=>e.platform==="phone"?new Kt(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0,"toneDeltaPair")});return Mt(super.error(),"2025",t)}errorDim(){return F.fromPalette({name:"error_dim",palette:c(t=>t.errorPalette,"palette"),tone:c(t=>Ls(t.errorPalette),"tone"),isBackground:!0,background:c(t=>this.surfaceContainerHigh(),"background"),contrastCurve:c(t=>bt(4.5),"contrastCurve"),toneDeltaPair:c(t=>new Kt(this.errorDim(),this.error(),5,"darker",!0,"farther"),"toneDeltaPair")})}onError(){const t=F.fromPalette({name:"on_error",palette:c(e=>e.errorPalette,"palette"),background:c(e=>e.platform==="phone"?this.error():this.errorDim(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(6):bt(7),"contrastCurve")});return Mt(super.onError(),"2025",t)}errorContainer(){const t=F.fromPalette({name:"error_container",palette:c(e=>e.errorPalette,"palette"),tone:c(e=>e.platform==="watch"?30:e.isDark?Ls(e.errorPalette,30,93):Vt(e.errorPalette,0,90),"tone"),isBackground:!0,background:c(e=>e.platform==="phone"?this.highestSurface(e):void 0,"background"),toneDeltaPair:c(e=>e.platform==="watch"?new Kt(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,"toneDeltaPair"),contrastCurve:c(e=>e.platform==="phone"&&e.contrastLevel>0?bt(1.5):void 0,"contrastCurve")});return Mt(super.errorContainer(),"2025",t)}onErrorContainer(){const t=F.fromPalette({name:"on_error_container",palette:c(e=>e.errorPalette,"palette"),background:c(e=>this.errorContainer(),"background"),contrastCurve:c(e=>e.platform==="phone"?bt(4.5):bt(7),"contrastCurve")});return Mt(super.onErrorContainer(),"2025",t)}surfaceVariant(){const t=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return Mt(super.surfaceVariant(),"2025",t)}surfaceTint(){const t=Object.assign(this.primary().clone(),{name:"surface_tint"});return Mt(super.surfaceTint(),"2025",t)}background(){const t=Object.assign(this.surface().clone(),{name:"background"});return Mt(super.background(),"2025",t)}onBackground(){const t=Object.assign(this.onSurface().clone(),{name:"on_background",tone:c(e=>e.platform==="watch"?100:this.onSurface().getTone(e),"tone")});return Mt(super.onBackground(),"2025",t)}},h(Pp,"Jy"),Pp);c(JL,"ColorSpecDelegateImpl2025");let Fj=JL;var ot;const tz=(ot=class{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(t=>t!==void 0)}highestSurface(t){return ot.colorSpec.highestSurface(t)}primaryPaletteKeyColor(){return ot.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return ot.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return ot.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return ot.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return ot.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return ot.colorSpec.errorPaletteKeyColor()}background(){return ot.colorSpec.background()}onBackground(){return ot.colorSpec.onBackground()}surface(){return ot.colorSpec.surface()}surfaceDim(){return ot.colorSpec.surfaceDim()}surfaceBright(){return ot.colorSpec.surfaceBright()}surfaceContainerLowest(){return ot.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return ot.colorSpec.surfaceContainerLow()}surfaceContainer(){return ot.colorSpec.surfaceContainer()}surfaceContainerHigh(){return ot.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return ot.colorSpec.surfaceContainerHighest()}onSurface(){return ot.colorSpec.onSurface()}surfaceVariant(){return ot.colorSpec.surfaceVariant()}onSurfaceVariant(){return ot.colorSpec.onSurfaceVariant()}outline(){return ot.colorSpec.outline()}outlineVariant(){return ot.colorSpec.outlineVariant()}inverseSurface(){return ot.colorSpec.inverseSurface()}inverseOnSurface(){return ot.colorSpec.inverseOnSurface()}shadow(){return ot.colorSpec.shadow()}scrim(){return ot.colorSpec.scrim()}surfaceTint(){return ot.colorSpec.surfaceTint()}primary(){return ot.colorSpec.primary()}primaryDim(){return ot.colorSpec.primaryDim()}onPrimary(){return ot.colorSpec.onPrimary()}primaryContainer(){return ot.colorSpec.primaryContainer()}onPrimaryContainer(){return ot.colorSpec.onPrimaryContainer()}inversePrimary(){return ot.colorSpec.inversePrimary()}primaryFixed(){return ot.colorSpec.primaryFixed()}primaryFixedDim(){return ot.colorSpec.primaryFixedDim()}onPrimaryFixed(){return ot.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return ot.colorSpec.onPrimaryFixedVariant()}secondary(){return ot.colorSpec.secondary()}secondaryDim(){return ot.colorSpec.secondaryDim()}onSecondary(){return ot.colorSpec.onSecondary()}secondaryContainer(){return ot.colorSpec.secondaryContainer()}onSecondaryContainer(){return ot.colorSpec.onSecondaryContainer()}secondaryFixed(){return ot.colorSpec.secondaryFixed()}secondaryFixedDim(){return ot.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return ot.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return ot.colorSpec.onSecondaryFixedVariant()}tertiary(){return ot.colorSpec.tertiary()}tertiaryDim(){return ot.colorSpec.tertiaryDim()}onTertiary(){return ot.colorSpec.onTertiary()}tertiaryContainer(){return ot.colorSpec.tertiaryContainer()}onTertiaryContainer(){return ot.colorSpec.onTertiaryContainer()}tertiaryFixed(){return ot.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return ot.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return ot.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return ot.colorSpec.onTertiaryFixedVariant()}error(){return ot.colorSpec.error()}errorDim(){return ot.colorSpec.errorDim()}onError(){return ot.colorSpec.onError()}errorContainer(){return ot.colorSpec.errorContainer()}onErrorContainer(){return ot.colorSpec.onErrorContainer()}static highestSurface(t){return ot.colorSpec.highestSurface(t)}},h(ot,"G"),ot);c(tz,"MaterialDynamicColors");let N=tz;N.contentAccentToneDelta=15;N.colorSpec=new Fj;N.primaryPaletteKeyColor=N.colorSpec.primaryPaletteKeyColor();N.secondaryPaletteKeyColor=N.colorSpec.secondaryPaletteKeyColor();N.tertiaryPaletteKeyColor=N.colorSpec.tertiaryPaletteKeyColor();N.neutralPaletteKeyColor=N.colorSpec.neutralPaletteKeyColor();N.neutralVariantPaletteKeyColor=N.colorSpec.neutralVariantPaletteKeyColor();N.background=N.colorSpec.background();N.onBackground=N.colorSpec.onBackground();N.surface=N.colorSpec.surface();N.surfaceDim=N.colorSpec.surfaceDim();N.surfaceBright=N.colorSpec.surfaceBright();N.surfaceContainerLowest=N.colorSpec.surfaceContainerLowest();N.surfaceContainerLow=N.colorSpec.surfaceContainerLow();N.surfaceContainer=N.colorSpec.surfaceContainer();N.surfaceContainerHigh=N.colorSpec.surfaceContainerHigh();N.surfaceContainerHighest=N.colorSpec.surfaceContainerHighest();N.onSurface=N.colorSpec.onSurface();N.surfaceVariant=N.colorSpec.surfaceVariant();N.onSurfaceVariant=N.colorSpec.onSurfaceVariant();N.inverseSurface=N.colorSpec.inverseSurface();N.inverseOnSurface=N.colorSpec.inverseOnSurface();N.outline=N.colorSpec.outline();N.outlineVariant=N.colorSpec.outlineVariant();N.shadow=N.colorSpec.shadow();N.scrim=N.colorSpec.scrim();N.surfaceTint=N.colorSpec.surfaceTint();N.primary=N.colorSpec.primary();N.onPrimary=N.colorSpec.onPrimary();N.primaryContainer=N.colorSpec.primaryContainer();N.onPrimaryContainer=N.colorSpec.onPrimaryContainer();N.inversePrimary=N.colorSpec.inversePrimary();N.secondary=N.colorSpec.secondary();N.onSecondary=N.colorSpec.onSecondary();N.secondaryContainer=N.colorSpec.secondaryContainer();N.onSecondaryContainer=N.colorSpec.onSecondaryContainer();N.tertiary=N.colorSpec.tertiary();N.onTertiary=N.colorSpec.onTertiary();N.tertiaryContainer=N.colorSpec.tertiaryContainer();N.onTertiaryContainer=N.colorSpec.onTertiaryContainer();N.error=N.colorSpec.error();N.onError=N.colorSpec.onError();N.errorContainer=N.colorSpec.errorContainer();N.onErrorContainer=N.colorSpec.onErrorContainer();N.primaryFixed=N.colorSpec.primaryFixed();N.primaryFixedDim=N.colorSpec.primaryFixedDim();N.onPrimaryFixed=N.colorSpec.onPrimaryFixed();N.onPrimaryFixedVariant=N.colorSpec.onPrimaryFixedVariant();N.secondaryFixed=N.colorSpec.secondaryFixed();N.secondaryFixedDim=N.colorSpec.secondaryFixedDim();N.onSecondaryFixed=N.colorSpec.onSecondaryFixed();N.onSecondaryFixedVariant=N.colorSpec.onSecondaryFixedVariant();N.tertiaryFixed=N.colorSpec.tertiaryFixed();N.tertiaryFixedDim=N.colorSpec.tertiaryFixedDim();N.onTertiaryFixed=N.colorSpec.onTertiaryFixed();N.onTertiaryFixedVariant=N.colorSpec.onTertiaryFixedVariant();var da;const ez=(da=class{static maybeFallbackSpecVersion(t,e){switch(e){case I.EXPRESSIVE:case I.VIBRANT:case I.TONAL_SPOT:case I.NEUTRAL:return t;default:return"2021"}}constructor(t){this.sourceColorArgb=t.sourceColorHct.toInt(),this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.platform=t.platform??"phone",this.specVersion=da.maybeFallbackSpecVersion(t.specVersion??"2021",this.variant),this.sourceColorHct=t.sourceColorHct,this.primaryPalette=t.primaryPalette??no(this.specVersion).getPrimaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=t.secondaryPalette??no(this.specVersion).getSecondaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=t.tertiaryPalette??no(this.specVersion).getTertiaryPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=t.neutralPalette??no(this.specVersion).getNeutralPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=t.neutralVariantPalette??no(this.specVersion).getNeutralVariantPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=t.errorPalette??no(this.specVersion).getErrorPalette(this.variant,t.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??G.fromHueAndChroma(25,84),this.colors=new N}toString(){return`Scheme: variant=${I[this.variant]}, mode=${this.isDark?"dark":"light"}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(t,e,i){const r=Math.min(e.length-1,i.length),n=t.hue;for(let a=0;a<r;a++)if(n>=e[a]&&n<e[a+1])return Mi(i[a]);return n}static getRotatedHue(t,e,i){let r=da.getPiecewiseHue(t,e,i);return Math.min(e.length-1,i.length)<=0&&(r=0),Mi(t.hue+r)}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(this.colors.primaryPaletteKeyColor())}get secondaryPaletteKeyColor(){return this.getArgb(this.colors.secondaryPaletteKeyColor())}get tertiaryPaletteKeyColor(){return this.getArgb(this.colors.tertiaryPaletteKeyColor())}get neutralPaletteKeyColor(){return this.getArgb(this.colors.neutralPaletteKeyColor())}get neutralVariantPaletteKeyColor(){return this.getArgb(this.colors.neutralVariantPaletteKeyColor())}get errorPaletteKeyColor(){return this.getArgb(this.colors.errorPaletteKeyColor())}get background(){return this.getArgb(this.colors.background())}get onBackground(){return this.getArgb(this.colors.onBackground())}get surface(){return this.getArgb(this.colors.surface())}get surfaceDim(){return this.getArgb(this.colors.surfaceDim())}get surfaceBright(){return this.getArgb(this.colors.surfaceBright())}get surfaceContainerLowest(){return this.getArgb(this.colors.surfaceContainerLowest())}get surfaceContainerLow(){return this.getArgb(this.colors.surfaceContainerLow())}get surfaceContainer(){return this.getArgb(this.colors.surfaceContainer())}get surfaceContainerHigh(){return this.getArgb(this.colors.surfaceContainerHigh())}get surfaceContainerHighest(){return this.getArgb(this.colors.surfaceContainerHighest())}get onSurface(){return this.getArgb(this.colors.onSurface())}get surfaceVariant(){return this.getArgb(this.colors.surfaceVariant())}get onSurfaceVariant(){return this.getArgb(this.colors.onSurfaceVariant())}get inverseSurface(){return this.getArgb(this.colors.inverseSurface())}get inverseOnSurface(){return this.getArgb(this.colors.inverseOnSurface())}get outline(){return this.getArgb(this.colors.outline())}get outlineVariant(){return this.getArgb(this.colors.outlineVariant())}get shadow(){return this.getArgb(this.colors.shadow())}get scrim(){return this.getArgb(this.colors.scrim())}get surfaceTint(){return this.getArgb(this.colors.surfaceTint())}get primary(){return this.getArgb(this.colors.primary())}get primaryDim(){const t=this.colors.primaryDim();if(t===void 0)throw new Error("`primaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onPrimary(){return this.getArgb(this.colors.onPrimary())}get primaryContainer(){return this.getArgb(this.colors.primaryContainer())}get onPrimaryContainer(){return this.getArgb(this.colors.onPrimaryContainer())}get primaryFixed(){return this.getArgb(this.colors.primaryFixed())}get primaryFixedDim(){return this.getArgb(this.colors.primaryFixedDim())}get onPrimaryFixed(){return this.getArgb(this.colors.onPrimaryFixed())}get onPrimaryFixedVariant(){return this.getArgb(this.colors.onPrimaryFixedVariant())}get inversePrimary(){return this.getArgb(this.colors.inversePrimary())}get secondary(){return this.getArgb(this.colors.secondary())}get secondaryDim(){const t=this.colors.secondaryDim();if(t===void 0)throw new Error("`secondaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onSecondary(){return this.getArgb(this.colors.onSecondary())}get secondaryContainer(){return this.getArgb(this.colors.secondaryContainer())}get onSecondaryContainer(){return this.getArgb(this.colors.onSecondaryContainer())}get secondaryFixed(){return this.getArgb(this.colors.secondaryFixed())}get secondaryFixedDim(){return this.getArgb(this.colors.secondaryFixedDim())}get onSecondaryFixed(){return this.getArgb(this.colors.onSecondaryFixed())}get onSecondaryFixedVariant(){return this.getArgb(this.colors.onSecondaryFixedVariant())}get tertiary(){return this.getArgb(this.colors.tertiary())}get tertiaryDim(){const t=this.colors.tertiaryDim();if(t===void 0)throw new Error("`tertiaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onTertiary(){return this.getArgb(this.colors.onTertiary())}get tertiaryContainer(){return this.getArgb(this.colors.tertiaryContainer())}get onTertiaryContainer(){return this.getArgb(this.colors.onTertiaryContainer())}get tertiaryFixed(){return this.getArgb(this.colors.tertiaryFixed())}get tertiaryFixedDim(){return this.getArgb(this.colors.tertiaryFixedDim())}get onTertiaryFixed(){return this.getArgb(this.colors.onTertiaryFixed())}get onTertiaryFixedVariant(){return this.getArgb(this.colors.onTertiaryFixedVariant())}get error(){return this.getArgb(this.colors.error())}get errorDim(){const t=this.colors.errorDim();if(t===void 0)throw new Error("`errorDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onError(){return this.getArgb(this.colors.onError())}get errorContainer(){return this.getArgb(this.colors.errorContainer())}get onErrorContainer(){return this.getArgb(this.colors.onErrorContainer())}},h(da,"wl"),da);c(ez,"DynamicScheme");let vi=ez;vi.DEFAULT_SPEC_VERSION="2021";vi.DEFAULT_PLATFORM="phone";var Qp;const iz=(Qp=class{getPrimaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma);case I.FRUIT_SALAD:return G.fromHueAndChroma(Mi(e.hue-50),48);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,12);case I.RAINBOW:return G.fromHueAndChroma(e.hue,48);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,36);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+240),40);case I.VIBRANT:return G.fromHueAndChroma(e.hue,200);default:throw new Error(`Unsupported variant: ${t}`)}}getSecondaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,Math.max(e.chroma-32,e.chroma*.5));case I.FRUIT_SALAD:return G.fromHueAndChroma(Mi(e.hue-50),36);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,8);case I.RAINBOW:return G.fromHueAndChroma(e.hue,16);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,16);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[45,95,45,20,45,90,45,45,45]),24);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[18,15,10,12,15,18,15,12,12]),24);default:throw new Error(`Unsupported variant: ${t}`)}}getTertiaryPalette(t,e,i,r,n){switch(t){case I.CONTENT:return G.fromHct(bS.fixIfDisliked(new f9(e).analogous(3,6)[2]));case I.FIDELITY:return G.fromHct(bS.fixIfDisliked(new f9(e).complement));case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,36);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,16);case I.RAINBOW:case I.TONAL_SPOT:return G.fromHueAndChroma(Mi(e.hue+60),24);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[120,120,20,45,20,15,20,120,120]),32);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[35,30,20,25,30,35,30,25,25]),32);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralPalette(t,e,i,r,n){switch(t){case I.CONTENT:case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma/8);case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,10);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,2);case I.RAINBOW:return G.fromHueAndChroma(e.hue,0);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,6);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+15),8);case I.VIBRANT:return G.fromHueAndChroma(e.hue,10);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralVariantPalette(t,e,i,r,n){switch(t){case I.CONTENT:return G.fromHueAndChroma(e.hue,e.chroma/8+4);case I.FIDELITY:return G.fromHueAndChroma(e.hue,e.chroma/8+4);case I.FRUIT_SALAD:return G.fromHueAndChroma(e.hue,16);case I.MONOCHROME:return G.fromHueAndChroma(e.hue,0);case I.NEUTRAL:return G.fromHueAndChroma(e.hue,2);case I.RAINBOW:return G.fromHueAndChroma(e.hue,0);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,8);case I.EXPRESSIVE:return G.fromHueAndChroma(Mi(e.hue+15),12);case I.VIBRANT:return G.fromHueAndChroma(e.hue,12);default:throw new Error(`Unsupported variant: ${t}`)}}getErrorPalette(t,e,i,r,n){}},h(Qp,"tw"),Qp);c(iz,"DynamicSchemePalettesDelegateImpl2021");let rz=iz;var wi;const sz=(wi=class extends rz{getPrimaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?zt.isBlue(e.hue)?12:8:zt.isBlue(e.hue)?16:12);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,r==="phone"&&i?26:32);case I.EXPRESSIVE:return G.fromHueAndChroma(e.hue,r==="phone"?i?36:48:40);case I.VIBRANT:return G.fromHueAndChroma(e.hue,r==="phone"?74:56);default:return super.getPrimaryPalette(t,e,i,r,n)}}getSecondaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?zt.isBlue(e.hue)?6:4:zt.isBlue(e.hue)?10:6);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,16);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-160,155,-100,96,-96,-156,-165,-160]),r==="phone"&&i?16:24);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,105,140,333,360],[-14,10,-14,10,-14]),r==="phone"?56:36);default:return super.getSecondaryPalette(t,e,i,r,n)}}getTertiaryPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,105,161,204,278,333,360],[-32,26,10,-39,24,-15,-32]),r==="phone"?20:36);case I.TONAL_SPOT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,20,71,161,333,360],[-40,48,-32,40,-32]),r==="phone"?28:32);case I.EXPRESSIVE:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-165,160,-105,101,-101,-160,-170,-165]),48);case I.VIBRANT:return G.fromHueAndChroma(vi.getRotatedHue(e,[0,38,71,105,140,161,253,333,360],[-72,35,24,-24,62,50,62,-72]),56);default:return super.getTertiaryPalette(t,e,i,r,n)}}static getExpressiveNeutralHue(t){return vi.getRotatedHue(t,[0,71,124,253,278,300,360],[10,0,10,0,10,0])}static getExpressiveNeutralChroma(t,e,i){const r=wi.getExpressiveNeutralHue(t);return i==="phone"?e?zt.isYellow(r)?6:14:18:12}static getVibrantNeutralHue(t){return vi.getRotatedHue(t,[0,38,105,140,333,360],[-14,10,-14,10,-14])}static getVibrantNeutralChroma(t,e){const i=wi.getVibrantNeutralHue(t);return e==="phone"||zt.isBlue(i)?28:20}getNeutralPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,r==="phone"?1.4:6);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,r==="phone"?5:10);case I.EXPRESSIVE:return G.fromHueAndChroma(wi.getExpressiveNeutralHue(e),wi.getExpressiveNeutralChroma(e,i,r));case I.VIBRANT:return G.fromHueAndChroma(wi.getVibrantNeutralHue(e),wi.getVibrantNeutralChroma(e,r));default:return super.getNeutralPalette(t,e,i,r,n)}}getNeutralVariantPalette(t,e,i,r,n){switch(t){case I.NEUTRAL:return G.fromHueAndChroma(e.hue,(r==="phone"?1.4:6)*2.2);case I.TONAL_SPOT:return G.fromHueAndChroma(e.hue,(r==="phone"?5:10)*1.7);case I.EXPRESSIVE:const a=wi.getExpressiveNeutralHue(e),o=wi.getExpressiveNeutralChroma(e,i,r);return G.fromHueAndChroma(a,o*(a>=105&&a<125?1.6:2.3));case I.VIBRANT:const l=wi.getVibrantNeutralHue(e),d=wi.getVibrantNeutralChroma(e,r);return G.fromHueAndChroma(l,d*1.29);default:return super.getNeutralVariantPalette(t,e,i,r,n)}}getErrorPalette(t,e,i,r,n){const a=vi.getPiecewiseHue(e,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(t){case I.NEUTRAL:return G.fromHueAndChroma(a,r==="phone"?50:40);case I.TONAL_SPOT:return G.fromHueAndChroma(a,r==="phone"?60:48);case I.EXPRESSIVE:return G.fromHueAndChroma(a,r==="phone"?64:48);case I.VIBRANT:return G.fromHueAndChroma(a,r==="phone"?80:60);default:return super.getErrorPalette(t,e,i,r,n)}}},h(wi,"Xe"),wi);c(sz,"DynamicSchemePalettesDelegateImpl2025");let qj=sz;const Zj=new rz,Nj=new qj;function no(s){return s==="2025"?Nj:Zj}h(no,"da");c(no,"getSpec");function nz(s){s=s.replace("#","");const t=s.length===3,e=s.length===6,i=s.length===8;if(!t&&!e&&!i)throw new Error("unexpected hex "+s);let r=0,n=0,a=0;return t?(r=es(s.slice(0,1).repeat(2)),n=es(s.slice(1,2).repeat(2)),a=es(s.slice(2,3).repeat(2))):e?(r=es(s.slice(0,2)),n=es(s.slice(2,4)),a=es(s.slice(4,6))):i&&(r=es(s.slice(2,4)),n=es(s.slice(4,6)),a=es(s.slice(6,8))),(255<<24|(r&255)<<16|(n&255)<<8|a&255)>>>0}h(nz,"Gg");c(nz,"argbFromHex");function es(s){return parseInt(s,16)}h(es,"Ni");c(es,"parseIntHex");function az(s,t=!1){const e=s.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)$/)?.slice(1).map((o,l)=>l===3?Math.round(parseFloat(o)*255):parseFloat(o));if(!e)throw new Error("Could not parse rgba color.");const[i,r,n,a]=e;return((t?255:a&255)<<24|(i&255)<<16|(r&255)<<8|n&255)>>>0}h(az,"Zg");c(az,"argbFromRgba");function Rr(s,t){return Math.round(255*t)<<24|s&16777215}h(Rr,"$i");c(Rr,"addAlphaToArgb");function oz(s){const t=xb(s),e=kb(s),i=Sb(s),r=TL(s),n=[t.toString(16),e.toString(16),i.toString(16)];r!==255&&n.push(r.toString(16));for(const[a,o]of n.entries())o.length===1&&(n[a]="0"+o);return"#"+n.join("")}h(oz,"Yg");c(oz,"hexWithAlphaFromArgb");function lz(s){Pe();const t=document.createElement("wy-compute-styles");t.setAttribute("style",`color: ${s} !important;`),document.documentElement.append(t);const e=window.getComputedStyle(t).color;return t.remove(),e}h(lz,"Xg");c(lz,"getComputedColor");var Tp;const cz=(Tp=class extends vi{constructor(t,e,i,r=I.FIDELITY){const n=t.chroma,a=Math.min(36,t.chroma*16/36),o=a,l=Math.min(6,t.chroma*6/36),d=Math.min(8,t.chroma*8/36);super({sourceColorHct:t,variant:r,contrastLevel:i,isDark:e,primaryPalette:G.fromHueAndChroma(t.hue,n),secondaryPalette:G.fromHueAndChroma(t.hue,a),tertiaryPalette:G.fromHueAndChroma(Mi(t.hue-6*22.5),o),neutralPalette:G.fromHueAndChroma(t.hue,l),neutralVariantPalette:G.fromHueAndChroma(t.hue,d)}),this.allTones={98:98,95:95,90:90,80:80,70:70,60:60,50:50,40:40,30:30,20:20,10:10},this.namedColorToneMap={red:{light:60,dark:60},"deep-orange":{light:60,dark:60},orange:{light:70,dark:70},amber:{light:70,dark:70},yellow:{light:70,dark:80},lime:{light:70,dark:70},"light-green":{light:70,dark:70},green:{light:60,dark:60},teal:{light:60,dark:60},cyan:{light:50,dark:60},"light-blue":{light:60,dark:70},blue:{light:70,dark:80},indigo:{light:60,dark:60},"deep-purple":{light:60,dark:70},purple:{light:60,dark:70},pink:{light:60,dark:70},gray:{light:50,dark:60}};const u=t.hue,p=t.chroma,f=Math.max(48,p),y=Math.min(f,84),g=360/16,O=27.4,k=-8,$=(u+360-O-k+g/2)%g+O+k-g/2;this.errorPalette=G.fromHueAndChroma($,84),this.warningPalette=G.fromHueAndChroma($+4*g,y),this.namedColorPalettes={red:G.fromHueAndChroma($,y),"deep-orange":G.fromHueAndChroma($+1*g,y),orange:G.fromHueAndChroma($+2*g,y),amber:G.fromHueAndChroma($+3*g,y),yellow:G.fromHueAndChroma($+4*g,y),lime:G.fromHueAndChroma($+5*g,y),"light-green":G.fromHueAndChroma($+6*g,y),green:G.fromHueAndChroma($+7*g,y),teal:G.fromHueAndChroma($+8*g,y),cyan:G.fromHueAndChroma($+9*g,y),"light-blue":G.fromHueAndChroma($+10*g,y),blue:G.fromHueAndChroma($+11*g,y),indigo:G.fromHueAndChroma($+12*g,y),"deep-purple":G.fromHueAndChroma($+13*g,y),purple:G.fromHueAndChroma($+14*g,y),pink:G.fromHueAndChroma($+15*g,y),gray:G.fromHueAndChroma(u,4)}}get black(){return 0}get white(){return 16777215}get surfaceLayerLowest(){return this.isDark?Rr(this.black,.5):Rr(this.white,.75)}get surfaceLayerLow(){return this.isDark?Rr(this.black,.25):Rr(this.white,.5)}get surfaceLayer(){return this.isDark?Rr(this.white,.05):Rr(this.black,.05)}get surfaceLayerHigh(){return this.isDark?Rr(this.white,.1):Rr(this.black,.075)}get surfaceLayerHighest(){return this.isDark?Rr(this.white,.15):Rr(this.black,.1)}get warning(){return this.warningPalette.tone(this.isDark?90:70)}get onWarning(){return this.warningPalette.tone(this.isDark?30:0)}get warningContainer(){return this.warningPalette.tone(this.isDark?50:90)}get onWarningContainer(){return this.warningPalette.tone(this.isDark?95:10)}get highlight(){return this.primaryPalette.tone(this.isDark?20:95)}get onHighlight(){return this.primaryPalette.tone(this.isDark?90:10)}namedColor(t){return this.namedColorPalettes[t].tone(this.namedColorToneMap[t][this.isDark?"dark":"light"])}get red(){return this.namedColor("red")}get deepOrange(){return this.namedColor("deep-orange")}get orange(){return this.namedColor("orange")}get amber(){return this.namedColor("amber")}get yellow(){return this.namedColor("yellow")}get lime(){return this.namedColor("lime")}get lightGreen(){return this.namedColor("light-green")}get green(){return this.namedColor("green")}get teal(){return this.namedColor("teal")}get cyan(){return this.namedColor("cyan")}get lightBlue(){return this.namedColor("light-blue")}get blue(){return this.namedColor("blue")}get indigo(){return this.namedColor("indigo")}get deepPurple(){return this.namedColor("deep-purple")}get purple(){return this.namedColor("purple")}get pink(){return this.namedColor("pink")}get gray(){return this.namedColor("gray")}},h(Tp,"ew"),Tp);c(cz,"SchemeWeavy");let m9=cz;function y0(s){return getComputedStyle(s).getPropertyValue("--wy-theme-color")||void 0}h(y0,"xp");c(y0,"getCSSThemeColor");function hz(s,t){let e=y0(s);const i=new MutationObserver(()=>{const a=y0(s);a!==e&&(e=a,t(a))}),r={attributes:!0,attributeFilter:["class","style"]};let n=s;for(;n&&n!==document;)i.observe(n,r),n=n.parentNode;return()=>i.disconnect()}h(hz,"Jg");c(hz,"observeCSSThemeColor");function g0(){return Pe(),Array.from(document.head.querySelectorAll("meta[name='theme-color']")).filter(s=>{const t=s.getAttribute("media");return!t||window.matchMedia(t)?.matches}).pop()?.getAttribute("content")||void 0}h(g0,"Cp");c(g0,"getMetaThemeColor");function dz(s){Pe();const t=Array.from(document.head.querySelectorAll("meta[name='theme-color']"));if(!t)return()=>{};let e=g0();const i=c(()=>{const o=g0();o!==e&&(e=o,s(o))},"checkChangedColor"),r=new MutationObserver(i),n={attributes:!0,attributeFilter:["content"]},a=[];return t.forEach(o=>{r.observe(o,n);const l=o.getAttribute("media");if(l){const d=window.matchMedia(l);d.addEventListener("change",i),a.push(d)}}),()=>{r.disconnect(),a.forEach(o=>o.removeEventListener("change",i))}}h(dz,"t0");c(dz,"observeMetaThemeColor");const Sg=[],Bj=16;function uz(s,t=!1){if(Sg.some(l=>l.seedColor===s)){const l=Sg.find(d=>d.seedColor===s)?.colors;if(l)return l}const e=[];t&&e.push(`--wy-theme-color:${s};`);let i=s;!s.startsWith("#")&&!s.startsWith("rgb")&&(i=lz(s));const r=s.startsWith("#")?nz(i):az(i),n=zt.fromInt(r),a={light:new m9(n,!1,0,I.FIDELITY),dark:new m9(n,!0,0,I.FIDELITY)},o={primary:"primary",onPrimary:"on-primary",primaryContainer:"primary-container",onPrimaryContainer:"on-primary-container",secondary:"secondary",onSecondary:"on-secondary",secondaryContainer:"secondary-container",onSecondaryContainer:"on-secondary-container",tertiary:"tertiary",onTertiary:"on-tertiary",tertiaryContainer:"tertiary-container",onTertiaryContainer:"on-tertiary-container",error:"error",onError:"on-error",errorContainer:"error-container",onErrorContainer:"on-error-container",background:"background",onBackground:"on-background",surface:"surface",onSurface:"on-surface",surfaceVariant:"surface-variant",onSurfaceVariant:"on-surface-variant",surfaceContainerLowest:"surface-container-lowest",surfaceContainerLow:"surface-container-low",surfaceContainer:"surface-container",surfaceContainerHigh:"surface-container-high",surfaceContainerHighest:"surface-container-highest",outline:"outline",outlineVariant:"outline-variant",shadow:"shadow",scrim:"scrim",surfaceLayerLowest:"surface-layer-lowest",surfaceLayerLow:"surface-layer-low",surfaceLayer:"surface-layer",surfaceLayerHigh:"surface-layer-high",surfaceLayerHighest:"surface-layer-highest",warning:"warning",onWarning:"on-warning",warningContainer:"warning-container",onWarningContainer:"on-warning-container",highlight:"highlight",onHighlight:"on-highlight",red:"red",deepOrange:"deep-orange",orange:"orange",amber:"amber",yellow:"yellow",lime:"lime",lightGreen:"light-green",green:"green",teal:"teal",cyan:"cyan",lightBlue:"light-blue",blue:"blue",indigo:"indigo",deepPurple:"deep-purple",purple:"purple",pink:"pink",gray:"gray"};for(const l in a){const d=a[l];for(const u in o){const p=o[u],f=oz(d[u]);e.push(`--wy-${p}-${l}:${f};`)}}return Sg.unshift({seedColor:s,colors:e}),Sg.length=Math.min(Sg.length,Bj),e}h(uz,"i0");c(uz,"generateThemeColors");const Xj=c(s=>{if(Pe(),yb)document.adoptedStyleSheets=s.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of s){const e=document.createElement("style"),i=global.litNonce;i!==void 0&&e.setAttribute("nonce",i),e.textContent=t.cssText,(document.head||document.documentElement).appendChild(e)}},"adoptGlobalStyles"),De=it`@property --wy-color-scheme{syntax:\"normal | light | dark\";inherits:true;initial-value:normal}:is(.wy-light,[part~=wy-light]) :where(wy-chat),:is(.wy-light,[part~=wy-light]) :where(wy-comments),:is(.wy-light,[part~=wy-light]) :where(wy-component),:is(.wy-light,[part~=wy-light]) :where(wy-copilot),:is(.wy-light,[part~=wy-light]) :where(wy-files),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-badge),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-button),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-conversation),:is(.wy-light,[part~=wy-light]) :where(wy-messenger-new),:is(.wy-light,[part~=wy-light]) :where(wy-messenger),:is(.wy-light,[part~=wy-light]) :where(wy-notification-badge),:is(.wy-light,[part~=wy-light]) :where(wy-notification-button),:is(.wy-light,[part~=wy-light]) :where(wy-notification-toasts),:is(.wy-light,[part~=wy-light]) :where(wy-notifications),:is(.wy-light,[part~=wy-light]) :where(wy-posts),:host(:is(.wy-light,[part~=wy-light])),:host :is(.wy-light,[part~=wy-light]),::slotted(:is(.wy-light,[part~=wy-light])){color-scheme:light;--wy-primary:var(--wy-primary-light, #2f628c);--wy-on-primary:var(--wy-on-primary-light, #ffffff);--wy-primary-container:var(--wy-primary-container-light, #cee5ff);--wy-on-primary-container:var(--wy-on-primary-container-light, #0d4a73);--wy-secondary:var(--wy-secondary-light, #51606f);--wy-on-secondary:var(--wy-on-secondary-light, #ffffff);--wy-secondary-container:var(--wy-secondary-container-light, #d5e4f7);--wy-on-secondary-container:var(--wy-on-secondary-container-light, #3a4857);--wy-tertiary:var(--wy-tertiary-light, #645f41);--wy-on-tertiary:var(--wy-on-tertiary-light, #ffffff);--wy-tertiary-container:var(--wy-tertiary-container-light, #ebe3bd);--wy-on-tertiary-container:var(--wy-on-tertiary-container-light, #4c472b);--wy-error:var(--wy-error-light, #ba1821);--wy-on-error:var(--wy-on-error-light, #ffffff);--wy-error-container:var(--wy-error-container-light, #ffdad6);--wy-on-error-container:var(--wy-on-error-container-light, #930012);--wy-background:var(--wy-background-light, #f7f9ff);--wy-on-background:var(--wy-on-background-light, #181c20);--wy-surface:var(--wy-surface-light, #f7f9ff);--wy-on-surface:var(--wy-on-surface-light, #181c20);--wy-surface-variant:var(--wy-surface-variant-light, #dee3eb);--wy-on-surface-variant:var(--wy-on-surface-variant-light, #42474e);--wy-outline:var(--wy-outline-light, #72777f);--wy-outline-variant:var(--wy-outline-variant-light, #c2c7cf);--wy-surface-container-highest:var(--wy-surface-container-highest-light, #e0e2e8);--wy-surface-container-high:var(--wy-surface-container-high-light, #e6e8ee);--wy-surface-container:var(--wy-surface-container-light, #eceef3);--wy-surface-container-low:var(--wy-surface-container-low-light, #f1f3f9);--wy-surface-container-lowest:var(--wy-surface-container-lowest-light, #ffffff);--wy-surface-layer-highest:var(--wy-surface-layer-highest-light, rgba(0, 0, 0, .1019607843));--wy-surface-layer-high:var(--wy-surface-layer-high-light, rgba(0, 0, 0, .0745098039));--wy-surface-layer:var(--wy-surface-layer-light, rgba(0, 0, 0, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-light, rgba(255, 255, 255, .5019607843));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-light, rgba(255, 255, 255, .7490196078));--wy-warning:var(--wy-warning-light, #adb140);--wy-on-warning:var(--wy-on-warning-light, #000000);--wy-warning-container:var(--wy-warning-container-light, #e5e972);--wy-on-warning-container:var(--wy-on-warning-container-light, #1c1d00);--wy-highlight:var(--wy-highlight-light, #e8f2ff);--wy-on-highlight:var(--wy-on-highlight-light, #001d32);--wy-link:var(--wy-primary-light, #2f628c);--wy-presence-active:var(--wy-green-light, #00a38d);--wy-shade:var(--wy-shade-light, rgba(0, 0, 0, .3));--wy-shade-invert:var(--wy-shade-invert-light, rgba(255, 255, 255, .15));--wy-shade-opaque:var(--wy-shade-opaque-light, white);--wy-blue:var(--wy-blue-light, #8aa9fc);--wy-indigo:var(--wy-indigo-light, #9285de);--wy-purple:var(--wy-purple-light, #c675b6);--wy-pink:var(--wy-pink-light, #d57193);--wy-red:var(--wy-red-light, #db726b);--wy-orange:var(--wy-orange-light, #e79b3a);--wy-yellow:var(--wy-yellow-light, #adb140);--wy-green:var(--wy-green-light, #00a38d);--wy-teal:var(--wy-teal-light, #00a0a9);--wy-cyan:var(--wy-cyan-light, #0081a2);--wy-gray:var(--wy-gray-light, #76777a);--wy-code-text:var(--wy-code-text-light, #3b3b3b);--wy-code-variable:var(--wy-code-variable-light, #001080);--wy-code-operator:var(--wy-code-operator-light, #000000);--wy-code-prolog:var(--wy-code-prolog-light, #000080);--wy-code-comment:var(--wy-code-comment-light, #008000);--wy-code-builtin:var(--wy-code-builtin-light, #0070C1);--wy-code-number:var(--wy-code-number-light, #098658);--wy-code-inserted:var(--wy-code-inserted-light, #098658);--wy-code-constant:var(--wy-code-constant-light, #811F3F);--wy-code-hexcode:var(--wy-code-hexcode-light, #811F3F);--wy-code-regex:var(--wy-code-regex-light, #811F3F);--wy-code-char:var(--wy-code-char-light, #811F3F);--wy-code-tag:var(--wy-code-tag-light, #800000);--wy-code-attr-name:var(--wy-code-attr-name-light, #E50000);--wy-code-selector:var(--wy-code-selector-light, #E50000);--wy-code-property:var(--wy-code-property-light, #E50000);--wy-code-deleted:var(--wy-code-deleted-light, #A31515);--wy-code-string:var(--wy-code-string-light, #A31515);--wy-code-changed:var(--wy-code-changed-light, #0451A5);--wy-code-punctuation:var(--wy-code-punctuation-light, #000000);--wy-code-function:var(--wy-code-function-light, #0000FF);--wy-code-keyword:var(--wy-code-keyword-light, #AF00DB);--wy-code-class-name:var(--wy-code-class-name-light, #267F99)}:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-chat),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-comments),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-component),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-copilot),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-files),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-badge),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-button),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-conversation),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger-new),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-messenger),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-badge),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-button),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notification-toasts),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-notifications),:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]) :where(wy-posts),:host(:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light])),:host :is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light]),::slotted(:is(.wy-dark,[part~=wy-dark]):not(.wy-light,[part~=wy-light])){color-scheme:dark;--wy-primary:var(--wy-primary-dark, #9bcbfa);--wy-on-primary:var(--wy-on-primary-dark, #003353);--wy-primary-container:var(--wy-primary-container-dark, #0d4a73);--wy-on-primary-container:var(--wy-on-primary-container-dark, #cee5ff);--wy-secondary:var(--wy-secondary-dark, #b9c8da);--wy-on-secondary:var(--wy-on-secondary-dark, #233240);--wy-secondary-container:var(--wy-secondary-container-dark, #3a4857);--wy-on-secondary-container:var(--wy-on-secondary-container-dark, #d5e4f7);--wy-tertiary:var(--wy-tertiary-dark, #cfc7a2);--wy-on-tertiary:var(--wy-on-tertiary-dark, #353117);--wy-tertiary-container:var(--wy-tertiary-container-dark, #4c472b);--wy-on-tertiary-container:var(--wy-on-tertiary-container-dark, #ebe3bd);--wy-error:var(--wy-error-dark, #ffb3ad);--wy-on-error:var(--wy-on-error-dark, #680009);--wy-error-container:var(--wy-error-container-dark, #930012);--wy-on-error-container:var(--wy-on-error-container-dark, #ffdad6);--wy-background:var(--wy-background-dark, #101418);--wy-on-background:var(--wy-on-background-dark, #e0e2e8);--wy-surface:var(--wy-surface-dark, #101418);--wy-on-surface:var(--wy-on-surface-dark, #e0e2e8);--wy-surface-variant:var(--wy-surface-variant-dark, #42474e);--wy-on-surface-variant:var(--wy-on-surface-variant-dark, #c2c7cf);--wy-outline:var(--wy-outline-dark, #8c9198);--wy-outline-variant:var(--wy-outline-variant-dark, #42474e);--wy-surface-container-highest:var(--wy-surface-container-highest-dark, #323539);--wy-surface-container-high:var(--wy-surface-container-high-dark, #272a2f);--wy-surface-container:var(--wy-surface-container-dark, #1c2024);--wy-surface-container-low:var(--wy-surface-container-low-dark, #181c20);--wy-surface-container-lowest:var(--wy-surface-container-lowest-dark, #0b0f12);--wy-surface-layer-highest:var(--wy-surface-layer-highest-dark, rgba(255, 255, 255, .1490196078));--wy-surface-layer-high:var(--wy-surface-layer-high-dark, rgba(255, 255, 255, .1019607843));--wy-surface-layer:var(--wy-surface-layer-dark, rgba(255, 255, 255, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-dark, rgba(0, 0, 0, .2509803922));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-dark, rgba(0, 0, 0, .5019607843));--wy-warning:var(--wy-warning-dark, #e5e972);--wy-on-warning:var(--wy-on-warning-dark, #484a00);--wy-warning-container:var(--wy-warning-container-dark, #787c07);--wy-on-warning-container:var(--wy-on-warning-container-dark, #f4f87e);--wy-highlight:var(--wy-highlight-dark, #003353);--wy-on-highlight:var(--wy-on-highlight-dark, #cee5ff);--wy-link:var(--wy-primary-dark, #9bcbfa);--wy-presence-active:var(--wy-green-dark, #00a38d);--wy-shade:var(--wy-shade-dark, rgba(0, 0, 0, .5));--wy-shade-invert:var(--wy-shade-invert-dark, rgba(255, 255, 255, .25));--wy-shade-opaque:var(--wy-shade-opaque-dark, grey);--wy-blue:var(--wy-blue-dark, #b2c5ff);--wy-indigo:var(--wy-indigo-dark, #9285de);--wy-purple:var(--wy-purple-dark, #e48fd2);--wy-pink:var(--wy-pink-dark, #f58bad);--wy-red:var(--wy-red-dark, #db726b);--wy-orange:var(--wy-orange-dark, #e79b3a);--wy-yellow:var(--wy-yellow-dark, #c9cd59);--wy-green:var(--wy-green-dark, #00a38d);--wy-teal:var(--wy-teal-dark, #00a0a9);--wy-cyan:var(--wy-cyan-dark, #009dc4);--wy-gray:var(--wy-gray-dark, #909194);--wy-code-text:var(--wy-code-text-dark, #cccccc);--wy-code-variable:var(--wy-code-variable-dark, #9CDCFE);--wy-code-operator:var(--wy-code-operator-dark, #d4d4d4);--wy-code-prolog:var(--wy-code-prolog-dark, #569CD6);--wy-code-comment:var(--wy-code-comment-dark, #6a9955);--wy-code-builtin:var(--wy-code-builtin-dark, #4fc1ff);--wy-code-number:var(--wy-code-number-dark, #b5cea8);--wy-code-inserted:var(--wy-code-inserted-dark, #b5cea8);--wy-code-constant:var(--wy-code-constant-dark, #646695);--wy-code-hexcode:var(--wy-code-hexcode-dark, #646695);--wy-code-regex:var(--wy-code-regex-dark, #d16969);--wy-code-char:var(--wy-code-char-dark, #d16969);--wy-code-tag:var(--wy-code-tag-dark, #569cd6);--wy-code-attr-name:var(--wy-code-attr-name-dark, #9cdcfe);--wy-code-selector:var(--wy-code-selector-dark, #9cdcfe);--wy-code-property:var(--wy-code-property-dark, #9cdcfe);--wy-code-deleted:var(--wy-code-deleted-dark, #ce9178);--wy-code-string:var(--wy-code-string-dark, #ce9178);--wy-code-changed:var(--wy-code-changed-dark, #569cd6);--wy-code-punctuation:var(--wy-code-punctuation-dark, #D4D4D4);--wy-code-function:var(--wy-code-function-dark, #569cd6);--wy-code-keyword:var(--wy-code-keyword-dark, #C586C0);--wy-code-class-name:var(--wy-code-class-name-dark, #4ec9b0)}@container style(--wy-color-scheme: dark){:not(.wy-light):not([part~=wy-light]) :where(wy-chat),:not(.wy-light):not([part~=wy-light]) :where(wy-comments),:not(.wy-light):not([part~=wy-light]) :where(wy-component),:not(.wy-light):not([part~=wy-light]) :where(wy-copilot),:not(.wy-light):not([part~=wy-light]) :where(wy-files),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-badge),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-button),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-conversation),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger-new),:not(.wy-light):not([part~=wy-light]) :where(wy-messenger),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-badge),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-button),:not(.wy-light):not([part~=wy-light]) :where(wy-notification-toasts),:not(.wy-light):not([part~=wy-light]) :where(wy-notifications),:not(.wy-light):not([part~=wy-light]) :where(wy-posts),:host(:not(.wy-light):not([part~=wy-light])),:host :not(.wy-light):not([part~=wy-light]),::slotted(:not(.wy-light):not([part~=wy-light])){color-scheme:dark;--wy-primary:var(--wy-primary-dark, #9bcbfa);--wy-on-primary:var(--wy-on-primary-dark, #003353);--wy-primary-container:var(--wy-primary-container-dark, #0d4a73);--wy-on-primary-container:var(--wy-on-primary-container-dark, #cee5ff);--wy-secondary:var(--wy-secondary-dark, #b9c8da);--wy-on-secondary:var(--wy-on-secondary-dark, #233240);--wy-secondary-container:var(--wy-secondary-container-dark, #3a4857);--wy-on-secondary-container:var(--wy-on-secondary-container-dark, #d5e4f7);--wy-tertiary:var(--wy-tertiary-dark, #cfc7a2);--wy-on-tertiary:var(--wy-on-tertiary-dark, #353117);--wy-tertiary-container:var(--wy-tertiary-container-dark, #4c472b);--wy-on-tertiary-container:var(--wy-on-tertiary-container-dark, #ebe3bd);--wy-error:var(--wy-error-dark, #ffb3ad);--wy-on-error:var(--wy-on-error-dark, #680009);--wy-error-container:var(--wy-error-container-dark, #930012);--wy-on-error-container:var(--wy-on-error-container-dark, #ffdad6);--wy-background:var(--wy-background-dark, #101418);--wy-on-background:var(--wy-on-background-dark, #e0e2e8);--wy-surface:var(--wy-surface-dark, #101418);--wy-on-surface:var(--wy-on-surface-dark, #e0e2e8);--wy-surface-variant:var(--wy-surface-variant-dark, #42474e);--wy-on-surface-variant:var(--wy-on-surface-variant-dark, #c2c7cf);--wy-outline:var(--wy-outline-dark, #8c9198);--wy-outline-variant:var(--wy-outline-variant-dark, #42474e);--wy-surface-container-highest:var(--wy-surface-container-highest-dark, #323539);--wy-surface-container-high:var(--wy-surface-container-high-dark, #272a2f);--wy-surface-container:var(--wy-surface-container-dark, #1c2024);--wy-surface-container-low:var(--wy-surface-container-low-dark, #181c20);--wy-surface-container-lowest:var(--wy-surface-container-lowest-dark, #0b0f12);--wy-surface-layer-highest:var(--wy-surface-layer-highest-dark, rgba(255, 255, 255, .1490196078));--wy-surface-layer-high:var(--wy-surface-layer-high-dark, rgba(255, 255, 255, .1019607843));--wy-surface-layer:var(--wy-surface-layer-dark, rgba(255, 255, 255, .0509803922));--wy-surface-layer-low:var(--wy-surface-layer-low-dark, rgba(0, 0, 0, .2509803922));--wy-surface-layer-lowest:var(--wy-surface-layer-lowest-dark, rgba(0, 0, 0, .5019607843));--wy-warning:var(--wy-warning-dark, #e5e972);--wy-on-warning:var(--wy-on-warning-dark, #484a00);--wy-warning-container:var(--wy-warning-container-dark, #787c07);--wy-on-warning-container:var(--wy-on-warning-container-dark, #f4f87e);--wy-highlight:var(--wy-highlight-dark, #003353);--wy-on-highlight:var(--wy-on-highlight-dark, #cee5ff);--wy-link:var(--wy-primary-dark, #9bcbfa);--wy-presence-active:var(--wy-green-dark, #00a38d);--wy-shade:var(--wy-shade-dark, rgba(0, 0, 0, .5));--wy-shade-invert:var(--wy-shade-invert-dark, rgba(255, 255, 255, .25));--wy-shade-opaque:var(--wy-shade-opaque-dark, grey);--wy-blue:var(--wy-blue-dark, #b2c5ff);--wy-indigo:var(--wy-indigo-dark, #9285de);--wy-purple:var(--wy-purple-dark, #e48fd2);--wy-pink:var(--wy-pink-dark, #f58bad);--wy-red:var(--wy-red-dark, #db726b);--wy-orange:var(--wy-orange-dark, #e79b3a);--wy-yellow:var(--wy-yellow-dark, #c9cd59);--wy-green:var(--wy-green-dark, #00a38d);--wy-teal:var(--wy-teal-dark, #00a0a9);--wy-cyan:var(--wy-cyan-dark, #009dc4);--wy-gray:var(--wy-gray-dark, #909194);--wy-code-text:var(--wy-code-text-dark, #cccccc);--wy-code-variable:var(--wy-code-variable-dark, #9CDCFE);--wy-code-operator:var(--wy-code-operator-dark, #d4d4d4);--wy-code-prolog:var(--wy-code-prolog-dark, #569CD6);--wy-code-comment:var(--wy-code-comment-dark, #6a9955);--wy-code-builtin:var(--wy-code-builtin-dark, #4fc1ff);--wy-code-number:var(--wy-code-number-dark, #b5cea8);--wy-code-inserted:var(--wy-code-inserted-dark, #b5cea8);--wy-code-constant:var(--wy-code-constant-dark, #646695);--wy-code-hexcode:var(--wy-code-hexcode-dark, #646695);--wy-code-regex:var(--wy-code-regex-dark, #d16969);--wy-code-char:var(--wy-code-char-dark, #d16969);--wy-code-tag:var(--wy-code-tag-dark, #569cd6);--wy-code-attr-name:var(--wy-code-attr-name-dark, #9cdcfe);--wy-code-selector:var(--wy-code-selector-dark, #9cdcfe);--wy-code-property:var(--wy-code-property-dark, #9cdcfe);--wy-code-deleted:var(--wy-code-deleted-dark, #ce9178);--wy-code-string:var(--wy-code-string-dark, #ce9178);--wy-code-changed:var(--wy-code-changed-dark, #569cd6);--wy-code-punctuation:var(--wy-code-punctuation-dark, #D4D4D4);--wy-code-function:var(--wy-code-function-dark, #569cd6);--wy-code-keyword:var(--wy-code-keyword-dark, #C586C0);--wy-code-class-name:var(--wy-code-class-name-dark, #4ec9b0)}}`,jj=it`@property --wy-component-color{syntax:\"<color>\";inherits:true;initial-value:currentColor}@property --wy-component-background-color{syntax:\"<color>\";inherits:true;initial-value:rgba(0,0,0,0)}`,Uj=c(s=>{var e;var t;return t=(e=class extends s{constructor(...r){super(...r),Xj([jj,De])}},h(e,"t"),e),c(t,"WeavyStyles"),t},"WeavyStylesMixin"),Hj=c(s=>{var i;var t,e;return e=(i=class extends s{constructor(...n){super(...n),q(this,t),this.version=Le.version,this.whenUrl().then(()=>{this.isDestroyed||this.checkVersion()})}async checkVersion(){return x(this,t)||E(this,t,(async()=>{await this.whenUrl(),this.networkStateIsPending=!0;let n;try{if(n=await fetch(new URL("/version",this.url),await this.fetchOptions({},!1)),!n.ok)throw new Error(`Could not verify environment version. ${n.status} ${n.statusText}`,{cause:n.status});this.networkStateIsPending=!1,this.serverState="ok"}catch(o){throw this.networkStateIsPending=!1,this.serverState="unreachable",new Error("Error checking Weavy version: "+o.toString(),{cause:o.cause})}const a=await n.text();if(!this.version||!a||this.version!==a)try{const o=this.version.split(".").slice(0,2),l=a.split(".").slice(0,2);if(o[0]!==l[0])throw new Error("Major version mismatch",{cause:"major"});if(o[1]!==l[1])throw new Error("Minor version mismatch",{cause:"minor"});if(o[2]!==l[2])throw new Error("Patch version mismatch",{cause:"patch"})}catch(o){throw new Error(`Weavy version mismatch! ${Le.sourceName}@${this.version} ≠ ${this.url?.hostname}@${a} - This will likely cause errors!`,{cause:{mismatch:o.cause,client:{name:Le.sourceName,version:this.version},environment:{name:this.url?.hostname,version:a}}})}finally{E(this,t,void 0)}else console.info(`Weavy version ${this.version} ☑️`);return{client:{name:Le.sourceName,version:this.version},environment:{name:this.url?.hostname,version:a}}})()),await x(this,t)}},h(i,"e"),i),t=new WeakMap,c(e,"WeavyVersion"),e},"WeavyVersionMixin");var b$,Mp;let pz=(b$=(Mp=class extends Event{constructor(t,e,i,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=r??!1}},h(Mp,"ts"),Mp),c(b$,"s"),b$);var $$,Ap;let xr=($$=(Ap=class{constructor(t,e,i,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(n,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=n,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(n,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){const n=e;this.context=n.context,this.callback=n.callback,this.subscribe=n.subscribe??!1}else this.context=e,this.callback=i,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new pz(this.context,this.host,this.t,this.subscribe))}},h(Ap,"es"),Ap),c($$,"s"),$$);var x$,Rp;let Yj=(x$=(Rp=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:i}]of this.subscriptions)e(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:c(()=>{this.subscriptions.delete(t)},"disposer"),consumerHost:e});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},h(Rp,"is"),Rp),c(x$,"s"),x$);var k$,Ep;let Gj=(k$=(Ep=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},h(Ep,"rs"),Ep),c(k$,"e"),k$);var S$,_p;let xS=(S$=(_p=class extends Yj{constructor(t,e,i){super(e.context!==void 0?e.initialValue:i),this.onContextRequest=r=>{if(r.context!==this.context)return;const n=r.contextTarget??r.composedPath()[0];n!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,n,r.subscribe))},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;const n=new Set;for(const[a,{consumerHost:o}]of this.subscriptions)n.has(a)||(n.add(a),o.dispatchEvent(new pz(this.context,o,a,!0)));r.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Gj(this.context,this.host))}},h(_p,"ns"),_p),c(S$,"i"),S$);function wn({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(r){return i.get(this).setValue(r),t.set.call(this,r)},init(r){return i.set(this,new xS(this,{context:s,initialValue:r})),r}};{t.constructor.addInitializer((a=>{i.set(a,new xS(a,{context:s}))}));const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const a=new WeakMap;n={get(){return a.get(this)},set(o){i.get(this).setValue(o),a.set(this,o)},configurable:!0,enumerable:!0}}else{const a=r.set;n={...r,set(o){i.get(this).setValue(o),a?.call(this,o)}}}return void Object.defineProperty(t,e,n)}}}h(wn,"Yr");c(wn,"e$4");function je({context:s,subscribe:t}){return(e,i)=>{typeof i=="object"?i.addInitializer((function(){new xr(this,{context:s,callback:c(r=>{e.set.call(this,r)},"callback"),subscribe:t})})):e.constructor.addInitializer((r=>{new xr(r,{context:s,callback:c(n=>{r[i]=n},"callback"),subscribe:t})}))}}h(je,"be");c(je,"c$2");var Lp;const fz=(Lp=class extends Event{constructor(t,e,i,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=r??!1}},h(Lp,"iw"),Lp);c(fz,"ContextRequestEvent");let Kj=fz;var zp;const mz=(zp=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},h(zp,"rw"),zp);c(mz,"ContextProviderEvent");let Jj=mz;var Ip;const yz=(Ip=class extends xS{constructor(t,e,i){e.context!==void 0?super(t,e):super(t,e,i),e.context!==void 0?this._context=e.context:this._context=e,this.isAttached=!0,this.host instanceof wt||this.dispatchWhenConnected()}dispatchWhenConnected(){this.isAttached&&(this.host.isConnected?this.host.dispatchEvent(new Jj(this._context,this.host)):requestAnimationFrame(()=>this.dispatchWhenConnected()))}detachListeners(){this.isAttached=!1,this.host.removeEventListener("context-request",this.onContextRequest),this.host.removeEventListener("context-provider",this.onProviderRequest)}},h(Ip,"nw"),Ip);c(yz,"WyContextProvider");let gz=yz;const Ve=Symbol.for("weavy-client");function wz(s,t){return Pe(),new gz(s,{context:Ve,initialValue:t})}h(wz,"l0");c(wz,"createWeavyContextProvider");const Hc=W0()?wz(document.documentElement):void 0,tU=c(s=>{var i;var t,e;return e=(i=class extends s{constructor(...n){super(...n),q(this,t),this.host!==document.documentElement?(Hc?.detachListeners(),E(this,t,new gz(this.host,{context:Ve,initialValue:this}))):Hc?.setValue(this)}updateContext(){this.host!==document.documentElement?x(this,t)?.updateObservers():Hc?.updateObservers()}destroy(){super.destroy(),this.host!==document.documentElement?x(this,t)?.detachListeners():Hc?.value===this&&Hc?.setValue(void 0)}},h(i,"e"),i),t=new WeakMap,c(e,"WeavyContextProvider"),e},"WeavyContextProviderMixin");var Uv,Hv,Mn,qg,Ke;const Zg=(Ke=class{constructor(t){q(this,Uv),q(this,Hv),q(this,Mn),q(this,qg),this.weavySid=wy(),this.weavyId=`${Ke.sourceName}#${this.weavySid}`,this.cloudFilePickerUrl=Ke.defaults.cloudFilePickerUrl,this.configurationTimeout=Ke.defaults.configurationTimeout,this.disableEnvironmentImports=Ke.defaults.disableEnvironmentImports,this.gcTime=Ke.defaults.gcTime,this.scrollBehavior=Ke.defaults.scrollBehavior,this.staleTime=Ke.defaults.staleTime,this.tokenFactoryRetryDelay=Ke.defaults.tokenFactoryRetryDelay,this.tokenFactoryTimeout=Ke.defaults.tokenFactoryTimeout,E(this,Hv,new Promise(i=>{E(this,Uv,i)})),E(this,qg,!1),console.info(`${Ke.sourceName}@${Ke.version} #${this.weavySid}`),Pe(),this.host=document.documentElement;const e={};for(const i in t){const r=i;t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}e?.host&&(this.host=e.host,delete e.host),e&&Object.assign(this,e)}async whenUrl(){await x(this,Hv)}get url(){return x(this,Mn)}set url(t){var e;if(this.isDestroyed)throw new _e;try{if(typeof t=="string")t&&E(this,Mn,new URL(t,window.location.toString()));else if(t instanceof URL)E(this,Mn,t||void 0);else if(t==null)E(this,Mn,void 0);else throw new Error}catch{throw new TypeError("Invalid url")}t&&!this.disableEnvironmentImports&&globalThis.WEAVY_IMPORT_URL===void 0&&(globalThis.WEAVY_IMPORT_URL=new URL("./uikit-web/",t).href),x(this,Mn)&&((e=x(this,Uv))==null||e.call(this,x(this,Mn)))}get cachePrefix(){return`${Ke.version}:${this.url}`}async reset(){console.info(this.weavyId,"is reset")}get isDestroyed(){return x(this,qg)}destroy(){E(this,qg,!0),console.info(this.weavyId,"was destroyed")}},h(Ke,"we"),Ke);Uv=new WeakMap,Hv=new WeakMap,Mn=new WeakMap,qg=new WeakMap,c(Zg,"WeavyClient"),Zg.version="30.3.2",Zg.sourceName="@weavy/uikit-web",Zg.defaults={cloudFilePickerUrl:"https://filebrowser.weavy.io/v14/",configurationTimeout:5e3,disableEnvironmentImports:!1,gcTime:1e3*60*60*24,locale:J_,scrollBehavior:"auto",staleTime:1e3*1,tokenFactoryRetryDelay:2e3,tokenFactoryTimeout:2e4,annotations:"buttons-inline",enterToSend:"auto",reactions:"😍 😎 😉 😜 👍"};let Le=Zg;var Dp;const vz=(Dp=class extends tU(gj(mj(wj(fj(Rj(Hj(yj(Uj(Ej(Le)))))))))){},h(Dp,"aw"),Dp);c(vz,"Weavy");let Se=vz;const e4=Symbol.for("weavy-app"),Oz=Symbol.for("weavy-context-id"),bz=Symbol.for("weavy-data-blobs");var L=(s=>(s.Attachments="attachments",s.CloudFiles="cloud_files",s.ContextData="context_data",s.Comments="comments",s.Embeds="embeds",s.GoogleMeet="google_meet",s.Meetings="meetings",s.Mentions="mentions",s.MicrosoftTeams="microsoft_teams",s.Polls="polls",s.Previews="previews",s.Reactions="reactions",s.Receipts="receipts",s.Thumbnails="thumbnails",s.Typing="typing",s.Versions="versions",s.WebDAV="web_dav",s.ZoomMeetings="zoom_meetings",s))(L||{});const Cb=Symbol.for("weavy-features");var ao,Yc,zs,ll;const $z=(ll=class{constructor(t,e){q(this,ao),q(this,Yc),q(this,zs),E(this,ao,Object.keys(t)),E(this,Yc,Object.entries(t).reduce((i,[r,n])=>(n&&i.push(r),i),[])),E(this,zs,e??x(this,Yc))}features(){return x(this,ao)}supportedFeature(...t){return t.every(e=>x(this,ao).includes(e))}allowedFeatures(){return x(this,zs)}allowsFeature(...t){return t.every(e=>this.supportedFeature(e)?x(this,zs).includes(e):!1)}allowsAnyFeature(...t){return t.some(e=>this.supportedFeature(e)?x(this,zs).includes(e):!1)}setAllowedFeatures(t){return E(this,zs,typeof t=="string"?i4(t,x(this,ao)):x(this,Yc)),x(this,zs)}immutable(){const t=Pb(x(this,ao),x(this,Yc));return new ll(t,x(this,zs))}},h(ll,"mh"),ll);ao=new WeakMap,Yc=new WeakMap,zs=new WeakMap,c($z,"ComponentFeatures");let ui=$z;function i4(s,t){return s.split(" ").filter(e=>{if(e){if(t.includes(e))return!0;console.warn("Unknown feature provided:",e)}return!1})}h(i4,"Am");c(i4,"featureListFromString");function Pb(s,t){return t??=s,Object.fromEntries(s.map(e=>[e,t.includes(e)]))}h(Pb,"ly");c(Pb,"featureConfigFromList");const kS=Object.values(L),xz=Symbol.for("weavy-link");var Yv,Vp;const kz=(Vp=class{constructor(t){q(this,Yv),this.enterToSend=Le.defaults.enterToSend,this.reactions=Le.defaults.reactions,this.annotations=Le.defaults.annotations,E(this,Yv,t),Object.keys(this).forEach(e=>{e in t&&Object.assign(this,{[e]:t[e]})})}get component(){return x(this,Yv)}},h(Vp,"sw"),Vp);Yv=new WeakMap,c(kz,"WeavyComponentSettings");let y9=kz;const Sz=Symbol.for("weavy-component-settings"),Qb=Symbol.for("weavy-user");var Wp;const Cz=(Wp=class{constructor(t,e,i,r,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this._callback=(a,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=a,this.host.requestUpdate(),(!this.provided||this.subscribe)&&(this.provided=!0,this.callback&&this.callback(a,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const a=e;this.context=a.context,this.callback=a.callback,this.subscribe=a.subscribe??!1,this.ref=a.ref??t}else this.context=e,this.callback=i,this.subscribe=r??!1,this.ref=n??t;this.host.addController?.(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.ref.dispatchEvent(new Kj(this.context,this.host,this._callback,this.subscribe))}},h(Wp,"ow"),Wp);c(Cz,"ContextConsumer");let eU=Cz;var Fp;const Pz=(Fp=class{constructor(t,e,i){this.whenRef=new Promise(r=>this.resolveRef=r),t.addController(this),this.host=t,this.setRef(i),this.setContext(e)}get ref(){return this._ref}set ref(t){this._ref=t,t&&this.resolveRef?.(t)}setRef(t){this.ref=t}async setContext(t){this.whenContext=new Promise(i=>this.resolveContext=i);const e=await this.whenRef;this.context=new eU(this.host,{context:t,subscribe:!0,callback:c((i,r)=>{this.resolveContext?.(i),this.host.requestUpdate()},"callback"),ref:e}),await BS(e),this.context.dispatchRequest()}hostUpdate(){this.context?.value&&this.resolveContext?.(this.context.value)}},h(Fp,"cw"),Fp);c(Pz,"ContextController");let iU=Pz;var xt=(s=>(s.Chat="d65dd4bc-418e-403c-9f56-f9cf4da931ed",s.Comments="88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd",s.Files="523edd88-4bbf-4547-b60f-2859a6d2ddc1",s.Posts="5ebfa152-de85-48da-82dd-30a1b560c313",s.ChatRoom="edb400ac-839b-45a7-b2a8-6a01820d1c44",s.PrivateChat="7e14f418-8f15-46f4-b182-f619b671e470",s.AgentChat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(xt||{}),zr=(s=>(s.Chat="chat",s.Comments="comments",s.Files="files",s.Posts="posts",s.ChatRoom="chat_room",s.PrivateChat="private_chat",s.AgentChat="agent_chat",s))(zr||{}),Qz=(s=>(s["d65dd4bc-418e-403c-9f56-f9cf4da931ed"]="chat",s["88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd"]="comments",s["523edd88-4bbf-4547-b60f-2859a6d2ddc1"]="files",s["5ebfa152-de85-48da-82dd-30a1b560c313"]="posts",s["edb400ac-839b-45a7-b2a8-6a01820d1c44"]="chat_room",s["7e14f418-8f15-46f4-b182-f619b671e470"]="private_chat",s["2352a1c6-abc6-420e-8b85-ca7d5aed8779"]="agent_chat",s))(Qz||{}),Tz=(s=>(s.chat="d65dd4bc-418e-403c-9f56-f9cf4da931ed",s.comments="88f96a08-c6c1-4eac-a0bd-5bf8fba1a3fd",s.files="523edd88-4bbf-4547-b60f-2859a6d2ddc1",s.posts="5ebfa152-de85-48da-82dd-30a1b560c313",s.chat_room="edb400ac-839b-45a7-b2a8-6a01820d1c44",s.private_chat="7e14f418-8f15-46f4-b182-f619b671e470",s.agent_chat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(Tz||{}),Mz=(s=>(s["2352a1c6-abc6-420e-8b85-ca7d5aed8779"]="agent_chat",s))(Mz||{}),Az=(s=>(s.agent_chat="2352a1c6-abc6-420e-8b85-ca7d5aed8779",s))(Az||{}),zn=(s=>(s.None="none",s.Read="read",s.Write="write",s.Admin="admin",s))(zn||{}),yl=(s=>(s.List="list",s.Read="read",s.Create="create",s.Update="update",s.Delete="delete",s.Admin="admin",s))(yl||{}),Oi=(s=>(s.App="app",s.File="file",s.Message="message",s.User="user",s.Comment="comment",s.Post="post",s))(Oi||{});function Fy(s,t,e,i,r,n="GET"){return{queryKey:t,queryFn:c(async()=>{const a=await s.fetch(e||"/api/"+t.join("/"),{method:n,body:r});if(a.ok)return await a.json();throw new Error(`Error calling ${e||"/api/"+t.join("/")}`)},"queryFn"),...i}}h(Fy,"hd");c(Fy,"getApiOptions");const Rz=c(s=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(s,t)})):customElements.define(s,t)},"t$3"),rU={attribute:!0,type:String,converter:i0,reflect:!1,hasChanged:EP},sU=c((s=rU,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),n.set(e.name,s),i==="accessor"){const{name:a}=e;return{set(o){const l=t.get.call(this);t.set.call(this,o),this.requestUpdate(a,l,s)},init(o){return o!==void 0&&this.C(a,void 0,s,o),o}}}if(i==="setter"){const{name:a}=e;return function(o){const l=this[a];t.call(this,o),this.requestUpdate(a,l,s)}}throw Error("Unsupported decorator location: "+i)},"r$3");function b(s){return(t,e)=>typeof e=="object"?sU(s,t,e):((i,r,n)=>{const a=r.hasOwnProperty(n);return r.constructor.createProperty(n,i),a?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}h(b,"u");c(b,"n$3");function B(s){return b({...s,state:!0,attribute:!1})}h(B,"D");c(B,"r$2");const nU=c((s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e),"e$3");function Vl(s){return(t,e)=>{const{slot:i,selector:r}=s??{},n="slot"+(i?`[name=${i}]`:":not([name])");return nU(t,e,{get(){const a=this.renderRoot?.querySelector(n),o=a?.assignedElements(s)??[];return r===void 0?o:o.filter((l=>l.matches(r)))}})}}h(Vl,"Kc");c(Vl,"o$6");var qp;const Ez=(qp=class{get result(){return this._result&&this.observer?this.observer.trackResult(this._result):{isPending:!0}}constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenQueryClient=new Promise(e=>this.resolveQueryClient=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0,callback:c(t=>{t&&(this.resolveContext?.(t),this.queryClient=t.queryClient,this.resolveQueryClient?.(t.queryClient))},"callback")})}async trackQuery(t,e=!0){this.observerUnsubscribe?.();const i=await this.whenQueryClient;if(!i)throw new Error("No QueryClient provided");const r=new gL(i,t);this.observer=r,this.observerSubscribe(e)}observerSubscribe(t=!0){if(this.queryClient&&this.observer){t?this._result=this.observer.getOptimisticResult(this.observer.options):this._result=this.observer.getCurrentResult(),this.observerUnsubscribe=this.observer.subscribe(()=>{if(this.observer){const i=Wy(this.result,this.observer.getCurrentResult());i!==this._result&&(this._result=i,this.host.requestUpdate())}}),this.observer.updateResult(),this.host.requestUpdate();let e;t?e=this.observer.fetchOptimistic(this.observer.options):e=this.queryClient.getQueryCache().get(this.observer.options.queryHash)?.promise,e?.catch(()=>{}).finally(()=>{this.observer?.updateResult()})}}untrackQuery(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this._result=void 0,this.observer=void 0,this.host.requestUpdate()}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(qp,"lw"),qp);c(Ez,"QueryController");let Tr=Ez;function w0(s){return s.signal instanceof AbortSignal||typeof s.abort=="function"}h(w0,"Mp");c(w0,"hasAbort");var Zp;const _z=(Zp=class{constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenObserver=new Promise(e=>this.resolveObserver=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0})}hostUpdate(){this.context?.value&&this.resolveContext?.()}async trackMutation(t,e){if(e||(await this.whenContext,e=this.context?.value?.queryClient),!e)throw new Error("No QueryClient provided");return this.observerUnsubscribe?.(),this.observer&&(this.whenObserver=new Promise(i=>this.resolveObserver=i)),this.observer=new Gt(e,{...t}),this.observerSubscribe(),this.resolveObserver?.(this.observer),this.observer}observerSubscribe(){this.observer&&(this.result=this.observer.getCurrentResult(),this.observerUnsubscribe??=this.observer.subscribe(()=>{if(this.observer){const t=Wy(this.result,this.observer.getCurrentResult());this.result!==t&&(this.result=t,this.host.requestUpdate())}}),this.host.requestUpdate())}untrackMutation(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this.result=void 0,this.observer=void 0,this.host.requestUpdate()}async mutate(t,e){const i=await this.whenObserver,r=new AbortController;return i.mutate({...t,signal:r.signal,abort:r.abort.bind(r)},e)}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(Zp,"dw"),Zp);c(_z,"MutationController");let Fr=_z;function r4(s){if(s)return s.match(/^[0-9]+$/)?parseInt(s):s}h(r4,"Fm");c(r4,"toIntOrString");const oi=[];for(let s=0;s<256;++s)oi.push((s+256).toString(16).slice(1));function Lz(s,t=0){return(oi[s[t+0]]+oi[s[t+1]]+oi[s[t+2]]+oi[s[t+3]]+"-"+oi[s[t+4]]+oi[s[t+5]]+"-"+oi[s[t+6]]+oi[s[t+7]]+"-"+oi[s[t+8]]+oi[s[t+9]]+"-"+oi[s[t+10]]+oi[s[t+11]]+oi[s[t+12]]+oi[s[t+13]]+oi[s[t+14]]+oi[s[t+15]]).toLowerCase()}h(Lz,"y0");c(Lz,"unsafeStringify");let C$;const aU=new Uint8Array(16);function zz(){if(!C$){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");C$=crypto.getRandomValues.bind(crypto)}return C$(aU)}h(zz,"f0");c(zz,"rng");const oU=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),g9={randomUUID:oU};function Iz(s,t,e){s=s||{};const i=s.random??s.rng?.()??zz();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Lz(i)}h(Iz,"v0");c(Iz,"_v4");function Mh(s,t,e){return g9.randomUUID&&!s?g9.randomUUID():Iz(s)}h(Mh,"pl");c(Mh,"v4");function Dz(s){let t;if(s instanceof URL)t={type:"url",item:s};else if(s instanceof File)t={type:"file",item:s};else if(s instanceof Blob)t={type:"file",item:new File([s],`${Mh()}`,{type:s.type})};else if(typeof s=="string")t={type:"file",item:new File([s],`${Mh()}.data.txt`,{type:"text/plain;charset=UTF-8"})};else if(Z_(s)||n0(s))try{const e=n0(s)?s.toJSON():JSON.stringify(s,U_(),2);t={type:"file",item:new File([e],`${Mh()}.json.txt`,{type:"text/plain;charset=UTF-8"})}}catch(e){console.error("Could not serialize context data to JSON.",e)}return t}h(Dz,"g0");c(Dz,"getContextDataRef");const Tb=c((s,t=3)=>{const e=[" B"," KB"," MB"," GB"," TB"," PB"," EB"," ZB"," YB"];let i=s,r=0;for(;r<e.length-1&&i>=1024;)i=100*i/1024/100,r++;return i.toLocaleString(void 0,{maximumSignificantDigits:t})+e[r]},"fileSizeAsString");function ur(s){return s.lastIndexOf(".")===-1?".":(s.substring(s.lastIndexOf("."),s.length)||s).toLowerCase()}h(ur,"di");c(ur,"getExtension");function s4(s){switch(s){case".aac":case".aif":case".aiff":case".au":case".gsm":case".m4a":case".mid":case".midi":case".mka":case".mp3":case".oga":case".ogg":case".ra":case".ram":case".snd":case".spx":case".wav":case".wma":return!0;default:return!1}}h(s4,"Dm");c(s4,"isAudio");function Vz(s){switch(s){case".ai":case".apng":case".bmp":case".emf":case".eps":case".gif":case".heic":case".ico":case".jpg":case".jpeg":case".png":case".psd":case".svg":case".tif":case".tiff":case".webp":case".wmf":return!0;default:return!1}}h(Vz,"b0");c(Vz,"isImage");function Wz(s){switch(ur(s)){case".apng":case".bmp":case".gif":case".ico":case".jpg":case".jpeg":case".png":case".svg":case".webp":return!0;default:return!1}}h(Wz,"x0");c(Wz,"isWebImage");function n4(s){switch(s){case".3g2":case".asx":case".asf":case".avi":case".flv":case".mk3d":case".mkv":case".mov":case".mp4":case".mpeg":case".mpg":case".ogm":case".ogv":case".ogx":case".qt":case".rm":case".rv":case".smi":case".smil":case".swf":case".webm":case".wmv":case".xaml":return!0;default:return!1}}h(n4,"Vm");c(n4,"isVideo");function Fz(s){switch(s){case".markdown":case".md":return!0;default:return!1}}h(Fz,"C0");c(Fz,"isMarkdown");function a4(s){switch(s){case".htm":case".html":case".xhtml":case".xml":return!0;default:return!1}}h(a4,"Hm");c(a4,"isMarkup");function Mb(s){if(a4(s))return!0;switch(s){case".as":case".as3":case".asm":case".aspx":case".bat":case".c":case".cc":case".cmake":case".coffee":case".cpp":case".cs":case".css":case".cxx":case".diff":case".erb":case".erl":case".groovy":case".gvy":case".h":case".haml":case".hh":case".hpp":case".hxx":case".java":case".js":case".json":case".jsx":case".less":case".lst":case".m":case".make":case".ml":case".mm":case".out":case".patch":case".php":case".pl":case".plist":case".properties":case".py":case".rb":case".sass":case".scala":case".scm":case".script":case".scss":case".sh":case".sml":case".sql":case".vb":case".vi":case".vim":case".xsd":case".xsl":case".yaml":case".yml":return!0;default:return!1}}h(Mb,"dy");c(Mb,"isCode");function o4(s){if(Mb(s)||Fz(s))return!0;switch(s){case".txt":return!0;default:return!1}}h(o4,"Bm");c(o4,"isText");function vn(s){const t=ur(s);if(t==="")return{icon:"file"};if(s4(t))return{icon:"file-music",color:"indigo"};if(Vz(t))return{icon:"file-image",color:"cyan"};if(n4(t))return{icon:"file-video",color:"pink"};if(a4(t))return{icon:"file-xml",color:"purple"};if(Mb(t))return{icon:"file-code",color:"purple"};if(o4(t))return{icon:"file-document"};switch(t){case".7z":case".zip":return{icon:"file-compressed",color:"orange"};case".doc":case".docm":case".docx":case".dotm":case".dotx":return{icon:"file-word",color:"native"};case".eml":case".msg":return{icon:"email",color:""};case".xls":case".xlsm":case".xlsx":case".xltx":return{icon:"file-excel",color:"native"};case".pdf":return{icon:"file-pdf",color:"native"};case".ppt":case".pptm":case".pptx":case".potx":return{icon:"file-powerpoint",color:"native"};case".pages":return{icon:"file",color:"orange"};case".numbers":return{icon:"file",color:"green"};case".keynote":return{icon:"file",color:"blue"}}return{icon:"file"}}h(vn,"Xr");c(vn,"getIcon");function qz(s){const t=ur(s);return t===""?"none":Wz(t)?"image":Mb(t)?"code":o4(t)?"text":s4(t)?"audio":n4(t)?"video":"none"}h(qz,"$0");c(qz,"getWebPreviewFormat");function qy(s){switch(s){case"Google Drive":return"google-drive";case"Dropbox":return"dropbox";case"OneDrive":return"onedrive";case"Box":return"box";default:return""}}h(qy,"ud");c(qy,"getProvider");function Ab(s){let t="file";switch(ur(s)){case".7z":case".zip":t="archive";break;case".aac":case".aif":case".aiff":case".au":case".gsm":case".m4a":case".mid":case".midi":case".mka":case".mp3":case".oga":case".ogg":case".ra":case".ram":case".snd":case".spx":case".wav":case".wma":t="audio";break;case".c":case".cgi":case".cpp":case".cs":case".cshtml":case".css":case".html":case".java":case".js":case".json":case".less":case".php":case".pl":case".ps1":case".py":case".rb":case".rs":case".scss":case".sh":case".swift":case".sql":case".ts":case".xml":case".yaml":case".yml":t="code";break;case".doc":case".docm":case".docx":case".dotm":case".dotx":case".gdoc":case".pages":case".pdf":t="document";break;case".eml":case".msg":t="email";break;case".gslides":case".keynote":case".ppt":case".pptm":case".pptx":case".potx":t="presentation";break;case".gsheet":case".numbers":case".xls":case".xlsm":case".xlsx":case".xltx":t="spreadsheet";break;case".ai":case".apng":case".bmp":case".emf":case".eps":case".gif":case".heic":case".ico":case".jpg":case".jpeg":case".png":case".psd":case".svg":case".tif":case".tiff":case".webp":case".wmf":t="image";break;case".md":case".markdown":case".txt":t="text";break;case".3g2":case".asx":case".asf":case".avi":case".flv":case".mk3d":case".mkv":case".mov":case".mp4":case".mpeg":case".mpg":case".ogm":case".ogv":case".ogx":case".qt":case".rm":case".rv":case".smi":case".smil":case".swf":case".webm":case".wmv":case".xaml":t="video";break}return t}h(Ab,"hy");c(Ab,"getKind");function Rb(s){const t=s.target,e=t?.value.lastIndexOf(".");e===-1?t?.select():e!==void 0&&t?.setSelectionRange(0,e)}h(Rb,"uy");c(Rb,"handleSelectFilename");async function v0(s,t="SHA-256"){return await new Promise(e=>{if(s){const i=new FileReader;i.readAsArrayBuffer(s),i.onloadend=async()=>{const r=await crypto.subtle.digest(t,i.result);let n="";r&&(n=Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")),e(n)}}else e("")})}h(v0,"Ap");c(v0,"getHash");function Gv(s,t){return s.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}h(Gv,"Vu");c(Gv,"getResult");var Np;const Zz=(Np=class{constructor(t){this.alwaysUpdate=!1,t.addController(this),this.host=t,this.setContext()}async setContext(){this.whenContext=new Promise(t=>this.resolveContext=t),await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0})}hostUpdate(){this.context?.value&&this.resolveContext?.()}async trackMutationState(t,e){if(e||(await this.whenContext,e=this.context?.value?.queryClient),!e)throw new Error("No QueryClient provided");return this.mutationCacheUnsubscribe?.(),this.options=t,this.mutationCache=e.getMutationCache(),this.mutationCacheSubscribe(),this.result}mutationCacheSubscribe(){this.mutationCache&&this.options&&(this.result=Gv(this.mutationCache,this.options),this.mutationCacheUnsubscribe=this.mutationCache.subscribe(t=>{if(this.mutationCache&&this.options&&/added|removed|updated/.test(t.type)){const e=Gv(this.mutationCache,this.options);this.result!==e&&!vo(this.result,e)&&(this.result=e,this.host.requestUpdate())}}),this.host.requestUpdate())}get isMutating(){return!this.mutationCache||!this.options?.filters?0:Gv(this.mutationCache,{filters:{...this.options.filters,status:"pending"}}).length}untrackMutationState(){this.mutationCacheUnsubscribe?.(),this.mutationCacheUnsubscribe=void 0,this.result=void 0,this.options=void 0,this.mutationCache=void 0,this.host.requestUpdate()}hostConnected(){this.mutationCacheSubscribe()}hostDisconnected(){this.mutationCacheUnsubscribe?.()}},h(Np,"hw"),Np);c(Zz,"MutationStateController");let Eb=Zz;function de(s,t,e,i){const r=s.getMutationCache(),n=r.find({mutationKey:t,predicate:c(a=>a.state.variables===e,"predicate")});if(n&&n.state.context){const a={...n.state.context};i(a);const o={...n.state,context:a};n.state=o,r.notify({mutation:n,type:"updated",action:{type:"pending",context:n.state.context,variables:n.state.variables,isPaused:!1}})}}h(de,"qt");c(de,"updateMutationContext");function l4(s,t,e){const i=s.getMutationCache().find({mutationKey:t,exact:!0,predicate:e});i&&s.getMutationCache().remove(i)}h(l4,"Nm");c(l4,"removeMutation");function Nz(s,t){const e=s.getMutationCache();e.findAll({mutationKey:t,exact:!0}).forEach(i=>{e.remove(i)})}h(Nz,"k0");c(Nz,"removeMutations");const c4=c((s,t,e=0,i="application/octet-stream",r,n=Date.now())=>{const a=s&&(s instanceof URL?s.toString():URL.createObjectURL(s));return{id:n,app:{id:-1},name:t,kind:Ab(t),size:e,media_type:i,embed_url:"",preview_format:qz(t),thumbnail_url:a,preview_url:a,download_url:a,rev:-1,created_by:r,created_at:new Date().toUTCString(),is_subscribed:!1,is_trashed:!1,is_starred:!1}},"getTempFile");function h4(s){const t=s?s.reduce((e,i)=>{const r=i.context?.file;return r&&i.context?.status.progress&&r.size?{loaded:e.loaded+Math.floor(i.context.status.progress/100*r.size),total:e.total+r.size}:e},{loaded:0,total:0}):{loaded:0,total:0};return{loaded:t.loaded,total:t.total,percent:t.total>0?t.loaded/t.total*100:null}}h(h4,"Um");c(h4,"getFileMutationsTotalProgress");function O0(s){return s?s.some(t=>t.context?.status.state==="conflict")?"conflict":s.some(t=>t.status==="error")?"error":s.every(t=>t.status==="success")?"ok":"pending":"ok"}h(O0,"Ep");c(O0,"getFileMutationsTotalStatus");function SS(s){return s?.filter(t=>t.context?.status.state==="pending")||[]}h(SS,"of");c(SS,"getPendingFileMutations");function CS(s){return s?.filter(t=>t.context?.status.state==="conflict"||t.status==="error")||[]}h(CS,"cf");c(CS,"getFileMutationsByConflictOrError");function Bz(s,t){const e=s.queryClient;e.getMutationCache().findAll({mutationKey:["apps",t.id,"blobs"],exact:!0}).forEach(i=>{i.state.context?.status.state==="error"&&e.getMutationCache().remove(i)}),e.getMutationCache().findAll({mutationKey:["apps",t.id,"files"],exact:!0}).forEach(i=>{i.state.context?.status.state==="conflict"&&e.getMutationCache().remove(i)})}h(Bz,"P0");c(Bz,"removeErroredFileMutations");function b0(s,t,e){const i=s.queryClient;i.getMutationCache().findAll({mutationKey:["apps",t.id,"blobs"],exact:!0,predicate:c(r=>/error|success/.test(r.state.status)&&(!e||r.state.variables?.blob?.name===e),"predicate")}).forEach(r=>{i.getMutationCache().remove(r)}),i.getMutationCache().findAll({mutationKey:["apps",t.id,"files"],exact:!0,predicate:c(r=>/error|success/.test(r.state.status)&&(!e||r.state.variables?.blob?.name===e),"predicate")}).forEach(r=>{i.getMutationCache().remove(r)})}h(b0,"Rp");c(b0,"removeSettledFileMutations");function Xz(s,t,e){const i=s.queryClient,r=["apps",e.id,"files"];return{mutationFn:c(async({blob:n,replace:a=!1})=>{const o=await s.fetch("/api/apps/"+e.id+"/files",{method:"POST",body:JSON.stringify({blob_id:n.id,replace:a})});if(!o.ok){const l=await o.json();throw new Error(l.detail||l.title,{cause:l})}return await o.json()},"mutationFn"),mutationKey:r,onMutate:c(async n=>{await i.cancelQueries({queryKey:r,exact:!0}),jz(s,e,n.blob.name),b0(s,e,n.blob.name);let a;try{a=n.blob.thumbnail_url&&new URL(n.blob.thumbnail_url)||void 0}catch{}const o=c4(a,n.blob.name,n.blob.size,n.blob.media_type,t);return{type:n.replace?"replace":"create",file:o,status:{state:"pending"}}},"onMutate"),onSuccess:c((n,a,o)=>(de(i,r,a,l=>{l&&(l.status.state="ok",l.status.progress=void 0,l.status.text=void 0)}),i.invalidateQueries({queryKey:r})),"onSuccess"),onError(n,a,o){n?.cause?.status===409?de(i,r,a,l=>{l&&(l.status.progress=void 0,l.status.state="conflict",l.status.text=n.message)}):de(i,r,a,l=>{l&&(l.status.state="error",l.status.progress=void 0,l.status.text=n.message)})}}}h(Xz,"_0");c(Xz,"getCreateFileMutationOptions");function jz(s,t,e,i,r="blobs"){const n=s.queryClient;n.getMutationCache().findAll({mutationKey:["apps",t.id,r],exact:!0,status:"success",predicate:c(a=>a.state.data?.name===e,"predicate")}).forEach(a=>{n.getMutationCache().remove(a)})}h(jz,"S0");c(jz,"removeSuccessfulUploadBlobMutations");async function d4(s,t,e,i){const r=new FormData;r.append("blob",t);const n=await s.upload("/api/blobs","POST",r,a0.Auto,a=>{e&&e({progress:a})},i);if(!n.ok){const a=await n.json();throw new Error(a.detail||a.title,{cause:a})}return await n.json()}h(d4,"qm");c(d4,"uploadBlob");function Uz(s){return{mutationFn:c(async t=>await d4(s,t.file,t.onProgress),"mutationFn")}}h(Uz,"M0");c(Uz,"getSimpleUploadBlobMutationOptions");function _b(s,t,e,i,r="blobs"){const n=s.queryClient,a=i?["apps",e,r,i]:["apps",e,r];return{mutationFn:c(async o=>await d4(s,o.file,o.onProgress,o.signal),"mutationFn"),mutationKey:a,onMutate:c(async o=>{await n.cancelQueries({queryKey:a,exact:!0});const l=c4(o.file,o.file.name,o.file.size,o.file.type,t);o.onProgress=({progress:u})=>{de(n,a,o,p=>{p.status.state="pending",p.status.progress=u})};const d=await v0(o.file);return{type:"upload",file:l,status:{state:"pending"},sha256:d}},"onMutate"),onSuccess:c((o,l,d)=>{de(n,a,l,u=>{u.status.state="ok",u.status.progress=void 0,u.status.text=void 0})},"onSuccess"),onError(o,l,d){const u=o.cause;u&&u.status===409?de(n,a,l,p=>{p.status.state="conflict",p.status.progress=void 0,p.status.text=u.detail||u.title}):de(n,a,l,p=>{p&&(p.status.state="error",p.status.progress=void 0,p.status.text=u.detail||u.title)})}}}h(_b,"yy");c(_b,"getUploadBlobMutationOptions");var lU=Object.defineProperty,u4=c((s,t,e,i)=>{for(var r=void 0,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=a(t,e,r)||r);return r&&lU(t,e,r),r},"__decorateClass$1j"),Ng,Bg,Xg,jg,Ug,Hg,An,Bp;const Hz=(Bp=class extends wt{constructor(){super(...arguments),q(this,Ng),q(this,Bg),q(this,Xg),q(this,jg),q(this,Ug),q(this,Hg),q(this,An),this.contextId=Mh(),E(this,Bg,new Promise(t=>{E(this,Ng,t)})),E(this,jg,new Promise(t=>{E(this,Xg,t)})),E(this,Hg,new Promise(t=>{E(this,Ug,t)})),E(this,An,new Tr(this))}async whenContextId(){return await x(this,Bg)}async whenUser(){return await x(this,jg)}async whenWeavy(){return await x(this,Hg)}connectedCallback(){super.connectedCallback(),this.contextId&&this.requestUpdate("contextId"),this.user&&this.requestUpdate("user"),this.weavy&&this.requestUpdate("weavy")}async scheduleUpdate(){await Ss(this),await super.scheduleUpdate()}async willUpdate(t){var e,i,r;super.willUpdate(t),this.weavyContextConsumer??=new xr(this,{context:Ve,subscribe:!0}),this.weavyContextConsumer?.value&&this.weavy!==this.weavyContextConsumer?.value&&(this.weavy=this.weavyContextConsumer?.value),t.has("weavy")&&this.weavy&&await x(this,An).trackQuery(Fy(this.weavy,["user"])),x(this,An).result?.isPending||(this.user&&x(this,An).result.data&&this.user.id!==x(this,An).result.data.id&&(console.warn("User mismatch, resetting"),this.weavy?.reset()),this.user=x(this,An).result?.data),t.has("contextId")&&this.contextId&&(t.get("contextId")&&E(this,Bg,new Promise(n=>{E(this,Ng,n)})),(e=x(this,Ng))==null||e.call(this,this.contextId)),t.has("user")&&this.user&&(t.get("user")&&E(this,jg,new Promise(n=>{E(this,Xg,n)})),(i=x(this,Xg))==null||i.call(this,this.user)),t.has("weavy")&&this.weavy&&(t.get("weavy")&&E(this,Hg,new Promise(n=>{E(this,Ug,n)})),(r=x(this,Ug))==null||r.call(this,this.weavy))}},h(Bp,"uw"),Bp);Ng=new WeakMap,Bg=new WeakMap,Xg=new WeakMap,jg=new WeakMap,Ug=new WeakMap,Hg=new WeakMap,An=new WeakMap,c(Hz,"WeavyComponent");let Lb=Hz;u4([B()],Lb.prototype,"weavy");u4([wn({context:Oz}),B()],Lb.prototype,"contextId");u4([wn({context:Qb}),B()],Lb.prototype,"user");var cU=Object.defineProperty,hU=Object.getOwnPropertyDescriptor,Bi=c((s,t,e,i)=>{for(var r=i>1?void 0:i?hU(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&cU(t,e,r),r},"__decorateClass$1i"),Kv,Jv,tO,eO,Yg,Gg,Kg,Jg,Gc,Kc,tw,ew,Is,iw,Jc,Xp;const Yz=(Xp=class extends Lb{constructor(){super(),q(this,Kv),q(this,Jv),q(this,tO),q(this,eO),q(this,Yg),q(this,Gg),q(this,Kg),q(this,Jg),q(this,Gc),q(this,Kc),q(this,tw),q(this,ew),q(this,Is),q(this,iw),q(this,Jc),this.storage=ZP("localStorage"),this.storageLinkHandler=t=>{t.storageArea===this.storage&&t.key==="wy-link"&&t.newValue&&this.readStorageLink()},this.linkEventHandler=async t=>{!t.defaultPrevented&&t.detail.link&&(this.link&&this.link.id===t.detail.link.id&&(this.link=void 0,await this.updateComplete),this.link=t.detail.link,this.link||this.provideStorageLink(t.detail.link))},this.notificationEventConsumer=t=>{t.stopPropagation(),t.defaultPrevented||this.visibilityElement&&this.visibilityElement.isConnected&&this.visibilityElement.checkVisibility(XS)&&this.matchesLink(t.detail.link)&&t.preventDefault()},E(this,Gg,new Promise(t=>{E(this,Yg,t)})),E(this,Jg,new Promise(t=>{E(this,Kg,t)})),E(this,Kc,new Promise(t=>{E(this,Gc,t)})),E(this,ew,new Promise(t=>{E(this,tw,t)})),E(this,Is,new Map),E(this,iw,new Fr(this)),E(this,Jc,new Eb(this)),this.settings=new y9(this)}matchesLink(t){return t?.app?.type&&this.componentTypes?.includes(t.app.type)?t.agent?t.agent===this.agent:!0:!1}set link(t){const e=this._link;this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e)}get link(){return this._link}clearLink(){this.link&&(E(this,Kc,new Promise(t=>{E(this,Gc,t)})),this.link=void 0)}provideStorageLink(t){this.storage?.setItem("wy-link",btoa(JSON.stringify(t)))}readStorageLink(){if(!this.storage){console.error("Storage not available");return}const t=this.storage.getItem("wy-link");if(t)try{const e=JSON.parse(atob(t));e&&(this.link=e)}catch(e){console.error("Error parsing link",e)}}consumeStorageLink(){this.storage?.removeItem("wy-link")}get visibilityElement(){return this}set agent(t){this._agentUid=t||void 0}get agent(){return this._agentUid}set data(t){console.warn(".data property array is deprecated. Use .contextualData string instead."),E(this,Kv,t)}get data(){return x(this,Kv)}set annotations(t){E(this,Jv,t)}get annotations(){return x(this,Jv)??this.weavy?.annotations??Le.defaults.annotations}set enterToSend(t){E(this,tO,t)}get enterToSend(){return x(this,tO)??this.weavy?.enterToSend??Le.defaults.enterToSend}set reactions(t){E(this,eO,t)}get reactions(){return x(this,eO)??this.weavy?.reactions??Le.defaults.reactions}async whenContextDataBlobs(){return await x(this,Gg)}async whenComponentFeatures(){return await x(this,Jg)}async whenLink(){return await x(this,Kc)}async whenSettings(){return await x(this,ew)}connectedCallback(){super.connectedCallback(),document.addEventListener("wy-link",this.linkEventHandler),window.addEventListener("storage",this.storageLinkHandler),this.componentFeatures&&this.requestUpdate("componentFeatures"),this.contextDataBlobs&&this.requestUpdate("contextDataBlobs"),this.link&&this.requestUpdate("link"),this.settings&&this.requestUpdate("settings")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("wy-link",this.linkEventHandler),window.removeEventListener("storage",this.storageLinkHandler),this.weavy?.host.removeEventListener("wy-notification",this.notificationEventConsumer,{capture:!0})}async willUpdate(t){var e,i,r,n;await super.willUpdate(t),t.has("bot")&&typeof this.bot=="string"&&console.error(`Using .bot property is deprecated. Use .agent = "${this.bot}"; instead`);const a=Object.keys(this.settings);if((t.has("weavy")||a.find(o=>t.has(o)))&&(this.settings=new y9(this)),t.has("features")&&this.componentFeatures&&(this.componentFeatures.setAllowedFeatures(this.features),this.componentFeatures instanceof ui&&(this.componentFeatures=this.componentFeatures.immutable())),(t.has("weavy")||t.has("contextId")||t.has("user")||t.has("componentFeatures"))&&this.weavy&&this.contextId&&this.user&&this.componentFeatures?.allowsFeature(L.ContextData)&&(await x(this,iw).trackMutation(_b(this.weavy,this.user,this.contextId,void 0,"data")),await x(this,Jc).trackMutationState({filters:{mutationKey:["apps",this.contextId,"data"],exact:!0}},this.weavy.queryClient)),t.has("contextualData")||t.has("data")||t.has("componentFeatures")){const o=this.contextualData?[this.contextualData]:this.data?this.data:[],l=x(this,Is);if(E(this,Is,new Map),o.forEach(d=>{const u=l.get(d);if(u)x(this,Is).set(d,u);else{const p=Dz(d);p&&x(this,Is).set(d,p)}}),x(this,Is)&&this.componentFeatures?.allowsFeature(L.ContextData)){for(const f of Array.from(x(this,Is).values()))if(f.type==="file"){const y=await v0(f.item);await B_(x(this,Jc).result??[],async g=>(g.context?.sha256??await v0(g.variables?.file))===y)||await x(this,iw).mutate({file:f.item})}const d=x(this,Jc).result,u=d?.some(f=>f.status==="pending"),p=d?.map(f=>f.data?.id).filter(f=>f).reverse()??[];u||(this.contextDataBlobs=p)}else this.contextDataBlobs=[]}(t.has("componentTypes")||t.has("agent"))&&this.componentTypes&&this.readStorageLink(),t.has("link")&&this.link&&(console.info("Opening notification link"),this.consumeStorageLink()),t.has("contextDataBlobs")&&this.contextDataBlobs&&(t.get("contextDataBlobs")&&E(this,Gg,new Promise(o=>{E(this,Yg,o)})),(e=x(this,Yg))==null||e.call(this,this.contextDataBlobs)),t.has("componentFeatures")&&this.componentFeatures&&(t.get("componentFeatures")&&E(this,Jg,new Promise(o=>{E(this,Kg,o)})),(i=x(this,Kg))==null||i.call(this,this.componentFeatures)),t.has("link")&&this.link&&(t.get("link")&&E(this,Kc,new Promise(o=>{E(this,Gc,o)})),(r=x(this,Gc))==null||r.call(this,this.link)),t.has("settings")&&this.settings&&(t.get("settings")&&E(this,ew,new Promise(o=>{E(this,tw,o)})),(n=x(this,tw))==null||n.call(this,this.settings)),t.has("weavy")&&this.weavy&&this.weavy.host.addEventListener("wy-notification",this.notificationEventConsumer,{capture:!0})}},h(Xp,"pw"),Xp);Kv=new WeakMap,Jv=new WeakMap,tO=new WeakMap,eO=new WeakMap,Yg=new WeakMap,Gg=new WeakMap,Kg=new WeakMap,Jg=new WeakMap,Gc=new WeakMap,Kc=new WeakMap,tw=new WeakMap,ew=new WeakMap,Is=new WeakMap,iw=new WeakMap,Jc=new WeakMap,c(Yz,"WeavyTypeComponent");let We=Yz;Bi([wn({context:bz}),B()],We.prototype,"contextDataBlobs",2);Bi([wn({context:Cb}),B()],We.prototype,"componentFeatures",2);Bi([wn({context:Sz}),B()],We.prototype,"settings",2);Bi([wn({context:xz})],We.prototype,"_link",2);Bi([b({type:Object})],We.prototype,"link",1);Bi([B()],We.prototype,"componentTypes",2);Bi([b()],We.prototype,"features",2);Bi([b({type:String})],We.prototype,"agent",1);Bi([b({attribute:!0,type:String})],We.prototype,"contextualData",2);Bi([b({attribute:!0,type:String,converter:{fromAttribute(s){return N_(s)}}})],We.prototype,"data",1);Bi([b({type:String})],We.prototype,"annotations",1);Bi([b({type:String})],We.prototype,"enterToSend",1);Bi([b({type:String})],We.prototype,"reactions",1);Bi([b()],We.prototype,"bot",2);const Gz=new Map(DP(Qz)),Kz=new Map(DP(Tz)),$0=new Map(Object.entries(Mz));new Map(Object.entries(Az));var dU=Object.defineProperty,uU=Object.getOwnPropertyDescriptor,Wl=c((s,t,e,i)=>{for(var r=i>1?void 0:i?uU(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&dU(t,e,r),r},"__decorateClass$1h");const Xn="unknown";var rw,sw,oo,jp;const Jz=(jp=class extends We{constructor(){super(...arguments),q(this,rw),q(this,sw),q(this,oo),this.appSubscribeMutation=new Fr(this),E(this,sw,new Promise(t=>{E(this,rw,t)})),E(this,oo,new Tr(this))}reset(){this.app&&(this.app=void 0),this._appName!==this._initialAppName&&(this._appName=this._initialAppName)}matchesLink(t){return t?.app?.type&&!this.appType&&this.componentTypes?.includes(t.app.type)?t.agent?t.agent===this.agent:!0:!!(t&&t.app&&this.appType!==Xn&&(typeof this.uid=="string"&&t.app?.uid===this.uid||typeof this.uid=="number"&&t.app?.id===this.uid||!this.uid&&this.app&&t.app.id===this.app.id))}set link(t){const e=this._link;!this.uid&&this.appType&&this.appType!==Xn?this.whenApp().then(()=>{this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e)}):(this._link=this.matchesLink(t)?t:void 0,this.requestUpdate("link",e))}get link(){return this._link}set name(t){this._initialAppName=t,this._appName=t}get name(){return this._appName}async subscribe(t=!0){if(!this.uid)throw new Error(`Cannot ${t?"subscribe":"unsubscribe"} without a uid.`);await this.whenApp(),this.app?.id&&this.appSubscribeMutation.mutate({subscribe:t})}async whenApp(){return await x(this,sw)}connectedCallback(){super.connectedCallback(),this.app&&this.requestUpdate("app")}async willUpdate(t){var e;if(await super.willUpdate(t),t.has("autoUid")&&typeof this.autoUid=="string"&&(console.error(`Using .autoUid property is deprecated. Use .generateUid = "${this.autoUid}"; instead`),this.generateUid=this.autoUid),(t.has("generateUid")||t.has("user")||t.has("agent"))&&this.generateUid&&this.user&&(this.appType&&$0.has(this.appType)&&this.agent||this.appType&&!$0.has(this.appType))){const r=[this.generateUid];this.agent&&r.push(this.agent),this.user&&r.push(this.user.uid||this.user.id),this.uid=r.join("-")}const i=this.name;if((t.has("appType")||t.has("uid")||t.has("agent")||t.has("weavy"))&&this._appName!==this._initialAppName&&(this._appName=this._initialAppName,this.requestUpdate("name",i)),t.has("appType")||t.has("uid")||t.has("agent")||t.has("name")||t.has("weavy"))if(this.appType&&this.uid&&this.weavy){const r=this.name?{name:this.name}:void 0,n=this.agent?[this.agent]:void 0;await x(this,oo).trackQuery(tI(this.weavy,this.uid,this.appType,n,r))}else x(this,oo).untrackQuery();if(x(this,oo).result?.isPending||(this.app=x(this,oo).result?.data,this.app?.name&&this._appName!==this.app.name&&(this.name=this.app.name,this.requestUpdate("name",i))),t.has("uid")&&(this.uid||t.get("uid"))&&this.uid!==t.get("uid")&&this.clearLink(),!this.link&&(t.has("uid")&&this.uid||t.has("app")&&this.app)&&this.appType&&this.appType!==Xn&&this.readStorageLink(),t.has("app")&&this.app){const r=new CustomEvent("wy-app",{bubbles:!1,composed:!0,detail:{app:this.app}});this.dispatchEvent(r)}t.has("app")&&this.app&&(t.get("app")&&E(this,sw,new Promise(r=>{E(this,rw,r)})),(e=x(this,rw))==null||e.call(this,this.app)),(t.has("weavy")||t.has("app"))&&this.weavy&&this.app&&this.appSubscribeMutation.trackMutation(iI(this.weavy,this.app))}},h(jp,"yw"),jp);rw=new WeakMap,sw=new WeakMap,oo=new WeakMap,c(Jz,"WeavyAppComponent");let Xi=Jz;Wl([wn({context:e4}),B()],Xi.prototype,"app",2);Wl([b({type:Object})],Xi.prototype,"link",1);Wl([B()],Xi.prototype,"appType",2);Wl([b()],Xi.prototype,"generateUid",2);Wl([b({converter:r4})],Xi.prototype,"uid",2);Wl([b({type:String})],Xi.prototype,"name",1);Wl([b()],Xi.prototype,"autoUid",2);function tI(s,t,e=Xn,i,r){return{queryKey:["apps",t],queryFn:c(async()=>{const n=[];e===Xn||typeof t=="number"?n.push(s.fetch(`/api/apps/${t}`)):i?.length?(n.push(s.fetch(`/api/apps/${t}`)),n.push(s.fetch("/api/apps",{method:"POST",body:JSON.stringify({type:e,members:i,uid:t,...r})}))):n.push(s.fetch(`/api/apps/${t}`,{method:"PUT",body:JSON.stringify({type:e,...r})}));const a=(await Promise.allSettled(n)).findLast(l=>l.status==="fulfilled"&&l.value?.ok),o=a?.status==="fulfilled"&&a.value;if(o)return await o.json();throw new Error(`Error getting or creating app ${t}`)},"queryFn")}}h(tI,"I0");c(tI,"getOrCreateAppOptions");function eI(s){return{mutationFn:c(async({name:t,members:e,type:i,uid:r})=>await(await s.fetch("/api/apps",{method:"POST",body:JSON.stringify({name:t,members:e,type:i,uid:r})})).json(),"mutationFn"),onSettled:c(async()=>{await s.queryClient.invalidateQueries({queryKey:["apps"]})},"onSettled")}}h(eI,"F0");c(eI,"getCreateAppMutationOptions");function p4(s){return new Gt(s.queryClient,eI(s))}h(p4,"jm");c(p4,"getCreateAppMutation");function iI(s,t){const e=s.queryClient,i=["apps",t.uid||t.id];return{mutationFn:c(async({subscribe:r})=>{if(t.id>=1){const n=await s.fetch(`/api/apps/${t.id}/${r?"subscribe":"unsubscribe"}`,{method:"POST"});if(!n.ok)throw await n.json()}else throw new Error(`Could not subscribe to app ${t.uid||t.id}.`)},"mutationFn"),onMutate:c(r=>{let n;return e.setQueryData(i,a=>(n=a.is_subscribed,{...a,is_subscribed:r.subscribe})),{previousSubscribe:n,subscribe:r.subscribe}},"onMutate"),onError(r,n,a){a&&a.previousSubscribe!==void 0&&e.setQueryData(i,o=>({...o,is_subscribed:a?.previousSubscribe}))}}}h(iI,"D0");c(iI,"getAppSubscribeMutationOptions");function rI(s,t=[xt.ChatRoom,xt.PrivateChat],e){const i=new URLSearchParams({count_only:"true",unread:"true",uid:"false"});e&&i.append("member",e),t?.forEach(n=>i.append("type",n));const r=`/api/apps?${i.toString()}`;return Fy(s,["apps","unread",t,e],r)}h(rI,"V0");c(rI,"getAppsUnreadOptions");function sI(s,t={},e,i,r,n,a){return{...t,initialPageParam:0,queryKey:["apps","list",e,i,n,a],queryFn:c(async o=>{const l=new URLSearchParams;i&&l.append("member",i),o.pageParam&&typeof o.pageParam=="number"&&l.append("skip",o.pageParam?.toString()),e?.forEach(f=>l.append("type",f)),l.append("order_by",n);const d=r?.();d&&l.append("q",d),l.append("uid","false");const u=`/api/apps?${l.toString()}`,p=await(await s.fetch(u)).json();return p.data=p.data||[],p},"queryFn"),getNextPageParam:c(o=>{if(o.end&&o?.end<o?.count)return o.end},"getNextPageParam")}}h(sI,"H0");c(sI,"getAppListOptions");var bi=(s=>(s.Default="",s.Select="select",s.Star="star",s.Unstar="unstar",s.Subscribe="subscribe",s.Unsubscribe="unsubscribe",s.Pin="pin",s.Unpin="unpin",s.Download="download",s.Preview="preview",s))(bi||{}),Up;const nI=(Up=class{get weavy(){return this.weavyContext?.value}constructor(t){t.addController(this),this.host=t,this.whenWeavyContext=new Promise(e=>this.resolveWeavyContext=e),this.setContexts()}async setContexts(){await Ss(this.host),this.weavyContext=new xr(this.host,{context:Ve,subscribe:!0})}dispatchActionEvent(t){const e=new CustomEvent("wy-action",{detail:{action:bi.Select,app:t},bubbles:!0,composed:!0});return this.host.dispatchEvent(e)}async initMutation(){if(!this.addConversationMutation){const t=await this.whenWeavyContext;this.addConversationMutation=p4(t)}return this.addConversationMutation}async create(t=[]){const e=await this.initMutation(),i=this.agent??this.host.agent,r=i?{members:[i],type:zr.AgentChat}:{members:t,type:t.length===1?zr.PrivateChat:zr.ChatRoom},n=await e.mutate(r);return this.dispatchActionEvent(n),n}hostUpdate(){this.weavyContext?.value&&this.resolveWeavyContext?.(this.weavyContext?.value)}},h(Up,"ww"),Up);c(nI,"CreateConversationController");let zb=nI;var nw,Hp;const aI=(Hp=class{constructor(t){q(this,nw,!1),t.addController(this),this.host=t,t.addEventListener("dragstart",()=>this.isDragActive=!0),t.addEventListener("dragenter",()=>this.isDragActive=!0),t.addEventListener("dragover",e=>{e.preventDefault(),this.isDragActive=!0}),t.addEventListener("dragleave",()=>this.isDragActive=!1),t.addEventListener("dragend",()=>this.isDragActive=!1),t.addEventListener("drop",e=>this.handleDrop(e))}get isDragActive(){return x(this,nw)}set isDragActive(t){x(this,nw)!==t&&(E(this,nw,t),this.host.requestUpdate())}handleDrop(t){t.preventDefault();const e=[];t.dataTransfer?.items?[...t.dataTransfer.items].forEach(i=>{if(i.kind==="file"){const r=i.getAsFile();r?e.push(r):console.error("Could not add file")}}):t.dataTransfer?.files&&[...t.dataTransfer.files].forEach(i=>{e.push(i)}),e.length&&this.dispatchUploadFiles(e),this.isDragActive=!1}dispatchUploadFiles(t){const e=new CustomEvent("drop-files",{detail:{files:t}});return this.host.dispatchEvent(e)}hostDisconnected(){}},h(Hp,"fw"),Hp);nw=new WeakMap,c(aI,"DropZoneController");let oI=aI;function Sw(s,t){Pe();const e=wo({},window.history.state,!0);if(!e.weavy||!e.weavy[s]||!Object.hasOwn(e.weavy[s],t))throw new Error("Property not found");return e.weavy[s][t]}h(Sw,"Fd");c(Sw,"getBrowserStateProperty");function x0(s,t,e="push",i){if(Pe(),t){const r=wo({},window.history.state,!0);r.weavy??={},r.weavy[s]=t,i=i&&String(i)||window.location.href;try{e==="replace"?window.history.replaceState(r,"",i):window.history.pushState(r,"",i)}catch(n){console.warn("history: Could not push history state.",n,t)}}}h(x0,"Tp");c(x0,"setBrowserState");function lI(s,t,e){Pe();const i=`${typeof s}:${t}`;e.forEach(r=>{try{const n=Sw(i,r),a=s[r];f4(a,n)&&(s[r]=n)}catch{}})}h(lI,"B0");c(lI,"restoreHistoryProperties");function k0(s,t,e,i="push"){Pe();const r=`${typeof s}:${t}`,n={};e.forEach(a=>{n[a]=s[a]}),x0(r,n,i)}h(k0,"Lp");c(k0,"pushHistoryProperties");function cI(s,t,e){k0(s,t,e,"replace")}h(cI,"N0");c(cI,"updateHistoryProperties");function f4(s,t){return s&&t&&(nn(s)||nn(t))?s&&Object.hasOwn(s,"id")||t&&Object.hasOwn(t,"id")?s.id!==t.id:!vo(s,t):s!==t}h(f4,"Wm");c(f4,"itemHasChanged");var Yp;const pU=(Yp=class{constructor(t,e,i){if(this._backCount=0,this.restoreHistory=r=>{if(this.prefixKey&&this.properties){lI(this.host,this.prefixKey,this.properties);try{this._backCount=Sw(this.prefixKey,"_backCount")||0}catch{this._backCount=0}this.updatePrevPropertyValues()}},t.addController(this),this.host=t,i&&(this.properties=i),e){this.prefixKey=e;try{this._backCount=Sw(this.prefixKey,"_backCount")||this._backCount}catch{}}}get hasBackNavigation(){return this._backCount>0}back(){window.history.back()}backAll(){window.history.go(this._backCount*-1)}observe(t,e){if(this.properties=t,e){this.prefixKey=e;try{this._backCount=Sw(this.prefixKey,"_hasBack")||this._backCount}catch{}}}pushCurrentState(){this.prefixKey&&(k0(this.host,this.prefixKey,this.properties),this._backCount++,x0(this.prefixKey,{_backCount:this._backCount},"replace"))}updatePrevPropertyValues(){this.properties&&this.properties.forEach(t=>{this.prevPropertyValues??={};const e=this.host[t];this.prevPropertyValues[t]!==e&&(this.prevPropertyValues[t]=e&&JSON.parse(JSON.stringify(e)))})}hostConnected(){window.addEventListener("popstate",this.restoreHistory)}hostUpdated(){this.prefixKey&&this.properties&&(this.prevPropertyValues?this.properties.some(t=>{const e=this.prevPropertyValues?.[t],i=this.host[t];return f4(e,i)})&&(k0(this.prevPropertyValues,this.prefixKey,this.properties),this._backCount++,x0(this.prefixKey,{_backCount:this._backCount},"replace")):this.prevPropertyValues={},cI(this.host,this.prefixKey,this.properties),this.updatePrevPropertyValues())}hostDisconnected(){window.removeEventListener("popstate",this.restoreHistory)}},h(Yp,"mw"),Yp);c(pU,"HistoryController");var Gp;const hI=(Gp=class{get result(){return this._result&&this.observer?this.observer.trackResult(this._result):this.observer?.getCurrentResult()??{isPending:!0}}constructor(t){t.addController(this),this.host=t,this.whenContext=new Promise(e=>this.resolveContext=e),this.whenQueryClient=new Promise(e=>this.resolveQueryClient=e),this.setContext()}async setContext(){await Ss(this.host),this.context=new xr(this.host,{context:Ve,subscribe:!0,callback:c(t=>{t&&(this.resolveContext?.(t),this.queryClient=t.queryClient,this.resolveQueryClient?.(t.queryClient))},"callback")})}async trackInfiniteQuery(t,e=!0){this.observerUnsubscribe?.();const i=await this.whenQueryClient;if(!i)throw new Error("No QueryClient provided");const r=new Cj(i,t);this.observer=r,this.observerSubscribe(e)}observerSubscribe(t=!0){if(this.queryClient&&this.observer){t?this._result=this.observer.getOptimisticResult(this.observer.options):this._result=this.observer.getCurrentResult(),this.observerUnsubscribe=this.observer.subscribe(()=>{if(this.observer){const i=Wy(this.result,this.observer.getCurrentResult());i!==this._result&&(this._result=i,this.host.requestUpdate())}}),this.observer.updateResult(),this.host.requestUpdate();let e;t?e=this.observer.fetchOptimistic(this.observer.options):e=this.queryClient.getQueryCache().get(this.observer.options.queryHash)?.promise,e?.catch(()=>{}).finally(()=>{this.observer?.updateResult()})}}untrackInfiniteQuery(){this.observerUnsubscribe?.(),this.observerUnsubscribe=void 0,this._result=void 0,this.observer=void 0,this.host.requestUpdate()}hostConnected(){this.observerSubscribe()}hostDisconnected(){this.observerUnsubscribe?.()}},h(Gp,"vw"),Gp);c(hI,"InfiniteQueryController");let Fl=hI;function S0(s,t=!1){for(s&&!t&&(s=s.nextElementSibling);s;){if(!(s instanceof HTMLElement))continue;const e=getComputedStyle(s);if(e.display!=="none"){if(e.display==="contents"){if(s.shadowRoot&&s.shadowRoot.firstElementChild instanceof HTMLElement){const i=S0(s.shadowRoot.firstElementChild,!0);if(i)return i}if(s.firstElementChild instanceof HTMLElement){const i=S0(s.firstElementChild,!0);if(i)return i}}if(/absolute|sticky|fixed/.test(e.position)===!1)return s;s=s.nextElementSibling}}return null}h(S0,"Op");c(S0,"getNextPositionedChild");function Q1(s,t=!1){if(Pe(),s){let e=getComputedStyle(s);const i=e.position==="absolute",r=t?/(auto|scroll|overlay|hidden)/:/(auto|overlay|scroll)/;if(e.position==="fixed"&&document.scrollingElement)return document.scrollingElement;for(let n=s;n=n.parentElement||n.parentNode||n.host;)if(n instanceof Element&&(e=getComputedStyle(n),!(i&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX)))return n}return document.scrollingElement||s}h(Q1,"$h");c(Q1,"getScrollParent");function dI(s){if(s&&s.isConnected){const t=Q1(s);return t.clientHeight!==t.scrollHeight}return!1}h(dI,"U0");c(dI,"hasScroll");function uI(s,t=32){if(s){const e=Q1(s);return Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)<t}return!1}h(uI,"q0");c(uI,"isParentAtBottom");async function pI(s,t=!1){if(s){const e=Q1(s);Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)>1&&(t?e.scrollTo({top:e.scrollHeight,left:0,behavior:"smooth"}):e.scrollTop=e.scrollHeight),await new Promise(i=>{let r=e.scrollTop;const n=c(()=>{t&&e.scrollTop===r&&(e.scrollTop=e.scrollHeight),r=e.scrollTop,Math.abs(e.scrollTop+e.clientHeight-e.scrollHeight)>1?requestAnimationFrame(n):i(void 0)},"scrollCheck");requestAnimationFrame(n)})}}h(pI,"j0");c(pI,"scrollParentToBottom");const fU=0,mU=void 0;function fI(s,t,e=!1){Pe(),t??=c(()=>Promise.reject(new Error("No scroll function defined")),"whenNext");const i=e?Q1(s):document.documentElement,r=i===document.documentElement?document:i;let n=!1;const a=new IntersectionObserver(o=>{o.forEach(l=>{if(l.isIntersecting&&!n)if(n=!0,e&&i&&r instanceof HTMLElement){const d=S0(l.target)||l.target,u=i.scrollHeight,p=d.offsetTop,f=c(()=>{queueMicrotask(()=>{if(u!==i.scrollHeight){if(d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)}else queueMicrotask(()=>{if(u!==i.scrollHeight){if(d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)}else requestAnimationFrame(()=>{if(a.takeRecords().length&&d?.isConnected){const y=d.offsetTop-p;i.scrollTop+=y}requestAnimationFrame(()=>n=!1)})})})},"afterNext");t().then(f)}else t().then(()=>{requestAnimationFrame(()=>n=!1)})})},{root:r,threshold:fU,rootMargin:mU});return a.observe(s),a}h(fI,"Q0");c(fI,"createScroller");var Kp;const mI=(Kp=class{constructor(t,e=!1){this.reverse=!1,this.isObservePending=!1,t.addController(this),this.host=t,this.reverse=e}observe(t,e){t&&e&&!t.isLoading&&!this.isObservePending&&(this.isObservePending=!0,requestAnimationFrame(()=>{this.loadMoreRefElement=e,this.scroller?.disconnect(),this.scroller=fI(e,async()=>{t.hasNextPage&&!t.isFetching&&(await t.fetchNextPage({cancelRefetch:!1}),this.reverse&&await this.host.updateComplete)},this.reverse),this.isObservePending=!1}))}hostConnected(){this.loadMoreRefElement&&this.scroller?.observe(this.loadMoreRefElement)}hostDisconnected(){this.scroller?.disconnect()}},h(Kp,"gw"),Kp);c(mI,"InfiniteScrollController");let ql=mI;var Jp;const yI=(Jp=class extends ql{constructor(t){super(t,!0)}},h(Jp,"bw"),Jp);c(yI,"ReverseInfiniteScrollController");let yU=yI;var Rn,th,tf;const gI=(tf=class{constructor(t){if(q(this,Rn),q(this,th),E(this,Rn,new Map),this.keyPrefix="WEAVY_OFFLINE_CACHE",t)E(this,th,t);else try{Pe(),E(this,th,window.sessionStorage)}catch{console.warn("Session storage not available.")}}resetPersistPropertiesCache(){x(this,Rn).clear()}getStorageItem(t,e){const i=x(this,th)?.getItem(`${t}-${e.toString()}`);if(i)return JSON.parse(i)}setStorageItem(t,e,i){const r=JSON.stringify(i);r&&x(this,th)?.setItem(`${t}-${e.toString()}`,r)}persistProperties(t,e,i,r,n){const a=`${this.keyPrefix}:${r?`${r}:`:""}${typeof t}:${e}`,o=new Map;for(const l of i){if(!x(this,Rn).has(l.name)){const d=this.getStorageItem(a,l.name);d&&(l.override||!t[l.name])&&(o.set(l.name,t[l.name]),t[l.name]=d),x(this,Rn).set(l.name,d)}if(n?.(o),t[l.name]!==x(this,Rn).get(l.name)){const d=t[l.name];x(this,Rn).set(l.name,d),this.setStorageItem(a,l.name,d)}}}},h(tf,"xw"),tf);Rn=new WeakMap,th=new WeakMap,c(gI,"PersistStorageCache");let gU=gI;var eh,aw,ef;const wI=(ef=class{constructor(t){q(this,eh),q(this,aw),E(this,eh,""),this.properties=[],this.initialProperties=new Map,this.persistStorageCache=new gU,t.addController(this),this.host=t}get prefixKey(){return x(this,eh)}set prefixKey(t){t!==x(this,eh)&&(this.persistStorageCache.resetPersistPropertiesCache(),E(this,eh,t),this.host.requestUpdate())}get cachePrefix(){return x(this,aw)}set cachePrefix(t){t!==x(this,aw)&&(this.persistStorageCache.resetPersistPropertiesCache(),E(this,aw,t),this.host.requestUpdate())}observe(t,e,i,r){this.properties=t,this.callback=r;const n=!!(this.prefixKey&&this.prefixKey!==e||this.cachePrefix&&this.cachePrefix!==i);this.properties.forEach(a=>{n&&this.initialProperties.has(a.name)?this.host[a.name]=this.initialProperties.get(a.name):this.initialProperties.has(a.name)||this.initialProperties.set(a.name,this.host[a.name])}),e&&(this.prefixKey=e),i&&(this.cachePrefix=i)}hostUpdate(){this.prefixKey&&this.properties&&this.host.weavy&&this.persistStorageCache.persistProperties(this.host,this.prefixKey,this.properties,this.cachePrefix?`${this.host.weavy.cachePrefix}:${this.cachePrefix}`:this.host.weavy.cachePrefix,this.callback)}},h(ef,"Cw"),ef);eh=new WeakMap,aw=new WeakMap,c(wI,"PersistStateController");let T1=wI;var rf;const wU=(rf=class{constructor(t){this.observers=[],this.conditions={},this.resizer=new ResizeObserver(e=>{let i=!1;for(const r of e)i=this.checkConditions(r)||i;i&&this.host.requestUpdate()}),t.addController(this),this.host=t}checkConditions(t){let e=!1;return this.observers.forEach(i=>{if(t.target===i.target){const r=this.conditions[i.name],n=i.condition(t);r!==n&&(this.conditions[i.name]=n,e=!0)}}),e}observe(t){const e=t.target,i=e.getBoundingClientRect();this.observers.push(t),this.resizer.observe(e),this.checkConditions({contentBoxSize:[{inlineSize:e.clientWidth,blockSize:e.clientHeight}],borderBoxSize:[{inlineSize:i.width,blockSize:i.height}],devicePixelContentBoxSize:[{inlineSize:i.width*window.devicePixelRatio,blockSize:i.height*window.devicePixelRatio}],contentRect:i,target:e})}reset(){this.conditions={},this.observers.length=0,this.resizer.disconnect()}hostConnected(){this.observers.forEach(t=>{this.resizer.observe(t.target)})}hostDisconnected(){this.resizer.disconnect()}},h(rf,"$w"),rf);c(wU,"ResizeController");var sf;const vI=(sf=class{constructor(t,e){this.additionalTargets=new Set,this.setExportParts=i=>{(!this.host.hasAttribute("exportparts")||this.shadowParts)&&(this.shadowParts??=new Set,i.forEach(r=>{r.part.forEach(n=>this.shadowParts?.add(n)),r.getAttribute("exportparts")?.split(", ").forEach(n=>this.shadowParts?.add(n))}),this.shadowParts.size&&this.host.setAttribute("exportparts",Array.from(this.shadowParts.values()).join(", ")))},t.addController(this),this.host=t,this.addLocalName=e}addPartsFrom(t){t&&!this.additionalTargets.has(t)&&(this.setExportParts([t]),this.observer?.observe(t,{attributeFilter:["part","exportparts"]}),this.additionalTargets.add(t))}async hostConnected(){if(await this.host.updateComplete,$k(this.host)&&this.host.shadowRoot){const t=Array.from(this.host.shadowRoot.querySelectorAll("[part], [exportparts]"));this.setExportParts(t),this.observer=new MutationObserver(e=>{const i=e.flatMap(r=>r.type==="attributes"?[r.target]:Array.from(r.addedNodes)).filter(r=>r instanceof Element);this.setExportParts(i)}),this.observer.observe(this.host.shadowRoot,{subtree:!0,childList:!0,attributeFilter:["part","exportparts"]}),Array.from(this.additionalTargets).forEach(e=>{this.observer?.observe(e,{attributeFilter:["part","exportparts"]})})}}hostUpdated(){$k(this.host)&&this.addLocalName!==!1&&!this.host.part.contains(this.host.localName)&&(this.addLocalName||getComputedStyle(this.host).display!=="contents")&&this.host.part.add(this.host.localName)}hostDisconnected(){this.observer?.disconnect()}},h(sf,"kw"),sf);c(vI,"ShadowPartsController");let rt=vI;var nf;const OI=(nf=class{constructor(t){this.delay=NaN,this.sleep=!1,t.addController(this),this.host=t}createObserver(t){this.scrollObserver?.disconnect(),this.swipeElement=t,this.scrollObserver=new IntersectionObserver(e=>{e.forEach(async i=>{i.isIntersecting&&!this.sleep&&i.intersectionRatio>=1&&(this.sleep=!0,Number.isNaN(this.delay)||await new Promise(r=>{setTimeout(r,this.delay)}),i.target===this.prevElement&&this.whenPrev&&await this.whenPrev(),i.target===this.nextElement&&this.whenNext&&await this.whenNext(),await this.host.updateComplete)})},{root:t,threshold:1,rootMargin:"0px"})}observe(t,e){this.prevElement&&(this.scrollObserver?.unobserve(this.prevElement),this.prevElement=void 0),this.nextElement&&(this.scrollObserver?.unobserve(this.nextElement),this.nextElement=void 0),t&&(this.scrollObserver?.observe(t),this.prevElement=t),e&&(this.scrollObserver?.observe(e),this.nextElement=e),this.sleep=!1}clearObserver(){this.prevElement=void 0,this.nextElement=void 0,this.scrollObserver?.disconnect(),this.sleep=!1}hostConnected(){this.scrollObserver&&(this.prevElement&&this.scrollObserver.observe(this.prevElement),this.nextElement&&this.scrollObserver.observe(this.nextElement),this.sleep=!1)}hostDisconnected(){this.scrollObserver?.disconnect()}},h(nf,"Pw"),nf);c(OI,"SwipeScrollController");let vU=OI;var ow,iO,af;const bI=(af=class{constructor(t,e){q(this,ow),q(this,iO),E(this,ow,!0),this.styles=[],t.addController(this),this.host=t,e&&(this.styles=e)}get themeColor(){return x(this,iO)}set themeColor(t){E(this,iO,t),this.checkThemeUpdate()}checkThemeUpdate(){const t=this.themeColor||y0(this.host)||g0();if(t&&t!==this._resolvedThemeColor){this._resolvedThemeColor=t,console.info("Configuring theme",this._resolvedThemeColor);const e=uz(this._resolvedThemeColor).join(""),i=it`
|
|
32
32
|
:host {
|
|
33
33
|
${P_(e)};
|
|
34
34
|
}
|
|
@@ -2815,7 +2815,7 @@ ${r.join(`
|
|
|
2815
2815
|
:host {
|
|
2816
2816
|
position: relative;
|
|
2817
2817
|
}
|
|
2818
|
-
`];Jl([b()],Rl.prototype,"typeFilter",2);Jl([B()],Rl.prototype,"activeFilter",2);Jl([Vl({flatten:!0,selector:":not(slot)"})],Rl.prototype,"_slotDefault",2);Rl=Jl([Y("wy-notification-header"),Rt()],Rl);var EJ=Object.defineProperty,_J=Object.getOwnPropertyDescriptor,l3=c((s,t,e,i)=>{for(var r=i>1?void 0:i?_J(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&EJ(t,e,r),r},"__decorateClass$i"),ik,Fm;let El=(ik=(Fm=class extends Zy{constructor(){super(...arguments),this.unreadNotifications=new w4(this),this.theme=new _i(this,El.styles),this.currentTypeFilter=Ut.All,this.typeFilter=Ut.All}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),t.has("typeFilter")&&(this.currentTypeFilter=this.typeFilter),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){const t=this.typeFilter===Ut.All;return v`
|
|
2818
|
+
`];Jl([b()],Rl.prototype,"typeFilter",2);Jl([B()],Rl.prototype,"activeFilter",2);Jl([Vl({flatten:!0,selector:":not(slot)"})],Rl.prototype,"_slotDefault",2);Rl=Jl([Y("wy-notification-header"),Rt()],Rl);var EJ=Object.defineProperty,_J=Object.getOwnPropertyDescriptor,l3=c((s,t,e,i)=>{for(var r=i>1?void 0:i?_J(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&EJ(t,e,r),r},"__decorateClass$i"),ik,Fm;let El=(ik=(Fm=class extends Zy{constructor(){super(...arguments),this.unreadNotifications=new w4(this),this.theme=new _i(this,El.styles),this.currentTypeFilter=Ut.All,this.typeFilter=Ut.All}matchesLink(){return!1}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),t.has("typeFilter")&&(this.currentTypeFilter=this.typeFilter),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){const t=this.typeFilter===Ut.All;return v`
|
|
2819
2819
|
${t?v`
|
|
2820
2820
|
<wy-notification-header
|
|
2821
2821
|
@filter=${e=>{this.currentTypeFilter=e.detail.typeFilter}}
|
|
@@ -2832,13 +2832,13 @@ ${r.join(`
|
|
|
2832
2832
|
<wy-progress-circular indeterminate padded reveal></wy-progress-circular>
|
|
2833
2833
|
</wy-empty>
|
|
2834
2834
|
`}
|
|
2835
|
-
`}},h(Fm,"rc"),Fm),c(ik,"WyNotifications"),ik);El.styles=[De,On,Zl,Nl,Li];l3([B()],El.prototype,"currentTypeFilter",2);l3([b()],El.prototype,"typeFilter",2);El=l3([Y("wy-notifications"),Rt()],El);const lW=it`:host{display:inline-flex}`;var LJ=Object.defineProperty,zJ=Object.getOwnPropertyDescriptor,a2=c((s,t,e,i)=>{for(var r=i>1?void 0:i?zJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&LJ(t,e,r),r},"__decorateClass$h"),rk,qm;let Qa=(rk=(qm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,Qa.styles),this.unreadNotifications=new w4(this),this.badge="count",this.badgePosition="inline",this.typeFilter=Ut.All}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){return this.user&&this.badge!=="none"?v`
|
|
2835
|
+
`}},h(Fm,"rc"),Fm),c(ik,"WyNotifications"),ik);El.styles=[De,On,Zl,Nl,Li];l3([B()],El.prototype,"currentTypeFilter",2);l3([b()],El.prototype,"typeFilter",2);El=l3([Y("wy-notifications"),Rt()],El);const lW=it`:host{display:inline-flex}`;var LJ=Object.defineProperty,zJ=Object.getOwnPropertyDescriptor,a2=c((s,t,e,i)=>{for(var r=i>1?void 0:i?zJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&LJ(t,e,r),r},"__decorateClass$h"),rk,qm;let Qa=(rk=(qm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,Qa.styles),this.unreadNotifications=new w4(this),this.badge="count",this.badgePosition="inline",this.typeFilter=Ut.All}matchesLink(){return!1}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){return this.user&&this.badge!=="none"?v`
|
|
2836
2836
|
<wy-badge
|
|
2837
2837
|
appearance=${this.badge}
|
|
2838
2838
|
position=${this.badgePosition}
|
|
2839
2839
|
.count=${this.unreadNotifications.isUnreadPending?NaN:this.unreadNotifications.unread}
|
|
2840
2840
|
></wy-badge>
|
|
2841
|
-
`:C}},h(qm,"nc"),qm),c(rk,"WyNotificationBadge"),rk);Qa.styles=[lW,De,Li];a2([b({type:String})],Qa.prototype,"badge",2);a2([b({type:String})],Qa.prototype,"badgePosition",2);a2([b()],Qa.prototype,"typeFilter",2);Qa=a2([Y("wy-notification-badge")],Qa);var IJ=Object.defineProperty,DJ=Object.getOwnPropertyDescriptor,La=c((s,t,e,i)=>{for(var r=i>1?void 0:i?DJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&IJ(t,e,r),r},"__decorateClass$g"),sk,Zm;let Qr=(sk=(Zm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,Qr.styles),this.unreadNotifications=new w4(this),this.overlay="sheet",this.badge="compact",this.badgePosition="top-right",this.typeFilter=Ut.All,this.currentTypeFilter=Ut.All,this.showNotificationList=!1}set list(t){console.warn(`.list is deprecated. Use .overlay = "${t}"; instead`),this.overlay=t}get list(){return this.overlay}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),t.has("typeFilter")&&(this.currentTypeFilter=this.typeFilter),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){const t=this.typeFilter===Ut.All;return v`
|
|
2841
|
+
`:C}},h(qm,"nc"),qm),c(rk,"WyNotificationBadge"),rk);Qa.styles=[lW,De,Li];a2([b({type:String})],Qa.prototype,"badge",2);a2([b({type:String})],Qa.prototype,"badgePosition",2);a2([b()],Qa.prototype,"typeFilter",2);Qa=a2([Y("wy-notification-badge")],Qa);var IJ=Object.defineProperty,DJ=Object.getOwnPropertyDescriptor,La=c((s,t,e,i)=>{for(var r=i>1?void 0:i?DJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&IJ(t,e,r),r},"__decorateClass$g"),sk,Zm;let Qr=(sk=(Zm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,Qr.styles),this.unreadNotifications=new w4(this),this.overlay="sheet",this.badge="compact",this.badgePosition="top-right",this.typeFilter=Ut.All,this.currentTypeFilter=Ut.All,this.showNotificationList=!1}matchesLink(){return!1}set list(t){console.warn(`.list is deprecated. Use .overlay = "${t}"; instead`),this.overlay=t}get list(){return this.overlay}get unread(){return this.unreadNotifications.unread}async markAllAsRead(){await this.unreadNotifications.markAllAsRead()}async willUpdate(t){await super.willUpdate(t),t.has("typeFilter")&&(this.currentTypeFilter=this.typeFilter),(t.has("typeFilter")||t.has("app"))&&await this.unreadNotifications.track(this.typeFilter,this.app?.id)}render(){const t=this.typeFilter===Ut.All;return v`
|
|
2842
2842
|
<wy-button
|
|
2843
2843
|
kind="icon"
|
|
2844
2844
|
?active=${this.showNotificationList}
|
|
@@ -2915,7 +2915,7 @@ ${r.join(`
|
|
|
2915
2915
|
>
|
|
2916
2916
|
<slot></slot>
|
|
2917
2917
|
</div>
|
|
2918
|
-
`}firstUpdated(){requestAnimationFrame(()=>{this.show=!0})}disconnectedCallback(){super.disconnectedCallback(),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=void 0)}},h(Bm,"oc"),Bm),c(ak,"WyToast"),ak);fn.styles=[P4,ft];fn.defaultDuration=5e3;U1([B()],fn.prototype,"show",2);U1([b({type:Number})],fn.prototype,"duration",2);fn=U1([Y("wy-toast")],fn);var FJ=Object.defineProperty,qJ=Object.getOwnPropertyDescriptor,cW=c(s=>{throw TypeError(s)},"__typeError$3"),Jy=c((s,t,e,i)=>{for(var r=i>1?void 0:i?qJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&FJ(t,e,r),r},"__decorateClass$e"),hW=c((s,t,e)=>t.has(s)||cW("Cannot "+e),"__accessCheck$3"),N9=c((s,t,e)=>(hW(s,t,"read from private field"),e?e.call(s):t.get(s)),"__privateGet$3"),ZJ=c((s,t,e)=>t.has(s)?cW("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),"__privateAdd$3"),B9=c((s,t,e,i)=>(hW(s,t,"write to private field"),t.set(s,e),e),"__privateSet$3"),lh,ok,Xm;let $s=(ok=(Xm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,$s.styles),this.typeFilter=Ut.All,this.appearance="internal",this.requestUserPermission=!1,this.duration=fn.defaultDuration,this._notifications=[],this._nativeNotifications=[],this.handleEvent=async t=>{if(this.typeFilter===Ut.All||this.typeFilter===t.notification.type)if(t.action==="notification_deleted")this.removeNotification(t.notification.id),this.closeNativeNotification(t.notification.id);else{const{title:e,detail:i}=Y4(t.notification),r={...t.notification,title:e,detail:i,lang:this.weavy?.locale},n=new CustomEvent("wy-notification",{bubbles:!0,composed:!0,cancelable:!0,detail:r});(!this.requestUserPermission&&this.appearance!=="native"||await this.hasUserPermission())&&this.dispatchEvent(n)&&(t.action==="notification_created"&&t.notification.is_unread?await this.addOrUpdateNotification(t.notification):await this.updateNotification(t.notification),await this.addOrUpdateNativeNotification(r))}},ZJ(this,lh)}async addOrUpdateNotification(t){if(!this.requestUserPermission||await this.hasUserPermission()){const e=[...this._notifications],i=e.findIndex(r=>r.id===t.id);i!==-1?(e.splice(i,1,t),this._notifications=e):(e.push(t),this._notifications=e)}}async updateNotification(t){if(!this.requestUserPermission||await this.hasUserPermission()){const e=[...this._notifications],i=e.findIndex(r=>r.id===t.id);i!==-1&&(e.splice(i,1,t),this._notifications=e)}}removeNotification(t){const e=[...this._notifications],i=e.findIndex(r=>r.id===t);i!==-1&&(e.splice(i,1),this._notifications=e)}async addOrUpdateNativeNotification(t){if(this.appearance==="native"&&await this.hasUserPermission()){const e=this.removeNativeNotification(t.id),i=t.actor,r=new Notification(t.title,{tag:`wy-${t.id}`,lang:t.lang,body:t.detail,icon:i.avatar_url,renotify:e&&t.is_unread});r.onclick=async()=>{await this.markAsRead(t.id,!0),await H4(this,this.weavy,t)},r.onclose=()=>{this.removeNativeNotification(t.id)},this._nativeNotifications=[...this._nativeNotifications,r]}}removeNativeNotification(t){const e=[...this._nativeNotifications],i=e.findIndex(r=>r.tag===`wy-${t}`);return i?(e.splice(i,1),this._nativeNotifications=e,!0):!1}closeNativeNotification(t){const e=this._nativeNotifications.findIndex(i=>i.tag===`wy-${t}`);return e?(this._nativeNotifications[e].close(),!0):!1}async hasUserPermission(){if(!("Notification"in window))console.error("This browser does not support desktop notifications");else if(!window.isSecureContext)console.error(`Desktop notifications can only be used in secure contexts.
|
|
2918
|
+
`}firstUpdated(){requestAnimationFrame(()=>{this.show=!0})}disconnectedCallback(){super.disconnectedCallback(),this.timeout&&(window.clearTimeout(this.timeout),this.timeout=void 0)}},h(Bm,"oc"),Bm),c(ak,"WyToast"),ak);fn.styles=[P4,ft];fn.defaultDuration=5e3;U1([B()],fn.prototype,"show",2);U1([b({type:Number})],fn.prototype,"duration",2);fn=U1([Y("wy-toast")],fn);var FJ=Object.defineProperty,qJ=Object.getOwnPropertyDescriptor,cW=c(s=>{throw TypeError(s)},"__typeError$3"),Jy=c((s,t,e,i)=>{for(var r=i>1?void 0:i?qJ(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&FJ(t,e,r),r},"__decorateClass$e"),hW=c((s,t,e)=>t.has(s)||cW("Cannot "+e),"__accessCheck$3"),N9=c((s,t,e)=>(hW(s,t,"read from private field"),e?e.call(s):t.get(s)),"__privateGet$3"),ZJ=c((s,t,e)=>t.has(s)?cW("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),"__privateAdd$3"),B9=c((s,t,e,i)=>(hW(s,t,"write to private field"),t.set(s,e),e),"__privateSet$3"),lh,ok,Xm;let $s=(ok=(Xm=class extends Zy{constructor(){super(...arguments),this.theme=new _i(this,$s.styles),this.typeFilter=Ut.All,this.appearance="internal",this.requestUserPermission=!1,this.duration=fn.defaultDuration,this._notifications=[],this._nativeNotifications=[],this.handleEvent=async t=>{if(this.typeFilter===Ut.All||this.typeFilter===t.notification.type)if(t.action==="notification_deleted")this.removeNotification(t.notification.id),this.closeNativeNotification(t.notification.id);else{const{title:e,detail:i}=Y4(t.notification),r={...t.notification,title:e,detail:i,lang:this.weavy?.locale},n=new CustomEvent("wy-notification",{bubbles:!0,composed:!0,cancelable:!0,detail:r});(!this.requestUserPermission&&this.appearance!=="native"||await this.hasUserPermission())&&this.dispatchEvent(n)&&(t.action==="notification_created"&&t.notification.is_unread?await this.addOrUpdateNotification(t.notification):await this.updateNotification(t.notification),await this.addOrUpdateNativeNotification(r))}},ZJ(this,lh)}matchesLink(){return!1}async addOrUpdateNotification(t){if(!this.requestUserPermission||await this.hasUserPermission()){const e=[...this._notifications],i=e.findIndex(r=>r.id===t.id);i!==-1?(e.splice(i,1,t),this._notifications=e):(e.push(t),this._notifications=e)}}async updateNotification(t){if(!this.requestUserPermission||await this.hasUserPermission()){const e=[...this._notifications],i=e.findIndex(r=>r.id===t.id);i!==-1&&(e.splice(i,1,t),this._notifications=e)}}removeNotification(t){const e=[...this._notifications],i=e.findIndex(r=>r.id===t);i!==-1&&(e.splice(i,1),this._notifications=e)}async addOrUpdateNativeNotification(t){if(this.appearance==="native"&&await this.hasUserPermission()){const e=this.removeNativeNotification(t.id),i=t.actor,r=new Notification(t.title,{tag:`wy-${t.id}`,lang:t.lang,body:t.detail,icon:i.avatar_url,renotify:e&&t.is_unread});r.onclick=async()=>{await this.markAsRead(t.id,!0),await H4(this,this.weavy,t)},r.onclose=()=>{this.removeNativeNotification(t.id)},this._nativeNotifications=[...this._nativeNotifications,r]}}removeNativeNotification(t){const e=[...this._nativeNotifications],i=e.findIndex(r=>r.tag===`wy-${t}`);return i?(e.splice(i,1),this._nativeNotifications=e,!0):!1}closeNativeNotification(t){const e=this._nativeNotifications.findIndex(i=>i.tag===`wy-${t}`);return e?(this._nativeNotifications[e].close(),!0):!1}async hasUserPermission(){if(!("Notification"in window))console.error("This browser does not support desktop notifications");else if(!window.isSecureContext)console.error(`Desktop notifications can only be used in secure contexts.
|
|
2919
2919
|
See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`);else{if(Notification.permission==="granted")return!0;if(Notification.permission!=="denied")return await Notification.requestPermission()==="granted"}return!1}clearNotifications(){this._notifications=[]}async markAsRead(t,e=!0){await this.markNotificationMutation?.mutate({notificationId:t,markAsRead:e})}async willUpdate(t){var e;await super.willUpdate(t),t.has("weavy")&&this.weavy&&(this.markNotificationMutation=g4(this.weavy),(e=N9(this,lh))==null||e.call(this),this.weavy.subscribe(null,"notification_created",this.handleEvent),this.weavy.subscribe(null,"notification_updated",this.handleEvent),B9(this,lh,()=>{this.weavy?.unsubscribe(null,"notification_created",this.handleEvent),this.weavy?.unsubscribe(null,"notification_updated",this.handleEvent),B9(this,lh,void 0)})),(t.has("requestUserPermission")&&this.requestUserPermission||t.has("appearance")&&this.appearance==="native")&&this.hasUserPermission()}render(){return v`
|
|
2920
2920
|
${this.user&&this.appearance==="internal"?v`
|
|
2921
2921
|
<wy-toasts ?show=${!!this._notifications.length} @hide=${()=>this.clearNotifications()}>
|
|
@@ -3399,13 +3399,13 @@ ${r.join(`
|
|
|
3399
3399
|
<wy-context-data-progress></wy-context-data-progress>
|
|
3400
3400
|
</div>
|
|
3401
3401
|
</wy-overlay> `:C}
|
|
3402
|
-
`}},h(Km,"yc"),Km),c(pk,"WyMessengerButton"),pk);Ei.styles=[ft,De,Li,Ul,h3];jr([b({type:String})],Ei.prototype,"overlay",2);jr([b({type:String})],Ei.prototype,"badge",2);jr([b({type:String})],Ei.prototype,"badgePosition",2);jr([b({attribute:!1})],Ei.prototype,"componentTypes",2);jr([b({type:String})],Ei.prototype,"agent",1);jr([b()],Ei.prototype,"instructions",2);jr([b()],Ei.prototype,"placeholder",2);jr([b({type:Number})],Ei.prototype,"conversationId",2);jr([B()],Ei.prototype,"show",2);jr([B()],Ei.prototype,"maximized",2);Ei=jr([Y("wy-messenger-button"),Rt()],Ei);var stt=Object.getOwnPropertyDescriptor,ntt=c((s,t,e,i)=>{for(var r=i>1?void 0:i?stt(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=a(r)||r);return r},"__decorateClass$7"),fk,Jm;let g1=(fk=(Jm=class extends We{constructor(){super(...arguments),this.theme=new _i(this,g1.styles),this.createConversationController=new zb(this),this.conversationNewRef=$t()}async createConversation(t){return await this.createConversationController.create(t)}async selectMembers(){return await this.conversationNewRef.value?.selectMembers()}async willUpdate(t){await super.willUpdate(t),t.has("agent")&&(this.createConversationController.agent=this.agent)}render(){return v`
|
|
3402
|
+
`}},h(Km,"yc"),Km),c(pk,"WyMessengerButton"),pk);Ei.styles=[ft,De,Li,Ul,h3];jr([b({type:String})],Ei.prototype,"overlay",2);jr([b({type:String})],Ei.prototype,"badge",2);jr([b({type:String})],Ei.prototype,"badgePosition",2);jr([b({attribute:!1})],Ei.prototype,"componentTypes",2);jr([b({type:String})],Ei.prototype,"agent",1);jr([b()],Ei.prototype,"instructions",2);jr([b()],Ei.prototype,"placeholder",2);jr([b({type:Number})],Ei.prototype,"conversationId",2);jr([B()],Ei.prototype,"show",2);jr([B()],Ei.prototype,"maximized",2);Ei=jr([Y("wy-messenger-button"),Rt()],Ei);var stt=Object.getOwnPropertyDescriptor,ntt=c((s,t,e,i)=>{for(var r=i>1?void 0:i?stt(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=a(r)||r);return r},"__decorateClass$7"),fk,Jm;let g1=(fk=(Jm=class extends We{constructor(){super(...arguments),this.theme=new _i(this,g1.styles),this.createConversationController=new zb(this),this.conversationNewRef=$t()}matchesLink(){return!1}async createConversation(t){return await this.createConversationController.create(t)}async selectMembers(){return await this.conversationNewRef.value?.selectMembers()}async willUpdate(t){await super.willUpdate(t),t.has("agent")&&(this.createConversationController.agent=this.agent)}render(){return v`
|
|
3403
3403
|
<wy-conversation-new
|
|
3404
3404
|
.agent=${this.agent}
|
|
3405
3405
|
@create=${async t=>{await this.createConversationController.create(t.detail.members)}}
|
|
3406
3406
|
${ht(this.conversationNewRef)}
|
|
3407
3407
|
></wy-conversation-new>
|
|
3408
|
-
`}},h(Jm,"wc"),Jm),c(fk,"WyMessengerNew"),fk);g1.styles=[De,Ul,h3,On,Li];g1=ntt([Y("wy-messenger-new")],g1);var att=Object.defineProperty,ott=Object.getOwnPropertyDescriptor,H1=c((s,t,e,i)=>{for(var r=i>1?void 0:i?ott(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&att(t,e,r),r},"__decorateClass$6"),mk,ty;let mn=(mk=(ty=class extends We{constructor(){super(...arguments),this.theme=new _i(this,mn.styles),this.unreadConversations=new Ib(this),this.componentTypes=[xt.ChatRoom,xt.PrivateChat],this.badge="count",this.badgePosition="inline"}set agent(t){super.agent=t,this._agentUid?this.componentTypes=[xt.AgentChat]:this.componentTypes=[xt.ChatRoom,xt.PrivateChat]}get agent(){return super.agent}get unread(){return this.unreadConversations.unread}async willUpdate(t){await super.willUpdate(t),(t.has("componentTypes")||t.has("agent"))&&await this.unreadConversations.track(this.componentTypes,this.agent)}render(){return this.user&&this.badge!=="none"?v`
|
|
3408
|
+
`}},h(Jm,"wc"),Jm),c(fk,"WyMessengerNew"),fk);g1.styles=[De,Ul,h3,On,Li];g1=ntt([Y("wy-messenger-new")],g1);var att=Object.defineProperty,ott=Object.getOwnPropertyDescriptor,H1=c((s,t,e,i)=>{for(var r=i>1?void 0:i?ott(t,e):t,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(i?a(t,e,r):a(r))||r);return i&&r&&att(t,e,r),r},"__decorateClass$6"),mk,ty;let mn=(mk=(ty=class extends We{constructor(){super(...arguments),this.theme=new _i(this,mn.styles),this.unreadConversations=new Ib(this),this.componentTypes=[xt.ChatRoom,xt.PrivateChat],this.badge="count",this.badgePosition="inline"}matchesLink(){return!1}set agent(t){super.agent=t,this._agentUid?this.componentTypes=[xt.AgentChat]:this.componentTypes=[xt.ChatRoom,xt.PrivateChat]}get agent(){return super.agent}get unread(){return this.unreadConversations.unread}async willUpdate(t){await super.willUpdate(t),(t.has("componentTypes")||t.has("agent"))&&await this.unreadConversations.track(this.componentTypes,this.agent)}render(){return this.user&&this.badge!=="none"?v`
|
|
3409
3409
|
<wy-badge
|
|
3410
3410
|
appearance=${this.badge}
|
|
3411
3411
|
position=${this.badgePosition}
|
|
@@ -3667,4 +3667,4 @@ ${r.join(`
|
|
|
3667
3667
|
>
|
|
3668
3668
|
<wy-icon name="send"></wy-icon>
|
|
3669
3669
|
</wy-button>
|
|
3670
|
-
</div>`}renderBottomSlot(){return C}},h(ay,"Cc"),ay),c(bk,"WyMessageEditor"),bk);V0.styles=[...Bt.styles,Ott];V0=$tt([Y("wy-message-editor"),Rt()],V0);const J=Object.freeze(Object.defineProperty({__proto__:null,get WyAnnotation(){return a1},get WyAnnotationList(){return o1},get WyAttachment(){return n1},get WyAttachmentList(){return Cy},get WyAvatar(){return ws},get WyAvatarGroup(){return vl},get WyAvatarHeader(){return Jw},get WyBadge(){return un},get WyButton(){return lr},get WyButtons(){return Ol},get WyCloudFiles(){return Ql},get WyComment(){return Os},get WyCommentEditor(){return I0},get WyCommentList(){return dn},get WyContainer(){return cn},get WyContextDataProgress(){return D0},get WyConversation(){return Ni},get WyConversationHeader(){return xs},get WyConversationItem(){return pi},get WyConversationList(){return Ta},get WyConversationNew(){return Ll},get WyDropdown(){return cr},get WyDropdownDivider(){return E0},get WyDropdownItem(){return r1},get WyDropdownOption(){return Sy},get WyEditor(){return Bt},get WyEmbed(){return Py},get WyEmbedSelect(){return l1},get WyEmpty(){return xy},get WyFileGrid(){return Al},get WyFileItem(){return bs},get WyFileMenu(){return Pl},get WyFileTable(){return Sa},get WyFileVersions(){return f1},get WyFilesHeader(){return ka},get WyFilesList(){return pn},get WyIcon(){return we},get WyIconDisplay(){return Kw},get WyIconStack(){return Q0},get WyImageGrid(){return $l},get WyItem(){return Xe},get WyItemList(){return va},get WyMeetingCard(){return c1},get WyMessage(){return pe},get WyMessageEditor(){return V0},get WyMessageTyping(){return kr},get WyNotificationHeader(){return Rl},get WyNotificationList(){return Ey},get WyNotificationListItem(){return Pa},get WyOverlay(){return $a},get WyPdfViewer(){return Cl},get WyPoll(){return d1},get WyPollOption(){return xl},get WyPost(){return Oe},get WyPostEdit(){return ri},get WyPostList(){return m1},get WyPostTrashed(){return Ay},get WyPostView(){return he},get WyPresence(){return $y},get WyPreview(){return ve},get WyPreviewEmbed(){return xa},get WyPreviewIcon(){return kl},get WyPreviewImage(){return Sl},get WyPreviewItem(){return Ty},get WyPreviewMedia(){return hn},get WyPreviewText(){return vs},get WyProgressCircular(){return qr},get WyProgressLinear(){return Pr},get WyReactionItem(){return u1},get WyReactions(){return Qe},get WySearch(){return _l},get WySkeleton(){return s1},get WyTitlebar(){return ln},get WyTitlebarText(){return h1},get WyToast(){return fn},get WyToasts(){return y1},get WyTyping(){return zy},get WyUpload(){return Ly},get WyUsersSearch(){return Nr}},Symbol.toStringTag,{value:"Module"}));Le.version="30.3.1";Le.sourceName="@weavy/uikit-react";const wW=X.createContext(null);function xtt(s,t=[]){const[e,i]=X.useState(),r={...s,cloudFilePickerUrl:s.cloudFilePickerUrl?.toString(),locales:X.useMemo(()=>s.locales,[s.locales?.length]),tokenUrl:s.tokenUrl?.toString(),tokenFactory:X.useMemo(()=>s.tokenFactory,[s.tokenFactory?.toString(),...t]),url:s.url?.toString()},[n,a]=X.useState(r);return X.useEffect(()=>{if(!e){const l=Hc?.value??new Se(r);i(l)}},[]),X.useEffect(()=>{if(e&&!e.isDestroyed){const o={};Object.entries(r).forEach(([l,d])=>{d!==n[l]&&Object.assign(o,{[l]:d})}),Object.keys(o).length&&(a(r),Object.assign(e,o))}},[r]),e}h(xtt,"useWeavy");const vW=Promise.resolve(),p3=class p3{constructor(t,e){this.o=[],this.t=!0,this.i=!1,this.l=t,this.h=e,this.u=new Promise(((i,r)=>{this.p=i}))}addController(t){this.o.push(t)}removeController(t){this.o?.splice(this.o.indexOf(t)>>>0,1)}requestUpdate(){this.t||(this.t=!0,vW.then((()=>this.h(++this.l))))}get updateComplete(){return this.u}m(){this.i=!0,this.o.forEach((t=>t.hostConnected?.()))}_(){this.i=!1,this.o.forEach((t=>t.hostDisconnected?.()))}v(){this.o.forEach((t=>t.hostUpdate?.()))}C(){this.t=!1;const t=this.p;this.u=new Promise(((e,i)=>{this.p=e})),this.o.forEach((e=>e.hostUpdated?.())),t(this.t)}};h(p3,"s");let ZS=p3;const ktt=h((s,t)=>{const{useState:e,useLayoutEffect:i}=s,[r,n]=e(0);let a=!1;const[o]=e((()=>{const l=new ZS(r,n),d=t(l);return l.M=d,l.m(),a=!0,vW.then((()=>{a&&l._()})),l}));return o.t=!0,i((()=>(a=!1,o.i||o.m(),()=>o._())),[]),i((()=>o.C())),o.v(),o.M},"e$1");function OW(s,t){const e=(typeof s=="function"?s():s&&"current"in s?s.current:s)||void 0,i=ktt(X,r=>new iU(r,t??Ve,e));return X.useEffect(()=>{e&&i.setRef(e)},[i,e]),i.context?.value}h(OW,"useWeavyContext");const Stt=new Set(["children","localName","ref","style","className"]),K9=new WeakMap,J9=h((s,t,e,i,r)=>{const n=r?.[t];n===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((a,o,l)=>{let d=K9.get(a);d===void 0&&K9.set(a,d=new Map);let u=d.get(o);l!==void 0?u===void 0?(d.set(o,u={handleEvent:l}),a.addEventListener(o,u)):u.handleEvent=l:u!==void 0&&(d.delete(o),a.removeEventListener(o,u))})(s,n,e)},"t"),U=h(({react:s,tagName:t,elementClass:e,events:i,displayName:r})=>{const n=new Set(Object.keys(i??{})),a=s.forwardRef(((o,l)=>{const d=s.useRef(new Map),u=s.useRef(null),p={},f={};for(const[y,g]of Object.entries(o))Stt.has(y)?p[y==="className"?"class":y]=g:n.has(y)||y in e.prototype?f[y]=g:p[y]=g;return s.useLayoutEffect((()=>{if(u.current===null)return;const y=new Map;for(const g in f)J9(u.current,g,o[g],d.current.get(g),i),d.current.delete(g),y.set(g,o[g]);for(const[g,O]of d.current)J9(u.current,g,void 0,O,i);d.current=y})),s.useLayoutEffect((()=>{u.current?.removeAttribute("defer-hydration")}),[]),p.suppressHydrationWarning=!0,s.createElement(t,{...p,ref:s.useCallback((y=>{u.current=y,typeof l=="function"?l(y):l!==null&&(l.current=y)}),[l])})}));return a.displayName=r??e.name,a},"o"),be="wy-action",Yi="wy-app",d2="wy-link",bW="wy-message",$W="wy-notification",fi="wy-preview-open",mi="wy-preview-close",Ia="wy-unread",Ctt=Object.freeze(Object.defineProperty({__proto__:null,onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyMessage:bW,onWyNotification:$W,onWyPreviewClose:mi,onWyPreviewOpen:fi,onWyUnread:Ia},Symbol.toStringTag,{value:"Module"})),Ptt=U({react:X,tagName:"wy-chat",elementClass:Tl,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Qtt=U({react:X,tagName:"wy-comments",elementClass:My,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ttt=U({react:X,tagName:"wy-component",elementClass:gl,events:{...Ctt}}),Mtt=U({react:X,tagName:"wy-context",elementClass:ge});function Att({children:s,...t}){const e=X.useRef(null),i=OW(()=>e.current);return X.createElement(Mtt,{ref:e,...t},X.createElement(wW.Provider,{value:i??null},s))}h(Att,"WyContext");const Rtt=U({react:X,tagName:"wy-copilot",elementClass:Ml,events:{onWyApp:Yi,onWyAction:be,onWyMessage:bW,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ett=U({react:X,tagName:"wy-files",elementClass:Ca,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),_tt=U({react:X,tagName:"wy-messenger",elementClass:ks,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyUnread:Ia}}),Ltt=U({react:X,tagName:"wy-messenger-badge",elementClass:mn,events:{onWyUnread:Ia}}),ztt=U({react:X,tagName:"wy-messenger-button",elementClass:Ei,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyUnread:Ia}}),Itt=U({react:X,tagName:"wy-messenger-conversations",elementClass:Ma,events:{onWyAction:be,onWyApp:Yi,onWyUnread:Ia}}),Dtt=U({react:X,tagName:"wy-messenger-new",elementClass:g1,events:{onWyApp:Yi}}),Vtt=U({react:X,tagName:"wy-notifications",elementClass:El,events:{onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyUnread:Ia}}),Wtt=U({react:X,tagName:"wy-notification-badge",elementClass:Qa,events:{onWyApp:Yi,onWyUnread:Ia}}),Ftt=U({react:X,tagName:"wy-notification-button",elementClass:Qr,events:{onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyUnread:Ia}}),qtt=U({react:X,tagName:"wy-notification-toasts",elementClass:$s,events:{onWyApp:Yi,onWyLink:d2,onWyNotification:$W}}),Ztt=U({react:X,tagName:"wy-posts",elementClass:Ry,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ntt=U({react:X,tagName:"wy-avatar",elementClass:J.WyAvatar}),Btt=U({react:X,tagName:"wy-avatar-group",elementClass:J.WyAvatarGroup}),Xtt=U({react:X,tagName:"wy-avatar-header",elementClass:J.WyAvatarHeader}),jtt=U({react:X,tagName:"wy-button",elementClass:J.WyButton}),Utt=U({react:X,tagName:"wy-buttons",elementClass:J.WyButtons}),Htt=U({react:X,tagName:"wy-badge",elementClass:J.WyBadge}),Ytt=U({react:X,tagName:"wy-dropdown",elementClass:J.WyDropdown}),Gtt=U({react:X,tagName:"wy-dropdown-item",elementClass:J.WyDropdownItem}),Ktt=U({react:X,tagName:"wy-dropdown-option",elementClass:J.WyDropdownOption}),Jtt=U({react:X,tagName:"wy-dropdown-divider",elementClass:J.WyDropdownDivider}),tet=U({react:X,tagName:"wy-icon",elementClass:J.WyIcon}),eet=U({react:X,tagName:"wy-icon-stack",elementClass:J.WyIconStack}),iet=U({react:X,tagName:"wy-icon-display",elementClass:J.WyIconDisplay}),ret=U({react:X,tagName:"wy-image-grid",elementClass:J.WyImageGrid,events:{onFileOpen:"file-open"}}),set=U({react:X,tagName:"wy-item",elementClass:J.WyItem}),net=U({react:X,tagName:"wy-item-list",elementClass:J.WyItemList}),aet=U({react:X,tagName:"wy-overlay",elementClass:J.WyOverlay,events:{onClose:"close"}}),oet=U({react:X,tagName:"wy-presence",elementClass:J.WyPresence}),cet=U({react:X,tagName:"wy-progress-circular",elementClass:J.WyProgressCircular}),het=U({react:X,tagName:"wy-progress-linear",elementClass:J.WyProgressLinear}),det=U({react:X,tagName:"wy-search",elementClass:J.WySearch,events:{onSearch:"search"}}),uet=U({react:X,tagName:"wy-container",elementClass:J.WyContainer}),pet=U({react:X,tagName:"wy-skeleton",elementClass:J.WySkeleton}),fet=U({react:X,tagName:"wy-titlebar",elementClass:J.WyTitlebar}),met=U({react:X,tagName:"wy-titlebar-text",elementClass:J.WyTitlebarText}),yet=U({react:X,tagName:"wy-toasts",elementClass:J.WyToasts,events:{onHide:"hide"}}),get=U({react:X,tagName:"wy-toast",elementClass:J.WyToast,events:{onClosed:"closed"}}),wet=U({react:X,tagName:"wy-annotation",elementClass:J.WyAnnotation}),vet=U({react:X,tagName:"wy-annotation-list",elementClass:J.WyAnnotationList,events:{onFileOpen:"file-open"}}),Oet=U({react:X,tagName:"wy-attachment",elementClass:J.WyAttachment,events:{onFileOpen:"file-open"}}),bet=U({react:X,tagName:"wy-attachment-list",elementClass:J.WyAttachmentList,events:{onFileOpen:"file-open"}}),$et=U({react:X,tagName:"wy-upload",elementClass:J.WyUpload,events:{onBlobUploaded:"blob-uploaded"}}),xet=U({react:X,tagName:"wy-cloud-files",elementClass:J.WyCloudFiles,events:{onExternalBlobs:"external-blobs"}}),ket=U({react:X,tagName:"wy-comment-list",elementClass:J.WyCommentList,events:{onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Cet=U({react:X,tagName:"wy-comment",elementClass:J.WyComment,events:{onVote:"vote",onTrash:"trash",onRestore:"restore",onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Pet=U({react:X,tagName:"wy-context-data-progress",elementClass:J.WyContextDataProgress}),Qet=U({react:X,tagName:"wy-conversation",elementClass:J.WyConversation,events:{onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Tet=U({react:X,tagName:"wy-conversation-header",elementClass:J.WyConversationHeader,events:{onWyAction:be}}),Met=U({react:X,tagName:"wy-conversation-new",elementClass:J.WyConversationNew,events:{onSelected:"create"}}),Aet=U({react:X,tagName:"wy-conversation-list",elementClass:J.WyConversationList,events:{onWyAction:be}}),Ret=U({react:X,tagName:"wy-conversation-item",elementClass:J.WyConversationItem,events:{onSelected:"selected",onStar:"star",onPin:"pin",onMark:"mark",onLeave:"leave",onRemove:"remove",onTrash:"trash"}}),Eet=U({react:X,tagName:"wy-editor",elementClass:J.WyEditor,events:{onSubmit:"submit"}}),_et=U({react:X,tagName:"wy-comment-editor",elementClass:J.WyCommentEditor,events:{onSubmit:"submit"}}),Let=U({react:X,tagName:"wy-message-editor",elementClass:J.WyMessageEditor,events:{onSubmit:"submit"}}),zet=U({react:X,tagName:"wy-embed",elementClass:J.WyEmbed,events:{onWyAction:be}}),Iet=U({react:X,tagName:"wy-embed-select",elementClass:J.WyEmbedSelect,events:{onEmbedRemove:"embed-remove",onEmbedSwap:"embed-swap"}}),Det=U({react:X,tagName:"wy-empty",elementClass:J.WyEmpty}),Vet=U({react:X,tagName:"wy-file-grid",elementClass:J.WyFileGrid,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe"}}),Wet=U({react:X,tagName:"wy-file-item",elementClass:J.WyFileItem,events:{onEditName:"edit-name",onRename:"rename",onSubscribe:"subscribe",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever"}}),Fet=U({react:X,tagName:"wy-file-menu",elementClass:J.WyFileMenu,events:{onEditName:"edit-name",onSubscribe:"subscribe",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever"}}),qet=U({react:X,tagName:"wy-file-table",elementClass:J.WyFileTable,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe"}}),Zet=U({react:X,tagName:"wy-file-versions",elementClass:J.WyFileVersions,events:{onFileVersionSelect:"file-version-select"}}),Net=U({react:X,tagName:"wy-files-header",elementClass:J.WyFilesHeader,events:{onUploadFiles:"upload-files",onExternalBlobs:"external-blobs",onCreateFiles:"create-files",onOrder:"order",onView:"view",onShowTrashed:"show-trashed",onSubscribe:"subscribe"}}),Bet=U({react:X,tagName:"wy-files-list",elementClass:J.WyFilesList,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe",onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Xet=U({react:X,tagName:"wy-meeting-card",elementClass:J.WyMeetingCard}),jet="vote",Uet="typing",Het=U({react:X,tagName:"wy-message",elementClass:J.WyMessage,events:{onVote:jet,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Yet=U({react:X,tagName:"wy-message-typing",elementClass:J.WyMessageTyping,events:{onTyping:Uet}}),Get=U({react:X,tagName:"wy-notification-list",elementClass:J.WyNotificationList,events:{onWyAction:be}}),Ket=U({react:X,tagName:"wy-notification-header",elementClass:J.WyNotificationHeader}),Jet=U({react:X,tagName:"wy-notification-list-item",elementClass:J.WyNotificationListItem,events:{onSelect:"select",onMark:"mark",onHide:"hide",onClose:"close"}}),tit=U({react:X,tagName:"wy-pdf-viewer",elementClass:J.WyPdfViewer,events:{onFilePreviewLoaded:"file-preview-loaded"}}),eit=U({react:X,tagName:"wy-poll",elementClass:J.WyPoll,events:{onVote:"vote"}}),iit=U({react:X,tagName:"wy-poll-option",elementClass:J.WyPollOption,events:{onVote:"vote"}}),u3="edit",xW="vote",kW="subscribe",SW="trash",CW="restore",rit=U({react:X,tagName:"wy-post-list",elementClass:J.WyPostList,events:{onEdit:u3,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),sit=U({react:X,tagName:"wy-post",elementClass:J.WyPost,events:{onVote:xW,onSubscribe:kW,onTrash:SW,onRestore:CW,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),nit=U({react:X,tagName:"wy-post-view",elementClass:J.WyPostView,events:{onVote:xW,onSubscribe:kW,onTrash:SW,onEdit:u3,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),ait=U({react:X,tagName:"wy-post-edit",elementClass:J.WyPostEdit,events:{onEdit:u3}}),oit=U({react:X,tagName:"wy-post-trashed",elementClass:J.WyPostTrashed,events:{onRestore:CW}}),eg="file-preview-loaded",lit=U({react:X,tagName:"wy-preview",elementClass:J.WyPreview,events:{onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyAction:be}}),cit=U({react:X,tagName:"wy-preview-embed",elementClass:J.WyPreviewEmbed,events:{onFilePreviewLoaded:eg}}),hit=U({react:X,tagName:"wy-preview-icon",elementClass:J.WyPreviewIcon,events:{onFilePreviewLoaded:eg}}),dit=U({react:X,tagName:"wy-preview-image",elementClass:J.WyPreviewImage,events:{onFilePreviewLoaded:eg}}),uit=U({react:X,tagName:"wy-preview-item",elementClass:J.WyPreviewItem,events:{onFilePreviewLoaded:eg}}),pit=U({react:X,tagName:"wy-preview-media",elementClass:J.WyPreviewMedia,events:{onFilePreviewLoaded:eg}}),fit=U({react:X,tagName:"wy-preview-text",elementClass:J.WyPreviewText,events:{onFilePreviewLoaded:eg}}),mit="close",yit=U({react:X,tagName:"wy-reactions",elementClass:J.WyReactions,events:{onClose:mit}}),git=U({react:X,tagName:"wy-reaction-item",elementClass:J.WyReactionItem}),wit=U({react:X,tagName:"wy-typing",elementClass:J.WyTyping}),vit=U({react:X,tagName:"wy-users-search",elementClass:J.WyUsersSearch,events:{onSubmit:"submit"}}),Oit=Object.freeze(Object.defineProperty({__proto__:null,WyAnnotation:wet,WyAnnotationList:vet,WyAttachment:Oet,WyAttachmentList:bet,WyAvatar:Ntt,WyAvatarGroup:Btt,WyAvatarHeader:Xtt,WyBadge:Htt,WyButton:jtt,WyButtons:Utt,WyCloudFiles:xet,WyComment:Cet,WyCommentEditor:_et,WyCommentList:ket,WyContainer:uet,WyContextDataProgress:Pet,WyConversation:Qet,WyConversationAppbar:Tet,WyConversationItem:Ret,WyConversationList:Aet,WyConversationNew:Met,WyDropdown:Ytt,WyDropdownDivider:Jtt,WyDropdownItem:Gtt,WyDropdownOption:Ktt,WyEditor:Eet,WyEmbed:zet,WyEmbedSelect:Iet,WyEmpty:Det,WyFileGrid:Vet,WyFileItem:Wet,WyFileMenu:Fet,WyFileTable:qet,WyFileVersions:Zet,WyFilesHeader:Net,WyFilesList:Bet,WyIcon:tet,WyIconDisplay:iet,WyIconStack:eet,WyImageGrid:ret,WyItem:set,WyItemList:net,WyMeetingCard:Xet,WyMessage:Het,WyMessageEditor:Let,WyMessageTyping:Yet,WyNotificationHeader:Ket,WyNotificationList:Get,WyNotificationListitem:Jet,WyOverlay:aet,WyPdfViewer:tit,WyPoll:eit,WyPollOption:iit,WyPost:sit,WyPostEdit:ait,WyPostList:rit,WyPostTrashed:oit,WyPostView:nit,WyPresence:oet,WyPreview:lit,WyPreviewEmbed:cit,WyPreviewIcon:hit,WyPreviewImage:dit,WyPreviewItem:uit,WyPreviewMedia:pit,WyPreviewText:fit,WyProgressCircular:cet,WyProgressLinear:het,WyReactionItem:git,WyReactions:yit,WySearch:det,WySkeleton:pet,WyTitlebar:fet,WyTitlebarText:met,WyToast:get,WyToasts:yet,WyTyping:wit,WyUpload:$et,WyUsersSearch:vit},Symbol.toStringTag,{value:"Module"}));exports.AppTypeGuids=Gz;exports.AppTypeStrings=Kz;exports.Feature=L;exports.MessengerTypes=NJ;exports.Weavy=Se;exports.WeavyComponents=Oit;exports.WeavyContext=wW;exports.WyChat=Ptt;exports.WyComments=Qtt;exports.WyComponent=Ttt;exports.WyContext=Att;exports.WyCopilot=Rtt;exports.WyFiles=Ett;exports.WyMessenger=_tt;exports.WyMessengerBadge=Ltt;exports.WyMessengerButton=ztt;exports.WyMessengerConversations=Itt;exports.WyMessengerNew=Dtt;exports.WyNotificationBadge=Wtt;exports.WyNotificationButton=Ftt;exports.WyNotificationToasts=qtt;exports.WyNotifications=Vtt;exports.WyPosts=Ztt;exports.useWeavy=xtt;exports.useWeavyContext=OW;
|
|
3670
|
+
</div>`}renderBottomSlot(){return C}},h(ay,"Cc"),ay),c(bk,"WyMessageEditor"),bk);V0.styles=[...Bt.styles,Ott];V0=$tt([Y("wy-message-editor"),Rt()],V0);const J=Object.freeze(Object.defineProperty({__proto__:null,get WyAnnotation(){return a1},get WyAnnotationList(){return o1},get WyAttachment(){return n1},get WyAttachmentList(){return Cy},get WyAvatar(){return ws},get WyAvatarGroup(){return vl},get WyAvatarHeader(){return Jw},get WyBadge(){return un},get WyButton(){return lr},get WyButtons(){return Ol},get WyCloudFiles(){return Ql},get WyComment(){return Os},get WyCommentEditor(){return I0},get WyCommentList(){return dn},get WyContainer(){return cn},get WyContextDataProgress(){return D0},get WyConversation(){return Ni},get WyConversationHeader(){return xs},get WyConversationItem(){return pi},get WyConversationList(){return Ta},get WyConversationNew(){return Ll},get WyDropdown(){return cr},get WyDropdownDivider(){return E0},get WyDropdownItem(){return r1},get WyDropdownOption(){return Sy},get WyEditor(){return Bt},get WyEmbed(){return Py},get WyEmbedSelect(){return l1},get WyEmpty(){return xy},get WyFileGrid(){return Al},get WyFileItem(){return bs},get WyFileMenu(){return Pl},get WyFileTable(){return Sa},get WyFileVersions(){return f1},get WyFilesHeader(){return ka},get WyFilesList(){return pn},get WyIcon(){return we},get WyIconDisplay(){return Kw},get WyIconStack(){return Q0},get WyImageGrid(){return $l},get WyItem(){return Xe},get WyItemList(){return va},get WyMeetingCard(){return c1},get WyMessage(){return pe},get WyMessageEditor(){return V0},get WyMessageTyping(){return kr},get WyNotificationHeader(){return Rl},get WyNotificationList(){return Ey},get WyNotificationListItem(){return Pa},get WyOverlay(){return $a},get WyPdfViewer(){return Cl},get WyPoll(){return d1},get WyPollOption(){return xl},get WyPost(){return Oe},get WyPostEdit(){return ri},get WyPostList(){return m1},get WyPostTrashed(){return Ay},get WyPostView(){return he},get WyPresence(){return $y},get WyPreview(){return ve},get WyPreviewEmbed(){return xa},get WyPreviewIcon(){return kl},get WyPreviewImage(){return Sl},get WyPreviewItem(){return Ty},get WyPreviewMedia(){return hn},get WyPreviewText(){return vs},get WyProgressCircular(){return qr},get WyProgressLinear(){return Pr},get WyReactionItem(){return u1},get WyReactions(){return Qe},get WySearch(){return _l},get WySkeleton(){return s1},get WyTitlebar(){return ln},get WyTitlebarText(){return h1},get WyToast(){return fn},get WyToasts(){return y1},get WyTyping(){return zy},get WyUpload(){return Ly},get WyUsersSearch(){return Nr}},Symbol.toStringTag,{value:"Module"}));Le.version="30.3.2";Le.sourceName="@weavy/uikit-react";const wW=X.createContext(null);function xtt(s,t=[]){const[e,i]=X.useState(),r={...s,cloudFilePickerUrl:s.cloudFilePickerUrl?.toString(),locales:X.useMemo(()=>s.locales,[s.locales?.length]),tokenUrl:s.tokenUrl?.toString(),tokenFactory:X.useMemo(()=>s.tokenFactory,[s.tokenFactory?.toString(),...t]),url:s.url?.toString()},[n,a]=X.useState(r);return X.useEffect(()=>{if(!e){const l=Hc?.value??new Se(r);i(l)}},[]),X.useEffect(()=>{if(e&&!e.isDestroyed){const o={};Object.entries(r).forEach(([l,d])=>{d!==n[l]&&Object.assign(o,{[l]:d})}),Object.keys(o).length&&(a(r),Object.assign(e,o))}},[r]),e}h(xtt,"useWeavy");const vW=Promise.resolve(),p3=class p3{constructor(t,e){this.o=[],this.t=!0,this.i=!1,this.l=t,this.h=e,this.u=new Promise(((i,r)=>{this.p=i}))}addController(t){this.o.push(t)}removeController(t){this.o?.splice(this.o.indexOf(t)>>>0,1)}requestUpdate(){this.t||(this.t=!0,vW.then((()=>this.h(++this.l))))}get updateComplete(){return this.u}m(){this.i=!0,this.o.forEach((t=>t.hostConnected?.()))}_(){this.i=!1,this.o.forEach((t=>t.hostDisconnected?.()))}v(){this.o.forEach((t=>t.hostUpdate?.()))}C(){this.t=!1;const t=this.p;this.u=new Promise(((e,i)=>{this.p=e})),this.o.forEach((e=>e.hostUpdated?.())),t(this.t)}};h(p3,"s");let ZS=p3;const ktt=h((s,t)=>{const{useState:e,useLayoutEffect:i}=s,[r,n]=e(0);let a=!1;const[o]=e((()=>{const l=new ZS(r,n),d=t(l);return l.M=d,l.m(),a=!0,vW.then((()=>{a&&l._()})),l}));return o.t=!0,i((()=>(a=!1,o.i||o.m(),()=>o._())),[]),i((()=>o.C())),o.v(),o.M},"e$1");function OW(s,t){const e=(typeof s=="function"?s():s&&"current"in s?s.current:s)||void 0,i=ktt(X,r=>new iU(r,t??Ve,e));return X.useEffect(()=>{e&&i.setRef(e)},[i,e]),i.context?.value}h(OW,"useWeavyContext");const Stt=new Set(["children","localName","ref","style","className"]),K9=new WeakMap,J9=h((s,t,e,i,r)=>{const n=r?.[t];n===void 0?(s[t]=e,e==null&&t in HTMLElement.prototype&&s.removeAttribute(t)):e!==i&&((a,o,l)=>{let d=K9.get(a);d===void 0&&K9.set(a,d=new Map);let u=d.get(o);l!==void 0?u===void 0?(d.set(o,u={handleEvent:l}),a.addEventListener(o,u)):u.handleEvent=l:u!==void 0&&(d.delete(o),a.removeEventListener(o,u))})(s,n,e)},"t"),U=h(({react:s,tagName:t,elementClass:e,events:i,displayName:r})=>{const n=new Set(Object.keys(i??{})),a=s.forwardRef(((o,l)=>{const d=s.useRef(new Map),u=s.useRef(null),p={},f={};for(const[y,g]of Object.entries(o))Stt.has(y)?p[y==="className"?"class":y]=g:n.has(y)||y in e.prototype?f[y]=g:p[y]=g;return s.useLayoutEffect((()=>{if(u.current===null)return;const y=new Map;for(const g in f)J9(u.current,g,o[g],d.current.get(g),i),d.current.delete(g),y.set(g,o[g]);for(const[g,O]of d.current)J9(u.current,g,void 0,O,i);d.current=y})),s.useLayoutEffect((()=>{u.current?.removeAttribute("defer-hydration")}),[]),p.suppressHydrationWarning=!0,s.createElement(t,{...p,ref:s.useCallback((y=>{u.current=y,typeof l=="function"?l(y):l!==null&&(l.current=y)}),[l])})}));return a.displayName=r??e.name,a},"o"),be="wy-action",Yi="wy-app",d2="wy-link",bW="wy-message",$W="wy-notification",fi="wy-preview-open",mi="wy-preview-close",Ia="wy-unread",Ctt=Object.freeze(Object.defineProperty({__proto__:null,onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyMessage:bW,onWyNotification:$W,onWyPreviewClose:mi,onWyPreviewOpen:fi,onWyUnread:Ia},Symbol.toStringTag,{value:"Module"})),Ptt=U({react:X,tagName:"wy-chat",elementClass:Tl,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Qtt=U({react:X,tagName:"wy-comments",elementClass:My,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ttt=U({react:X,tagName:"wy-component",elementClass:gl,events:{...Ctt}}),Mtt=U({react:X,tagName:"wy-context",elementClass:ge});function Att({children:s,...t}){const e=X.useRef(null),i=OW(()=>e.current);return X.createElement(Mtt,{ref:e,...t},X.createElement(wW.Provider,{value:i??null},s))}h(Att,"WyContext");const Rtt=U({react:X,tagName:"wy-copilot",elementClass:Ml,events:{onWyApp:Yi,onWyAction:be,onWyMessage:bW,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ett=U({react:X,tagName:"wy-files",elementClass:Ca,events:{onWyApp:Yi,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),_tt=U({react:X,tagName:"wy-messenger",elementClass:ks,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyUnread:Ia}}),Ltt=U({react:X,tagName:"wy-messenger-badge",elementClass:mn,events:{onWyUnread:Ia}}),ztt=U({react:X,tagName:"wy-messenger-button",elementClass:Ei,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyUnread:Ia}}),Itt=U({react:X,tagName:"wy-messenger-conversations",elementClass:Ma,events:{onWyAction:be,onWyApp:Yi,onWyUnread:Ia}}),Dtt=U({react:X,tagName:"wy-messenger-new",elementClass:g1,events:{onWyApp:Yi}}),Vtt=U({react:X,tagName:"wy-notifications",elementClass:El,events:{onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyUnread:Ia}}),Wtt=U({react:X,tagName:"wy-notification-badge",elementClass:Qa,events:{onWyApp:Yi,onWyUnread:Ia}}),Ftt=U({react:X,tagName:"wy-notification-button",elementClass:Qr,events:{onWyAction:be,onWyApp:Yi,onWyLink:d2,onWyUnread:Ia}}),qtt=U({react:X,tagName:"wy-notification-toasts",elementClass:$s,events:{onWyApp:Yi,onWyLink:d2,onWyNotification:$W}}),Ztt=U({react:X,tagName:"wy-posts",elementClass:Ry,events:{onWyAction:be,onWyApp:Yi,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Ntt=U({react:X,tagName:"wy-avatar",elementClass:J.WyAvatar}),Btt=U({react:X,tagName:"wy-avatar-group",elementClass:J.WyAvatarGroup}),Xtt=U({react:X,tagName:"wy-avatar-header",elementClass:J.WyAvatarHeader}),jtt=U({react:X,tagName:"wy-button",elementClass:J.WyButton}),Utt=U({react:X,tagName:"wy-buttons",elementClass:J.WyButtons}),Htt=U({react:X,tagName:"wy-badge",elementClass:J.WyBadge}),Ytt=U({react:X,tagName:"wy-dropdown",elementClass:J.WyDropdown}),Gtt=U({react:X,tagName:"wy-dropdown-item",elementClass:J.WyDropdownItem}),Ktt=U({react:X,tagName:"wy-dropdown-option",elementClass:J.WyDropdownOption}),Jtt=U({react:X,tagName:"wy-dropdown-divider",elementClass:J.WyDropdownDivider}),tet=U({react:X,tagName:"wy-icon",elementClass:J.WyIcon}),eet=U({react:X,tagName:"wy-icon-stack",elementClass:J.WyIconStack}),iet=U({react:X,tagName:"wy-icon-display",elementClass:J.WyIconDisplay}),ret=U({react:X,tagName:"wy-image-grid",elementClass:J.WyImageGrid,events:{onFileOpen:"file-open"}}),set=U({react:X,tagName:"wy-item",elementClass:J.WyItem}),net=U({react:X,tagName:"wy-item-list",elementClass:J.WyItemList}),aet=U({react:X,tagName:"wy-overlay",elementClass:J.WyOverlay,events:{onClose:"close"}}),oet=U({react:X,tagName:"wy-presence",elementClass:J.WyPresence}),cet=U({react:X,tagName:"wy-progress-circular",elementClass:J.WyProgressCircular}),het=U({react:X,tagName:"wy-progress-linear",elementClass:J.WyProgressLinear}),det=U({react:X,tagName:"wy-search",elementClass:J.WySearch,events:{onSearch:"search"}}),uet=U({react:X,tagName:"wy-container",elementClass:J.WyContainer}),pet=U({react:X,tagName:"wy-skeleton",elementClass:J.WySkeleton}),fet=U({react:X,tagName:"wy-titlebar",elementClass:J.WyTitlebar}),met=U({react:X,tagName:"wy-titlebar-text",elementClass:J.WyTitlebarText}),yet=U({react:X,tagName:"wy-toasts",elementClass:J.WyToasts,events:{onHide:"hide"}}),get=U({react:X,tagName:"wy-toast",elementClass:J.WyToast,events:{onClosed:"closed"}}),wet=U({react:X,tagName:"wy-annotation",elementClass:J.WyAnnotation}),vet=U({react:X,tagName:"wy-annotation-list",elementClass:J.WyAnnotationList,events:{onFileOpen:"file-open"}}),Oet=U({react:X,tagName:"wy-attachment",elementClass:J.WyAttachment,events:{onFileOpen:"file-open"}}),bet=U({react:X,tagName:"wy-attachment-list",elementClass:J.WyAttachmentList,events:{onFileOpen:"file-open"}}),$et=U({react:X,tagName:"wy-upload",elementClass:J.WyUpload,events:{onBlobUploaded:"blob-uploaded"}}),xet=U({react:X,tagName:"wy-cloud-files",elementClass:J.WyCloudFiles,events:{onExternalBlobs:"external-blobs"}}),ket=U({react:X,tagName:"wy-comment-list",elementClass:J.WyCommentList,events:{onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Cet=U({react:X,tagName:"wy-comment",elementClass:J.WyComment,events:{onVote:"vote",onTrash:"trash",onRestore:"restore",onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Pet=U({react:X,tagName:"wy-context-data-progress",elementClass:J.WyContextDataProgress}),Qet=U({react:X,tagName:"wy-conversation",elementClass:J.WyConversation,events:{onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Tet=U({react:X,tagName:"wy-conversation-header",elementClass:J.WyConversationHeader,events:{onWyAction:be}}),Met=U({react:X,tagName:"wy-conversation-new",elementClass:J.WyConversationNew,events:{onSelected:"create"}}),Aet=U({react:X,tagName:"wy-conversation-list",elementClass:J.WyConversationList,events:{onWyAction:be}}),Ret=U({react:X,tagName:"wy-conversation-item",elementClass:J.WyConversationItem,events:{onSelected:"selected",onStar:"star",onPin:"pin",onMark:"mark",onLeave:"leave",onRemove:"remove",onTrash:"trash"}}),Eet=U({react:X,tagName:"wy-editor",elementClass:J.WyEditor,events:{onSubmit:"submit"}}),_et=U({react:X,tagName:"wy-comment-editor",elementClass:J.WyCommentEditor,events:{onSubmit:"submit"}}),Let=U({react:X,tagName:"wy-message-editor",elementClass:J.WyMessageEditor,events:{onSubmit:"submit"}}),zet=U({react:X,tagName:"wy-embed",elementClass:J.WyEmbed,events:{onWyAction:be}}),Iet=U({react:X,tagName:"wy-embed-select",elementClass:J.WyEmbedSelect,events:{onEmbedRemove:"embed-remove",onEmbedSwap:"embed-swap"}}),Det=U({react:X,tagName:"wy-empty",elementClass:J.WyEmpty}),Vet=U({react:X,tagName:"wy-file-grid",elementClass:J.WyFileGrid,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe"}}),Wet=U({react:X,tagName:"wy-file-item",elementClass:J.WyFileItem,events:{onEditName:"edit-name",onRename:"rename",onSubscribe:"subscribe",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever"}}),Fet=U({react:X,tagName:"wy-file-menu",elementClass:J.WyFileMenu,events:{onEditName:"edit-name",onSubscribe:"subscribe",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever"}}),qet=U({react:X,tagName:"wy-file-table",elementClass:J.WyFileTable,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe"}}),Zet=U({react:X,tagName:"wy-file-versions",elementClass:J.WyFileVersions,events:{onFileVersionSelect:"file-version-select"}}),Net=U({react:X,tagName:"wy-files-header",elementClass:J.WyFilesHeader,events:{onUploadFiles:"upload-files",onExternalBlobs:"external-blobs",onCreateFiles:"create-files",onOrder:"order",onView:"view",onShowTrashed:"show-trashed",onSubscribe:"subscribe"}}),Bet=U({react:X,tagName:"wy-files-list",elementClass:J.WyFilesList,events:{onFileOpen:"file-open",onOrder:"order",onEditName:"edit-name",onRename:"rename",onTrash:"trash",onRestore:"restore",onDeleteForever:"delete-forever",onSubscribe:"subscribe",onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Xet=U({react:X,tagName:"wy-meeting-card",elementClass:J.WyMeetingCard}),jet="vote",Uet="typing",Het=U({react:X,tagName:"wy-message",elementClass:J.WyMessage,events:{onVote:jet,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),Yet=U({react:X,tagName:"wy-message-typing",elementClass:J.WyMessageTyping,events:{onTyping:Uet}}),Get=U({react:X,tagName:"wy-notification-list",elementClass:J.WyNotificationList,events:{onWyAction:be}}),Ket=U({react:X,tagName:"wy-notification-header",elementClass:J.WyNotificationHeader}),Jet=U({react:X,tagName:"wy-notification-list-item",elementClass:J.WyNotificationListItem,events:{onSelect:"select",onMark:"mark",onHide:"hide",onClose:"close"}}),tit=U({react:X,tagName:"wy-pdf-viewer",elementClass:J.WyPdfViewer,events:{onFilePreviewLoaded:"file-preview-loaded"}}),eit=U({react:X,tagName:"wy-poll",elementClass:J.WyPoll,events:{onVote:"vote"}}),iit=U({react:X,tagName:"wy-poll-option",elementClass:J.WyPollOption,events:{onVote:"vote"}}),u3="edit",xW="vote",kW="subscribe",SW="trash",CW="restore",rit=U({react:X,tagName:"wy-post-list",elementClass:J.WyPostList,events:{onEdit:u3,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),sit=U({react:X,tagName:"wy-post",elementClass:J.WyPost,events:{onVote:xW,onSubscribe:kW,onTrash:SW,onRestore:CW,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),nit=U({react:X,tagName:"wy-post-view",elementClass:J.WyPostView,events:{onVote:xW,onSubscribe:kW,onTrash:SW,onEdit:u3,onWyAction:be,onWyPreviewOpen:fi,onWyPreviewClose:mi}}),ait=U({react:X,tagName:"wy-post-edit",elementClass:J.WyPostEdit,events:{onEdit:u3}}),oit=U({react:X,tagName:"wy-post-trashed",elementClass:J.WyPostTrashed,events:{onRestore:CW}}),eg="file-preview-loaded",lit=U({react:X,tagName:"wy-preview",elementClass:J.WyPreview,events:{onWyPreviewOpen:fi,onWyPreviewClose:mi,onWyAction:be}}),cit=U({react:X,tagName:"wy-preview-embed",elementClass:J.WyPreviewEmbed,events:{onFilePreviewLoaded:eg}}),hit=U({react:X,tagName:"wy-preview-icon",elementClass:J.WyPreviewIcon,events:{onFilePreviewLoaded:eg}}),dit=U({react:X,tagName:"wy-preview-image",elementClass:J.WyPreviewImage,events:{onFilePreviewLoaded:eg}}),uit=U({react:X,tagName:"wy-preview-item",elementClass:J.WyPreviewItem,events:{onFilePreviewLoaded:eg}}),pit=U({react:X,tagName:"wy-preview-media",elementClass:J.WyPreviewMedia,events:{onFilePreviewLoaded:eg}}),fit=U({react:X,tagName:"wy-preview-text",elementClass:J.WyPreviewText,events:{onFilePreviewLoaded:eg}}),mit="close",yit=U({react:X,tagName:"wy-reactions",elementClass:J.WyReactions,events:{onClose:mit}}),git=U({react:X,tagName:"wy-reaction-item",elementClass:J.WyReactionItem}),wit=U({react:X,tagName:"wy-typing",elementClass:J.WyTyping}),vit=U({react:X,tagName:"wy-users-search",elementClass:J.WyUsersSearch,events:{onSubmit:"submit"}}),Oit=Object.freeze(Object.defineProperty({__proto__:null,WyAnnotation:wet,WyAnnotationList:vet,WyAttachment:Oet,WyAttachmentList:bet,WyAvatar:Ntt,WyAvatarGroup:Btt,WyAvatarHeader:Xtt,WyBadge:Htt,WyButton:jtt,WyButtons:Utt,WyCloudFiles:xet,WyComment:Cet,WyCommentEditor:_et,WyCommentList:ket,WyContainer:uet,WyContextDataProgress:Pet,WyConversation:Qet,WyConversationAppbar:Tet,WyConversationItem:Ret,WyConversationList:Aet,WyConversationNew:Met,WyDropdown:Ytt,WyDropdownDivider:Jtt,WyDropdownItem:Gtt,WyDropdownOption:Ktt,WyEditor:Eet,WyEmbed:zet,WyEmbedSelect:Iet,WyEmpty:Det,WyFileGrid:Vet,WyFileItem:Wet,WyFileMenu:Fet,WyFileTable:qet,WyFileVersions:Zet,WyFilesHeader:Net,WyFilesList:Bet,WyIcon:tet,WyIconDisplay:iet,WyIconStack:eet,WyImageGrid:ret,WyItem:set,WyItemList:net,WyMeetingCard:Xet,WyMessage:Het,WyMessageEditor:Let,WyMessageTyping:Yet,WyNotificationHeader:Ket,WyNotificationList:Get,WyNotificationListitem:Jet,WyOverlay:aet,WyPdfViewer:tit,WyPoll:eit,WyPollOption:iit,WyPost:sit,WyPostEdit:ait,WyPostList:rit,WyPostTrashed:oit,WyPostView:nit,WyPresence:oet,WyPreview:lit,WyPreviewEmbed:cit,WyPreviewIcon:hit,WyPreviewImage:dit,WyPreviewItem:uit,WyPreviewMedia:pit,WyPreviewText:fit,WyProgressCircular:cet,WyProgressLinear:het,WyReactionItem:git,WyReactions:yit,WySearch:det,WySkeleton:pet,WyTitlebar:fet,WyTitlebarText:met,WyToast:get,WyToasts:yet,WyTyping:wit,WyUpload:$et,WyUsersSearch:vit},Symbol.toStringTag,{value:"Module"}));exports.AppTypeGuids=Gz;exports.AppTypeStrings=Kz;exports.Feature=L;exports.MessengerTypes=NJ;exports.Weavy=Se;exports.WeavyComponents=Oit;exports.WeavyContext=wW;exports.WyChat=Ptt;exports.WyComments=Qtt;exports.WyComponent=Ttt;exports.WyContext=Att;exports.WyCopilot=Rtt;exports.WyFiles=Ett;exports.WyMessenger=_tt;exports.WyMessengerBadge=Ltt;exports.WyMessengerButton=ztt;exports.WyMessengerConversations=Itt;exports.WyMessengerNew=Dtt;exports.WyNotificationBadge=Wtt;exports.WyNotificationButton=Ftt;exports.WyNotificationToasts=qtt;exports.WyNotifications=Vtt;exports.WyPosts=Ztt;exports.useWeavy=xtt;exports.useWeavyContext=OW;
|